@@ -98,6 +98,11 @@ def self.configure
9898 initial_delay : 1.0 , max_delay : 10.0 , multiplier : 1.3 , retry_codes : [ 14 ]
9999 }
100100
101+ default_config . rpcs . cancel_order . timeout = 60.0
102+ default_config . rpcs . cancel_order . retry_policy = {
103+ initial_delay : 1.0 , max_delay : 10.0 , multiplier : 1.3 , retry_codes : [ 14 ]
104+ }
105+
101106 default_config . rpcs . list_sites . timeout = 60.0
102107 default_config . rpcs . list_sites . retry_policy = {
103108 initial_delay : 1.0 , max_delay : 10.0 , multiplier : 1.3 , retry_codes : [ 14 ]
@@ -965,6 +970,104 @@ def submit_order request, options = nil
965970 raise ::Google ::Cloud ::Error . from_error ( e )
966971 end
967972
973+ ##
974+ # Cancels an order.
975+ #
976+ # @overload cancel_order(request, options = nil)
977+ # Pass arguments to `cancel_order` via a request object, either of type
978+ # {::Google::Cloud::GDCHardwareManagement::V1alpha::CancelOrderRequest} or an equivalent Hash.
979+ #
980+ # @param request [::Google::Cloud::GDCHardwareManagement::V1alpha::CancelOrderRequest, ::Hash]
981+ # A request object representing the call parameters. Required. To specify no
982+ # parameters, or to keep all the default parameter values, pass an empty Hash.
983+ # @param options [::Gapic::CallOptions, ::Hash]
984+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
985+ #
986+ # @overload cancel_order(name: nil, request_id: nil)
987+ # Pass arguments to `cancel_order` via keyword arguments. Note that at
988+ # least one keyword argument is required. To specify no parameters, or to keep all
989+ # the default parameter values, pass an empty Hash as a request object (see above).
990+ #
991+ # @param name [::String]
992+ # Required. The name of the order.
993+ # Format: `projects/{project}/locations/{location}/orders/{order}`
994+ # @param request_id [::String]
995+ # Optional. An optional unique identifier for this request. See
996+ # [AIP-155](https://google.aip.dev/155).
997+ #
998+ # @yield [response, operation] Access the result along with the RPC operation
999+ # @yieldparam response [::Gapic::Operation]
1000+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1001+ #
1002+ # @return [::Gapic::Operation]
1003+ #
1004+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1005+ #
1006+ # @example Basic example
1007+ # require "google/cloud/gdc_hardware_management/v1alpha"
1008+ #
1009+ # # Create a client object. The client can be reused for multiple calls.
1010+ # client = Google::Cloud::GDCHardwareManagement::V1alpha::GDCHardwareManagement::Client.new
1011+ #
1012+ # # Create a request. To set request fields, pass in keyword arguments.
1013+ # request = Google::Cloud::GDCHardwareManagement::V1alpha::CancelOrderRequest.new
1014+ #
1015+ # # Call the cancel_order method.
1016+ # result = client.cancel_order request
1017+ #
1018+ # # The returned object is of type Gapic::Operation. You can use it to
1019+ # # check the status of an operation, cancel it, or wait for results.
1020+ # # Here is how to wait for a response.
1021+ # result.wait_until_done! timeout: 60
1022+ # if result.response?
1023+ # p result.response
1024+ # else
1025+ # puts "No response received."
1026+ # end
1027+ #
1028+ def cancel_order request , options = nil
1029+ raise ::ArgumentError , "request must be provided" if request . nil?
1030+
1031+ request = ::Gapic ::Protobuf . coerce request , to : ::Google ::Cloud ::GDCHardwareManagement ::V1alpha ::CancelOrderRequest
1032+
1033+ # Converts hash and nil to an options object
1034+ options = ::Gapic ::CallOptions . new ( **options . to_h ) if options . respond_to? :to_h
1035+
1036+ # Customize the options with defaults
1037+ metadata = @config . rpcs . cancel_order . metadata . to_h
1038+
1039+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1040+ metadata [ :"x-goog-api-client" ] ||= ::Gapic ::Headers . x_goog_api_client \
1041+ lib_name : @config . lib_name , lib_version : @config . lib_version ,
1042+ gapic_version : ::Google ::Cloud ::GDCHardwareManagement ::V1alpha ::VERSION
1043+ metadata [ :"x-goog-api-version" ] = API_VERSION unless API_VERSION . empty?
1044+ metadata [ :"x-goog-user-project" ] = @quota_project_id if @quota_project_id
1045+
1046+ header_params = { }
1047+ if request . name
1048+ header_params [ "name" ] = request . name
1049+ end
1050+
1051+ request_params_header = header_params . map { |k , v | "#{ k } =#{ v } " } . join ( "&" )
1052+ metadata [ :"x-goog-request-params" ] ||= request_params_header
1053+
1054+ options . apply_defaults timeout : @config . rpcs . cancel_order . timeout ,
1055+ metadata : metadata ,
1056+ retry_policy : @config . rpcs . cancel_order . retry_policy
1057+
1058+ options . apply_defaults timeout : @config . timeout ,
1059+ metadata : @config . metadata ,
1060+ retry_policy : @config . retry_policy
1061+
1062+ @gdc_hardware_management_stub . call_rpc :cancel_order , request , options : options do |response , operation |
1063+ response = ::Gapic ::Operation . new response , @operations_client , options : options
1064+ yield response , operation if block_given?
1065+ throw :response , response
1066+ end
1067+ rescue ::GRPC ::BadStatus => e
1068+ raise ::Google ::Cloud ::Error . from_error ( e )
1069+ end
1070+
9681071 ##
9691072 # Lists sites in a given project and location.
9701073 #
@@ -3840,6 +3943,104 @@ def signal_zone_state request, options = nil
38403943 raise ::Google ::Cloud ::Error . from_error ( e )
38413944 end
38423945
3946+ ##
3947+ # Updates the requested date change of a single Order.
3948+ #
3949+ # @overload request_order_date_change(request, options = nil)
3950+ # Pass arguments to `request_order_date_change` via a request object, either of type
3951+ # {::Google::Cloud::GDCHardwareManagement::V1alpha::RequestOrderDateChangeRequest} or an equivalent Hash.
3952+ #
3953+ # @param request [::Google::Cloud::GDCHardwareManagement::V1alpha::RequestOrderDateChangeRequest, ::Hash]
3954+ # A request object representing the call parameters. Required. To specify no
3955+ # parameters, or to keep all the default parameter values, pass an empty Hash.
3956+ # @param options [::Gapic::CallOptions, ::Hash]
3957+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
3958+ #
3959+ # @overload request_order_date_change(name: nil, requested_date: nil)
3960+ # Pass arguments to `request_order_date_change` via keyword arguments. Note that at
3961+ # least one keyword argument is required. To specify no parameters, or to keep all
3962+ # the default parameter values, pass an empty Hash as a request object (see above).
3963+ #
3964+ # @param name [::String]
3965+ # Required. The name of the order to update.
3966+ # Format: projects/\\{project}/locations/\\{location}/orders/\\{order}
3967+ # @param requested_date [::Google::Type::Date, ::Hash]
3968+ # Required. The date to which the customer or Google wants to set the
3969+ # scheduled installation date.
3970+ #
3971+ # @yield [response, operation] Access the result along with the RPC operation
3972+ # @yieldparam response [::Gapic::Operation]
3973+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
3974+ #
3975+ # @return [::Gapic::Operation]
3976+ #
3977+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
3978+ #
3979+ # @example Basic example
3980+ # require "google/cloud/gdc_hardware_management/v1alpha"
3981+ #
3982+ # # Create a client object. The client can be reused for multiple calls.
3983+ # client = Google::Cloud::GDCHardwareManagement::V1alpha::GDCHardwareManagement::Client.new
3984+ #
3985+ # # Create a request. To set request fields, pass in keyword arguments.
3986+ # request = Google::Cloud::GDCHardwareManagement::V1alpha::RequestOrderDateChangeRequest.new
3987+ #
3988+ # # Call the request_order_date_change method.
3989+ # result = client.request_order_date_change request
3990+ #
3991+ # # The returned object is of type Gapic::Operation. You can use it to
3992+ # # check the status of an operation, cancel it, or wait for results.
3993+ # # Here is how to wait for a response.
3994+ # result.wait_until_done! timeout: 60
3995+ # if result.response?
3996+ # p result.response
3997+ # else
3998+ # puts "No response received."
3999+ # end
4000+ #
4001+ def request_order_date_change request , options = nil
4002+ raise ::ArgumentError , "request must be provided" if request . nil?
4003+
4004+ request = ::Gapic ::Protobuf . coerce request , to : ::Google ::Cloud ::GDCHardwareManagement ::V1alpha ::RequestOrderDateChangeRequest
4005+
4006+ # Converts hash and nil to an options object
4007+ options = ::Gapic ::CallOptions . new ( **options . to_h ) if options . respond_to? :to_h
4008+
4009+ # Customize the options with defaults
4010+ metadata = @config . rpcs . request_order_date_change . metadata . to_h
4011+
4012+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
4013+ metadata [ :"x-goog-api-client" ] ||= ::Gapic ::Headers . x_goog_api_client \
4014+ lib_name : @config . lib_name , lib_version : @config . lib_version ,
4015+ gapic_version : ::Google ::Cloud ::GDCHardwareManagement ::V1alpha ::VERSION
4016+ metadata [ :"x-goog-api-version" ] = API_VERSION unless API_VERSION . empty?
4017+ metadata [ :"x-goog-user-project" ] = @quota_project_id if @quota_project_id
4018+
4019+ header_params = { }
4020+ if request . name
4021+ header_params [ "name" ] = request . name
4022+ end
4023+
4024+ request_params_header = header_params . map { |k , v | "#{ k } =#{ v } " } . join ( "&" )
4025+ metadata [ :"x-goog-request-params" ] ||= request_params_header
4026+
4027+ options . apply_defaults timeout : @config . rpcs . request_order_date_change . timeout ,
4028+ metadata : metadata ,
4029+ retry_policy : @config . rpcs . request_order_date_change . retry_policy
4030+
4031+ options . apply_defaults timeout : @config . timeout ,
4032+ metadata : @config . metadata ,
4033+ retry_policy : @config . retry_policy
4034+
4035+ @gdc_hardware_management_stub . call_rpc :request_order_date_change , request , options : options do |response , operation |
4036+ response = ::Gapic ::Operation . new response , @operations_client , options : options
4037+ yield response , operation if block_given?
4038+ throw :response , response
4039+ end
4040+ rescue ::GRPC ::BadStatus => e
4041+ raise ::Google ::Cloud ::Error . from_error ( e )
4042+ end
4043+
38434044 ##
38444045 # Configuration class for the GDCHardwareManagement API.
38454046 #
@@ -4037,6 +4238,11 @@ class Rpcs
40374238 #
40384239 attr_reader :submit_order
40394240 ##
4241+ # RPC-specific configuration for `cancel_order`
4242+ # @return [::Gapic::Config::Method]
4243+ #
4244+ attr_reader :cancel_order
4245+ ##
40404246 # RPC-specific configuration for `list_sites`
40414247 # @return [::Gapic::Config::Method]
40424248 #
@@ -4181,6 +4387,11 @@ class Rpcs
41814387 # @return [::Gapic::Config::Method]
41824388 #
41834389 attr_reader :signal_zone_state
4390+ ##
4391+ # RPC-specific configuration for `request_order_date_change`
4392+ # @return [::Gapic::Config::Method]
4393+ #
4394+ attr_reader :request_order_date_change
41844395
41854396 # @private
41864397 def initialize parent_rpcs = nil
@@ -4196,6 +4407,8 @@ def initialize parent_rpcs = nil
41964407 @delete_order = ::Gapic ::Config ::Method . new delete_order_config
41974408 submit_order_config = parent_rpcs . submit_order if parent_rpcs . respond_to? :submit_order
41984409 @submit_order = ::Gapic ::Config ::Method . new submit_order_config
4410+ cancel_order_config = parent_rpcs . cancel_order if parent_rpcs . respond_to? :cancel_order
4411+ @cancel_order = ::Gapic ::Config ::Method . new cancel_order_config
41994412 list_sites_config = parent_rpcs . list_sites if parent_rpcs . respond_to? :list_sites
42004413 @list_sites = ::Gapic ::Config ::Method . new list_sites_config
42014414 get_site_config = parent_rpcs . get_site if parent_rpcs . respond_to? :get_site
@@ -4254,6 +4467,8 @@ def initialize parent_rpcs = nil
42544467 @delete_zone = ::Gapic ::Config ::Method . new delete_zone_config
42554468 signal_zone_state_config = parent_rpcs . signal_zone_state if parent_rpcs . respond_to? :signal_zone_state
42564469 @signal_zone_state = ::Gapic ::Config ::Method . new signal_zone_state_config
4470+ request_order_date_change_config = parent_rpcs . request_order_date_change if parent_rpcs . respond_to? :request_order_date_change
4471+ @request_order_date_change = ::Gapic ::Config ::Method . new request_order_date_change_config
42574472
42584473 yield self if block_given?
42594474 end
0 commit comments