api/generated/ruby/azure-iiot-opc-registry/generated/swagger/azure_opc_registry_client.rb
#
# Unsubscribe registry events
#
# Unregister a user and stop it from receiving discoverer events.
#
# @param user_id [String] The user id that will not receive any more discoverer
# events
# @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.
#
Unsubscribe registry events
Unregister a user and stop it from receiving discoverer events.
Unsubscribe registry events Unregister a user and stop it from receiving discoverer events .
def unsubscribe1_async(user_id, custom_headers:nil)
      fail ArgumentError, 'user_id is nil' if user_id.nil?
      request_headers = {}
      request_headers['Content-Type'] = 'application/json; charset=utf-8'
      path_template = 'v2/discovery/events/{userId}'
      request_url = @base_url || self.base_url
      options = {
          middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
          path_params: {'userId' => user_id},
          headers: request_headers.merge(custom_headers || {}),
          base_url: request_url
      }
      promise = self.make_request_async(:delete, 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 unsubscribe1_async ( user_id , custom_headers : nil ) fail ArgumentError , 'user_id is nil' if user_id . nil? request_headers = { } request_headers [ 'Content-Type' ] = 'application/json; charset=utf-8' path_template = 'v2/discovery/events/{userId}' request_url = @base_url || self . base_url options = { middlewares : [ [ MsRest :: RetryPolicyMiddleware , times : 3 , retry : 0.02 ] , [ :cookie_jar ] ] , path_params : { 'userId' => user_id } , headers : request_headers . merge ( custom_headers || { } ) , base_url : request_url } promise = self . make_request_async ( :delete , 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
Unsubscribe registry events
Unregister a user and stop it from receiving discoverer events.
Unsubscribe registry events Unregister a user and stop it from receiving discoverer events .
Promise object which holds the HTTP response.
Promise object which holds the HTTP response .
Concurrent::Promise
user_id
The user id that will not receive any more discoverer events
The user id that will not receive any more discoverer events
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 .