google-cloud-cloud_controls_partner-v1 2.0.1 → 2.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 49a186fc50b7bbd74b780d8ec996e23f4033a6edf2649a82dc8ca09df5bff757
4
- data.tar.gz: 7b9dc0809ad1a390daf582075b348bea4b9e503af957b7d621841553db3f2056
3
+ metadata.gz: e8605761c9322169ad0e0dac623beeac30dd958f6e14cbb1ee60b12f0c9e2e34
4
+ data.tar.gz: 532c40272bb0d71b3d96a88db7d348be712ff40e79c8880beab3c2fc795394c3
5
5
  SHA512:
6
- metadata.gz: 8abaf559ad18df2e128a29610f4c4a495dda043c7e7b41aed583586456711c4cd4e79b1d98d7e6489633db92b17b8e29341188da60a2e77c1f9534fc13d102d3
7
- data.tar.gz: 71550ccd1a3d22dacfbe8db76e3de8c66a8ff480b4c81f13d5c0ffdb5d3b114f61c6de7994245ddc8e30e4f7c6d5f70380f2a884fb0ec3ca964a8c31868519a9
6
+ metadata.gz: f9b80806aade65031632b4ce4a034cb94cd3110e5c3adb5f8da1e41a2c8f8d8070d533fd9577d78862bf3f2651d114eece312a4e81826bb408fd90d2e160ebfe
7
+ data.tar.gz: 567f0003174dcd2193f7e70ec5f4f521a895718e4cdd0dd983612871d33b35a5b0982834349d8c3bc5c83919589fbecf25264cbfe92a48645e3becafdbed1525
@@ -961,6 +961,273 @@ module Google
961
961
  raise ::Google::Cloud::Error.from_error(e)
962
962
  end
963
963
 
964
+ ##
965
+ # Creates a new customer.
966
+ #
967
+ # @overload create_customer(request, options = nil)
968
+ # Pass arguments to `create_customer` via a request object, either of type
969
+ # {::Google::Cloud::CloudControlsPartner::V1::CreateCustomerRequest} or an equivalent Hash.
970
+ #
971
+ # @param request [::Google::Cloud::CloudControlsPartner::V1::CreateCustomerRequest, ::Hash]
972
+ # A request object representing the call parameters. Required. To specify no
973
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
974
+ # @param options [::Gapic::CallOptions, ::Hash]
975
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
976
+ #
977
+ # @overload create_customer(parent: nil, customer: nil, customer_id: nil)
978
+ # Pass arguments to `create_customer` via keyword arguments. Note that at
979
+ # least one keyword argument is required. To specify no parameters, or to keep all
980
+ # the default parameter values, pass an empty Hash as a request object (see above).
981
+ #
982
+ # @param parent [::String]
983
+ # Required. Parent resource
984
+ # Format: `organizations/{organization}/locations/{location}`
985
+ # @param customer [::Google::Cloud::CloudControlsPartner::V1::Customer, ::Hash]
986
+ # Required. The customer to create.
987
+ # @param customer_id [::String]
988
+ # Required. The customer id to use for the customer, which will become the
989
+ # final component of the customer's resource name. The specified value must
990
+ # be a valid Google cloud organization id.
991
+ #
992
+ # @yield [response, operation] Access the result along with the RPC operation
993
+ # @yieldparam response [::Google::Cloud::CloudControlsPartner::V1::Customer]
994
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
995
+ #
996
+ # @return [::Google::Cloud::CloudControlsPartner::V1::Customer]
997
+ #
998
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
999
+ #
1000
+ # @example Basic example
1001
+ # require "google/cloud/cloud_controls_partner/v1"
1002
+ #
1003
+ # # Create a client object. The client can be reused for multiple calls.
1004
+ # client = Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Client.new
1005
+ #
1006
+ # # Create a request. To set request fields, pass in keyword arguments.
1007
+ # request = Google::Cloud::CloudControlsPartner::V1::CreateCustomerRequest.new
1008
+ #
1009
+ # # Call the create_customer method.
1010
+ # result = client.create_customer request
1011
+ #
1012
+ # # The returned object is of type Google::Cloud::CloudControlsPartner::V1::Customer.
1013
+ # p result
1014
+ #
1015
+ def create_customer request, options = nil
1016
+ raise ::ArgumentError, "request must be provided" if request.nil?
1017
+
1018
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudControlsPartner::V1::CreateCustomerRequest
1019
+
1020
+ # Converts hash and nil to an options object
1021
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1022
+
1023
+ # Customize the options with defaults
1024
+ metadata = @config.rpcs.create_customer.metadata.to_h
1025
+
1026
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1027
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1028
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1029
+ gapic_version: ::Google::Cloud::CloudControlsPartner::V1::VERSION
1030
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1031
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1032
+
1033
+ header_params = {}
1034
+ if request.parent
1035
+ header_params["parent"] = request.parent
1036
+ end
1037
+
1038
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1039
+ metadata[:"x-goog-request-params"] ||= request_params_header
1040
+
1041
+ options.apply_defaults timeout: @config.rpcs.create_customer.timeout,
1042
+ metadata: metadata,
1043
+ retry_policy: @config.rpcs.create_customer.retry_policy
1044
+
1045
+ options.apply_defaults timeout: @config.timeout,
1046
+ metadata: @config.metadata,
1047
+ retry_policy: @config.retry_policy
1048
+
1049
+ @cloud_controls_partner_core_stub.call_rpc :create_customer, request, options: options do |response, operation|
1050
+ yield response, operation if block_given?
1051
+ end
1052
+ rescue ::GRPC::BadStatus => e
1053
+ raise ::Google::Cloud::Error.from_error(e)
1054
+ end
1055
+
1056
+ ##
1057
+ # Update details of a single customer
1058
+ #
1059
+ # @overload update_customer(request, options = nil)
1060
+ # Pass arguments to `update_customer` via a request object, either of type
1061
+ # {::Google::Cloud::CloudControlsPartner::V1::UpdateCustomerRequest} or an equivalent Hash.
1062
+ #
1063
+ # @param request [::Google::Cloud::CloudControlsPartner::V1::UpdateCustomerRequest, ::Hash]
1064
+ # A request object representing the call parameters. Required. To specify no
1065
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1066
+ # @param options [::Gapic::CallOptions, ::Hash]
1067
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1068
+ #
1069
+ # @overload update_customer(customer: nil, update_mask: nil)
1070
+ # Pass arguments to `update_customer` via keyword arguments. Note that at
1071
+ # least one keyword argument is required. To specify no parameters, or to keep all
1072
+ # the default parameter values, pass an empty Hash as a request object (see above).
1073
+ #
1074
+ # @param customer [::Google::Cloud::CloudControlsPartner::V1::Customer, ::Hash]
1075
+ # Required. The customer to update
1076
+ # Format:
1077
+ # `organizations/{organization}/locations/{location}/customers/{customer}`
1078
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1079
+ # Optional. The list of fields to update
1080
+ #
1081
+ # @yield [response, operation] Access the result along with the RPC operation
1082
+ # @yieldparam response [::Google::Cloud::CloudControlsPartner::V1::Customer]
1083
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1084
+ #
1085
+ # @return [::Google::Cloud::CloudControlsPartner::V1::Customer]
1086
+ #
1087
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1088
+ #
1089
+ # @example Basic example
1090
+ # require "google/cloud/cloud_controls_partner/v1"
1091
+ #
1092
+ # # Create a client object. The client can be reused for multiple calls.
1093
+ # client = Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Client.new
1094
+ #
1095
+ # # Create a request. To set request fields, pass in keyword arguments.
1096
+ # request = Google::Cloud::CloudControlsPartner::V1::UpdateCustomerRequest.new
1097
+ #
1098
+ # # Call the update_customer method.
1099
+ # result = client.update_customer request
1100
+ #
1101
+ # # The returned object is of type Google::Cloud::CloudControlsPartner::V1::Customer.
1102
+ # p result
1103
+ #
1104
+ def update_customer request, options = nil
1105
+ raise ::ArgumentError, "request must be provided" if request.nil?
1106
+
1107
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudControlsPartner::V1::UpdateCustomerRequest
1108
+
1109
+ # Converts hash and nil to an options object
1110
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1111
+
1112
+ # Customize the options with defaults
1113
+ metadata = @config.rpcs.update_customer.metadata.to_h
1114
+
1115
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1116
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1117
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1118
+ gapic_version: ::Google::Cloud::CloudControlsPartner::V1::VERSION
1119
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1120
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1121
+
1122
+ header_params = {}
1123
+ if request.customer&.name
1124
+ header_params["customer.name"] = request.customer.name
1125
+ end
1126
+
1127
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1128
+ metadata[:"x-goog-request-params"] ||= request_params_header
1129
+
1130
+ options.apply_defaults timeout: @config.rpcs.update_customer.timeout,
1131
+ metadata: metadata,
1132
+ retry_policy: @config.rpcs.update_customer.retry_policy
1133
+
1134
+ options.apply_defaults timeout: @config.timeout,
1135
+ metadata: @config.metadata,
1136
+ retry_policy: @config.retry_policy
1137
+
1138
+ @cloud_controls_partner_core_stub.call_rpc :update_customer, request, options: options do |response, operation|
1139
+ yield response, operation if block_given?
1140
+ end
1141
+ rescue ::GRPC::BadStatus => e
1142
+ raise ::Google::Cloud::Error.from_error(e)
1143
+ end
1144
+
1145
+ ##
1146
+ # Delete details of a single customer
1147
+ #
1148
+ # @overload delete_customer(request, options = nil)
1149
+ # Pass arguments to `delete_customer` via a request object, either of type
1150
+ # {::Google::Cloud::CloudControlsPartner::V1::DeleteCustomerRequest} or an equivalent Hash.
1151
+ #
1152
+ # @param request [::Google::Cloud::CloudControlsPartner::V1::DeleteCustomerRequest, ::Hash]
1153
+ # A request object representing the call parameters. Required. To specify no
1154
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1155
+ # @param options [::Gapic::CallOptions, ::Hash]
1156
+ # Overrides the default settings for this call, e.g, timeout, retries, etc. Optional.
1157
+ #
1158
+ # @overload delete_customer(name: nil)
1159
+ # Pass arguments to `delete_customer` via keyword arguments. Note that at
1160
+ # least one keyword argument is required. To specify no parameters, or to keep all
1161
+ # the default parameter values, pass an empty Hash as a request object (see above).
1162
+ #
1163
+ # @param name [::String]
1164
+ # Required. name of the resource to be deleted
1165
+ # format: name=organizations/*/locations/*/customers/*
1166
+ #
1167
+ # @yield [response, operation] Access the result along with the RPC operation
1168
+ # @yieldparam response [::Google::Protobuf::Empty]
1169
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1170
+ #
1171
+ # @return [::Google::Protobuf::Empty]
1172
+ #
1173
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1174
+ #
1175
+ # @example Basic example
1176
+ # require "google/cloud/cloud_controls_partner/v1"
1177
+ #
1178
+ # # Create a client object. The client can be reused for multiple calls.
1179
+ # client = Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Client.new
1180
+ #
1181
+ # # Create a request. To set request fields, pass in keyword arguments.
1182
+ # request = Google::Cloud::CloudControlsPartner::V1::DeleteCustomerRequest.new
1183
+ #
1184
+ # # Call the delete_customer method.
1185
+ # result = client.delete_customer request
1186
+ #
1187
+ # # The returned object is of type Google::Protobuf::Empty.
1188
+ # p result
1189
+ #
1190
+ def delete_customer request, options = nil
1191
+ raise ::ArgumentError, "request must be provided" if request.nil?
1192
+
1193
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudControlsPartner::V1::DeleteCustomerRequest
1194
+
1195
+ # Converts hash and nil to an options object
1196
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1197
+
1198
+ # Customize the options with defaults
1199
+ metadata = @config.rpcs.delete_customer.metadata.to_h
1200
+
1201
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1202
+ metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1203
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1204
+ gapic_version: ::Google::Cloud::CloudControlsPartner::V1::VERSION
1205
+ metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1206
+ metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1207
+
1208
+ header_params = {}
1209
+ if request.name
1210
+ header_params["name"] = request.name
1211
+ end
1212
+
1213
+ request_params_header = header_params.map { |k, v| "#{k}=#{v}" }.join("&")
1214
+ metadata[:"x-goog-request-params"] ||= request_params_header
1215
+
1216
+ options.apply_defaults timeout: @config.rpcs.delete_customer.timeout,
1217
+ metadata: metadata,
1218
+ retry_policy: @config.rpcs.delete_customer.retry_policy
1219
+
1220
+ options.apply_defaults timeout: @config.timeout,
1221
+ metadata: @config.metadata,
1222
+ retry_policy: @config.retry_policy
1223
+
1224
+ @cloud_controls_partner_core_stub.call_rpc :delete_customer, request, options: options do |response, operation|
1225
+ yield response, operation if block_given?
1226
+ end
1227
+ rescue ::GRPC::BadStatus => e
1228
+ raise ::Google::Cloud::Error.from_error(e)
1229
+ end
1230
+
964
1231
  ##
965
1232
  # Configuration class for the CloudControlsPartnerCore API.
966
1233
  #
@@ -1167,6 +1434,21 @@ module Google
1167
1434
  # @return [::Gapic::Config::Method]
1168
1435
  #
1169
1436
  attr_reader :get_partner
1437
+ ##
1438
+ # RPC-specific configuration for `create_customer`
1439
+ # @return [::Gapic::Config::Method]
1440
+ #
1441
+ attr_reader :create_customer
1442
+ ##
1443
+ # RPC-specific configuration for `update_customer`
1444
+ # @return [::Gapic::Config::Method]
1445
+ #
1446
+ attr_reader :update_customer
1447
+ ##
1448
+ # RPC-specific configuration for `delete_customer`
1449
+ # @return [::Gapic::Config::Method]
1450
+ #
1451
+ attr_reader :delete_customer
1170
1452
 
1171
1453
  # @private
1172
1454
  def initialize parent_rpcs = nil
@@ -1186,6 +1468,12 @@ module Google
1186
1468
  @list_access_approval_requests = ::Gapic::Config::Method.new list_access_approval_requests_config
1187
1469
  get_partner_config = parent_rpcs.get_partner if parent_rpcs.respond_to? :get_partner
1188
1470
  @get_partner = ::Gapic::Config::Method.new get_partner_config
1471
+ create_customer_config = parent_rpcs.create_customer if parent_rpcs.respond_to? :create_customer
1472
+ @create_customer = ::Gapic::Config::Method.new create_customer_config
1473
+ update_customer_config = parent_rpcs.update_customer if parent_rpcs.respond_to? :update_customer
1474
+ @update_customer = ::Gapic::Config::Method.new update_customer_config
1475
+ delete_customer_config = parent_rpcs.delete_customer if parent_rpcs.respond_to? :delete_customer
1476
+ @delete_customer = ::Gapic::Config::Method.new delete_customer_config
1189
1477
 
1190
1478
  yield self if block_given?
1191
1479
  end
@@ -896,6 +896,252 @@ module Google
896
896
  raise ::Google::Cloud::Error.from_error(e)
897
897
  end
898
898
 
899
+ ##
900
+ # Creates a new customer.
901
+ #
902
+ # @overload create_customer(request, options = nil)
903
+ # Pass arguments to `create_customer` via a request object, either of type
904
+ # {::Google::Cloud::CloudControlsPartner::V1::CreateCustomerRequest} or an equivalent Hash.
905
+ #
906
+ # @param request [::Google::Cloud::CloudControlsPartner::V1::CreateCustomerRequest, ::Hash]
907
+ # A request object representing the call parameters. Required. To specify no
908
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
909
+ # @param options [::Gapic::CallOptions, ::Hash]
910
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
911
+ #
912
+ # @overload create_customer(parent: nil, customer: nil, customer_id: nil)
913
+ # Pass arguments to `create_customer` via keyword arguments. Note that at
914
+ # least one keyword argument is required. To specify no parameters, or to keep all
915
+ # the default parameter values, pass an empty Hash as a request object (see above).
916
+ #
917
+ # @param parent [::String]
918
+ # Required. Parent resource
919
+ # Format: `organizations/{organization}/locations/{location}`
920
+ # @param customer [::Google::Cloud::CloudControlsPartner::V1::Customer, ::Hash]
921
+ # Required. The customer to create.
922
+ # @param customer_id [::String]
923
+ # Required. The customer id to use for the customer, which will become the
924
+ # final component of the customer's resource name. The specified value must
925
+ # be a valid Google cloud organization id.
926
+ # @yield [result, operation] Access the result along with the TransportOperation object
927
+ # @yieldparam result [::Google::Cloud::CloudControlsPartner::V1::Customer]
928
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
929
+ #
930
+ # @return [::Google::Cloud::CloudControlsPartner::V1::Customer]
931
+ #
932
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
933
+ #
934
+ # @example Basic example
935
+ # require "google/cloud/cloud_controls_partner/v1"
936
+ #
937
+ # # Create a client object. The client can be reused for multiple calls.
938
+ # client = Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.new
939
+ #
940
+ # # Create a request. To set request fields, pass in keyword arguments.
941
+ # request = Google::Cloud::CloudControlsPartner::V1::CreateCustomerRequest.new
942
+ #
943
+ # # Call the create_customer method.
944
+ # result = client.create_customer request
945
+ #
946
+ # # The returned object is of type Google::Cloud::CloudControlsPartner::V1::Customer.
947
+ # p result
948
+ #
949
+ def create_customer request, options = nil
950
+ raise ::ArgumentError, "request must be provided" if request.nil?
951
+
952
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudControlsPartner::V1::CreateCustomerRequest
953
+
954
+ # Converts hash and nil to an options object
955
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
956
+
957
+ # Customize the options with defaults
958
+ call_metadata = @config.rpcs.create_customer.metadata.to_h
959
+
960
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
961
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
962
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
963
+ gapic_version: ::Google::Cloud::CloudControlsPartner::V1::VERSION,
964
+ transports_version_send: [:rest]
965
+
966
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
967
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
968
+
969
+ options.apply_defaults timeout: @config.rpcs.create_customer.timeout,
970
+ metadata: call_metadata,
971
+ retry_policy: @config.rpcs.create_customer.retry_policy
972
+
973
+ options.apply_defaults timeout: @config.timeout,
974
+ metadata: @config.metadata,
975
+ retry_policy: @config.retry_policy
976
+
977
+ @cloud_controls_partner_core_stub.create_customer request, options do |result, operation|
978
+ yield result, operation if block_given?
979
+ end
980
+ rescue ::Gapic::Rest::Error => e
981
+ raise ::Google::Cloud::Error.from_error(e)
982
+ end
983
+
984
+ ##
985
+ # Update details of a single customer
986
+ #
987
+ # @overload update_customer(request, options = nil)
988
+ # Pass arguments to `update_customer` via a request object, either of type
989
+ # {::Google::Cloud::CloudControlsPartner::V1::UpdateCustomerRequest} or an equivalent Hash.
990
+ #
991
+ # @param request [::Google::Cloud::CloudControlsPartner::V1::UpdateCustomerRequest, ::Hash]
992
+ # A request object representing the call parameters. Required. To specify no
993
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
994
+ # @param options [::Gapic::CallOptions, ::Hash]
995
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
996
+ #
997
+ # @overload update_customer(customer: nil, update_mask: nil)
998
+ # Pass arguments to `update_customer` via keyword arguments. Note that at
999
+ # least one keyword argument is required. To specify no parameters, or to keep all
1000
+ # the default parameter values, pass an empty Hash as a request object (see above).
1001
+ #
1002
+ # @param customer [::Google::Cloud::CloudControlsPartner::V1::Customer, ::Hash]
1003
+ # Required. The customer to update
1004
+ # Format:
1005
+ # `organizations/{organization}/locations/{location}/customers/{customer}`
1006
+ # @param update_mask [::Google::Protobuf::FieldMask, ::Hash]
1007
+ # Optional. The list of fields to update
1008
+ # @yield [result, operation] Access the result along with the TransportOperation object
1009
+ # @yieldparam result [::Google::Cloud::CloudControlsPartner::V1::Customer]
1010
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1011
+ #
1012
+ # @return [::Google::Cloud::CloudControlsPartner::V1::Customer]
1013
+ #
1014
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1015
+ #
1016
+ # @example Basic example
1017
+ # require "google/cloud/cloud_controls_partner/v1"
1018
+ #
1019
+ # # Create a client object. The client can be reused for multiple calls.
1020
+ # client = Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.new
1021
+ #
1022
+ # # Create a request. To set request fields, pass in keyword arguments.
1023
+ # request = Google::Cloud::CloudControlsPartner::V1::UpdateCustomerRequest.new
1024
+ #
1025
+ # # Call the update_customer method.
1026
+ # result = client.update_customer request
1027
+ #
1028
+ # # The returned object is of type Google::Cloud::CloudControlsPartner::V1::Customer.
1029
+ # p result
1030
+ #
1031
+ def update_customer request, options = nil
1032
+ raise ::ArgumentError, "request must be provided" if request.nil?
1033
+
1034
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudControlsPartner::V1::UpdateCustomerRequest
1035
+
1036
+ # Converts hash and nil to an options object
1037
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1038
+
1039
+ # Customize the options with defaults
1040
+ call_metadata = @config.rpcs.update_customer.metadata.to_h
1041
+
1042
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1043
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1044
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1045
+ gapic_version: ::Google::Cloud::CloudControlsPartner::V1::VERSION,
1046
+ transports_version_send: [:rest]
1047
+
1048
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1049
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1050
+
1051
+ options.apply_defaults timeout: @config.rpcs.update_customer.timeout,
1052
+ metadata: call_metadata,
1053
+ retry_policy: @config.rpcs.update_customer.retry_policy
1054
+
1055
+ options.apply_defaults timeout: @config.timeout,
1056
+ metadata: @config.metadata,
1057
+ retry_policy: @config.retry_policy
1058
+
1059
+ @cloud_controls_partner_core_stub.update_customer request, options do |result, operation|
1060
+ yield result, operation if block_given?
1061
+ end
1062
+ rescue ::Gapic::Rest::Error => e
1063
+ raise ::Google::Cloud::Error.from_error(e)
1064
+ end
1065
+
1066
+ ##
1067
+ # Delete details of a single customer
1068
+ #
1069
+ # @overload delete_customer(request, options = nil)
1070
+ # Pass arguments to `delete_customer` via a request object, either of type
1071
+ # {::Google::Cloud::CloudControlsPartner::V1::DeleteCustomerRequest} or an equivalent Hash.
1072
+ #
1073
+ # @param request [::Google::Cloud::CloudControlsPartner::V1::DeleteCustomerRequest, ::Hash]
1074
+ # A request object representing the call parameters. Required. To specify no
1075
+ # parameters, or to keep all the default parameter values, pass an empty Hash.
1076
+ # @param options [::Gapic::CallOptions, ::Hash]
1077
+ # Overrides the default settings for this call, e.g, timeout, retries etc. Optional.
1078
+ #
1079
+ # @overload delete_customer(name: nil)
1080
+ # Pass arguments to `delete_customer` via keyword arguments. Note that at
1081
+ # least one keyword argument is required. To specify no parameters, or to keep all
1082
+ # the default parameter values, pass an empty Hash as a request object (see above).
1083
+ #
1084
+ # @param name [::String]
1085
+ # Required. name of the resource to be deleted
1086
+ # format: name=organizations/*/locations/*/customers/*
1087
+ # @yield [result, operation] Access the result along with the TransportOperation object
1088
+ # @yieldparam result [::Google::Protobuf::Empty]
1089
+ # @yieldparam operation [::Gapic::Rest::TransportOperation]
1090
+ #
1091
+ # @return [::Google::Protobuf::Empty]
1092
+ #
1093
+ # @raise [::Google::Cloud::Error] if the REST call is aborted.
1094
+ #
1095
+ # @example Basic example
1096
+ # require "google/cloud/cloud_controls_partner/v1"
1097
+ #
1098
+ # # Create a client object. The client can be reused for multiple calls.
1099
+ # client = Google::Cloud::CloudControlsPartner::V1::CloudControlsPartnerCore::Rest::Client.new
1100
+ #
1101
+ # # Create a request. To set request fields, pass in keyword arguments.
1102
+ # request = Google::Cloud::CloudControlsPartner::V1::DeleteCustomerRequest.new
1103
+ #
1104
+ # # Call the delete_customer method.
1105
+ # result = client.delete_customer request
1106
+ #
1107
+ # # The returned object is of type Google::Protobuf::Empty.
1108
+ # p result
1109
+ #
1110
+ def delete_customer request, options = nil
1111
+ raise ::ArgumentError, "request must be provided" if request.nil?
1112
+
1113
+ request = ::Gapic::Protobuf.coerce request, to: ::Google::Cloud::CloudControlsPartner::V1::DeleteCustomerRequest
1114
+
1115
+ # Converts hash and nil to an options object
1116
+ options = ::Gapic::CallOptions.new(**options.to_h) if options.respond_to? :to_h
1117
+
1118
+ # Customize the options with defaults
1119
+ call_metadata = @config.rpcs.delete_customer.metadata.to_h
1120
+
1121
+ # Set x-goog-api-client, x-goog-user-project and x-goog-api-version headers
1122
+ call_metadata[:"x-goog-api-client"] ||= ::Gapic::Headers.x_goog_api_client \
1123
+ lib_name: @config.lib_name, lib_version: @config.lib_version,
1124
+ gapic_version: ::Google::Cloud::CloudControlsPartner::V1::VERSION,
1125
+ transports_version_send: [:rest]
1126
+
1127
+ call_metadata[:"x-goog-api-version"] = API_VERSION unless API_VERSION.empty?
1128
+ call_metadata[:"x-goog-user-project"] = @quota_project_id if @quota_project_id
1129
+
1130
+ options.apply_defaults timeout: @config.rpcs.delete_customer.timeout,
1131
+ metadata: call_metadata,
1132
+ retry_policy: @config.rpcs.delete_customer.retry_policy
1133
+
1134
+ options.apply_defaults timeout: @config.timeout,
1135
+ metadata: @config.metadata,
1136
+ retry_policy: @config.retry_policy
1137
+
1138
+ @cloud_controls_partner_core_stub.delete_customer request, options do |result, operation|
1139
+ yield result, operation if block_given?
1140
+ end
1141
+ rescue ::Gapic::Rest::Error => e
1142
+ raise ::Google::Cloud::Error.from_error(e)
1143
+ end
1144
+
899
1145
  ##
900
1146
  # Configuration class for the CloudControlsPartnerCore REST API.
901
1147
  #
@@ -1082,6 +1328,21 @@ module Google
1082
1328
  # @return [::Gapic::Config::Method]
1083
1329
  #
1084
1330
  attr_reader :get_partner
1331
+ ##
1332
+ # RPC-specific configuration for `create_customer`
1333
+ # @return [::Gapic::Config::Method]
1334
+ #
1335
+ attr_reader :create_customer
1336
+ ##
1337
+ # RPC-specific configuration for `update_customer`
1338
+ # @return [::Gapic::Config::Method]
1339
+ #
1340
+ attr_reader :update_customer
1341
+ ##
1342
+ # RPC-specific configuration for `delete_customer`
1343
+ # @return [::Gapic::Config::Method]
1344
+ #
1345
+ attr_reader :delete_customer
1085
1346
 
1086
1347
  # @private
1087
1348
  def initialize parent_rpcs = nil
@@ -1101,6 +1362,12 @@ module Google
1101
1362
  @list_access_approval_requests = ::Gapic::Config::Method.new list_access_approval_requests_config
1102
1363
  get_partner_config = parent_rpcs.get_partner if parent_rpcs.respond_to? :get_partner
1103
1364
  @get_partner = ::Gapic::Config::Method.new get_partner_config
1365
+ create_customer_config = parent_rpcs.create_customer if parent_rpcs.respond_to? :create_customer
1366
+ @create_customer = ::Gapic::Config::Method.new create_customer_config
1367
+ update_customer_config = parent_rpcs.update_customer if parent_rpcs.respond_to? :update_customer
1368
+ @update_customer = ::Gapic::Config::Method.new update_customer_config
1369
+ delete_customer_config = parent_rpcs.delete_customer if parent_rpcs.respond_to? :delete_customer
1370
+ @delete_customer = ::Gapic::Config::Method.new delete_customer_config
1104
1371
 
1105
1372
  yield self if block_given?
1106
1373
  end