aboutsummaryrefslogtreecommitdiff
path: root/docs/dyn/paymentsresellersubscription_v1.partners.subscriptions.html
blob: 9f24b7dcc7ace8da5e47f89d185d9d0abecc95b4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
<html><body>
<style>

body, h1, h2, h3, div, span, p, pre, a {
  margin: 0;
  padding: 0;
  border: 0;
  font-weight: inherit;
  font-style: inherit;
  font-size: 100%;
  font-family: inherit;
  vertical-align: baseline;
}

body {
  font-size: 13px;
  padding: 1em;
}

h1 {
  font-size: 26px;
  margin-bottom: 1em;
}

h2 {
  font-size: 24px;
  margin-bottom: 1em;
}

h3 {
  font-size: 20px;
  margin-bottom: 1em;
  margin-top: 1em;
}

pre, code {
  line-height: 1.5;
  font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
}

pre {
  margin-top: 0.5em;
}

h1, h2, h3, p {
  font-family: Arial, sans serif;
}

h1, h2, h3 {
  border-bottom: solid #CCC 1px;
}

.toc_element {
  margin-top: 0.5em;
}

.firstline {
  margin-left: 2 em;
}

.method  {
  margin-top: 1em;
  border: solid 1px #CCC;
  padding: 1em;
  background: #EEE;
}

.details {
  font-weight: bold;
  font-size: 14px;
}

</style>

<h1><a href="paymentsresellersubscription_v1.html">Payments Reseller Subscription API</a> . <a href="paymentsresellersubscription_v1.partners.html">partners</a> . <a href="paymentsresellersubscription_v1.partners.subscriptions.html">subscriptions</a></h1>
<h2>Instance Methods</h2>
<p class="toc_element">
  <code><a href="#cancel">cancel(name, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Used by partners to cancel a subscription service either immediately or by the end of the current billing cycle for their customers. It should be called directly by the partner using service accounts.</p>
<p class="toc_element">
  <code><a href="#close">close()</a></code></p>
<p class="firstline">Close httplib2 connections.</p>
<p class="toc_element">
  <code><a href="#create">create(parent, body=None, subscriptionId=None, x__xgafv=None)</a></code></p>
<p class="firstline">Used by partners to create a subscription for their customers. The created subscription is associated with the end user inferred from the end user credentials. This API must be authorized by the end user using OAuth.</p>
<p class="toc_element">
  <code><a href="#entitle">entitle(name, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Used by partners to entitle a previously provisioned subscription to the current end user. The end user identity is inferred from the authorized credential of the request. This API must be authorized by the end user using OAuth.</p>
<p class="toc_element">
  <code><a href="#extend">extend(name, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Used by partners to extend a subscription service for their customers on an ongoing basis for the subscription to remain active and renewable. It should be called directly by the partner using service accounts.</p>
<p class="toc_element">
  <code><a href="#get">get(name, x__xgafv=None)</a></code></p>
<p class="firstline">Used by partners to get a subscription by id. It should be called directly by the partner using service accounts.</p>
<p class="toc_element">
  <code><a href="#provision">provision(parent, body=None, subscriptionId=None, x__xgafv=None)</a></code></p>
<p class="firstline">Used by partners to provision a subscription for their customers. This creates a subscription without associating it with the end user account. EntitleSubscription must be called separately using OAuth in order for the end user account to be associated with the subscription. It should be called directly by the partner using service accounts.</p>
<p class="toc_element">
  <code><a href="#undoCancel">undoCancel(name, body=None, x__xgafv=None)</a></code></p>
<p class="firstline">Used by partners to revoke the pending cancellation of a subscription, which is currently in `STATE_CANCEL_AT_END_OF_CYCLE` state. If the subscription is already cancelled, the request will fail. It should be called directly by the partner using service accounts.</p>
<h3>Method Details</h3>
<div class="method">
    <code class="details" id="cancel">cancel(name, body=None, x__xgafv=None)</code>
  <pre>Used by partners to cancel a subscription service either immediately or by the end of the current billing cycle for their customers. It should be called directly by the partner using service accounts.

Args:
  name: string, Required. The name of the subscription resource to be cancelled. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot; (required)
  body: object, The request body.
    The object takes the form of:

{
  &quot;cancelImmediately&quot;: True or False, # Optional. If true, the subscription will be cancelled immediately. Otherwise, the subscription will be cancelled at renewal_time, and therefore no prorated refund will be issued for the rest of the cycle.
  &quot;cancellationReason&quot;: &quot;A String&quot;, # Specifies the reason for the cancellation.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    {
  &quot;subscription&quot;: { # A Subscription resource managed by 3P Partners. # The cancelled subscription resource.
    &quot;cancellationDetails&quot;: { # Describes the details of a cancelled or cancelling subscription. # Output only. Describes the details of a cancelled subscription. Only applicable to subscription of state `STATE_CANCELLED`.
      &quot;reason&quot;: &quot;A String&quot;, # The reason of the cancellation.
    },
    &quot;createTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is created. UTC timezone.
    &quot;cycleEndTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be extended, in ISO 8061 format. UTC timezone. For example: &quot;2019-08-31T17:28:54.564Z&quot;
    &quot;endUserEntitled&quot;: True or False, # Output only. Indicates if the subscription is entitled to the end user.
    &quot;freeTrialEndTime&quot;: &quot;A String&quot;, # Output only. End of the free trial period, in ISO 8061 format. For example, &quot;2019-08-31T17:28:54.564Z&quot;. It will be set the same as createTime if no free trial promotion is specified.
    &quot;name&quot;: &quot;A String&quot;, # Output only. Response only. Resource name of the subscription. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot;
    &quot;partnerUserToken&quot;: &quot;A String&quot;, # Required. Identifier of the end-user in partner’s system. The value is restricted to 63 ASCII characters at the maximum.
    &quot;processingState&quot;: &quot;A String&quot;, # Output only. Describes the processing state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
    &quot;products&quot;: [ # Required. Resource name that identifies one or more subscription products. The format will be &#x27;partners/{partner_id}/products/{product_id}&#x27;.
      &quot;A String&quot;,
    ],
    &quot;promotions&quot;: [ # Optional. Resource name that identifies one or more promotions that can be applied on the product. A typical promotion for a subscription is Free trial. The format will be &#x27;partners/{partner_id}/promotions/{promotion_id}&#x27;.
      &quot;A String&quot;,
    ],
    &quot;redirectUri&quot;: &quot;A String&quot;, # Output only. The place where partners should redirect the end-user to after creation. This field might also be populated when creation failed. However, Partners should always prepare a default URL to redirect the user in case this field is empty.
    &quot;serviceLocation&quot;: { # Describes a location of an end user. # Required. The location that the service is provided as indicated by the partner.
      &quot;postalCode&quot;: &quot;A String&quot;, # The postal code this location refers to. Ex. &quot;94043&quot;
      &quot;regionCode&quot;: &quot;A String&quot;, # 2-letter ISO region code for current content region. Ex. “US” Please refers to: https://en.wikipedia.org/wiki/ISO_3166-1
    },
    &quot;state&quot;: &quot;A String&quot;, # Output only. Describes the state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
    &quot;updateTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is most recently updated. UTC timezone.
    &quot;upgradeDowngradeDetails&quot;: { # Details about the previous subscription that this new subscription upgrades/downgrades from. # Optional. Details about the previous subscription that this new subscription upgrades/downgrades from. Only populated if this subscription is an upgrade/downgrade from another subscription.
      &quot;billingCycleSpec&quot;: &quot;A String&quot;, # Required. Specifies the billing cycle spec for the new upgraded/downgraded subscription.
      &quot;previousSubscriptionId&quot;: &quot;A String&quot;, # Required. The previous subscription id to be replaced. This is not the full resource name, use the subscription_id segment only.
    },
  },
}</pre>
</div>

<div class="method">
    <code class="details" id="close">close()</code>
  <pre>Close httplib2 connections.</pre>
</div>

<div class="method">
    <code class="details" id="create">create(parent, body=None, subscriptionId=None, x__xgafv=None)</code>
  <pre>Used by partners to create a subscription for their customers. The created subscription is associated with the end user inferred from the end user credentials. This API must be authorized by the end user using OAuth.

Args:
  parent: string, Required. The parent resource name, which is the identifier of the partner. It will have the format of &quot;partners/{partner_id}&quot;. (required)
  body: object, The request body.
    The object takes the form of:

{ # A Subscription resource managed by 3P Partners.
  &quot;cancellationDetails&quot;: { # Describes the details of a cancelled or cancelling subscription. # Output only. Describes the details of a cancelled subscription. Only applicable to subscription of state `STATE_CANCELLED`.
    &quot;reason&quot;: &quot;A String&quot;, # The reason of the cancellation.
  },
  &quot;createTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is created. UTC timezone.
  &quot;cycleEndTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be extended, in ISO 8061 format. UTC timezone. For example: &quot;2019-08-31T17:28:54.564Z&quot;
  &quot;endUserEntitled&quot;: True or False, # Output only. Indicates if the subscription is entitled to the end user.
  &quot;freeTrialEndTime&quot;: &quot;A String&quot;, # Output only. End of the free trial period, in ISO 8061 format. For example, &quot;2019-08-31T17:28:54.564Z&quot;. It will be set the same as createTime if no free trial promotion is specified.
  &quot;name&quot;: &quot;A String&quot;, # Output only. Response only. Resource name of the subscription. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot;
  &quot;partnerUserToken&quot;: &quot;A String&quot;, # Required. Identifier of the end-user in partner’s system. The value is restricted to 63 ASCII characters at the maximum.
  &quot;processingState&quot;: &quot;A String&quot;, # Output only. Describes the processing state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
  &quot;products&quot;: [ # Required. Resource name that identifies one or more subscription products. The format will be &#x27;partners/{partner_id}/products/{product_id}&#x27;.
    &quot;A String&quot;,
  ],
  &quot;promotions&quot;: [ # Optional. Resource name that identifies one or more promotions that can be applied on the product. A typical promotion for a subscription is Free trial. The format will be &#x27;partners/{partner_id}/promotions/{promotion_id}&#x27;.
    &quot;A String&quot;,
  ],
  &quot;redirectUri&quot;: &quot;A String&quot;, # Output only. The place where partners should redirect the end-user to after creation. This field might also be populated when creation failed. However, Partners should always prepare a default URL to redirect the user in case this field is empty.
  &quot;serviceLocation&quot;: { # Describes a location of an end user. # Required. The location that the service is provided as indicated by the partner.
    &quot;postalCode&quot;: &quot;A String&quot;, # The postal code this location refers to. Ex. &quot;94043&quot;
    &quot;regionCode&quot;: &quot;A String&quot;, # 2-letter ISO region code for current content region. Ex. “US” Please refers to: https://en.wikipedia.org/wiki/ISO_3166-1
  },
  &quot;state&quot;: &quot;A String&quot;, # Output only. Describes the state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
  &quot;updateTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is most recently updated. UTC timezone.
  &quot;upgradeDowngradeDetails&quot;: { # Details about the previous subscription that this new subscription upgrades/downgrades from. # Optional. Details about the previous subscription that this new subscription upgrades/downgrades from. Only populated if this subscription is an upgrade/downgrade from another subscription.
    &quot;billingCycleSpec&quot;: &quot;A String&quot;, # Required. Specifies the billing cycle spec for the new upgraded/downgraded subscription.
    &quot;previousSubscriptionId&quot;: &quot;A String&quot;, # Required. The previous subscription id to be replaced. This is not the full resource name, use the subscription_id segment only.
  },
}

  subscriptionId: string, Required. Identifies the subscription resource on the Partner side. The value is restricted to 63 ASCII characters at the maximum. If a subscription was previously created with the same subscription_id, we will directly return that one.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A Subscription resource managed by 3P Partners.
  &quot;cancellationDetails&quot;: { # Describes the details of a cancelled or cancelling subscription. # Output only. Describes the details of a cancelled subscription. Only applicable to subscription of state `STATE_CANCELLED`.
    &quot;reason&quot;: &quot;A String&quot;, # The reason of the cancellation.
  },
  &quot;createTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is created. UTC timezone.
  &quot;cycleEndTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be extended, in ISO 8061 format. UTC timezone. For example: &quot;2019-08-31T17:28:54.564Z&quot;
  &quot;endUserEntitled&quot;: True or False, # Output only. Indicates if the subscription is entitled to the end user.
  &quot;freeTrialEndTime&quot;: &quot;A String&quot;, # Output only. End of the free trial period, in ISO 8061 format. For example, &quot;2019-08-31T17:28:54.564Z&quot;. It will be set the same as createTime if no free trial promotion is specified.
  &quot;name&quot;: &quot;A String&quot;, # Output only. Response only. Resource name of the subscription. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot;
  &quot;partnerUserToken&quot;: &quot;A String&quot;, # Required. Identifier of the end-user in partner’s system. The value is restricted to 63 ASCII characters at the maximum.
  &quot;processingState&quot;: &quot;A String&quot;, # Output only. Describes the processing state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
  &quot;products&quot;: [ # Required. Resource name that identifies one or more subscription products. The format will be &#x27;partners/{partner_id}/products/{product_id}&#x27;.
    &quot;A String&quot;,
  ],
  &quot;promotions&quot;: [ # Optional. Resource name that identifies one or more promotions that can be applied on the product. A typical promotion for a subscription is Free trial. The format will be &#x27;partners/{partner_id}/promotions/{promotion_id}&#x27;.
    &quot;A String&quot;,
  ],
  &quot;redirectUri&quot;: &quot;A String&quot;, # Output only. The place where partners should redirect the end-user to after creation. This field might also be populated when creation failed. However, Partners should always prepare a default URL to redirect the user in case this field is empty.
  &quot;serviceLocation&quot;: { # Describes a location of an end user. # Required. The location that the service is provided as indicated by the partner.
    &quot;postalCode&quot;: &quot;A String&quot;, # The postal code this location refers to. Ex. &quot;94043&quot;
    &quot;regionCode&quot;: &quot;A String&quot;, # 2-letter ISO region code for current content region. Ex. “US” Please refers to: https://en.wikipedia.org/wiki/ISO_3166-1
  },
  &quot;state&quot;: &quot;A String&quot;, # Output only. Describes the state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
  &quot;updateTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is most recently updated. UTC timezone.
  &quot;upgradeDowngradeDetails&quot;: { # Details about the previous subscription that this new subscription upgrades/downgrades from. # Optional. Details about the previous subscription that this new subscription upgrades/downgrades from. Only populated if this subscription is an upgrade/downgrade from another subscription.
    &quot;billingCycleSpec&quot;: &quot;A String&quot;, # Required. Specifies the billing cycle spec for the new upgraded/downgraded subscription.
    &quot;previousSubscriptionId&quot;: &quot;A String&quot;, # Required. The previous subscription id to be replaced. This is not the full resource name, use the subscription_id segment only.
  },
}</pre>
</div>

<div class="method">
    <code class="details" id="entitle">entitle(name, body=None, x__xgafv=None)</code>
  <pre>Used by partners to entitle a previously provisioned subscription to the current end user. The end user identity is inferred from the authorized credential of the request. This API must be authorized by the end user using OAuth.

Args:
  name: string, Required. The name of the subscription resource that is entitled to the current end user. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot; (required)
  body: object, The request body.
    The object takes the form of:

{ # Partner request for entitling the previously provisioned subscription to an end user. The end user identity is inferred from the request OAuth context.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    {
  &quot;subscription&quot;: { # A Subscription resource managed by 3P Partners. # The subscription that has user linked to it.
    &quot;cancellationDetails&quot;: { # Describes the details of a cancelled or cancelling subscription. # Output only. Describes the details of a cancelled subscription. Only applicable to subscription of state `STATE_CANCELLED`.
      &quot;reason&quot;: &quot;A String&quot;, # The reason of the cancellation.
    },
    &quot;createTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is created. UTC timezone.
    &quot;cycleEndTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be extended, in ISO 8061 format. UTC timezone. For example: &quot;2019-08-31T17:28:54.564Z&quot;
    &quot;endUserEntitled&quot;: True or False, # Output only. Indicates if the subscription is entitled to the end user.
    &quot;freeTrialEndTime&quot;: &quot;A String&quot;, # Output only. End of the free trial period, in ISO 8061 format. For example, &quot;2019-08-31T17:28:54.564Z&quot;. It will be set the same as createTime if no free trial promotion is specified.
    &quot;name&quot;: &quot;A String&quot;, # Output only. Response only. Resource name of the subscription. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot;
    &quot;partnerUserToken&quot;: &quot;A String&quot;, # Required. Identifier of the end-user in partner’s system. The value is restricted to 63 ASCII characters at the maximum.
    &quot;processingState&quot;: &quot;A String&quot;, # Output only. Describes the processing state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
    &quot;products&quot;: [ # Required. Resource name that identifies one or more subscription products. The format will be &#x27;partners/{partner_id}/products/{product_id}&#x27;.
      &quot;A String&quot;,
    ],
    &quot;promotions&quot;: [ # Optional. Resource name that identifies one or more promotions that can be applied on the product. A typical promotion for a subscription is Free trial. The format will be &#x27;partners/{partner_id}/promotions/{promotion_id}&#x27;.
      &quot;A String&quot;,
    ],
    &quot;redirectUri&quot;: &quot;A String&quot;, # Output only. The place where partners should redirect the end-user to after creation. This field might also be populated when creation failed. However, Partners should always prepare a default URL to redirect the user in case this field is empty.
    &quot;serviceLocation&quot;: { # Describes a location of an end user. # Required. The location that the service is provided as indicated by the partner.
      &quot;postalCode&quot;: &quot;A String&quot;, # The postal code this location refers to. Ex. &quot;94043&quot;
      &quot;regionCode&quot;: &quot;A String&quot;, # 2-letter ISO region code for current content region. Ex. “US” Please refers to: https://en.wikipedia.org/wiki/ISO_3166-1
    },
    &quot;state&quot;: &quot;A String&quot;, # Output only. Describes the state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
    &quot;updateTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is most recently updated. UTC timezone.
    &quot;upgradeDowngradeDetails&quot;: { # Details about the previous subscription that this new subscription upgrades/downgrades from. # Optional. Details about the previous subscription that this new subscription upgrades/downgrades from. Only populated if this subscription is an upgrade/downgrade from another subscription.
      &quot;billingCycleSpec&quot;: &quot;A String&quot;, # Required. Specifies the billing cycle spec for the new upgraded/downgraded subscription.
      &quot;previousSubscriptionId&quot;: &quot;A String&quot;, # Required. The previous subscription id to be replaced. This is not the full resource name, use the subscription_id segment only.
    },
  },
}</pre>
</div>

<div class="method">
    <code class="details" id="extend">extend(name, body=None, x__xgafv=None)</code>
  <pre>Used by partners to extend a subscription service for their customers on an ongoing basis for the subscription to remain active and renewable. It should be called directly by the partner using service accounts.

Args:
  name: string, Required. The name of the subscription resource to be extended. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot;. (required)
  body: object, The request body.
    The object takes the form of:

{ # Request message for extending a Subscription resource. A new recurrence will be made based on the subscription schedule defined by the original product.
  &quot;extension&quot;: { # Describes the details of an extension request. # Required. Specifies details of the extension. Currently, the duration of the extension must be exactly one billing cycle of the original subscription.
    &quot;duration&quot;: { # Describes the length of a period of a time. # Specifies the period of access the subscription should grant.
      &quot;count&quot;: 42, # number of duration units to be included.
      &quot;unit&quot;: &quot;A String&quot;, # The unit used for the duration
    },
    &quot;partnerUserToken&quot;: &quot;A String&quot;, # Required. Identifier of the end-user in partner’s system.
  },
  &quot;requestId&quot;: &quot;A String&quot;, # Required. Restricted to 36 ASCII characters. A random UUID is recommended. The idempotency key for the request. The ID generation logic is controlled by the partner. request_id should be the same as on retries of the same request. A different request_id must be used for a extension of a different cycle. A random UUID is recommended.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    {
  &quot;cycleEndTime&quot;: &quot;A String&quot;, # The time at which the subscription is expected to be extended, in ISO 8061 format. UTC timezone. Example, &quot;cycleEndTime&quot;:&quot;2019-08-31T17:28:54.564Z&quot;
  &quot;freeTrialEndTime&quot;: &quot;A String&quot;, # End of the free trial period, in ISO 8061 format. UTC timezone. Example, &quot;freeTrialEndTime&quot;:&quot;2019-08-31T17:28:54.564Z&quot; This time will be set the same as initial subscription creation time if no free trial period is offered to the partner.
}</pre>
</div>

<div class="method">
    <code class="details" id="get">get(name, x__xgafv=None)</code>
  <pre>Used by partners to get a subscription by id. It should be called directly by the partner using service accounts.

Args:
  name: string, Required. The name of the subscription resource to retrieve. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot; (required)
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A Subscription resource managed by 3P Partners.
  &quot;cancellationDetails&quot;: { # Describes the details of a cancelled or cancelling subscription. # Output only. Describes the details of a cancelled subscription. Only applicable to subscription of state `STATE_CANCELLED`.
    &quot;reason&quot;: &quot;A String&quot;, # The reason of the cancellation.
  },
  &quot;createTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is created. UTC timezone.
  &quot;cycleEndTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be extended, in ISO 8061 format. UTC timezone. For example: &quot;2019-08-31T17:28:54.564Z&quot;
  &quot;endUserEntitled&quot;: True or False, # Output only. Indicates if the subscription is entitled to the end user.
  &quot;freeTrialEndTime&quot;: &quot;A String&quot;, # Output only. End of the free trial period, in ISO 8061 format. For example, &quot;2019-08-31T17:28:54.564Z&quot;. It will be set the same as createTime if no free trial promotion is specified.
  &quot;name&quot;: &quot;A String&quot;, # Output only. Response only. Resource name of the subscription. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot;
  &quot;partnerUserToken&quot;: &quot;A String&quot;, # Required. Identifier of the end-user in partner’s system. The value is restricted to 63 ASCII characters at the maximum.
  &quot;processingState&quot;: &quot;A String&quot;, # Output only. Describes the processing state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
  &quot;products&quot;: [ # Required. Resource name that identifies one or more subscription products. The format will be &#x27;partners/{partner_id}/products/{product_id}&#x27;.
    &quot;A String&quot;,
  ],
  &quot;promotions&quot;: [ # Optional. Resource name that identifies one or more promotions that can be applied on the product. A typical promotion for a subscription is Free trial. The format will be &#x27;partners/{partner_id}/promotions/{promotion_id}&#x27;.
    &quot;A String&quot;,
  ],
  &quot;redirectUri&quot;: &quot;A String&quot;, # Output only. The place where partners should redirect the end-user to after creation. This field might also be populated when creation failed. However, Partners should always prepare a default URL to redirect the user in case this field is empty.
  &quot;serviceLocation&quot;: { # Describes a location of an end user. # Required. The location that the service is provided as indicated by the partner.
    &quot;postalCode&quot;: &quot;A String&quot;, # The postal code this location refers to. Ex. &quot;94043&quot;
    &quot;regionCode&quot;: &quot;A String&quot;, # 2-letter ISO region code for current content region. Ex. “US” Please refers to: https://en.wikipedia.org/wiki/ISO_3166-1
  },
  &quot;state&quot;: &quot;A String&quot;, # Output only. Describes the state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
  &quot;updateTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is most recently updated. UTC timezone.
  &quot;upgradeDowngradeDetails&quot;: { # Details about the previous subscription that this new subscription upgrades/downgrades from. # Optional. Details about the previous subscription that this new subscription upgrades/downgrades from. Only populated if this subscription is an upgrade/downgrade from another subscription.
    &quot;billingCycleSpec&quot;: &quot;A String&quot;, # Required. Specifies the billing cycle spec for the new upgraded/downgraded subscription.
    &quot;previousSubscriptionId&quot;: &quot;A String&quot;, # Required. The previous subscription id to be replaced. This is not the full resource name, use the subscription_id segment only.
  },
}</pre>
</div>

<div class="method">
    <code class="details" id="provision">provision(parent, body=None, subscriptionId=None, x__xgafv=None)</code>
  <pre>Used by partners to provision a subscription for their customers. This creates a subscription without associating it with the end user account. EntitleSubscription must be called separately using OAuth in order for the end user account to be associated with the subscription. It should be called directly by the partner using service accounts.

Args:
  parent: string, Required. The parent resource name, which is the identifier of the partner. It will have the format of &quot;partners/{partner_id}&quot;. (required)
  body: object, The request body.
    The object takes the form of:

{ # A Subscription resource managed by 3P Partners.
  &quot;cancellationDetails&quot;: { # Describes the details of a cancelled or cancelling subscription. # Output only. Describes the details of a cancelled subscription. Only applicable to subscription of state `STATE_CANCELLED`.
    &quot;reason&quot;: &quot;A String&quot;, # The reason of the cancellation.
  },
  &quot;createTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is created. UTC timezone.
  &quot;cycleEndTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be extended, in ISO 8061 format. UTC timezone. For example: &quot;2019-08-31T17:28:54.564Z&quot;
  &quot;endUserEntitled&quot;: True or False, # Output only. Indicates if the subscription is entitled to the end user.
  &quot;freeTrialEndTime&quot;: &quot;A String&quot;, # Output only. End of the free trial period, in ISO 8061 format. For example, &quot;2019-08-31T17:28:54.564Z&quot;. It will be set the same as createTime if no free trial promotion is specified.
  &quot;name&quot;: &quot;A String&quot;, # Output only. Response only. Resource name of the subscription. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot;
  &quot;partnerUserToken&quot;: &quot;A String&quot;, # Required. Identifier of the end-user in partner’s system. The value is restricted to 63 ASCII characters at the maximum.
  &quot;processingState&quot;: &quot;A String&quot;, # Output only. Describes the processing state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
  &quot;products&quot;: [ # Required. Resource name that identifies one or more subscription products. The format will be &#x27;partners/{partner_id}/products/{product_id}&#x27;.
    &quot;A String&quot;,
  ],
  &quot;promotions&quot;: [ # Optional. Resource name that identifies one or more promotions that can be applied on the product. A typical promotion for a subscription is Free trial. The format will be &#x27;partners/{partner_id}/promotions/{promotion_id}&#x27;.
    &quot;A String&quot;,
  ],
  &quot;redirectUri&quot;: &quot;A String&quot;, # Output only. The place where partners should redirect the end-user to after creation. This field might also be populated when creation failed. However, Partners should always prepare a default URL to redirect the user in case this field is empty.
  &quot;serviceLocation&quot;: { # Describes a location of an end user. # Required. The location that the service is provided as indicated by the partner.
    &quot;postalCode&quot;: &quot;A String&quot;, # The postal code this location refers to. Ex. &quot;94043&quot;
    &quot;regionCode&quot;: &quot;A String&quot;, # 2-letter ISO region code for current content region. Ex. “US” Please refers to: https://en.wikipedia.org/wiki/ISO_3166-1
  },
  &quot;state&quot;: &quot;A String&quot;, # Output only. Describes the state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
  &quot;updateTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is most recently updated. UTC timezone.
  &quot;upgradeDowngradeDetails&quot;: { # Details about the previous subscription that this new subscription upgrades/downgrades from. # Optional. Details about the previous subscription that this new subscription upgrades/downgrades from. Only populated if this subscription is an upgrade/downgrade from another subscription.
    &quot;billingCycleSpec&quot;: &quot;A String&quot;, # Required. Specifies the billing cycle spec for the new upgraded/downgraded subscription.
    &quot;previousSubscriptionId&quot;: &quot;A String&quot;, # Required. The previous subscription id to be replaced. This is not the full resource name, use the subscription_id segment only.
  },
}

  subscriptionId: string, Required. Identifies the subscription resource on the Partner side. The value is restricted to 63 ASCII characters at the maximum. If a subscription was previously created with the same subscription_id, we will directly return that one.
  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # A Subscription resource managed by 3P Partners.
  &quot;cancellationDetails&quot;: { # Describes the details of a cancelled or cancelling subscription. # Output only. Describes the details of a cancelled subscription. Only applicable to subscription of state `STATE_CANCELLED`.
    &quot;reason&quot;: &quot;A String&quot;, # The reason of the cancellation.
  },
  &quot;createTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is created. UTC timezone.
  &quot;cycleEndTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be extended, in ISO 8061 format. UTC timezone. For example: &quot;2019-08-31T17:28:54.564Z&quot;
  &quot;endUserEntitled&quot;: True or False, # Output only. Indicates if the subscription is entitled to the end user.
  &quot;freeTrialEndTime&quot;: &quot;A String&quot;, # Output only. End of the free trial period, in ISO 8061 format. For example, &quot;2019-08-31T17:28:54.564Z&quot;. It will be set the same as createTime if no free trial promotion is specified.
  &quot;name&quot;: &quot;A String&quot;, # Output only. Response only. Resource name of the subscription. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot;
  &quot;partnerUserToken&quot;: &quot;A String&quot;, # Required. Identifier of the end-user in partner’s system. The value is restricted to 63 ASCII characters at the maximum.
  &quot;processingState&quot;: &quot;A String&quot;, # Output only. Describes the processing state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
  &quot;products&quot;: [ # Required. Resource name that identifies one or more subscription products. The format will be &#x27;partners/{partner_id}/products/{product_id}&#x27;.
    &quot;A String&quot;,
  ],
  &quot;promotions&quot;: [ # Optional. Resource name that identifies one or more promotions that can be applied on the product. A typical promotion for a subscription is Free trial. The format will be &#x27;partners/{partner_id}/promotions/{promotion_id}&#x27;.
    &quot;A String&quot;,
  ],
  &quot;redirectUri&quot;: &quot;A String&quot;, # Output only. The place where partners should redirect the end-user to after creation. This field might also be populated when creation failed. However, Partners should always prepare a default URL to redirect the user in case this field is empty.
  &quot;serviceLocation&quot;: { # Describes a location of an end user. # Required. The location that the service is provided as indicated by the partner.
    &quot;postalCode&quot;: &quot;A String&quot;, # The postal code this location refers to. Ex. &quot;94043&quot;
    &quot;regionCode&quot;: &quot;A String&quot;, # 2-letter ISO region code for current content region. Ex. “US” Please refers to: https://en.wikipedia.org/wiki/ISO_3166-1
  },
  &quot;state&quot;: &quot;A String&quot;, # Output only. Describes the state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
  &quot;updateTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is most recently updated. UTC timezone.
  &quot;upgradeDowngradeDetails&quot;: { # Details about the previous subscription that this new subscription upgrades/downgrades from. # Optional. Details about the previous subscription that this new subscription upgrades/downgrades from. Only populated if this subscription is an upgrade/downgrade from another subscription.
    &quot;billingCycleSpec&quot;: &quot;A String&quot;, # Required. Specifies the billing cycle spec for the new upgraded/downgraded subscription.
    &quot;previousSubscriptionId&quot;: &quot;A String&quot;, # Required. The previous subscription id to be replaced. This is not the full resource name, use the subscription_id segment only.
  },
}</pre>
</div>

<div class="method">
    <code class="details" id="undoCancel">undoCancel(name, body=None, x__xgafv=None)</code>
  <pre>Used by partners to revoke the pending cancellation of a subscription, which is currently in `STATE_CANCEL_AT_END_OF_CYCLE` state. If the subscription is already cancelled, the request will fail. It should be called directly by the partner using service accounts.

Args:
  name: string, Required. The name of the subscription resource whose pending cancellation needs to be undone. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot; (required)
  body: object, The request body.
    The object takes the form of:

{ # Request to revoke a cancellation request.
}

  x__xgafv: string, V1 error format.
    Allowed values
      1 - v1 error format
      2 - v2 error format

Returns:
  An object of the form:

    { # Response that contains the updated subscription resource.
  &quot;subscription&quot;: { # A Subscription resource managed by 3P Partners. # The updated subscription resource.
    &quot;cancellationDetails&quot;: { # Describes the details of a cancelled or cancelling subscription. # Output only. Describes the details of a cancelled subscription. Only applicable to subscription of state `STATE_CANCELLED`.
      &quot;reason&quot;: &quot;A String&quot;, # The reason of the cancellation.
    },
    &quot;createTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is created. UTC timezone.
    &quot;cycleEndTime&quot;: &quot;A String&quot;, # Output only. The time at which the subscription is expected to be extended, in ISO 8061 format. UTC timezone. For example: &quot;2019-08-31T17:28:54.564Z&quot;
    &quot;endUserEntitled&quot;: True or False, # Output only. Indicates if the subscription is entitled to the end user.
    &quot;freeTrialEndTime&quot;: &quot;A String&quot;, # Output only. End of the free trial period, in ISO 8061 format. For example, &quot;2019-08-31T17:28:54.564Z&quot;. It will be set the same as createTime if no free trial promotion is specified.
    &quot;name&quot;: &quot;A String&quot;, # Output only. Response only. Resource name of the subscription. It will have the format of &quot;partners/{partner_id}/subscriptions/{subscription_id}&quot;
    &quot;partnerUserToken&quot;: &quot;A String&quot;, # Required. Identifier of the end-user in partner’s system. The value is restricted to 63 ASCII characters at the maximum.
    &quot;processingState&quot;: &quot;A String&quot;, # Output only. Describes the processing state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
    &quot;products&quot;: [ # Required. Resource name that identifies one or more subscription products. The format will be &#x27;partners/{partner_id}/products/{product_id}&#x27;.
      &quot;A String&quot;,
    ],
    &quot;promotions&quot;: [ # Optional. Resource name that identifies one or more promotions that can be applied on the product. A typical promotion for a subscription is Free trial. The format will be &#x27;partners/{partner_id}/promotions/{promotion_id}&#x27;.
      &quot;A String&quot;,
    ],
    &quot;redirectUri&quot;: &quot;A String&quot;, # Output only. The place where partners should redirect the end-user to after creation. This field might also be populated when creation failed. However, Partners should always prepare a default URL to redirect the user in case this field is empty.
    &quot;serviceLocation&quot;: { # Describes a location of an end user. # Required. The location that the service is provided as indicated by the partner.
      &quot;postalCode&quot;: &quot;A String&quot;, # The postal code this location refers to. Ex. &quot;94043&quot;
      &quot;regionCode&quot;: &quot;A String&quot;, # 2-letter ISO region code for current content region. Ex. “US” Please refers to: https://en.wikipedia.org/wiki/ISO_3166-1
    },
    &quot;state&quot;: &quot;A String&quot;, # Output only. Describes the state of the subscription. See more details at [the lifecycle of a subscription](/payments/reseller/subscription/reference/index/Receive.Notifications#payments-subscription-lifecycle).
    &quot;updateTime&quot;: &quot;A String&quot;, # Output only. System generated timestamp when the subscription is most recently updated. UTC timezone.
    &quot;upgradeDowngradeDetails&quot;: { # Details about the previous subscription that this new subscription upgrades/downgrades from. # Optional. Details about the previous subscription that this new subscription upgrades/downgrades from. Only populated if this subscription is an upgrade/downgrade from another subscription.
      &quot;billingCycleSpec&quot;: &quot;A String&quot;, # Required. Specifies the billing cycle spec for the new upgraded/downgraded subscription.
      &quot;previousSubscriptionId&quot;: &quot;A String&quot;, # Required. The previous subscription id to be replaced. This is not the full resource name, use the subscription_id segment only.
    },
  },
}</pre>
</div>

</body></html>