google-apis-cloudcommerceprocurement_v1 0.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.
@@ -0,0 +1,28 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ module Google
16
+ module Apis
17
+ module CloudcommerceprocurementV1
18
+ # Version of the google-apis-cloudcommerceprocurement_v1 gem
19
+ GEM_VERSION = "0.1.0"
20
+
21
+ # Version of the code generator used to generate this client
22
+ GENERATOR_VERSION = "0.2.0"
23
+
24
+ # Revision of the discovery document this client was generated from
25
+ REVISION = "20210417"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,256 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'date'
16
+ require 'google/apis/core/base_service'
17
+ require 'google/apis/core/json_representation'
18
+ require 'google/apis/core/hashable'
19
+ require 'google/apis/errors'
20
+
21
+ module Google
22
+ module Apis
23
+ module CloudcommerceprocurementV1
24
+
25
+ class Account
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class Approval
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class ApproveAccountRequest
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class ApproveEntitlementPlanChangeRequest
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class ApproveEntitlementRequest
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class Consumer
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class Empty
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class Entitlement
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class ListAccountsResponse
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class ListEntitlementsResponse
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class RejectAccountRequest
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class RejectEntitlementPlanChangeRequest
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class RejectEntitlementRequest
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class ResetAccountRequest
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class SuspendEntitlementRequest
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class Account
116
+ # @private
117
+ class Representation < Google::Apis::Core::JsonRepresentation
118
+ collection :approvals, as: 'approvals', class: Google::Apis::CloudcommerceprocurementV1::Approval, decorator: Google::Apis::CloudcommerceprocurementV1::Approval::Representation
119
+
120
+ property :create_time, as: 'createTime'
121
+ hash :input_properties, as: 'inputProperties'
122
+ property :name, as: 'name'
123
+ property :provider, as: 'provider'
124
+ property :state, as: 'state'
125
+ property :update_time, as: 'updateTime'
126
+ end
127
+ end
128
+
129
+ class Approval
130
+ # @private
131
+ class Representation < Google::Apis::Core::JsonRepresentation
132
+ property :name, as: 'name'
133
+ property :reason, as: 'reason'
134
+ property :state, as: 'state'
135
+ property :update_time, as: 'updateTime'
136
+ end
137
+ end
138
+
139
+ class ApproveAccountRequest
140
+ # @private
141
+ class Representation < Google::Apis::Core::JsonRepresentation
142
+ property :approval_name, as: 'approvalName'
143
+ hash :properties, as: 'properties'
144
+ property :reason, as: 'reason'
145
+ end
146
+ end
147
+
148
+ class ApproveEntitlementPlanChangeRequest
149
+ # @private
150
+ class Representation < Google::Apis::Core::JsonRepresentation
151
+ property :pending_plan_name, as: 'pendingPlanName'
152
+ end
153
+ end
154
+
155
+ class ApproveEntitlementRequest
156
+ # @private
157
+ class Representation < Google::Apis::Core::JsonRepresentation
158
+ hash :properties, as: 'properties'
159
+ end
160
+ end
161
+
162
+ class Consumer
163
+ # @private
164
+ class Representation < Google::Apis::Core::JsonRepresentation
165
+ property :project, as: 'project'
166
+ end
167
+ end
168
+
169
+ class Empty
170
+ # @private
171
+ class Representation < Google::Apis::Core::JsonRepresentation
172
+ end
173
+ end
174
+
175
+ class Entitlement
176
+ # @private
177
+ class Representation < Google::Apis::Core::JsonRepresentation
178
+ property :account, as: 'account'
179
+ collection :consumers, as: 'consumers', class: Google::Apis::CloudcommerceprocurementV1::Consumer, decorator: Google::Apis::CloudcommerceprocurementV1::Consumer::Representation
180
+
181
+ property :create_time, as: 'createTime'
182
+ hash :input_properties, as: 'inputProperties'
183
+ property :message_to_user, as: 'messageToUser'
184
+ property :name, as: 'name'
185
+ property :new_pending_offer, as: 'newPendingOffer'
186
+ property :new_pending_plan, as: 'newPendingPlan'
187
+ property :offer, as: 'offer'
188
+ property :offer_end_time, as: 'offerEndTime'
189
+ property :plan, as: 'plan'
190
+ property :product, as: 'product'
191
+ property :product_external_name, as: 'productExternalName'
192
+ property :provider, as: 'provider'
193
+ property :quote_external_name, as: 'quoteExternalName'
194
+ property :state, as: 'state'
195
+ property :subscription_end_time, as: 'subscriptionEndTime'
196
+ property :update_time, as: 'updateTime'
197
+ property :usage_reporting_id, as: 'usageReportingId'
198
+ end
199
+ end
200
+
201
+ class ListAccountsResponse
202
+ # @private
203
+ class Representation < Google::Apis::Core::JsonRepresentation
204
+ collection :accounts, as: 'accounts', class: Google::Apis::CloudcommerceprocurementV1::Account, decorator: Google::Apis::CloudcommerceprocurementV1::Account::Representation
205
+
206
+ property :next_page_token, as: 'nextPageToken'
207
+ end
208
+ end
209
+
210
+ class ListEntitlementsResponse
211
+ # @private
212
+ class Representation < Google::Apis::Core::JsonRepresentation
213
+ collection :entitlements, as: 'entitlements', class: Google::Apis::CloudcommerceprocurementV1::Entitlement, decorator: Google::Apis::CloudcommerceprocurementV1::Entitlement::Representation
214
+
215
+ property :next_page_token, as: 'nextPageToken'
216
+ end
217
+ end
218
+
219
+ class RejectAccountRequest
220
+ # @private
221
+ class Representation < Google::Apis::Core::JsonRepresentation
222
+ property :approval_name, as: 'approvalName'
223
+ property :reason, as: 'reason'
224
+ end
225
+ end
226
+
227
+ class RejectEntitlementPlanChangeRequest
228
+ # @private
229
+ class Representation < Google::Apis::Core::JsonRepresentation
230
+ property :pending_plan_name, as: 'pendingPlanName'
231
+ property :reason, as: 'reason'
232
+ end
233
+ end
234
+
235
+ class RejectEntitlementRequest
236
+ # @private
237
+ class Representation < Google::Apis::Core::JsonRepresentation
238
+ property :reason, as: 'reason'
239
+ end
240
+ end
241
+
242
+ class ResetAccountRequest
243
+ # @private
244
+ class Representation < Google::Apis::Core::JsonRepresentation
245
+ end
246
+ end
247
+
248
+ class SuspendEntitlementRequest
249
+ # @private
250
+ class Representation < Google::Apis::Core::JsonRepresentation
251
+ property :reason, as: 'reason'
252
+ end
253
+ end
254
+ end
255
+ end
256
+ end
@@ -0,0 +1,529 @@
1
+ # Copyright 2020 Google LLC
2
+ #
3
+ # Licensed under the Apache License, Version 2.0 (the "License");
4
+ # you may not use this file except in compliance with the License.
5
+ # You may obtain a copy of the License at
6
+ #
7
+ # http://www.apache.org/licenses/LICENSE-2.0
8
+ #
9
+ # Unless required by applicable law or agreed to in writing, software
10
+ # distributed under the License is distributed on an "AS IS" BASIS,
11
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
+ # See the License for the specific language governing permissions and
13
+ # limitations under the License.
14
+
15
+ require 'google/apis/core/base_service'
16
+ require 'google/apis/core/json_representation'
17
+ require 'google/apis/core/hashable'
18
+ require 'google/apis/errors'
19
+
20
+ module Google
21
+ module Apis
22
+ module CloudcommerceprocurementV1
23
+ # Cloud Commerce Partner Procurement API
24
+ #
25
+ # Partner API for the Cloud Commerce Procurement Service.
26
+ #
27
+ # @example
28
+ # require 'google/apis/cloudcommerceprocurement_v1'
29
+ #
30
+ # Cloudcommerceprocurement = Google::Apis::CloudcommerceprocurementV1 # Alias the module
31
+ # service = Cloudcommerceprocurement::CloudCommercePartnerProcurementServiceService.new
32
+ #
33
+ # @see https://cloud.google.com/marketplace/docs/partners/
34
+ class CloudCommercePartnerProcurementServiceService < Google::Apis::Core::BaseService
35
+ # @return [String]
36
+ # API key. Your API key identifies your project and provides you with API access,
37
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
38
+ attr_accessor :key
39
+
40
+ # @return [String]
41
+ # Available to use for quota purposes for server-side applications. Can be any
42
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
43
+ attr_accessor :quota_user
44
+
45
+ def initialize
46
+ super('https://cloudcommerceprocurement.googleapis.com/', '',
47
+ client_name: 'google-apis-cloudcommerceprocurement_v1',
48
+ client_version: Google::Apis::CloudcommerceprocurementV1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Grants an approval on an Account.
53
+ # @param [String] name
54
+ # The resource name of the account. Required.
55
+ # @param [Google::Apis::CloudcommerceprocurementV1::ApproveAccountRequest] approve_account_request_object
56
+ # @param [String] fields
57
+ # Selector specifying which fields to include in a partial response.
58
+ # @param [String] quota_user
59
+ # Available to use for quota purposes for server-side applications. Can be any
60
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
61
+ # @param [Google::Apis::RequestOptions] options
62
+ # Request-specific options
63
+ #
64
+ # @yield [result, err] Result & error if block supplied
65
+ # @yieldparam result [Google::Apis::CloudcommerceprocurementV1::Empty] parsed result object
66
+ # @yieldparam err [StandardError] error object if request failed
67
+ #
68
+ # @return [Google::Apis::CloudcommerceprocurementV1::Empty]
69
+ #
70
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
71
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
72
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
73
+ def approve_account(name, approve_account_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
74
+ command = make_simple_command(:post, 'v1/{+name}:approve', options)
75
+ command.request_representation = Google::Apis::CloudcommerceprocurementV1::ApproveAccountRequest::Representation
76
+ command.request_object = approve_account_request_object
77
+ command.response_representation = Google::Apis::CloudcommerceprocurementV1::Empty::Representation
78
+ command.response_class = Google::Apis::CloudcommerceprocurementV1::Empty
79
+ command.params['name'] = name unless name.nil?
80
+ command.query['fields'] = fields unless fields.nil?
81
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
82
+ execute_or_queue_command(command, &block)
83
+ end
84
+
85
+ # Gets a requested Account resource.
86
+ # @param [String] name
87
+ # The name of the account to retrieve.
88
+ # @param [String] fields
89
+ # Selector specifying which fields to include in a partial response.
90
+ # @param [String] quota_user
91
+ # Available to use for quota purposes for server-side applications. Can be any
92
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
93
+ # @param [Google::Apis::RequestOptions] options
94
+ # Request-specific options
95
+ #
96
+ # @yield [result, err] Result & error if block supplied
97
+ # @yieldparam result [Google::Apis::CloudcommerceprocurementV1::Account] parsed result object
98
+ # @yieldparam err [StandardError] error object if request failed
99
+ #
100
+ # @return [Google::Apis::CloudcommerceprocurementV1::Account]
101
+ #
102
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
103
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
104
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
105
+ def get_provider_account(name, fields: nil, quota_user: nil, options: nil, &block)
106
+ command = make_simple_command(:get, 'v1/{+name}', options)
107
+ command.response_representation = Google::Apis::CloudcommerceprocurementV1::Account::Representation
108
+ command.response_class = Google::Apis::CloudcommerceprocurementV1::Account
109
+ command.params['name'] = name unless name.nil?
110
+ command.query['fields'] = fields unless fields.nil?
111
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
112
+ execute_or_queue_command(command, &block)
113
+ end
114
+
115
+ # Lists Accounts that the provider has access to.
116
+ # @param [String] parent
117
+ # The parent resource name.
118
+ # @param [Fixnum] page_size
119
+ # The maximum number of entries that are requested. Default size is 200.
120
+ # @param [String] page_token
121
+ # The token for fetching the next page.
122
+ # @param [String] fields
123
+ # Selector specifying which fields to include in a partial response.
124
+ # @param [String] quota_user
125
+ # Available to use for quota purposes for server-side applications. Can be any
126
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
127
+ # @param [Google::Apis::RequestOptions] options
128
+ # Request-specific options
129
+ #
130
+ # @yield [result, err] Result & error if block supplied
131
+ # @yieldparam result [Google::Apis::CloudcommerceprocurementV1::ListAccountsResponse] parsed result object
132
+ # @yieldparam err [StandardError] error object if request failed
133
+ #
134
+ # @return [Google::Apis::CloudcommerceprocurementV1::ListAccountsResponse]
135
+ #
136
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
137
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
138
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
139
+ def list_provider_accounts(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
140
+ command = make_simple_command(:get, 'v1/{+parent}/accounts', options)
141
+ command.response_representation = Google::Apis::CloudcommerceprocurementV1::ListAccountsResponse::Representation
142
+ command.response_class = Google::Apis::CloudcommerceprocurementV1::ListAccountsResponse
143
+ command.params['parent'] = parent unless parent.nil?
144
+ command.query['pageSize'] = page_size unless page_size.nil?
145
+ command.query['pageToken'] = page_token unless page_token.nil?
146
+ command.query['fields'] = fields unless fields.nil?
147
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
148
+ execute_or_queue_command(command, &block)
149
+ end
150
+
151
+ # Rejects an approval on an Account.
152
+ # @param [String] name
153
+ # The resource name of the account. Required.
154
+ # @param [Google::Apis::CloudcommerceprocurementV1::RejectAccountRequest] reject_account_request_object
155
+ # @param [String] fields
156
+ # Selector specifying which fields to include in a partial response.
157
+ # @param [String] quota_user
158
+ # Available to use for quota purposes for server-side applications. Can be any
159
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
160
+ # @param [Google::Apis::RequestOptions] options
161
+ # Request-specific options
162
+ #
163
+ # @yield [result, err] Result & error if block supplied
164
+ # @yieldparam result [Google::Apis::CloudcommerceprocurementV1::Empty] parsed result object
165
+ # @yieldparam err [StandardError] error object if request failed
166
+ #
167
+ # @return [Google::Apis::CloudcommerceprocurementV1::Empty]
168
+ #
169
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
170
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
171
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
172
+ def reject_account(name, reject_account_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
173
+ command = make_simple_command(:post, 'v1/{+name}:reject', options)
174
+ command.request_representation = Google::Apis::CloudcommerceprocurementV1::RejectAccountRequest::Representation
175
+ command.request_object = reject_account_request_object
176
+ command.response_representation = Google::Apis::CloudcommerceprocurementV1::Empty::Representation
177
+ command.response_class = Google::Apis::CloudcommerceprocurementV1::Empty
178
+ command.params['name'] = name unless name.nil?
179
+ command.query['fields'] = fields unless fields.nil?
180
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
181
+ execute_or_queue_command(command, &block)
182
+ end
183
+
184
+ # Resets an Account and cancel all associated Entitlements. Partner can only
185
+ # reset accounts they own rather than customer accounts.
186
+ # @param [String] name
187
+ # The resource name of the account. Required.
188
+ # @param [Google::Apis::CloudcommerceprocurementV1::ResetAccountRequest] reset_account_request_object
189
+ # @param [String] fields
190
+ # Selector specifying which fields to include in a partial response.
191
+ # @param [String] quota_user
192
+ # Available to use for quota purposes for server-side applications. Can be any
193
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
194
+ # @param [Google::Apis::RequestOptions] options
195
+ # Request-specific options
196
+ #
197
+ # @yield [result, err] Result & error if block supplied
198
+ # @yieldparam result [Google::Apis::CloudcommerceprocurementV1::Empty] parsed result object
199
+ # @yieldparam err [StandardError] error object if request failed
200
+ #
201
+ # @return [Google::Apis::CloudcommerceprocurementV1::Empty]
202
+ #
203
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
204
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
205
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
206
+ def reset_account(name, reset_account_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
207
+ command = make_simple_command(:post, 'v1/{+name}:reset', options)
208
+ command.request_representation = Google::Apis::CloudcommerceprocurementV1::ResetAccountRequest::Representation
209
+ command.request_object = reset_account_request_object
210
+ command.response_representation = Google::Apis::CloudcommerceprocurementV1::Empty::Representation
211
+ command.response_class = Google::Apis::CloudcommerceprocurementV1::Empty
212
+ command.params['name'] = name unless name.nil?
213
+ command.query['fields'] = fields unless fields.nil?
214
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
215
+ execute_or_queue_command(command, &block)
216
+ end
217
+
218
+ # Approves an entitlement that is in the EntitlementState.
219
+ # ENTITLEMENT_ACTIVATION_REQUESTED state. This method is invoked by the provider
220
+ # to approve the creation of the entitlement resource.
221
+ # @param [String] name
222
+ # The resource name of the entitlement. Required.
223
+ # @param [Google::Apis::CloudcommerceprocurementV1::ApproveEntitlementRequest] approve_entitlement_request_object
224
+ # @param [String] fields
225
+ # Selector specifying which fields to include in a partial response.
226
+ # @param [String] quota_user
227
+ # Available to use for quota purposes for server-side applications. Can be any
228
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
229
+ # @param [Google::Apis::RequestOptions] options
230
+ # Request-specific options
231
+ #
232
+ # @yield [result, err] Result & error if block supplied
233
+ # @yieldparam result [Google::Apis::CloudcommerceprocurementV1::Empty] parsed result object
234
+ # @yieldparam err [StandardError] error object if request failed
235
+ #
236
+ # @return [Google::Apis::CloudcommerceprocurementV1::Empty]
237
+ #
238
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
239
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
240
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
241
+ def approve_entitlement(name, approve_entitlement_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
242
+ command = make_simple_command(:post, 'v1/{+name}:approve', options)
243
+ command.request_representation = Google::Apis::CloudcommerceprocurementV1::ApproveEntitlementRequest::Representation
244
+ command.request_object = approve_entitlement_request_object
245
+ command.response_representation = Google::Apis::CloudcommerceprocurementV1::Empty::Representation
246
+ command.response_class = Google::Apis::CloudcommerceprocurementV1::Empty
247
+ command.params['name'] = name unless name.nil?
248
+ command.query['fields'] = fields unless fields.nil?
249
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
250
+ execute_or_queue_command(command, &block)
251
+ end
252
+
253
+ # Approves an entitlement plan change that is in the EntitlementState.
254
+ # ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL state. This method is invoked by the
255
+ # provider to approve the plan change on the entitlement resource.
256
+ # @param [String] name
257
+ # The resource name of the entitlement. Required.
258
+ # @param [Google::Apis::CloudcommerceprocurementV1::ApproveEntitlementPlanChangeRequest] approve_entitlement_plan_change_request_object
259
+ # @param [String] fields
260
+ # Selector specifying which fields to include in a partial response.
261
+ # @param [String] quota_user
262
+ # Available to use for quota purposes for server-side applications. Can be any
263
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
264
+ # @param [Google::Apis::RequestOptions] options
265
+ # Request-specific options
266
+ #
267
+ # @yield [result, err] Result & error if block supplied
268
+ # @yieldparam result [Google::Apis::CloudcommerceprocurementV1::Empty] parsed result object
269
+ # @yieldparam err [StandardError] error object if request failed
270
+ #
271
+ # @return [Google::Apis::CloudcommerceprocurementV1::Empty]
272
+ #
273
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
274
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
275
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
276
+ def approve_provider_entitlement_plan_change(name, approve_entitlement_plan_change_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
277
+ command = make_simple_command(:post, 'v1/{+name}:approvePlanChange', options)
278
+ command.request_representation = Google::Apis::CloudcommerceprocurementV1::ApproveEntitlementPlanChangeRequest::Representation
279
+ command.request_object = approve_entitlement_plan_change_request_object
280
+ command.response_representation = Google::Apis::CloudcommerceprocurementV1::Empty::Representation
281
+ command.response_class = Google::Apis::CloudcommerceprocurementV1::Empty
282
+ command.params['name'] = name unless name.nil?
283
+ command.query['fields'] = fields unless fields.nil?
284
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
285
+ execute_or_queue_command(command, &block)
286
+ end
287
+
288
+ # Gets a requested Entitlement resource.
289
+ # @param [String] name
290
+ # The name of the entitlement to retrieve.
291
+ # @param [String] fields
292
+ # Selector specifying which fields to include in a partial response.
293
+ # @param [String] quota_user
294
+ # Available to use for quota purposes for server-side applications. Can be any
295
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
296
+ # @param [Google::Apis::RequestOptions] options
297
+ # Request-specific options
298
+ #
299
+ # @yield [result, err] Result & error if block supplied
300
+ # @yieldparam result [Google::Apis::CloudcommerceprocurementV1::Entitlement] parsed result object
301
+ # @yieldparam err [StandardError] error object if request failed
302
+ #
303
+ # @return [Google::Apis::CloudcommerceprocurementV1::Entitlement]
304
+ #
305
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
306
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
307
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
308
+ def get_provider_entitlement(name, fields: nil, quota_user: nil, options: nil, &block)
309
+ command = make_simple_command(:get, 'v1/{+name}', options)
310
+ command.response_representation = Google::Apis::CloudcommerceprocurementV1::Entitlement::Representation
311
+ command.response_class = Google::Apis::CloudcommerceprocurementV1::Entitlement
312
+ command.params['name'] = name unless name.nil?
313
+ command.query['fields'] = fields unless fields.nil?
314
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
315
+ execute_or_queue_command(command, &block)
316
+ end
317
+
318
+ # Lists Entitlements for which the provider has read access.
319
+ # @param [String] parent
320
+ # The parent resource name.
321
+ # @param [String] filter
322
+ # The filter that can be used to limit the list request. The filter is a query
323
+ # string that can match a selected set of attributes with string values. For
324
+ # example `account=E-1234-5678-ABCD-EFGH`, `state=pending_cancellation`, and `
325
+ # plan!=foo-plan`. Supported query attributes are * `account` * `
326
+ # customer_billing_account` with value in the format of: `billingAccounts/`id`` *
327
+ # `product_external_name` * `quote_external_name` * `offer` * `
328
+ # new_pending_offer` * `plan` * `newPendingPlan` or `new_pending_plan` * `state`
329
+ # * `consumers.project` Note that the consumers match works on repeated
330
+ # structures, so equality (`consumers.project=projects/123456789`) is not
331
+ # supported. Set membership can be expressed with the `:` operator. For example,
332
+ # `consumers.project:projects/123456789` finds entitlements with at least one
333
+ # consumer with project field equal to `projects/123456789`. Also note that the
334
+ # state name match is case-insensitive and query can omit the prefix "
335
+ # ENTITLEMENT_". For example, `state=active` is equivalent to `state=
336
+ # ENTITLEMENT_ACTIVE`. If the query contains some special characters other than
337
+ # letters, underscore, or digits, the phrase must be quoted with double quotes.
338
+ # For example, `product="providerId:productId"`, where the product name needs to
339
+ # be quoted because it contains special character colon. Queries can be combined
340
+ # with `AND`, `OR`, and `NOT` to form more complex queries. They can also be
341
+ # grouped to force a desired evaluation order. For example, `state=active AND (
342
+ # account=E-1234 OR account=5678) AND NOT (product=foo-product)`. Connective `
343
+ # AND` can be omitted between two predicates. For example `account=E-1234 state=
344
+ # active` is equivalent to `account=E-1234 AND state=active`.
345
+ # @param [Fixnum] page_size
346
+ # The maximum number of entries that are requested.
347
+ # @param [String] page_token
348
+ # The token for fetching the next page.
349
+ # @param [String] fields
350
+ # Selector specifying which fields to include in a partial response.
351
+ # @param [String] quota_user
352
+ # Available to use for quota purposes for server-side applications. Can be any
353
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
354
+ # @param [Google::Apis::RequestOptions] options
355
+ # Request-specific options
356
+ #
357
+ # @yield [result, err] Result & error if block supplied
358
+ # @yieldparam result [Google::Apis::CloudcommerceprocurementV1::ListEntitlementsResponse] parsed result object
359
+ # @yieldparam err [StandardError] error object if request failed
360
+ #
361
+ # @return [Google::Apis::CloudcommerceprocurementV1::ListEntitlementsResponse]
362
+ #
363
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
364
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
365
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
366
+ def list_provider_entitlements(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
367
+ command = make_simple_command(:get, 'v1/{+parent}/entitlements', options)
368
+ command.response_representation = Google::Apis::CloudcommerceprocurementV1::ListEntitlementsResponse::Representation
369
+ command.response_class = Google::Apis::CloudcommerceprocurementV1::ListEntitlementsResponse
370
+ command.params['parent'] = parent unless parent.nil?
371
+ command.query['filter'] = filter unless filter.nil?
372
+ command.query['pageSize'] = page_size unless page_size.nil?
373
+ command.query['pageToken'] = page_token unless page_token.nil?
374
+ command.query['fields'] = fields unless fields.nil?
375
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
376
+ execute_or_queue_command(command, &block)
377
+ end
378
+
379
+ # Updates an existing Entitlement.
380
+ # @param [String] name
381
+ # The name of the entitlement to update.
382
+ # @param [Google::Apis::CloudcommerceprocurementV1::Entitlement] entitlement_object
383
+ # @param [String] update_mask
384
+ # The update mask that applies to the resource. See the [FieldMask definition] (
385
+ # https://developers.google.com/protocol-buffers/docs/reference/google.protobuf#
386
+ # fieldmask) for more details.
387
+ # @param [String] fields
388
+ # Selector specifying which fields to include in a partial response.
389
+ # @param [String] quota_user
390
+ # Available to use for quota purposes for server-side applications. Can be any
391
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
392
+ # @param [Google::Apis::RequestOptions] options
393
+ # Request-specific options
394
+ #
395
+ # @yield [result, err] Result & error if block supplied
396
+ # @yieldparam result [Google::Apis::CloudcommerceprocurementV1::Entitlement] parsed result object
397
+ # @yieldparam err [StandardError] error object if request failed
398
+ #
399
+ # @return [Google::Apis::CloudcommerceprocurementV1::Entitlement]
400
+ #
401
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
402
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
403
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
404
+ def patch_provider_entitlement(name, entitlement_object = nil, update_mask: nil, fields: nil, quota_user: nil, options: nil, &block)
405
+ command = make_simple_command(:patch, 'v1/{+name}', options)
406
+ command.request_representation = Google::Apis::CloudcommerceprocurementV1::Entitlement::Representation
407
+ command.request_object = entitlement_object
408
+ command.response_representation = Google::Apis::CloudcommerceprocurementV1::Entitlement::Representation
409
+ command.response_class = Google::Apis::CloudcommerceprocurementV1::Entitlement
410
+ command.params['name'] = name unless name.nil?
411
+ command.query['updateMask'] = update_mask unless update_mask.nil?
412
+ command.query['fields'] = fields unless fields.nil?
413
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
414
+ execute_or_queue_command(command, &block)
415
+ end
416
+
417
+ # Rejects an entitlement that is in the EntitlementState.
418
+ # ENTITLEMENT_ACTIVATION_REQUESTED state. This method is invoked by the provider
419
+ # to reject the creation of the entitlement resource.
420
+ # @param [String] name
421
+ # The resource name of the entitlement. Required.
422
+ # @param [Google::Apis::CloudcommerceprocurementV1::RejectEntitlementRequest] reject_entitlement_request_object
423
+ # @param [String] fields
424
+ # Selector specifying which fields to include in a partial response.
425
+ # @param [String] quota_user
426
+ # Available to use for quota purposes for server-side applications. Can be any
427
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
428
+ # @param [Google::Apis::RequestOptions] options
429
+ # Request-specific options
430
+ #
431
+ # @yield [result, err] Result & error if block supplied
432
+ # @yieldparam result [Google::Apis::CloudcommerceprocurementV1::Empty] parsed result object
433
+ # @yieldparam err [StandardError] error object if request failed
434
+ #
435
+ # @return [Google::Apis::CloudcommerceprocurementV1::Empty]
436
+ #
437
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
438
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
439
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
440
+ def reject_entitlement(name, reject_entitlement_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
441
+ command = make_simple_command(:post, 'v1/{+name}:reject', options)
442
+ command.request_representation = Google::Apis::CloudcommerceprocurementV1::RejectEntitlementRequest::Representation
443
+ command.request_object = reject_entitlement_request_object
444
+ command.response_representation = Google::Apis::CloudcommerceprocurementV1::Empty::Representation
445
+ command.response_class = Google::Apis::CloudcommerceprocurementV1::Empty
446
+ command.params['name'] = name unless name.nil?
447
+ command.query['fields'] = fields unless fields.nil?
448
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
449
+ execute_or_queue_command(command, &block)
450
+ end
451
+
452
+ # Rejects an entitlement plan change that is in the EntitlementState.
453
+ # ENTITLEMENT_PENDING_PLAN_CHANGE_APPROVAL state. This method is invoked by the
454
+ # provider to reject the plan change on the entitlement resource.
455
+ # @param [String] name
456
+ # The resource name of the entitlement. Required.
457
+ # @param [Google::Apis::CloudcommerceprocurementV1::RejectEntitlementPlanChangeRequest] reject_entitlement_plan_change_request_object
458
+ # @param [String] fields
459
+ # Selector specifying which fields to include in a partial response.
460
+ # @param [String] quota_user
461
+ # Available to use for quota purposes for server-side applications. Can be any
462
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
463
+ # @param [Google::Apis::RequestOptions] options
464
+ # Request-specific options
465
+ #
466
+ # @yield [result, err] Result & error if block supplied
467
+ # @yieldparam result [Google::Apis::CloudcommerceprocurementV1::Empty] parsed result object
468
+ # @yieldparam err [StandardError] error object if request failed
469
+ #
470
+ # @return [Google::Apis::CloudcommerceprocurementV1::Empty]
471
+ #
472
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
473
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
474
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
475
+ def reject_provider_entitlement_plan_change(name, reject_entitlement_plan_change_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
476
+ command = make_simple_command(:post, 'v1/{+name}:rejectPlanChange', options)
477
+ command.request_representation = Google::Apis::CloudcommerceprocurementV1::RejectEntitlementPlanChangeRequest::Representation
478
+ command.request_object = reject_entitlement_plan_change_request_object
479
+ command.response_representation = Google::Apis::CloudcommerceprocurementV1::Empty::Representation
480
+ command.response_class = Google::Apis::CloudcommerceprocurementV1::Empty
481
+ command.params['name'] = name unless name.nil?
482
+ command.query['fields'] = fields unless fields.nil?
483
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
484
+ execute_or_queue_command(command, &block)
485
+ end
486
+
487
+ # Requests suspension of an active Entitlement. This is not yet supported.
488
+ # @param [String] name
489
+ # The name of the entitlement to suspend.
490
+ # @param [Google::Apis::CloudcommerceprocurementV1::SuspendEntitlementRequest] suspend_entitlement_request_object
491
+ # @param [String] fields
492
+ # Selector specifying which fields to include in a partial response.
493
+ # @param [String] quota_user
494
+ # Available to use for quota purposes for server-side applications. Can be any
495
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
496
+ # @param [Google::Apis::RequestOptions] options
497
+ # Request-specific options
498
+ #
499
+ # @yield [result, err] Result & error if block supplied
500
+ # @yieldparam result [Google::Apis::CloudcommerceprocurementV1::Empty] parsed result object
501
+ # @yieldparam err [StandardError] error object if request failed
502
+ #
503
+ # @return [Google::Apis::CloudcommerceprocurementV1::Empty]
504
+ #
505
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
506
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
507
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
508
+ def suspend_entitlement(name, suspend_entitlement_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
509
+ command = make_simple_command(:post, 'v1/{+name}:suspend', options)
510
+ command.request_representation = Google::Apis::CloudcommerceprocurementV1::SuspendEntitlementRequest::Representation
511
+ command.request_object = suspend_entitlement_request_object
512
+ command.response_representation = Google::Apis::CloudcommerceprocurementV1::Empty::Representation
513
+ command.response_class = Google::Apis::CloudcommerceprocurementV1::Empty
514
+ command.params['name'] = name unless name.nil?
515
+ command.query['fields'] = fields unless fields.nil?
516
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
517
+ execute_or_queue_command(command, &block)
518
+ end
519
+
520
+ protected
521
+
522
+ def apply_command_defaults(command)
523
+ command.query['key'] = key unless key.nil?
524
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
525
+ end
526
+ end
527
+ end
528
+ end
529
+ end