google-cloud-cloud_controls_partner-v1beta 0.3.0 → 0.5.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: fd8e24fe3a0dbcf7ebce22ad210aaeec46950682df56a8e39f9de816abb42997
4
- data.tar.gz: a449189f8a529cdf5ab2939a8aa84d5a346831ebcf4234b3000c589e64b0ba60
3
+ metadata.gz: 936f80768e241d6423e8d421ef81ce2ff320045339fdcbda5146ab6b5785efb7
4
+ data.tar.gz: 7726184b874fb67d2defbc7f76edae48172c69a99ad8d3c175e8ea4e2bd8c4fd
5
5
  SHA512:
6
- metadata.gz: a1b78e6e23f3be7f610469ca974829acfcfbf2d963df68c4e611140832b905476361d37d87d59b326cb1e06daf49b6204c805322ada36179fb6ba3a874dad2d4
7
- data.tar.gz: 888df3e8d75c47167d714197ab8312c152b375c9e93946d6f648cc833c82712080c25c90e79a4ea53a53921d7cbb93655c55ce4e0392b5e3c9eba325bcf62096
6
+ metadata.gz: 875aa58cede229aed7a8f77b0dfb0068eee3b1a8e7b7a925e4e45688b39cb89bd9d77cc5d44bdaf1028068c900bdf24998f61e8c2f45ea740383948dd93bba01
7
+ data.tar.gz: a116ae86019ab582ad9f161fc0d1540c1ac1d64f49cfc8bed23f4b980941ba8532e36a646e15a8b4d783ca1e37009eb09f0d69e6efd4a92654631a199b432e96
data/README.md CHANGED
@@ -86,7 +86,7 @@ To browse ready to use code samples check [Google Cloud Samples](https://cloud.g
86
86
 
87
87
  ## Supported Ruby Versions
88
88
 
89
- This library is supported on Ruby 2.7+.
89
+ This library is supported on Ruby 3.0+.
90
90
 
91
91
  Google provides official support for Ruby versions that are actively supported
92
92
  by Ruby Core—that is, Ruby versions that are either in normal maintenance or
@@ -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::V1beta::CreateCustomerRequest} or an equivalent Hash.
970
+ #
971
+ # @param request [::Google::Cloud::CloudControlsPartner::V1beta::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::V1beta::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::V1beta::Customer]
994
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
995
+ #
996
+ # @return [::Google::Cloud::CloudControlsPartner::V1beta::Customer]
997
+ #
998
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
999
+ #
1000
+ # @example Basic example
1001
+ # require "google/cloud/cloud_controls_partner/v1beta"
1002
+ #
1003
+ # # Create a client object. The client can be reused for multiple calls.
1004
+ # client = Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerCore::Client.new
1005
+ #
1006
+ # # Create a request. To set request fields, pass in keyword arguments.
1007
+ # request = Google::Cloud::CloudControlsPartner::V1beta::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::V1beta::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::V1beta::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::V1beta::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::V1beta::UpdateCustomerRequest} or an equivalent Hash.
1062
+ #
1063
+ # @param request [::Google::Cloud::CloudControlsPartner::V1beta::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::V1beta::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::V1beta::Customer]
1083
+ # @yieldparam operation [::GRPC::ActiveCall::Operation]
1084
+ #
1085
+ # @return [::Google::Cloud::CloudControlsPartner::V1beta::Customer]
1086
+ #
1087
+ # @raise [::Google::Cloud::Error] if the RPC is aborted.
1088
+ #
1089
+ # @example Basic example
1090
+ # require "google/cloud/cloud_controls_partner/v1beta"
1091
+ #
1092
+ # # Create a client object. The client can be reused for multiple calls.
1093
+ # client = Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerCore::Client.new
1094
+ #
1095
+ # # Create a request. To set request fields, pass in keyword arguments.
1096
+ # request = Google::Cloud::CloudControlsPartner::V1beta::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::V1beta::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::V1beta::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::V1beta::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::V1beta::DeleteCustomerRequest} or an equivalent Hash.
1151
+ #
1152
+ # @param request [::Google::Cloud::CloudControlsPartner::V1beta::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/v1beta"
1177
+ #
1178
+ # # Create a client object. The client can be reused for multiple calls.
1179
+ # client = Google::Cloud::CloudControlsPartner::V1beta::CloudControlsPartnerCore::Client.new
1180
+ #
1181
+ # # Create a request. To set request fields, pass in keyword arguments.
1182
+ # request = Google::Cloud::CloudControlsPartner::V1beta::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::V1beta::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::V1beta::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
  #
@@ -1005,6 +1272,13 @@ module Google
1005
1272
  # * (`GRPC::Core::Channel`) a gRPC channel with included credentials
1006
1273
  # * (`GRPC::Core::ChannelCredentials`) a gRPC credentails object
1007
1274
  # * (`nil`) indicating no credentials
1275
+ #
1276
+ # Warning: If you accept a credential configuration (JSON file or Hash) from an
1277
+ # external source for authentication to Google Cloud, you must validate it before
1278
+ # providing it to a Google API client library. Providing an unvalidated credential
1279
+ # configuration to Google APIs can compromise the security of your systems and data.
1280
+ # For more information, refer to [Validate credential configurations from external
1281
+ # sources](https://cloud.google.com/docs/authentication/external/externally-sourced-credentials).
1008
1282
  # @return [::Object]
1009
1283
  # @!attribute [rw] scope
1010
1284
  # The OAuth scopes
@@ -1160,6 +1434,21 @@ module Google
1160
1434
  # @return [::Gapic::Config::Method]
1161
1435
  #
1162
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
1163
1452
 
1164
1453
  # @private
1165
1454
  def initialize parent_rpcs = nil
@@ -1179,6 +1468,12 @@ module Google
1179
1468
  @list_access_approval_requests = ::Gapic::Config::Method.new list_access_approval_requests_config
1180
1469
  get_partner_config = parent_rpcs.get_partner if parent_rpcs.respond_to? :get_partner
1181
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
1182
1477
 
1183
1478
  yield self if block_given?
1184
1479
  end