Module: Google::Cloud::Compute::V1::ZoneOperations::Rest::NonstandardLro

Defined in:
lib/google/cloud/compute/v1/zone_operations/rest/nonstandard_lro.rb

Overview

A module containing nonstandard lro helpers

Class Method Summary collapse

Class Method Details

.create_operation(operation:, client:, request_values:, options:) ⇒ Gapic::GenericLRO::Operation

Creates a Generic LRO operation object that wraps the nonstandard long-running operation specific to this service.

Parameters:

  • operation (Object)

    The long-running operation object that is returned by the initial method call.

  • client (::Google::Cloud::Compute::V1::ZoneOperations::Rest::Client)

    The client that handles the polling for the longrunning operation.

  • request_values (Map<String, String>)

    The values that are to be copied from the request that triggered the longrunning operation, into the request that polls for the longrunning operation. The format is name of the request field -> value

  • options (Gapic::CallOptions)

    call options for this operation

Returns:

  • (Gapic::GenericLRO::Operation)


47
48
49
50
51
52
53
54
55
56
57
58
59
60
# File 'lib/google/cloud/compute/v1/zone_operations/rest/nonstandard_lro.rb', line 47

def create_operation operation:, client:, request_values:, options:
  Gapic::GenericLRO::Operation.new(operation,
                                   client: client,
                                   polling_method_name: "get",
                                   request_values: request_values,
                                   operation_status_field: "status",
                                   operation_name_field: "name",
                                   operation_err_code_field: "http_error_status_code",
                                   operation_err_msg_field: "http_error_message",
                                   operation_copy_fields: {
                                     "name" => "operation"
                                   },
                                   options: options)
end