api/generated/ruby/azure-iiot-opc-registry/generated/swagger/azure_opc_registry_client.rb
def query_discoverers_async(body, only_server_state:nil, page_size:nil, custom_headers:nil)
      fail ArgumentError, 'body is nil' if body.nil?


      request_headers = {}
      request_headers['Content-Type'] = 'application/json-patch+json; charset=utf-8'

      # Serialize Request
      request_mapper = azure.iiot.opc.registry::Models::DiscovererQueryApiModel.mapper()
      request_content = self.serialize(request_mapper,  body)
      request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil

      path_template = 'v2/discovery/query'

      request_url = @base_url || self.base_url

      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          query_params: {'onlyServerState' => only_server_state,'pageSize' => page_size},
          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

        # Deserialize Response
        if status_code == 200
          begin
            parsed_response = response_content.to_s.empty? ? nil : JSON.load(response_content)
            result_mapper = azure.iiot.opc.registry::Models::DiscovererListApiModel.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
#
# Query discoverers
#
# Get all discoverers that match a specified query. The returned model can
# contain a continuation token if more results are available. Call the
# GetListOfDiscoverers operation using the token to retrieve more results.
#
# @param body [DiscovererQueryApiModel] Discoverers query model
# @param only_server_state [Boolean] Whether to include only server state, or
# display current client state of the endpoint if available
# @param page_size [Integer] Number of results to return
# @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.
#
Query discoverers
Get all discoverers that match a specified query. The returned model can
contain a continuation token if more results are available. Call the
GetListOfDiscoverers operation using the token to retrieve more results.
Query discoverers Get all discoverers that match a specified query . The returned model can contain a continuation token if more results are available . Call the GetListOfDiscoverers operation using the token to retrieve more results .
def query_discoverers_async(body, only_server_state:nil, page_size:nil, custom_headers: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.registry::Models::DiscovererQueryApiModel.mapper()
      request_content = self.serialize(request_mapper,  body)
      request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
      path_template = 'v2/discovery/query'
      request_url = @base_url || self.base_url
      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          query_params: {'onlyServerState' => only_server_state,'pageSize' => page_size},
          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.registry::Models::DiscovererListApiModel.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 query_discoverers_async ( body , only_server_state : nil , page_size : nil , custom_headers : 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 . registry :: Models :: DiscovererQueryApiModel . mapper ( ) request_content = self . serialize ( request_mapper , body ) request_content = request_content != nil ? JSON . generate ( request_content , quirks_mode : true ) : nil path_template = 'v2/discovery/query' request_url = @base_url || self . base_url options = { middlewares : [ [ MsRest :: RetryPolicyMiddleware , times : 3 , retry : 0.02 ] , [ :cookie_jar ] ] , query_params : { 'onlyServerState' => only_server_state , 'pageSize' => page_size } , 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 . registry :: Models :: DiscovererListApiModel . 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
Query discoverers
Get all discoverers that match a specified query.
Query discoverers Get all discoverers that match a specified query .
# Serialize Request # Deserialize Response
Promise object which holds the HTTP response.
Promise object which holds the HTTP response .
Concurrent::Promise
body
Discoverers query model
Discoverers query model
only_server_state
Whether to include only server state, or display current client state of the endpoint if available
Whether to include only server state or display current client state of the endpoint if available
page_size
Number of results to return
Number of results to return
custom_headers
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 .