def create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers:nil)
      # Send request
      promise = begin_create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers:custom_headers)

      promise = promise.then do |response|
        # Defining deserialization method.
        deserialize_method = lambda do |parsed_response|
          result_mapper = Azure::Resources::Mgmt::V2018_02_01::Models::GenericResource.mapper()
          parsed_response = @client.deserialize(result_mapper, parsed_response)
        end

        # Waiting for response.
        @client.get_long_running_operation_result(response, deserialize_method)
      end

      promise
    end
def create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers:nil)
      # Send request
      promise = begin_create_or_update_by_id_async(resource_id, api_version, parameters, custom_headers:custom_headers)

      promise = promise.then do |response|
        # Defining deserialization method.
        deserialize_method = lambda do |parsed_response|
          result_mapper = Azure::Resources::Mgmt::V2018_02_01::Models::GenericResource.mapper()
          parsed_response = @client.deserialize(result_mapper, parsed_response)
        end

        # Waiting for response.
        @client.get_long_running_operation_result(response, deserialize_method)
      end

      promise
    end
@param resource_id [String] The fully qualified ID of the resource, including
 the resource name and resource type. Use the format,
 /subscriptions/{guid}/resourceGroups/{resource-group-name}/{resource-provider-namespace}/{resource-type}/{resource-name}
 @param api_version [String] The API version to use for the operation.
 @param parameters [GenericResource] Create or update resource parameters.
 @param custom_headers [Hash{String => String}] A hash of custom headers that
 will be added to the HTTP request.

 @return [Concurrent::Promise] promise which provides async access to http
 response.