google-apis-paymentsresellersubscription_v1 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 PaymentsresellersubscriptionV1
18
+ # Version of the google-apis-paymentsresellersubscription_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 = "20210507"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,301 @@
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 PaymentsresellersubscriptionV1
24
+
25
+ class GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionRequest
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionResponse
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class GoogleCloudPaymentsResellerSubscriptionV1Duration
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionRequest
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionResponse
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionRequest
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionResponse
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class GoogleCloudPaymentsResellerSubscriptionV1Extension
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ include Google::Apis::Core::JsonObjectSupport
71
+ end
72
+
73
+ class GoogleCloudPaymentsResellerSubscriptionV1ListProductsResponse
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ class GoogleCloudPaymentsResellerSubscriptionV1ListPromotionsResponse
80
+ class Representation < Google::Apis::Core::JsonRepresentation; end
81
+
82
+ include Google::Apis::Core::JsonObjectSupport
83
+ end
84
+
85
+ class GoogleCloudPaymentsResellerSubscriptionV1Location
86
+ class Representation < Google::Apis::Core::JsonRepresentation; end
87
+
88
+ include Google::Apis::Core::JsonObjectSupport
89
+ end
90
+
91
+ class GoogleCloudPaymentsResellerSubscriptionV1Product
92
+ class Representation < Google::Apis::Core::JsonRepresentation; end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class GoogleCloudPaymentsResellerSubscriptionV1Promotion
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class GoogleCloudPaymentsResellerSubscriptionV1Subscription
104
+ class Representation < Google::Apis::Core::JsonRepresentation; end
105
+
106
+ include Google::Apis::Core::JsonObjectSupport
107
+ end
108
+
109
+ class GoogleCloudPaymentsResellerSubscriptionV1SubscriptionCancellationDetails
110
+ class Representation < Google::Apis::Core::JsonRepresentation; end
111
+
112
+ include Google::Apis::Core::JsonObjectSupport
113
+ end
114
+
115
+ class GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionRequest
116
+ class Representation < Google::Apis::Core::JsonRepresentation; end
117
+
118
+ include Google::Apis::Core::JsonObjectSupport
119
+ end
120
+
121
+ class GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionResponse
122
+ class Representation < Google::Apis::Core::JsonRepresentation; end
123
+
124
+ include Google::Apis::Core::JsonObjectSupport
125
+ end
126
+
127
+ class GoogleTypeLocalizedText
128
+ class Representation < Google::Apis::Core::JsonRepresentation; end
129
+
130
+ include Google::Apis::Core::JsonObjectSupport
131
+ end
132
+
133
+ class GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionRequest
134
+ # @private
135
+ class Representation < Google::Apis::Core::JsonRepresentation
136
+ property :cancel_immediately, as: 'cancelImmediately'
137
+ property :cancellation_reason, as: 'cancellationReason'
138
+ end
139
+ end
140
+
141
+ class GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionResponse
142
+ # @private
143
+ class Representation < Google::Apis::Core::JsonRepresentation
144
+ property :subscription, as: 'subscription', class: Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Subscription, decorator: Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Subscription::Representation
145
+
146
+ end
147
+ end
148
+
149
+ class GoogleCloudPaymentsResellerSubscriptionV1Duration
150
+ # @private
151
+ class Representation < Google::Apis::Core::JsonRepresentation
152
+ property :count, as: 'count'
153
+ property :unit, as: 'unit'
154
+ end
155
+ end
156
+
157
+ class GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionRequest
158
+ # @private
159
+ class Representation < Google::Apis::Core::JsonRepresentation
160
+ end
161
+ end
162
+
163
+ class GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionResponse
164
+ # @private
165
+ class Representation < Google::Apis::Core::JsonRepresentation
166
+ property :subscription, as: 'subscription', class: Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Subscription, decorator: Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Subscription::Representation
167
+
168
+ end
169
+ end
170
+
171
+ class GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionRequest
172
+ # @private
173
+ class Representation < Google::Apis::Core::JsonRepresentation
174
+ property :extension, as: 'extension', class: Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Extension, decorator: Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Extension::Representation
175
+
176
+ property :request_id, as: 'requestId'
177
+ end
178
+ end
179
+
180
+ class GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionResponse
181
+ # @private
182
+ class Representation < Google::Apis::Core::JsonRepresentation
183
+ property :cycle_end_time, as: 'cycleEndTime'
184
+ property :free_trial_end_time, as: 'freeTrialEndTime'
185
+ end
186
+ end
187
+
188
+ class GoogleCloudPaymentsResellerSubscriptionV1Extension
189
+ # @private
190
+ class Representation < Google::Apis::Core::JsonRepresentation
191
+ property :duration, as: 'duration', class: Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Duration, decorator: Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Duration::Representation
192
+
193
+ property :partner_user_token, as: 'partnerUserToken'
194
+ end
195
+ end
196
+
197
+ class GoogleCloudPaymentsResellerSubscriptionV1ListProductsResponse
198
+ # @private
199
+ class Representation < Google::Apis::Core::JsonRepresentation
200
+ property :next_page_token, as: 'nextPageToken'
201
+ collection :products, as: 'products', class: Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Product, decorator: Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Product::Representation
202
+
203
+ end
204
+ end
205
+
206
+ class GoogleCloudPaymentsResellerSubscriptionV1ListPromotionsResponse
207
+ # @private
208
+ class Representation < Google::Apis::Core::JsonRepresentation
209
+ property :next_page_token, as: 'nextPageToken'
210
+ collection :promotions, as: 'promotions', class: Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Promotion, decorator: Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Promotion::Representation
211
+
212
+ end
213
+ end
214
+
215
+ class GoogleCloudPaymentsResellerSubscriptionV1Location
216
+ # @private
217
+ class Representation < Google::Apis::Core::JsonRepresentation
218
+ property :postal_code, as: 'postalCode'
219
+ property :region_code, as: 'regionCode'
220
+ end
221
+ end
222
+
223
+ class GoogleCloudPaymentsResellerSubscriptionV1Product
224
+ # @private
225
+ class Representation < Google::Apis::Core::JsonRepresentation
226
+ property :name, as: 'name'
227
+ collection :region_codes, as: 'regionCodes'
228
+ property :subscription_billing_cycle_duration, as: 'subscriptionBillingCycleDuration', class: Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Duration, decorator: Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Duration::Representation
229
+
230
+ collection :titles, as: 'titles', class: Google::Apis::PaymentsresellersubscriptionV1::GoogleTypeLocalizedText, decorator: Google::Apis::PaymentsresellersubscriptionV1::GoogleTypeLocalizedText::Representation
231
+
232
+ end
233
+ end
234
+
235
+ class GoogleCloudPaymentsResellerSubscriptionV1Promotion
236
+ # @private
237
+ class Representation < Google::Apis::Core::JsonRepresentation
238
+ collection :applicable_products, as: 'applicableProducts'
239
+ property :end_time, as: 'endTime'
240
+ property :free_trial_duration, as: 'freeTrialDuration', class: Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Duration, decorator: Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Duration::Representation
241
+
242
+ property :name, as: 'name'
243
+ collection :region_codes, as: 'regionCodes'
244
+ property :start_time, as: 'startTime'
245
+ collection :titles, as: 'titles', class: Google::Apis::PaymentsresellersubscriptionV1::GoogleTypeLocalizedText, decorator: Google::Apis::PaymentsresellersubscriptionV1::GoogleTypeLocalizedText::Representation
246
+
247
+ end
248
+ end
249
+
250
+ class GoogleCloudPaymentsResellerSubscriptionV1Subscription
251
+ # @private
252
+ class Representation < Google::Apis::Core::JsonRepresentation
253
+ property :cancellation_details, as: 'cancellationDetails', class: Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1SubscriptionCancellationDetails, decorator: Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1SubscriptionCancellationDetails::Representation
254
+
255
+ property :create_time, as: 'createTime'
256
+ property :cycle_end_time, as: 'cycleEndTime'
257
+ property :end_user_entitled, as: 'endUserEntitled'
258
+ property :free_trial_end_time, as: 'freeTrialEndTime'
259
+ property :name, as: 'name'
260
+ property :partner_user_token, as: 'partnerUserToken'
261
+ collection :products, as: 'products'
262
+ collection :promotions, as: 'promotions'
263
+ property :redirect_uri, as: 'redirectUri'
264
+ property :service_location, as: 'serviceLocation', class: Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Location, decorator: Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Location::Representation
265
+
266
+ property :state, as: 'state'
267
+ property :update_time, as: 'updateTime'
268
+ end
269
+ end
270
+
271
+ class GoogleCloudPaymentsResellerSubscriptionV1SubscriptionCancellationDetails
272
+ # @private
273
+ class Representation < Google::Apis::Core::JsonRepresentation
274
+ property :reason, as: 'reason'
275
+ end
276
+ end
277
+
278
+ class GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionRequest
279
+ # @private
280
+ class Representation < Google::Apis::Core::JsonRepresentation
281
+ end
282
+ end
283
+
284
+ class GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionResponse
285
+ # @private
286
+ class Representation < Google::Apis::Core::JsonRepresentation
287
+ property :subscription, as: 'subscription', class: Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Subscription, decorator: Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Subscription::Representation
288
+
289
+ end
290
+ end
291
+
292
+ class GoogleTypeLocalizedText
293
+ # @private
294
+ class Representation < Google::Apis::Core::JsonRepresentation
295
+ property :language_code, as: 'languageCode'
296
+ property :text, as: 'text'
297
+ end
298
+ end
299
+ end
300
+ end
301
+ end
@@ -0,0 +1,416 @@
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 PaymentsresellersubscriptionV1
23
+ # Payments Reseller Subscription API
24
+ #
25
+ #
26
+ #
27
+ # @example
28
+ # require 'google/apis/paymentsresellersubscription_v1'
29
+ #
30
+ # Paymentsresellersubscription = Google::Apis::PaymentsresellersubscriptionV1 # Alias the module
31
+ # service = Paymentsresellersubscription::PaymentsResellerSubscriptionService.new
32
+ #
33
+ # @see https://developers.google.com/payments/reseller/subscription/
34
+ class PaymentsResellerSubscriptionService < 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://paymentsresellersubscription.googleapis.com/', '',
47
+ client_name: 'google-apis-paymentsresellersubscription_v1',
48
+ client_version: Google::Apis::PaymentsresellersubscriptionV1::GEM_VERSION)
49
+ @batch_path = 'batch'
50
+ end
51
+
52
+ # Used by partners to list products that can be resold to their customers. It
53
+ # should be called directly by the partner using service accounts.
54
+ # @param [String] parent
55
+ # Required. The parent, the partner that can resell. Format: partners/`partner`
56
+ # @param [Fixnum] page_size
57
+ # Optional. The maximum number of products to return. The service may return
58
+ # fewer than this value. If unspecified, at most 50 products will be returned.
59
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
60
+ # @param [String] page_token
61
+ # Optional. A page token, received from a previous `ListProducts` call. Provide
62
+ # this to retrieve the subsequent page. When paginating, all other parameters
63
+ # provided to `ListProducts` must match the call that provided the page token.
64
+ # @param [String] fields
65
+ # Selector specifying which fields to include in a partial response.
66
+ # @param [String] quota_user
67
+ # Available to use for quota purposes for server-side applications. Can be any
68
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
69
+ # @param [Google::Apis::RequestOptions] options
70
+ # Request-specific options
71
+ #
72
+ # @yield [result, err] Result & error if block supplied
73
+ # @yieldparam result [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1ListProductsResponse] parsed result object
74
+ # @yieldparam err [StandardError] error object if request failed
75
+ #
76
+ # @return [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1ListProductsResponse]
77
+ #
78
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
79
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
80
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
81
+ def list_partner_products(parent, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
82
+ command = make_simple_command(:get, 'v1/{+parent}/products', options)
83
+ command.response_representation = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1ListProductsResponse::Representation
84
+ command.response_class = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1ListProductsResponse
85
+ command.params['parent'] = parent unless parent.nil?
86
+ command.query['pageSize'] = page_size unless page_size.nil?
87
+ command.query['pageToken'] = page_token unless page_token.nil?
88
+ command.query['fields'] = fields unless fields.nil?
89
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
90
+ execute_or_queue_command(command, &block)
91
+ end
92
+
93
+ # Used by partners to list promotions, such as free trial, that can be applied
94
+ # on subscriptions. It should be called directly by the partner using service
95
+ # accounts.
96
+ # @param [String] parent
97
+ # Required. The parent, the partner that can resell. Format: partners/`partner`
98
+ # @param [String] filter
99
+ # Optional. Specifies the filters for the promotion results. The syntax defined
100
+ # in the EBNF grammar: https://google.aip.dev/assets/misc/ebnf-filtering.txt.
101
+ # Examples: - applicable_products: "sku1" - region_codes: "US" -
102
+ # applicable_products: "sku1" AND region_codes: "US"
103
+ # @param [Fixnum] page_size
104
+ # Optional. The maximum number of promotions to return. The service may return
105
+ # fewer than this value. If unspecified, at most 50 products will be returned.
106
+ # The maximum value is 1000; values above 1000 will be coerced to 1000.
107
+ # @param [String] page_token
108
+ # Optional. A page token, received from a previous `ListPromotions` call.
109
+ # Provide this to retrieve the subsequent page. When paginating, all other
110
+ # parameters provided to `ListPromotions` must match the call that provided the
111
+ # page token.
112
+ # @param [String] fields
113
+ # Selector specifying which fields to include in a partial response.
114
+ # @param [String] quota_user
115
+ # Available to use for quota purposes for server-side applications. Can be any
116
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
117
+ # @param [Google::Apis::RequestOptions] options
118
+ # Request-specific options
119
+ #
120
+ # @yield [result, err] Result & error if block supplied
121
+ # @yieldparam result [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1ListPromotionsResponse] parsed result object
122
+ # @yieldparam err [StandardError] error object if request failed
123
+ #
124
+ # @return [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1ListPromotionsResponse]
125
+ #
126
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
127
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
128
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
129
+ def list_partner_promotions(parent, filter: nil, page_size: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
130
+ command = make_simple_command(:get, 'v1/{+parent}/promotions', options)
131
+ command.response_representation = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1ListPromotionsResponse::Representation
132
+ command.response_class = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1ListPromotionsResponse
133
+ command.params['parent'] = parent unless parent.nil?
134
+ command.query['filter'] = filter unless filter.nil?
135
+ command.query['pageSize'] = page_size unless page_size.nil?
136
+ command.query['pageToken'] = page_token unless page_token.nil?
137
+ command.query['fields'] = fields unless fields.nil?
138
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
139
+ execute_or_queue_command(command, &block)
140
+ end
141
+
142
+ # Used by partners to cancel a subscription service by the end of the current
143
+ # billing cycle for their customers. It should be called directly by the partner
144
+ # using service accounts.
145
+ # @param [String] name
146
+ # Required. The name of the subscription resource to be cancelled. It will have
147
+ # the format of "partners/`partner_id`/subscriptions/`subscription_id`"
148
+ # @param [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionRequest] google_cloud_payments_reseller_subscription_v1_cancel_subscription_request_object
149
+ # @param [String] fields
150
+ # Selector specifying which fields to include in a partial response.
151
+ # @param [String] quota_user
152
+ # Available to use for quota purposes for server-side applications. Can be any
153
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
154
+ # @param [Google::Apis::RequestOptions] options
155
+ # Request-specific options
156
+ #
157
+ # @yield [result, err] Result & error if block supplied
158
+ # @yieldparam result [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionResponse] parsed result object
159
+ # @yieldparam err [StandardError] error object if request failed
160
+ #
161
+ # @return [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionResponse]
162
+ #
163
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
164
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
165
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
166
+ def cancel_partner_subscription(name, google_cloud_payments_reseller_subscription_v1_cancel_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
167
+ command = make_simple_command(:post, 'v1/{+name}:cancel', options)
168
+ command.request_representation = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionRequest::Representation
169
+ command.request_object = google_cloud_payments_reseller_subscription_v1_cancel_subscription_request_object
170
+ command.response_representation = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionResponse::Representation
171
+ command.response_class = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1CancelSubscriptionResponse
172
+ command.params['name'] = name unless name.nil?
173
+ command.query['fields'] = fields unless fields.nil?
174
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
175
+ execute_or_queue_command(command, &block)
176
+ end
177
+
178
+ # Used by partners to create a subscription for their customers. The created
179
+ # subscription is associated with the end user inferred from the end user
180
+ # credentials. This API must be authorized by the end user using OAuth.
181
+ # @param [String] parent
182
+ # Required. The parent resource name, which is the identifier of the partner. It
183
+ # will have the format of "partners/`partner_id`".
184
+ # @param [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Subscription] google_cloud_payments_reseller_subscription_v1_subscription_object
185
+ # @param [String] subscription_id
186
+ # Required. Identifies the subscription resource on the Partner side. The value
187
+ # is restricted to 63 ASCII characters at the maximum. If a subscription was
188
+ # previously created with the same subscription_id, we will directly return that
189
+ # one.
190
+ # @param [String] fields
191
+ # Selector specifying which fields to include in a partial response.
192
+ # @param [String] quota_user
193
+ # Available to use for quota purposes for server-side applications. Can be any
194
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
195
+ # @param [Google::Apis::RequestOptions] options
196
+ # Request-specific options
197
+ #
198
+ # @yield [result, err] Result & error if block supplied
199
+ # @yieldparam result [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Subscription] parsed result object
200
+ # @yieldparam err [StandardError] error object if request failed
201
+ #
202
+ # @return [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Subscription]
203
+ #
204
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
205
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
206
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
207
+ def create_partner_subscription(parent, google_cloud_payments_reseller_subscription_v1_subscription_object = nil, subscription_id: nil, fields: nil, quota_user: nil, options: nil, &block)
208
+ command = make_simple_command(:post, 'v1/{+parent}/subscriptions', options)
209
+ command.request_representation = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Subscription::Representation
210
+ command.request_object = google_cloud_payments_reseller_subscription_v1_subscription_object
211
+ command.response_representation = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Subscription::Representation
212
+ command.response_class = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Subscription
213
+ command.params['parent'] = parent unless parent.nil?
214
+ command.query['subscriptionId'] = subscription_id unless subscription_id.nil?
215
+ command.query['fields'] = fields unless fields.nil?
216
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
217
+ execute_or_queue_command(command, &block)
218
+ end
219
+
220
+ # Used by partners to entitle a previously provisioned subscription to the
221
+ # current end user. The end user identity is inferred from the authorized
222
+ # credential of the request. This API must be authorized by the end user using
223
+ # OAuth.
224
+ # @param [String] name
225
+ # Required. The name of the subscription resource that is entitled to the
226
+ # current end user. It will have the format of "partners/`partner_id`/
227
+ # subscriptions/`subscription_id`"
228
+ # @param [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionRequest] google_cloud_payments_reseller_subscription_v1_entitle_subscription_request_object
229
+ # @param [String] fields
230
+ # Selector specifying which fields to include in a partial response.
231
+ # @param [String] quota_user
232
+ # Available to use for quota purposes for server-side applications. Can be any
233
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
234
+ # @param [Google::Apis::RequestOptions] options
235
+ # Request-specific options
236
+ #
237
+ # @yield [result, err] Result & error if block supplied
238
+ # @yieldparam result [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionResponse] parsed result object
239
+ # @yieldparam err [StandardError] error object if request failed
240
+ #
241
+ # @return [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionResponse]
242
+ #
243
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
244
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
245
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
246
+ def entitle_partner_subscription(name, google_cloud_payments_reseller_subscription_v1_entitle_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
247
+ command = make_simple_command(:post, 'v1/{+name}:entitle', options)
248
+ command.request_representation = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionRequest::Representation
249
+ command.request_object = google_cloud_payments_reseller_subscription_v1_entitle_subscription_request_object
250
+ command.response_representation = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionResponse::Representation
251
+ command.response_class = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1EntitleSubscriptionResponse
252
+ command.params['name'] = name unless name.nil?
253
+ command.query['fields'] = fields unless fields.nil?
254
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
255
+ execute_or_queue_command(command, &block)
256
+ end
257
+
258
+ # Used by partners to extend a subscription service for their customers. It
259
+ # should be called directly by the partner using service accounts.
260
+ # @param [String] name
261
+ # Required. The name of the subscription resource to be extended. It will have
262
+ # the format of "partners/`partner_id`/subscriptions/`subscription_id`".
263
+ # @param [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionRequest] google_cloud_payments_reseller_subscription_v1_extend_subscription_request_object
264
+ # @param [String] fields
265
+ # Selector specifying which fields to include in a partial response.
266
+ # @param [String] quota_user
267
+ # Available to use for quota purposes for server-side applications. Can be any
268
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
269
+ # @param [Google::Apis::RequestOptions] options
270
+ # Request-specific options
271
+ #
272
+ # @yield [result, err] Result & error if block supplied
273
+ # @yieldparam result [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionResponse] parsed result object
274
+ # @yieldparam err [StandardError] error object if request failed
275
+ #
276
+ # @return [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionResponse]
277
+ #
278
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
279
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
280
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
281
+ def extend_partner_subscription(name, google_cloud_payments_reseller_subscription_v1_extend_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
282
+ command = make_simple_command(:post, 'v1/{+name}:extend', options)
283
+ command.request_representation = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionRequest::Representation
284
+ command.request_object = google_cloud_payments_reseller_subscription_v1_extend_subscription_request_object
285
+ command.response_representation = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionResponse::Representation
286
+ command.response_class = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1ExtendSubscriptionResponse
287
+ command.params['name'] = name unless name.nil?
288
+ command.query['fields'] = fields unless fields.nil?
289
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
290
+ execute_or_queue_command(command, &block)
291
+ end
292
+
293
+ # Used by partners to get a subscription by id. It should be called directly by
294
+ # the partner using service accounts.
295
+ # @param [String] name
296
+ # Required. The name of the subscription resource to retrieve. It will have the
297
+ # format of "partners/`partner_id`/subscriptions/`subscription_id`"
298
+ # @param [String] fields
299
+ # Selector specifying which fields to include in a partial response.
300
+ # @param [String] quota_user
301
+ # Available to use for quota purposes for server-side applications. Can be any
302
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
303
+ # @param [Google::Apis::RequestOptions] options
304
+ # Request-specific options
305
+ #
306
+ # @yield [result, err] Result & error if block supplied
307
+ # @yieldparam result [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Subscription] parsed result object
308
+ # @yieldparam err [StandardError] error object if request failed
309
+ #
310
+ # @return [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Subscription]
311
+ #
312
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
313
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
314
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
315
+ def get_partner_subscription(name, fields: nil, quota_user: nil, options: nil, &block)
316
+ command = make_simple_command(:get, 'v1/{+name}', options)
317
+ command.response_representation = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Subscription::Representation
318
+ command.response_class = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Subscription
319
+ command.params['name'] = name unless name.nil?
320
+ command.query['fields'] = fields unless fields.nil?
321
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
322
+ execute_or_queue_command(command, &block)
323
+ end
324
+
325
+ # Used by partners to provision a subscription for their customers. This creates
326
+ # a subscription without associating it with the end user account.
327
+ # EntitleSubscription must be called separately using OAuth in order for the end
328
+ # user account to be associated with the subscription. It should be called
329
+ # directly by the partner using service accounts.
330
+ # @param [String] parent
331
+ # Required. The parent resource name, which is the identifier of the partner. It
332
+ # will have the format of "partners/`partner_id`".
333
+ # @param [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Subscription] google_cloud_payments_reseller_subscription_v1_subscription_object
334
+ # @param [String] subscription_id
335
+ # Required. Identifies the subscription resource on the Partner side. The value
336
+ # is restricted to 63 ASCII characters at the maximum. If a subscription was
337
+ # previously created with the same subscription_id, we will directly return that
338
+ # one.
339
+ # @param [String] fields
340
+ # Selector specifying which fields to include in a partial response.
341
+ # @param [String] quota_user
342
+ # Available to use for quota purposes for server-side applications. Can be any
343
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
344
+ # @param [Google::Apis::RequestOptions] options
345
+ # Request-specific options
346
+ #
347
+ # @yield [result, err] Result & error if block supplied
348
+ # @yieldparam result [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Subscription] parsed result object
349
+ # @yieldparam err [StandardError] error object if request failed
350
+ #
351
+ # @return [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Subscription]
352
+ #
353
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
354
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
355
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
356
+ def provision_partner_subscription(parent, google_cloud_payments_reseller_subscription_v1_subscription_object = nil, subscription_id: nil, fields: nil, quota_user: nil, options: nil, &block)
357
+ command = make_simple_command(:post, 'v1/{+parent}/subscriptions:provision', options)
358
+ command.request_representation = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Subscription::Representation
359
+ command.request_object = google_cloud_payments_reseller_subscription_v1_subscription_object
360
+ command.response_representation = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Subscription::Representation
361
+ command.response_class = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1Subscription
362
+ command.params['parent'] = parent unless parent.nil?
363
+ command.query['subscriptionId'] = subscription_id unless subscription_id.nil?
364
+ command.query['fields'] = fields unless fields.nil?
365
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
366
+ execute_or_queue_command(command, &block)
367
+ end
368
+
369
+ # Used by partners to revoke the pending cancellation of a subscription, which
370
+ # is currently in `STATE_CANCEL_AT_END_OF_CYCLE` state. If the subscription is
371
+ # already cancelled, the request will fail. It should be called directly by the
372
+ # partner using service accounts.
373
+ # @param [String] name
374
+ # Required. The name of the subscription resource whose pending cancellation
375
+ # needs to be undone. It will have the format of "partners/`partner_id`/
376
+ # subscriptions/`subscription_id`"
377
+ # @param [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionRequest] google_cloud_payments_reseller_subscription_v1_undo_cancel_subscription_request_object
378
+ # @param [String] fields
379
+ # Selector specifying which fields to include in a partial response.
380
+ # @param [String] quota_user
381
+ # Available to use for quota purposes for server-side applications. Can be any
382
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
383
+ # @param [Google::Apis::RequestOptions] options
384
+ # Request-specific options
385
+ #
386
+ # @yield [result, err] Result & error if block supplied
387
+ # @yieldparam result [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionResponse] parsed result object
388
+ # @yieldparam err [StandardError] error object if request failed
389
+ #
390
+ # @return [Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionResponse]
391
+ #
392
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
393
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
394
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
395
+ def undo_partner_subscription_cancel(name, google_cloud_payments_reseller_subscription_v1_undo_cancel_subscription_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
396
+ command = make_simple_command(:post, 'v1/{+name}:undoCancel', options)
397
+ command.request_representation = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionRequest::Representation
398
+ command.request_object = google_cloud_payments_reseller_subscription_v1_undo_cancel_subscription_request_object
399
+ command.response_representation = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionResponse::Representation
400
+ command.response_class = Google::Apis::PaymentsresellersubscriptionV1::GoogleCloudPaymentsResellerSubscriptionV1UndoCancelSubscriptionResponse
401
+ command.params['name'] = name unless name.nil?
402
+ command.query['fields'] = fields unless fields.nil?
403
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
404
+ execute_or_queue_command(command, &block)
405
+ end
406
+
407
+ protected
408
+
409
+ def apply_command_defaults(command)
410
+ command.query['key'] = key unless key.nil?
411
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
412
+ end
413
+ end
414
+ end
415
+ end
416
+ end