|
1 | 1 | // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
2 | 2 |
|
3 | 3 | import { APIResource } from '../../resource'; |
4 | | -import * as Core from '../../core'; |
5 | | -import * as Shared from '../shared'; |
6 | 4 |
|
7 | | -export class Subscriptions extends APIResource { |
8 | | - /** |
9 | | - * Create a zone subscription, either plan or add-ons. |
10 | | - * |
11 | | - * @example |
12 | | - * ```ts |
13 | | - * const subscription = |
14 | | - * await client.zones.subscriptions.create( |
15 | | - * '506e3185e9c882d175a2d0cb0093d9f2', |
16 | | - * ); |
17 | | - * ``` |
18 | | - */ |
19 | | - create( |
20 | | - identifier: string, |
21 | | - body: SubscriptionCreateParams, |
22 | | - options?: Core.RequestOptions, |
23 | | - ): Core.APIPromise<SubscriptionCreateResponse> { |
24 | | - return ( |
25 | | - this._client.post(`/zones/${identifier}/subscription`, { body, ...options }) as Core.APIPromise<{ |
26 | | - result: SubscriptionCreateResponse; |
27 | | - }> |
28 | | - )._thenUnwrap((obj) => obj.result); |
29 | | - } |
30 | | - |
31 | | - /** |
32 | | - * Updates zone subscriptions, either plan or add-ons. |
33 | | - * |
34 | | - * @example |
35 | | - * ```ts |
36 | | - * const subscription = |
37 | | - * await client.zones.subscriptions.update( |
38 | | - * '506e3185e9c882d175a2d0cb0093d9f2', |
39 | | - * ); |
40 | | - * ``` |
41 | | - */ |
42 | | - update( |
43 | | - identifier: string, |
44 | | - body: SubscriptionUpdateParams, |
45 | | - options?: Core.RequestOptions, |
46 | | - ): Core.APIPromise<SubscriptionUpdateResponse> { |
47 | | - return ( |
48 | | - this._client.put(`/zones/${identifier}/subscription`, { body, ...options }) as Core.APIPromise<{ |
49 | | - result: SubscriptionUpdateResponse; |
50 | | - }> |
51 | | - )._thenUnwrap((obj) => obj.result); |
52 | | - } |
53 | | - |
54 | | - /** |
55 | | - * Lists zone subscription details. |
56 | | - * |
57 | | - * @example |
58 | | - * ```ts |
59 | | - * const subscription = await client.zones.subscriptions.get( |
60 | | - * '506e3185e9c882d175a2d0cb0093d9f2', |
61 | | - * ); |
62 | | - * ``` |
63 | | - */ |
64 | | - get(identifier: string, options?: Core.RequestOptions): Core.APIPromise<SubscriptionGetResponse> { |
65 | | - return ( |
66 | | - this._client.get(`/zones/${identifier}/subscription`, options) as Core.APIPromise<{ |
67 | | - result: SubscriptionGetResponse; |
68 | | - }> |
69 | | - )._thenUnwrap((obj) => obj.result); |
70 | | - } |
71 | | -} |
72 | | - |
73 | | -export type SubscriptionCreateResponse = unknown | string | null; |
74 | | - |
75 | | -export type SubscriptionUpdateResponse = unknown | string | null; |
76 | | - |
77 | | -export type SubscriptionGetResponse = unknown | string | null; |
78 | | - |
79 | | -export interface SubscriptionCreateParams { |
80 | | - /** |
81 | | - * How often the subscription is renewed automatically. |
82 | | - */ |
83 | | - frequency?: 'weekly' | 'monthly' | 'quarterly' | 'yearly'; |
84 | | - |
85 | | - /** |
86 | | - * The rate plan applied to the subscription. |
87 | | - */ |
88 | | - rate_plan?: Shared.RatePlanParam; |
89 | | -} |
90 | | - |
91 | | -export interface SubscriptionUpdateParams { |
92 | | - /** |
93 | | - * How often the subscription is renewed automatically. |
94 | | - */ |
95 | | - frequency?: 'weekly' | 'monthly' | 'quarterly' | 'yearly'; |
96 | | - |
97 | | - /** |
98 | | - * The rate plan applied to the subscription. |
99 | | - */ |
100 | | - rate_plan?: Shared.RatePlanParam; |
101 | | -} |
102 | | - |
103 | | -export declare namespace Subscriptions { |
104 | | - export { |
105 | | - type SubscriptionCreateResponse as SubscriptionCreateResponse, |
106 | | - type SubscriptionUpdateResponse as SubscriptionUpdateResponse, |
107 | | - type SubscriptionGetResponse as SubscriptionGetResponse, |
108 | | - type SubscriptionCreateParams as SubscriptionCreateParams, |
109 | | - type SubscriptionUpdateParams as SubscriptionUpdateParams, |
110 | | - }; |
111 | | -} |
| 5 | +export class Subscriptions extends APIResource {} |
0 commit comments