api/generated/ruby/azure-iiot-opc-history/generated/swagger/azure_opc_history_client.rb
#
# Read next batch of historic values
#
# Read next batch of historic values of a node using historic access. The
# endpoint must be activated and connected and the module client and server
# must trust each other.
#
# @param endpoint_id [String] The identifier of the activated endpoint.
# @param body [HistoryReadNextRequestApiModel] The history read next request
# @param [Hash{String => String}] A hash of custom headers that will be added
# to the HTTP request.
#
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
#
Read next batch of historic values
Read next batch of historic values of a node using historic access. The
endpoint must be activated and connected and the module client and server
must trust each other.
Read next batch of historic values Read next batch of historic values of a node using historic access . The endpoint must be activated and connected and the module client and server must trust each other .
def history_read_value_next_async(endpoint_id, body, custom_headers:nil)
      fail ArgumentError, 'endpoint_id is nil' if endpoint_id.nil?
      fail ArgumentError, 'body is nil' if body.nil?
      request_headers = {}
      request_headers['Content-Type'] = 'application/json-patch+json; charset=utf-8'
      request_mapper = azure.iiot.opc.history::Models::HistoryReadNextRequestApiModel.mapper()
      request_content = self.serialize(request_mapper,  body)
      request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
      path_template = 'v2/read/{endpointId}/values/next'
      request_url = @base_url || self.base_url
      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          path_params: {'endpointId' => endpoint_id},
          body: request_content,
          headers: request_headers.merge(custom_headers || {}),
          base_url: request_url
      }
      promise = self.make_request_async(:post, path_template, options)
      promise = promise.then do |result|
        http_response = result.response
        status_code = http_response.status
        response_content = http_response.body
        unless status_code == 200
          error_model = JSON.load(response_content)
          fail MsRest::HttpOperationError.new(result.request, http_response, error_model)
        end
        if status_code == 200
          begin
            parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
            result_mapper = azure.iiot.opc.history::Models::HistoricValueApiModelSequenceHistoryReadNextResponseApiModel.mapper()
            result.body = self.deserialize(result_mapper, parsed_response)
          rescue Exception => e
            fail MsRest::DeserializationError.new('Error occurred in deserializing the response', e.message, e.backtrace, result)
          end
        end
        result
      end
      promise.execute
    end
def history_read_value_next_async ( endpoint_id , body , custom_headers : nil ) fail ArgumentError , 'endpoint_id is nil' if endpoint_id . nil? fail ArgumentError , 'body is nil' if body . nil? request_headers = { } request_headers [ 'Content-Type' ] = 'application/json-patch+json; charset=utf-8' request_mapper = azure . iiot . opc . history :: Models :: HistoryReadNextRequestApiModel . mapper ( ) request_content = self . serialize ( request_mapper , body ) request_content = request_content != nil ? JSON . generate ( request_content , quirks_mode : true ) : nil path_template = 'v2/read/{endpointId}/values/next' request_url = @base_url || self . base_url options = { middlewares : [ [ MsRest :: RetryPolicyMiddleware , times : 3 , retry : 0.02 ] , [ :cookie_jar ] ] , path_params : { 'endpointId' => endpoint_id } , body : request_content , headers : request_headers . merge ( custom_headers || { } ) , base_url : request_url } promise = self . make_request_async ( :post , path_template , options ) promise = promise . then do | result | http_response = result . response status_code = http_response . status response_content = http_response . body unless status_code == 200 error_model = JSON . load ( response_content ) fail MsRest :: HttpOperationError . new ( result . request , http_response , error_model ) end if status_code == 200 begin parsed_response = response_content . to_s . empty? ? nil : JSON . load ( response_content ) result_mapper = azure . iiot . opc . history :: Models :: HistoricValueApiModelSequenceHistoryReadNextResponseApiModel . mapper ( ) result . body = self . deserialize ( result_mapper , parsed_response ) rescue Exception => e fail MsRest :: DeserializationError . new ( 'Error occurred in deserializing the response' , e . message , e . backtrace , result ) end end result end promise . execute end
Read next batch of historic values
Read next batch of historic values of a node using historic access.
Read next batch of historic values Read next batch of historic values of a node using historic access .
# Serialize Request # Deserialize Response
Promise object which holds the HTTP response.
Promise object which holds the HTTP response .
Concurrent::Promise
endpoint_id
The identifier of the activated endpoint.
The identifier of the activated endpoint .
body
The history read next request
The history read next request
custom_headers
<not_specific>
<not_specific>
A hash of custom headers that will be added to the HTTP request.
A hash of custom headers that will be added to the HTTP request .