google-apis-reseller_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 ResellerV1
18
+ # Version of the google-apis-reseller_v1 gem
19
+ GEM_VERSION = "0.1.0"
20
+
21
+ # Version of the code generator used to generate this client
22
+ GENERATOR_VERSION = "0.1.1"
23
+
24
+ # Revision of the discovery document this client was generated from
25
+ REVISION = "20201129"
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,253 @@
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 ResellerV1
24
+
25
+ class Address
26
+ class Representation < Google::Apis::Core::JsonRepresentation; end
27
+
28
+ include Google::Apis::Core::JsonObjectSupport
29
+ end
30
+
31
+ class ChangePlanRequest
32
+ class Representation < Google::Apis::Core::JsonRepresentation; end
33
+
34
+ include Google::Apis::Core::JsonObjectSupport
35
+ end
36
+
37
+ class Customer
38
+ class Representation < Google::Apis::Core::JsonRepresentation; end
39
+
40
+ include Google::Apis::Core::JsonObjectSupport
41
+ end
42
+
43
+ class RenewalSettings
44
+ class Representation < Google::Apis::Core::JsonRepresentation; end
45
+
46
+ include Google::Apis::Core::JsonObjectSupport
47
+ end
48
+
49
+ class ResellernotifyGetwatchdetailsResponse
50
+ class Representation < Google::Apis::Core::JsonRepresentation; end
51
+
52
+ include Google::Apis::Core::JsonObjectSupport
53
+ end
54
+
55
+ class ResellernotifyResource
56
+ class Representation < Google::Apis::Core::JsonRepresentation; end
57
+
58
+ include Google::Apis::Core::JsonObjectSupport
59
+ end
60
+
61
+ class Seats
62
+ class Representation < Google::Apis::Core::JsonRepresentation; end
63
+
64
+ include Google::Apis::Core::JsonObjectSupport
65
+ end
66
+
67
+ class Subscription
68
+ class Representation < Google::Apis::Core::JsonRepresentation; end
69
+
70
+ class Plan
71
+ class Representation < Google::Apis::Core::JsonRepresentation; end
72
+
73
+ class CommitmentInterval
74
+ class Representation < Google::Apis::Core::JsonRepresentation; end
75
+
76
+ include Google::Apis::Core::JsonObjectSupport
77
+ end
78
+
79
+ include Google::Apis::Core::JsonObjectSupport
80
+ end
81
+
82
+ class TransferInfo
83
+ class Representation < Google::Apis::Core::JsonRepresentation; end
84
+
85
+ include Google::Apis::Core::JsonObjectSupport
86
+ end
87
+
88
+ class TrialSettings
89
+ class Representation < Google::Apis::Core::JsonRepresentation; end
90
+
91
+ include Google::Apis::Core::JsonObjectSupport
92
+ end
93
+
94
+ include Google::Apis::Core::JsonObjectSupport
95
+ end
96
+
97
+ class Subscriptions
98
+ class Representation < Google::Apis::Core::JsonRepresentation; end
99
+
100
+ include Google::Apis::Core::JsonObjectSupport
101
+ end
102
+
103
+ class Address
104
+ # @private
105
+ class Representation < Google::Apis::Core::JsonRepresentation
106
+ property :address_line1, as: 'addressLine1'
107
+ property :address_line2, as: 'addressLine2'
108
+ property :address_line3, as: 'addressLine3'
109
+ property :contact_name, as: 'contactName'
110
+ property :country_code, as: 'countryCode'
111
+ property :kind, as: 'kind'
112
+ property :locality, as: 'locality'
113
+ property :organization_name, as: 'organizationName'
114
+ property :postal_code, as: 'postalCode'
115
+ property :region, as: 'region'
116
+ end
117
+ end
118
+
119
+ class ChangePlanRequest
120
+ # @private
121
+ class Representation < Google::Apis::Core::JsonRepresentation
122
+ property :deal_code, as: 'dealCode'
123
+ property :kind, as: 'kind'
124
+ property :plan_name, as: 'planName'
125
+ property :purchase_order_id, as: 'purchaseOrderId'
126
+ property :seats, as: 'seats', class: Google::Apis::ResellerV1::Seats, decorator: Google::Apis::ResellerV1::Seats::Representation
127
+
128
+ end
129
+ end
130
+
131
+ class Customer
132
+ # @private
133
+ class Representation < Google::Apis::Core::JsonRepresentation
134
+ property :alternate_email, as: 'alternateEmail'
135
+ property :customer_domain, as: 'customerDomain'
136
+ property :customer_domain_verified, as: 'customerDomainVerified'
137
+ property :customer_id, as: 'customerId'
138
+ property :kind, as: 'kind'
139
+ property :phone_number, as: 'phoneNumber'
140
+ property :postal_address, as: 'postalAddress', class: Google::Apis::ResellerV1::Address, decorator: Google::Apis::ResellerV1::Address::Representation
141
+
142
+ property :resource_ui_url, as: 'resourceUiUrl'
143
+ end
144
+ end
145
+
146
+ class RenewalSettings
147
+ # @private
148
+ class Representation < Google::Apis::Core::JsonRepresentation
149
+ property :kind, as: 'kind'
150
+ property :renewal_type, as: 'renewalType'
151
+ end
152
+ end
153
+
154
+ class ResellernotifyGetwatchdetailsResponse
155
+ # @private
156
+ class Representation < Google::Apis::Core::JsonRepresentation
157
+ collection :service_account_email_addresses, as: 'serviceAccountEmailAddresses'
158
+ property :topic_name, as: 'topicName'
159
+ end
160
+ end
161
+
162
+ class ResellernotifyResource
163
+ # @private
164
+ class Representation < Google::Apis::Core::JsonRepresentation
165
+ property :topic_name, as: 'topicName'
166
+ end
167
+ end
168
+
169
+ class Seats
170
+ # @private
171
+ class Representation < Google::Apis::Core::JsonRepresentation
172
+ property :kind, as: 'kind'
173
+ property :licensed_number_of_seats, as: 'licensedNumberOfSeats'
174
+ property :maximum_number_of_seats, as: 'maximumNumberOfSeats'
175
+ property :number_of_seats, as: 'numberOfSeats'
176
+ end
177
+ end
178
+
179
+ class Subscription
180
+ # @private
181
+ class Representation < Google::Apis::Core::JsonRepresentation
182
+ property :billing_method, as: 'billingMethod'
183
+ property :creation_time, :numeric_string => true, as: 'creationTime'
184
+ property :customer_domain, as: 'customerDomain'
185
+ property :customer_id, as: 'customerId'
186
+ property :deal_code, as: 'dealCode'
187
+ property :kind, as: 'kind'
188
+ property :plan, as: 'plan', class: Google::Apis::ResellerV1::Subscription::Plan, decorator: Google::Apis::ResellerV1::Subscription::Plan::Representation
189
+
190
+ property :purchase_order_id, as: 'purchaseOrderId'
191
+ property :renewal_settings, as: 'renewalSettings', class: Google::Apis::ResellerV1::RenewalSettings, decorator: Google::Apis::ResellerV1::RenewalSettings::Representation
192
+
193
+ property :resource_ui_url, as: 'resourceUiUrl'
194
+ property :seats, as: 'seats', class: Google::Apis::ResellerV1::Seats, decorator: Google::Apis::ResellerV1::Seats::Representation
195
+
196
+ property :sku_id, as: 'skuId'
197
+ property :sku_name, as: 'skuName'
198
+ property :status, as: 'status'
199
+ property :subscription_id, as: 'subscriptionId'
200
+ collection :suspension_reasons, as: 'suspensionReasons'
201
+ property :transfer_info, as: 'transferInfo', class: Google::Apis::ResellerV1::Subscription::TransferInfo, decorator: Google::Apis::ResellerV1::Subscription::TransferInfo::Representation
202
+
203
+ property :trial_settings, as: 'trialSettings', class: Google::Apis::ResellerV1::Subscription::TrialSettings, decorator: Google::Apis::ResellerV1::Subscription::TrialSettings::Representation
204
+
205
+ end
206
+
207
+ class Plan
208
+ # @private
209
+ class Representation < Google::Apis::Core::JsonRepresentation
210
+ property :commitment_interval, as: 'commitmentInterval', class: Google::Apis::ResellerV1::Subscription::Plan::CommitmentInterval, decorator: Google::Apis::ResellerV1::Subscription::Plan::CommitmentInterval::Representation
211
+
212
+ property :is_commitment_plan, as: 'isCommitmentPlan'
213
+ property :plan_name, as: 'planName'
214
+ end
215
+
216
+ class CommitmentInterval
217
+ # @private
218
+ class Representation < Google::Apis::Core::JsonRepresentation
219
+ property :end_time, :numeric_string => true, as: 'endTime'
220
+ property :start_time, :numeric_string => true, as: 'startTime'
221
+ end
222
+ end
223
+ end
224
+
225
+ class TransferInfo
226
+ # @private
227
+ class Representation < Google::Apis::Core::JsonRepresentation
228
+ property :minimum_transferable_seats, as: 'minimumTransferableSeats'
229
+ property :transferability_expiration_time, :numeric_string => true, as: 'transferabilityExpirationTime'
230
+ end
231
+ end
232
+
233
+ class TrialSettings
234
+ # @private
235
+ class Representation < Google::Apis::Core::JsonRepresentation
236
+ property :is_in_trial, as: 'isInTrial'
237
+ property :trial_end_time, :numeric_string => true, as: 'trialEndTime'
238
+ end
239
+ end
240
+ end
241
+
242
+ class Subscriptions
243
+ # @private
244
+ class Representation < Google::Apis::Core::JsonRepresentation
245
+ property :kind, as: 'kind'
246
+ property :next_page_token, as: 'nextPageToken'
247
+ collection :subscriptions, as: 'subscriptions', class: Google::Apis::ResellerV1::Subscription, decorator: Google::Apis::ResellerV1::Subscription::Representation
248
+
249
+ end
250
+ end
251
+ end
252
+ end
253
+ end
@@ -0,0 +1,727 @@
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 ResellerV1
23
+ # Google Workspace Reseller API
24
+ #
25
+ # Perform common functions that are available on the Channel Services console at
26
+ # scale, like placing orders and viewing customer information
27
+ #
28
+ # @example
29
+ # require 'google/apis/reseller_v1'
30
+ #
31
+ # Reseller = Google::Apis::ResellerV1 # Alias the module
32
+ # service = Reseller::ResellerService.new
33
+ #
34
+ # @see https://developers.google.com/google-apps/reseller/
35
+ class ResellerService < Google::Apis::Core::BaseService
36
+ # @return [String]
37
+ # API key. Your API key identifies your project and provides you with API access,
38
+ # quota, and reports. Required unless you provide an OAuth 2.0 token.
39
+ attr_accessor :key
40
+
41
+ # @return [String]
42
+ # Available to use for quota purposes for server-side applications. Can be any
43
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
44
+ attr_accessor :quota_user
45
+
46
+ def initialize
47
+ super('https://reseller.googleapis.com/', '',
48
+ client_name: 'google-apis-reseller_v1',
49
+ client_version: Google::Apis::ResellerV1::GEM_VERSION)
50
+ @batch_path = 'batch'
51
+ end
52
+
53
+ # Get a customer account.
54
+ # @param [String] customer_id
55
+ # Either the customer's primary domain name or the customer's unique identifier.
56
+ # If using the domain name, we do not recommend using a customerId as a key for
57
+ # persistent data. If the domain name for a customerId is changed, the Google
58
+ # system automatically updates.
59
+ # @param [String] fields
60
+ # Selector specifying which fields to include in a partial response.
61
+ # @param [String] quota_user
62
+ # Available to use for quota purposes for server-side applications. Can be any
63
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
64
+ # @param [Google::Apis::RequestOptions] options
65
+ # Request-specific options
66
+ #
67
+ # @yield [result, err] Result & error if block supplied
68
+ # @yieldparam result [Google::Apis::ResellerV1::Customer] parsed result object
69
+ # @yieldparam err [StandardError] error object if request failed
70
+ #
71
+ # @return [Google::Apis::ResellerV1::Customer]
72
+ #
73
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
74
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
75
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
76
+ def get_customer(customer_id, fields: nil, quota_user: nil, options: nil, &block)
77
+ command = make_simple_command(:get, 'apps/reseller/v1/customers/{customerId}', options)
78
+ command.response_representation = Google::Apis::ResellerV1::Customer::Representation
79
+ command.response_class = Google::Apis::ResellerV1::Customer
80
+ command.params['customerId'] = customer_id unless customer_id.nil?
81
+ command.query['fields'] = fields unless fields.nil?
82
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
83
+ execute_or_queue_command(command, &block)
84
+ end
85
+
86
+ # Order a new customer's account.
87
+ # @param [Google::Apis::ResellerV1::Customer] customer_object
88
+ # @param [String] customer_auth_token
89
+ # The customerAuthToken query string is required when creating a resold account
90
+ # that transfers a direct customer's subscription or transfers another reseller
91
+ # customer's subscription to your reseller management. This is a hexadecimal
92
+ # authentication token needed to complete the subscription transfer. For more
93
+ # information, see the administrator help center.
94
+ # @param [String] fields
95
+ # Selector specifying which fields to include in a partial response.
96
+ # @param [String] quota_user
97
+ # Available to use for quota purposes for server-side applications. Can be any
98
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
99
+ # @param [Google::Apis::RequestOptions] options
100
+ # Request-specific options
101
+ #
102
+ # @yield [result, err] Result & error if block supplied
103
+ # @yieldparam result [Google::Apis::ResellerV1::Customer] parsed result object
104
+ # @yieldparam err [StandardError] error object if request failed
105
+ #
106
+ # @return [Google::Apis::ResellerV1::Customer]
107
+ #
108
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
109
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
110
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
111
+ def insert_customer(customer_object = nil, customer_auth_token: nil, fields: nil, quota_user: nil, options: nil, &block)
112
+ command = make_simple_command(:post, 'apps/reseller/v1/customers', options)
113
+ command.request_representation = Google::Apis::ResellerV1::Customer::Representation
114
+ command.request_object = customer_object
115
+ command.response_representation = Google::Apis::ResellerV1::Customer::Representation
116
+ command.response_class = Google::Apis::ResellerV1::Customer
117
+ command.query['customerAuthToken'] = customer_auth_token unless customer_auth_token.nil?
118
+ command.query['fields'] = fields unless fields.nil?
119
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
120
+ execute_or_queue_command(command, &block)
121
+ end
122
+
123
+ # Patch a customer account's settings via Apiary Patch Orchestration
124
+ # @param [String] customer_id
125
+ # Either the customer's primary domain name or the customer's unique identifier.
126
+ # If using the domain name, we do not recommend using a customerId as a key for
127
+ # persistent data. If the domain name for a customerId is changed, the Google
128
+ # system automatically updates.
129
+ # @param [Google::Apis::ResellerV1::Customer] customer_object
130
+ # @param [String] fields
131
+ # Selector specifying which fields to include in a partial response.
132
+ # @param [String] quota_user
133
+ # Available to use for quota purposes for server-side applications. Can be any
134
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
135
+ # @param [Google::Apis::RequestOptions] options
136
+ # Request-specific options
137
+ #
138
+ # @yield [result, err] Result & error if block supplied
139
+ # @yieldparam result [Google::Apis::ResellerV1::Customer] parsed result object
140
+ # @yieldparam err [StandardError] error object if request failed
141
+ #
142
+ # @return [Google::Apis::ResellerV1::Customer]
143
+ #
144
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
145
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
146
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
147
+ def patch_customer(customer_id, customer_object = nil, fields: nil, quota_user: nil, options: nil, &block)
148
+ command = make_simple_command(:patch, 'apps/reseller/v1/customers/{customerId}', options)
149
+ command.request_representation = Google::Apis::ResellerV1::Customer::Representation
150
+ command.request_object = customer_object
151
+ command.response_representation = Google::Apis::ResellerV1::Customer::Representation
152
+ command.response_class = Google::Apis::ResellerV1::Customer
153
+ command.params['customerId'] = customer_id unless customer_id.nil?
154
+ command.query['fields'] = fields unless fields.nil?
155
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
156
+ execute_or_queue_command(command, &block)
157
+ end
158
+
159
+ # Update a customer account's settings.
160
+ # @param [String] customer_id
161
+ # Either the customer's primary domain name or the customer's unique identifier.
162
+ # If using the domain name, we do not recommend using a customerId as a key for
163
+ # persistent data. If the domain name for a customerId is changed, the Google
164
+ # system automatically updates.
165
+ # @param [Google::Apis::ResellerV1::Customer] customer_object
166
+ # @param [String] fields
167
+ # Selector specifying which fields to include in a partial response.
168
+ # @param [String] quota_user
169
+ # Available to use for quota purposes for server-side applications. Can be any
170
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
171
+ # @param [Google::Apis::RequestOptions] options
172
+ # Request-specific options
173
+ #
174
+ # @yield [result, err] Result & error if block supplied
175
+ # @yieldparam result [Google::Apis::ResellerV1::Customer] parsed result object
176
+ # @yieldparam err [StandardError] error object if request failed
177
+ #
178
+ # @return [Google::Apis::ResellerV1::Customer]
179
+ #
180
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
181
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
182
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
183
+ def update_customer(customer_id, customer_object = nil, fields: nil, quota_user: nil, options: nil, &block)
184
+ command = make_simple_command(:put, 'apps/reseller/v1/customers/{customerId}', options)
185
+ command.request_representation = Google::Apis::ResellerV1::Customer::Representation
186
+ command.request_object = customer_object
187
+ command.response_representation = Google::Apis::ResellerV1::Customer::Representation
188
+ command.response_class = Google::Apis::ResellerV1::Customer
189
+ command.params['customerId'] = customer_id unless customer_id.nil?
190
+ command.query['fields'] = fields unless fields.nil?
191
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
192
+ execute_or_queue_command(command, &block)
193
+ end
194
+
195
+ # Returns all the details of the watch corresponding to the reseller.
196
+ # @param [String] fields
197
+ # Selector specifying which fields to include in a partial response.
198
+ # @param [String] quota_user
199
+ # Available to use for quota purposes for server-side applications. Can be any
200
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
201
+ # @param [Google::Apis::RequestOptions] options
202
+ # Request-specific options
203
+ #
204
+ # @yield [result, err] Result & error if block supplied
205
+ # @yieldparam result [Google::Apis::ResellerV1::ResellernotifyGetwatchdetailsResponse] parsed result object
206
+ # @yieldparam err [StandardError] error object if request failed
207
+ #
208
+ # @return [Google::Apis::ResellerV1::ResellernotifyGetwatchdetailsResponse]
209
+ #
210
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
211
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
212
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
213
+ def getwatchdetails_resellernotify(fields: nil, quota_user: nil, options: nil, &block)
214
+ command = make_simple_command(:get, 'apps/reseller/v1/resellernotify/getwatchdetails', options)
215
+ command.response_representation = Google::Apis::ResellerV1::ResellernotifyGetwatchdetailsResponse::Representation
216
+ command.response_class = Google::Apis::ResellerV1::ResellernotifyGetwatchdetailsResponse
217
+ command.query['fields'] = fields unless fields.nil?
218
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
219
+ execute_or_queue_command(command, &block)
220
+ end
221
+
222
+ # Registers a Reseller for receiving notifications.
223
+ # @param [String] service_account_email_address
224
+ # The service account which will own the created Cloud-PubSub topic.
225
+ # @param [String] fields
226
+ # Selector specifying which fields to include in a partial response.
227
+ # @param [String] quota_user
228
+ # Available to use for quota purposes for server-side applications. Can be any
229
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
230
+ # @param [Google::Apis::RequestOptions] options
231
+ # Request-specific options
232
+ #
233
+ # @yield [result, err] Result & error if block supplied
234
+ # @yieldparam result [Google::Apis::ResellerV1::ResellernotifyResource] parsed result object
235
+ # @yieldparam err [StandardError] error object if request failed
236
+ #
237
+ # @return [Google::Apis::ResellerV1::ResellernotifyResource]
238
+ #
239
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
240
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
241
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
242
+ def register_resellernotify(service_account_email_address: nil, fields: nil, quota_user: nil, options: nil, &block)
243
+ command = make_simple_command(:post, 'apps/reseller/v1/resellernotify/register', options)
244
+ command.response_representation = Google::Apis::ResellerV1::ResellernotifyResource::Representation
245
+ command.response_class = Google::Apis::ResellerV1::ResellernotifyResource
246
+ command.query['serviceAccountEmailAddress'] = service_account_email_address unless service_account_email_address.nil?
247
+ command.query['fields'] = fields unless fields.nil?
248
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
249
+ execute_or_queue_command(command, &block)
250
+ end
251
+
252
+ # Unregisters a Reseller for receiving notifications.
253
+ # @param [String] service_account_email_address
254
+ # The service account which owns the Cloud-PubSub topic.
255
+ # @param [String] fields
256
+ # Selector specifying which fields to include in a partial response.
257
+ # @param [String] quota_user
258
+ # Available to use for quota purposes for server-side applications. Can be any
259
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
260
+ # @param [Google::Apis::RequestOptions] options
261
+ # Request-specific options
262
+ #
263
+ # @yield [result, err] Result & error if block supplied
264
+ # @yieldparam result [Google::Apis::ResellerV1::ResellernotifyResource] parsed result object
265
+ # @yieldparam err [StandardError] error object if request failed
266
+ #
267
+ # @return [Google::Apis::ResellerV1::ResellernotifyResource]
268
+ #
269
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
270
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
271
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
272
+ def unregister_resellernotify(service_account_email_address: nil, fields: nil, quota_user: nil, options: nil, &block)
273
+ command = make_simple_command(:post, 'apps/reseller/v1/resellernotify/unregister', options)
274
+ command.response_representation = Google::Apis::ResellerV1::ResellernotifyResource::Representation
275
+ command.response_class = Google::Apis::ResellerV1::ResellernotifyResource
276
+ command.query['serviceAccountEmailAddress'] = service_account_email_address unless service_account_email_address.nil?
277
+ command.query['fields'] = fields unless fields.nil?
278
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
279
+ execute_or_queue_command(command, &block)
280
+ end
281
+
282
+ # Activates a subscription previously suspended by the reseller
283
+ # @param [String] customer_id
284
+ # Either the customer's primary domain name or the customer's unique identifier.
285
+ # If using the domain name, we do not recommend using a customerId as a key for
286
+ # persistent data. If the domain name for a customerId is changed, the Google
287
+ # system automatically updates.
288
+ # @param [String] subscription_id
289
+ # This is a required property. The subscriptionId is the subscription identifier
290
+ # and is unique for each customer. Since a subscriptionId changes when a
291
+ # subscription is updated, we recommend to not use this ID as a key for
292
+ # persistent data. And the subscriptionId can be found using the retrieve all
293
+ # reseller subscriptions method.
294
+ # @param [String] fields
295
+ # Selector specifying which fields to include in a partial response.
296
+ # @param [String] quota_user
297
+ # Available to use for quota purposes for server-side applications. Can be any
298
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
299
+ # @param [Google::Apis::RequestOptions] options
300
+ # Request-specific options
301
+ #
302
+ # @yield [result, err] Result & error if block supplied
303
+ # @yieldparam result [Google::Apis::ResellerV1::Subscription] parsed result object
304
+ # @yieldparam err [StandardError] error object if request failed
305
+ #
306
+ # @return [Google::Apis::ResellerV1::Subscription]
307
+ #
308
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
309
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
310
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
311
+ def activate_subscription(customer_id, subscription_id, fields: nil, quota_user: nil, options: nil, &block)
312
+ command = make_simple_command(:post, 'apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/activate', options)
313
+ command.response_representation = Google::Apis::ResellerV1::Subscription::Representation
314
+ command.response_class = Google::Apis::ResellerV1::Subscription
315
+ command.params['customerId'] = customer_id unless customer_id.nil?
316
+ command.params['subscriptionId'] = subscription_id unless subscription_id.nil?
317
+ command.query['fields'] = fields unless fields.nil?
318
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
319
+ execute_or_queue_command(command, &block)
320
+ end
321
+
322
+ # Update a subscription plan. Use this method to update a plan for a 30-day
323
+ # trial or a flexible plan subscription to an annual commitment plan with
324
+ # monthly or yearly payments.
325
+ # @param [String] customer_id
326
+ # Either the customer's primary domain name or the customer's unique identifier.
327
+ # If using the domain name, we do not recommend using a customerId as a key for
328
+ # persistent data. If the domain name for a customerId is changed, the Google
329
+ # system automatically updates.
330
+ # @param [String] subscription_id
331
+ # This is a required property. The subscriptionId is the subscription identifier
332
+ # and is unique for each customer. Since a subscriptionId changes when a
333
+ # subscription is updated, we recommend to not use this ID as a key for
334
+ # persistent data. And the subscriptionId can be found using the retrieve all
335
+ # reseller subscriptions method.
336
+ # @param [Google::Apis::ResellerV1::ChangePlanRequest] change_plan_request_object
337
+ # @param [String] fields
338
+ # Selector specifying which fields to include in a partial response.
339
+ # @param [String] quota_user
340
+ # Available to use for quota purposes for server-side applications. Can be any
341
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
342
+ # @param [Google::Apis::RequestOptions] options
343
+ # Request-specific options
344
+ #
345
+ # @yield [result, err] Result & error if block supplied
346
+ # @yieldparam result [Google::Apis::ResellerV1::Subscription] parsed result object
347
+ # @yieldparam err [StandardError] error object if request failed
348
+ #
349
+ # @return [Google::Apis::ResellerV1::Subscription]
350
+ #
351
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
352
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
353
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
354
+ def change_subscription_plan(customer_id, subscription_id, change_plan_request_object = nil, fields: nil, quota_user: nil, options: nil, &block)
355
+ command = make_simple_command(:post, 'apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/changePlan', options)
356
+ command.request_representation = Google::Apis::ResellerV1::ChangePlanRequest::Representation
357
+ command.request_object = change_plan_request_object
358
+ command.response_representation = Google::Apis::ResellerV1::Subscription::Representation
359
+ command.response_class = Google::Apis::ResellerV1::Subscription
360
+ command.params['customerId'] = customer_id unless customer_id.nil?
361
+ command.params['subscriptionId'] = subscription_id unless subscription_id.nil?
362
+ command.query['fields'] = fields unless fields.nil?
363
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
364
+ execute_or_queue_command(command, &block)
365
+ end
366
+
367
+ # Update a user license's renewal settings. This is applicable for accounts with
368
+ # annual commitment plans only.
369
+ # @param [String] customer_id
370
+ # Either the customer's primary domain name or the customer's unique identifier.
371
+ # If using the domain name, we do not recommend using a customerId as a key for
372
+ # persistent data. If the domain name for a customerId is changed, the Google
373
+ # system automatically updates.
374
+ # @param [String] subscription_id
375
+ # This is a required property. The subscriptionId is the subscription identifier
376
+ # and is unique for each customer. Since a subscriptionId changes when a
377
+ # subscription is updated, we recommend to not use this ID as a key for
378
+ # persistent data. And the subscriptionId can be found using the retrieve all
379
+ # reseller subscriptions method.
380
+ # @param [Google::Apis::ResellerV1::RenewalSettings] renewal_settings_object
381
+ # @param [String] fields
382
+ # Selector specifying which fields to include in a partial response.
383
+ # @param [String] quota_user
384
+ # Available to use for quota purposes for server-side applications. Can be any
385
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
386
+ # @param [Google::Apis::RequestOptions] options
387
+ # Request-specific options
388
+ #
389
+ # @yield [result, err] Result & error if block supplied
390
+ # @yieldparam result [Google::Apis::ResellerV1::Subscription] parsed result object
391
+ # @yieldparam err [StandardError] error object if request failed
392
+ #
393
+ # @return [Google::Apis::ResellerV1::Subscription]
394
+ #
395
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
396
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
397
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
398
+ def change_subscription_renewal_settings(customer_id, subscription_id, renewal_settings_object = nil, fields: nil, quota_user: nil, options: nil, &block)
399
+ command = make_simple_command(:post, 'apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/changeRenewalSettings', options)
400
+ command.request_representation = Google::Apis::ResellerV1::RenewalSettings::Representation
401
+ command.request_object = renewal_settings_object
402
+ command.response_representation = Google::Apis::ResellerV1::Subscription::Representation
403
+ command.response_class = Google::Apis::ResellerV1::Subscription
404
+ command.params['customerId'] = customer_id unless customer_id.nil?
405
+ command.params['subscriptionId'] = subscription_id unless subscription_id.nil?
406
+ command.query['fields'] = fields unless fields.nil?
407
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
408
+ execute_or_queue_command(command, &block)
409
+ end
410
+
411
+ # Update a subscription's user license settings.
412
+ # @param [String] customer_id
413
+ # Either the customer's primary domain name or the customer's unique identifier.
414
+ # If using the domain name, we do not recommend using a customerId as a key for
415
+ # persistent data. If the domain name for a customerId is changed, the Google
416
+ # system automatically updates.
417
+ # @param [String] subscription_id
418
+ # This is a required property. The subscriptionId is the subscription identifier
419
+ # and is unique for each customer. Since a subscriptionId changes when a
420
+ # subscription is updated, we recommend to not use this ID as a key for
421
+ # persistent data. And the subscriptionId can be found using the retrieve all
422
+ # reseller subscriptions method.
423
+ # @param [Google::Apis::ResellerV1::Seats] seats_object
424
+ # @param [String] fields
425
+ # Selector specifying which fields to include in a partial response.
426
+ # @param [String] quota_user
427
+ # Available to use for quota purposes for server-side applications. Can be any
428
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
429
+ # @param [Google::Apis::RequestOptions] options
430
+ # Request-specific options
431
+ #
432
+ # @yield [result, err] Result & error if block supplied
433
+ # @yieldparam result [Google::Apis::ResellerV1::Subscription] parsed result object
434
+ # @yieldparam err [StandardError] error object if request failed
435
+ #
436
+ # @return [Google::Apis::ResellerV1::Subscription]
437
+ #
438
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
439
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
440
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
441
+ def change_subscription_seats(customer_id, subscription_id, seats_object = nil, fields: nil, quota_user: nil, options: nil, &block)
442
+ command = make_simple_command(:post, 'apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/changeSeats', options)
443
+ command.request_representation = Google::Apis::ResellerV1::Seats::Representation
444
+ command.request_object = seats_object
445
+ command.response_representation = Google::Apis::ResellerV1::Subscription::Representation
446
+ command.response_class = Google::Apis::ResellerV1::Subscription
447
+ command.params['customerId'] = customer_id unless customer_id.nil?
448
+ command.params['subscriptionId'] = subscription_id unless subscription_id.nil?
449
+ command.query['fields'] = fields unless fields.nil?
450
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
451
+ execute_or_queue_command(command, &block)
452
+ end
453
+
454
+ # Cancel, suspend, or transfer a subscription to direct.
455
+ # @param [String] customer_id
456
+ # Either the customer's primary domain name or the customer's unique identifier.
457
+ # If using the domain name, we do not recommend using a customerId as a key for
458
+ # persistent data. If the domain name for a customerId is changed, the Google
459
+ # system automatically updates.
460
+ # @param [String] subscription_id
461
+ # This is a required property. The subscriptionId is the subscription identifier
462
+ # and is unique for each customer. Since a subscriptionId changes when a
463
+ # subscription is updated, we recommend to not use this ID as a key for
464
+ # persistent data. And the subscriptionId can be found using the retrieve all
465
+ # reseller subscriptions method.
466
+ # @param [String] deletion_type
467
+ # The deletionType query string enables the cancellation, downgrade, or
468
+ # suspension of a subscription.
469
+ # @param [String] fields
470
+ # Selector specifying which fields to include in a partial response.
471
+ # @param [String] quota_user
472
+ # Available to use for quota purposes for server-side applications. Can be any
473
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
474
+ # @param [Google::Apis::RequestOptions] options
475
+ # Request-specific options
476
+ #
477
+ # @yield [result, err] Result & error if block supplied
478
+ # @yieldparam result [NilClass] No result returned for this method
479
+ # @yieldparam err [StandardError] error object if request failed
480
+ #
481
+ # @return [void]
482
+ #
483
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
484
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
485
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
486
+ def delete_subscription(customer_id, subscription_id, deletion_type, fields: nil, quota_user: nil, options: nil, &block)
487
+ command = make_simple_command(:delete, 'apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}', options)
488
+ command.params['customerId'] = customer_id unless customer_id.nil?
489
+ command.params['subscriptionId'] = subscription_id unless subscription_id.nil?
490
+ command.query['deletionType'] = deletion_type unless deletion_type.nil?
491
+ command.query['fields'] = fields unless fields.nil?
492
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
493
+ execute_or_queue_command(command, &block)
494
+ end
495
+
496
+ # Get a specific subscription.
497
+ # @param [String] customer_id
498
+ # Either the customer's primary domain name or the customer's unique identifier.
499
+ # If using the domain name, we do not recommend using a customerId as a key for
500
+ # persistent data. If the domain name for a customerId is changed, the Google
501
+ # system automatically updates.
502
+ # @param [String] subscription_id
503
+ # This is a required property. The subscriptionId is the subscription identifier
504
+ # and is unique for each customer. Since a subscriptionId changes when a
505
+ # subscription is updated, we recommend to not use this ID as a key for
506
+ # persistent data. And the subscriptionId can be found using the retrieve all
507
+ # reseller subscriptions method.
508
+ # @param [String] fields
509
+ # Selector specifying which fields to include in a partial response.
510
+ # @param [String] quota_user
511
+ # Available to use for quota purposes for server-side applications. Can be any
512
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
513
+ # @param [Google::Apis::RequestOptions] options
514
+ # Request-specific options
515
+ #
516
+ # @yield [result, err] Result & error if block supplied
517
+ # @yieldparam result [Google::Apis::ResellerV1::Subscription] parsed result object
518
+ # @yieldparam err [StandardError] error object if request failed
519
+ #
520
+ # @return [Google::Apis::ResellerV1::Subscription]
521
+ #
522
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
523
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
524
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
525
+ def get_subscription(customer_id, subscription_id, fields: nil, quota_user: nil, options: nil, &block)
526
+ command = make_simple_command(:get, 'apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}', options)
527
+ command.response_representation = Google::Apis::ResellerV1::Subscription::Representation
528
+ command.response_class = Google::Apis::ResellerV1::Subscription
529
+ command.params['customerId'] = customer_id unless customer_id.nil?
530
+ command.params['subscriptionId'] = subscription_id unless subscription_id.nil?
531
+ command.query['fields'] = fields unless fields.nil?
532
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
533
+ execute_or_queue_command(command, &block)
534
+ end
535
+
536
+ # Create or transfer a subscription.
537
+ # @param [String] customer_id
538
+ # Either the customer's primary domain name or the customer's unique identifier.
539
+ # If using the domain name, we do not recommend using a customerId as a key for
540
+ # persistent data. If the domain name for a customerId is changed, the Google
541
+ # system automatically updates.
542
+ # @param [Google::Apis::ResellerV1::Subscription] subscription_object
543
+ # @param [String] customer_auth_token
544
+ # The customerAuthToken query string is required when creating a resold account
545
+ # that transfers a direct customer's subscription or transfers another reseller
546
+ # customer's subscription to your reseller management. This is a hexadecimal
547
+ # authentication token needed to complete the subscription transfer. For more
548
+ # information, see the administrator help center.
549
+ # @param [String] fields
550
+ # Selector specifying which fields to include in a partial response.
551
+ # @param [String] quota_user
552
+ # Available to use for quota purposes for server-side applications. Can be any
553
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
554
+ # @param [Google::Apis::RequestOptions] options
555
+ # Request-specific options
556
+ #
557
+ # @yield [result, err] Result & error if block supplied
558
+ # @yieldparam result [Google::Apis::ResellerV1::Subscription] parsed result object
559
+ # @yieldparam err [StandardError] error object if request failed
560
+ #
561
+ # @return [Google::Apis::ResellerV1::Subscription]
562
+ #
563
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
564
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
565
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
566
+ def insert_subscription(customer_id, subscription_object = nil, customer_auth_token: nil, fields: nil, quota_user: nil, options: nil, &block)
567
+ command = make_simple_command(:post, 'apps/reseller/v1/customers/{customerId}/subscriptions', options)
568
+ command.request_representation = Google::Apis::ResellerV1::Subscription::Representation
569
+ command.request_object = subscription_object
570
+ command.response_representation = Google::Apis::ResellerV1::Subscription::Representation
571
+ command.response_class = Google::Apis::ResellerV1::Subscription
572
+ command.params['customerId'] = customer_id unless customer_id.nil?
573
+ command.query['customerAuthToken'] = customer_auth_token unless customer_auth_token.nil?
574
+ command.query['fields'] = fields unless fields.nil?
575
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
576
+ execute_or_queue_command(command, &block)
577
+ end
578
+
579
+ # List of subscriptions managed by the reseller. The list can be all
580
+ # subscriptions, all of a customer's subscriptions, or all of a customer's
581
+ # transferable subscriptions.
582
+ # @param [String] customer_auth_token
583
+ # The customerAuthToken query string is required when creating a resold account
584
+ # that transfers a direct customer's subscription or transfers another reseller
585
+ # customer's subscription to your reseller management. This is a hexadecimal
586
+ # authentication token needed to complete the subscription transfer. For more
587
+ # information, see the administrator help center.
588
+ # @param [String] customer_id
589
+ # Either the customer's primary domain name or the customer's unique identifier.
590
+ # If using the domain name, we do not recommend using a customerId as a key for
591
+ # persistent data. If the domain name for a customerId is changed, the Google
592
+ # system automatically updates.
593
+ # @param [String] customer_name_prefix
594
+ # When retrieving all of your subscriptions and filtering for specific customers,
595
+ # you can enter a prefix for a customer name. Using an example customer group
596
+ # that includes exam.com, example20.com and example.com: - exa -- Returns all
597
+ # customer names that start with 'exa' which could include exam.com, example20.
598
+ # com, and example.com. A name prefix is similar to using a regular expression's
599
+ # asterisk, exa*. - example -- Returns example20.com and example.com.
600
+ # @param [Fixnum] max_results
601
+ # When retrieving a large list, the maxResults is the maximum number of results
602
+ # per page. The nextPageToken value takes you to the next page. The default is
603
+ # 20.
604
+ # @param [String] page_token
605
+ # Token to specify next page in the list
606
+ # @param [String] fields
607
+ # Selector specifying which fields to include in a partial response.
608
+ # @param [String] quota_user
609
+ # Available to use for quota purposes for server-side applications. Can be any
610
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
611
+ # @param [Google::Apis::RequestOptions] options
612
+ # Request-specific options
613
+ #
614
+ # @yield [result, err] Result & error if block supplied
615
+ # @yieldparam result [Google::Apis::ResellerV1::Subscriptions] parsed result object
616
+ # @yieldparam err [StandardError] error object if request failed
617
+ #
618
+ # @return [Google::Apis::ResellerV1::Subscriptions]
619
+ #
620
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
621
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
622
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
623
+ def list_subscriptions(customer_auth_token: nil, customer_id: nil, customer_name_prefix: nil, max_results: nil, page_token: nil, fields: nil, quota_user: nil, options: nil, &block)
624
+ command = make_simple_command(:get, 'apps/reseller/v1/subscriptions', options)
625
+ command.response_representation = Google::Apis::ResellerV1::Subscriptions::Representation
626
+ command.response_class = Google::Apis::ResellerV1::Subscriptions
627
+ command.query['customerAuthToken'] = customer_auth_token unless customer_auth_token.nil?
628
+ command.query['customerId'] = customer_id unless customer_id.nil?
629
+ command.query['customerNamePrefix'] = customer_name_prefix unless customer_name_prefix.nil?
630
+ command.query['maxResults'] = max_results unless max_results.nil?
631
+ command.query['pageToken'] = page_token unless page_token.nil?
632
+ command.query['fields'] = fields unless fields.nil?
633
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
634
+ execute_or_queue_command(command, &block)
635
+ end
636
+
637
+ # Immediately move a 30-day free trial subscription to a paid service
638
+ # subscription.
639
+ # @param [String] customer_id
640
+ # Either the customer's primary domain name or the customer's unique identifier.
641
+ # If using the domain name, we do not recommend using a customerId as a key for
642
+ # persistent data. If the domain name for a customerId is changed, the Google
643
+ # system automatically updates.
644
+ # @param [String] subscription_id
645
+ # This is a required property. The subscriptionId is the subscription identifier
646
+ # and is unique for each customer. Since a subscriptionId changes when a
647
+ # subscription is updated, we recommend to not use this ID as a key for
648
+ # persistent data. And the subscriptionId can be found using the retrieve all
649
+ # reseller subscriptions method.
650
+ # @param [String] fields
651
+ # Selector specifying which fields to include in a partial response.
652
+ # @param [String] quota_user
653
+ # Available to use for quota purposes for server-side applications. Can be any
654
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
655
+ # @param [Google::Apis::RequestOptions] options
656
+ # Request-specific options
657
+ #
658
+ # @yield [result, err] Result & error if block supplied
659
+ # @yieldparam result [Google::Apis::ResellerV1::Subscription] parsed result object
660
+ # @yieldparam err [StandardError] error object if request failed
661
+ #
662
+ # @return [Google::Apis::ResellerV1::Subscription]
663
+ #
664
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
665
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
666
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
667
+ def start_subscription_paid_service(customer_id, subscription_id, fields: nil, quota_user: nil, options: nil, &block)
668
+ command = make_simple_command(:post, 'apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/startPaidService', options)
669
+ command.response_representation = Google::Apis::ResellerV1::Subscription::Representation
670
+ command.response_class = Google::Apis::ResellerV1::Subscription
671
+ command.params['customerId'] = customer_id unless customer_id.nil?
672
+ command.params['subscriptionId'] = subscription_id unless subscription_id.nil?
673
+ command.query['fields'] = fields unless fields.nil?
674
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
675
+ execute_or_queue_command(command, &block)
676
+ end
677
+
678
+ # Suspends an active subscription.
679
+ # @param [String] customer_id
680
+ # Either the customer's primary domain name or the customer's unique identifier.
681
+ # If using the domain name, we do not recommend using a customerId as a key for
682
+ # persistent data. If the domain name for a customerId is changed, the Google
683
+ # system automatically updates.
684
+ # @param [String] subscription_id
685
+ # This is a required property. The subscriptionId is the subscription identifier
686
+ # and is unique for each customer. Since a subscriptionId changes when a
687
+ # subscription is updated, we recommend to not use this ID as a key for
688
+ # persistent data. And the subscriptionId can be found using the retrieve all
689
+ # reseller subscriptions method.
690
+ # @param [String] fields
691
+ # Selector specifying which fields to include in a partial response.
692
+ # @param [String] quota_user
693
+ # Available to use for quota purposes for server-side applications. Can be any
694
+ # arbitrary string assigned to a user, but should not exceed 40 characters.
695
+ # @param [Google::Apis::RequestOptions] options
696
+ # Request-specific options
697
+ #
698
+ # @yield [result, err] Result & error if block supplied
699
+ # @yieldparam result [Google::Apis::ResellerV1::Subscription] parsed result object
700
+ # @yieldparam err [StandardError] error object if request failed
701
+ #
702
+ # @return [Google::Apis::ResellerV1::Subscription]
703
+ #
704
+ # @raise [Google::Apis::ServerError] An error occurred on the server and the request can be retried
705
+ # @raise [Google::Apis::ClientError] The request is invalid and should not be retried without modification
706
+ # @raise [Google::Apis::AuthorizationError] Authorization is required
707
+ def suspend_subscription(customer_id, subscription_id, fields: nil, quota_user: nil, options: nil, &block)
708
+ command = make_simple_command(:post, 'apps/reseller/v1/customers/{customerId}/subscriptions/{subscriptionId}/suspend', options)
709
+ command.response_representation = Google::Apis::ResellerV1::Subscription::Representation
710
+ command.response_class = Google::Apis::ResellerV1::Subscription
711
+ command.params['customerId'] = customer_id unless customer_id.nil?
712
+ command.params['subscriptionId'] = subscription_id unless subscription_id.nil?
713
+ command.query['fields'] = fields unless fields.nil?
714
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
715
+ execute_or_queue_command(command, &block)
716
+ end
717
+
718
+ protected
719
+
720
+ def apply_command_defaults(command)
721
+ command.query['key'] = key unless key.nil?
722
+ command.query['quotaUser'] = quota_user unless quota_user.nil?
723
+ end
724
+ end
725
+ end
726
+ end
727
+ end