api/generated/ruby/azure-iiot-opc-registry/generated/swagger/azure_opc_registry_client.rb
#
# Update application registration
#
# The application information is updated with new properties. Note that this
# information might be overridden if the application is re-discovered during a
# discovery run (recurring or one-time).
#
# @param application_id [String] The identifier of the application
# @param body [ApplicationRegistrationUpdateApiModel] Application update
# 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.
#
Update application registration
The application information is updated with new properties. Note that this
information might be overridden if the application is re-discovered during a
discovery run (recurring or one-time).
Update application registration The application information is updated with new properties . Note that this information might be overridden if the application is re - discovered during a discovery run ( recurring or one - time ) .
def update_application_registration_async(application_id, body, custom_headers:nil)
      fail ArgumentError, 'application_id is nil' if application_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.registry::Models::ApplicationRegistrationUpdateApiModel.mapper()
      request_content = self.serialize(request_mapper,  body)
      request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
      path_template = 'v2/applications/{applicationId}'
      request_url = @base_url || self.base_url
      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          path_params: {'applicationId' => application_id},
          body: request_content,
          headers: request_headers.merge(custom_headers || {}),
          base_url: request_url
      }
      promise = self.make_request_async(:patch, 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
        result
      end
      promise.execute
    end
def update_application_registration_async ( application_id , body , custom_headers : nil ) fail ArgumentError , 'application_id is nil' if application_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 . registry :: Models :: ApplicationRegistrationUpdateApiModel . mapper ( ) request_content = self . serialize ( request_mapper , body ) request_content = request_content != nil ? JSON . generate ( request_content , quirks_mode : true ) : nil path_template = 'v2/applications/{applicationId}' request_url = @base_url || self . base_url options = { middlewares : [ [ MsRest :: RetryPolicyMiddleware , times : 3 , retry : 0.02 ] , [ :cookie_jar ] ] , path_params : { 'applicationId' => application_id } , body : request_content , headers : request_headers . merge ( custom_headers || { } ) , base_url : request_url } promise = self . make_request_async ( :patch , 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 result end promise . execute end
Update application registration
The application information is updated with new properties.
Update application registration The application information is updated with new properties .
# Serialize Request
Promise object which holds the HTTP response.
Promise object which holds the HTTP response .
Concurrent::Promise
application_id
The identifier of the application
The identifier of the application
body
Application update request
Application update 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 .