Skip to content

Commit efc48f6

Browse files
feat(api): api update
1 parent 1e078a4 commit efc48f6

File tree

9 files changed

+13
-220
lines changed

9 files changed

+13
-220
lines changed

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
configured_endpoints: 1752
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d70c5c90fa932b491e5a82cc3129e8b5ffe37357eb0f3ff1da3f79bdd25327e8.yml
3-
openapi_spec_hash: a594ce611500408431dc1748d763c115
1+
configured_endpoints: 1749
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-eb687efe4218a30bb557e3229a32a5a00dea3c1485961b2c54c1442828d01519.yml
3+
openapi_spec_hash: d8a905730da34b5120ca15ceda3f4546
44
config_hash: 609def1a180087b5109306455be2068d

api.md

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -68,14 +68,12 @@ Methods:
6868

6969
Types:
7070

71-
- <code><a href="./src/resources/accounts/subscriptions.ts">SubscriptionCreateResponse</a></code>
72-
- <code><a href="./src/resources/accounts/subscriptions.ts">SubscriptionUpdateResponse</a></code>
7371
- <code><a href="./src/resources/accounts/subscriptions.ts">SubscriptionDeleteResponse</a></code>
7472

7573
Methods:
7674

77-
- <code title="post /accounts/{account_id}/subscriptions">client.accounts.subscriptions.<a href="./src/resources/accounts/subscriptions.ts">create</a>({ ...params }) -> SubscriptionCreateResponse</code>
78-
- <code title="put /accounts/{account_id}/subscriptions/{subscription_identifier}">client.accounts.subscriptions.<a href="./src/resources/accounts/subscriptions.ts">update</a>(subscriptionIdentifier, { ...params }) -> SubscriptionUpdateResponse</code>
75+
- <code title="post /accounts/{account_id}/subscriptions">client.accounts.subscriptions.<a href="./src/resources/accounts/subscriptions.ts">create</a>({ ...params }) -> Subscription</code>
76+
- <code title="put /accounts/{account_id}/subscriptions/{subscription_identifier}">client.accounts.subscriptions.<a href="./src/resources/accounts/subscriptions.ts">update</a>(subscriptionIdentifier, { ...params }) -> Subscription</code>
7977
- <code title="delete /accounts/{account_id}/subscriptions/{subscription_identifier}">client.accounts.subscriptions.<a href="./src/resources/accounts/subscriptions.ts">delete</a>(subscriptionIdentifier, { ...params }) -> SubscriptionDeleteResponse</code>
8078
- <code title="get /accounts/{account_id}/subscriptions">client.accounts.subscriptions.<a href="./src/resources/accounts/subscriptions.ts">get</a>({ ...params }) -> SubscriptionsSinglePage</code>
8179

@@ -394,18 +392,6 @@ Methods:
394392

395393
## Subscriptions
396394

397-
Types:
398-
399-
- <code><a href="./src/resources/zones/subscriptions.ts">SubscriptionCreateResponse</a></code>
400-
- <code><a href="./src/resources/zones/subscriptions.ts">SubscriptionUpdateResponse</a></code>
401-
- <code><a href="./src/resources/zones/subscriptions.ts">SubscriptionGetResponse</a></code>
402-
403-
Methods:
404-
405-
- <code title="post /zones/{identifier}/subscription">client.zones.subscriptions.<a href="./src/resources/zones/subscriptions.ts">create</a>(identifier, { ...params }) -> SubscriptionCreateResponse</code>
406-
- <code title="put /zones/{identifier}/subscription">client.zones.subscriptions.<a href="./src/resources/zones/subscriptions.ts">update</a>(identifier, { ...params }) -> SubscriptionUpdateResponse</code>
407-
- <code title="get /zones/{identifier}/subscription">client.zones.subscriptions.<a href="./src/resources/zones/subscriptions.ts">get</a>(identifier) -> SubscriptionGetResponse</code>
408-
409395
## Plans
410396

411397
Types:

src/resources/accounts/accounts.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,10 @@ import { RoleGetParams, RoleListParams, Roles } from './roles';
1919
import * as SubscriptionsAPI from './subscriptions';
2020
import {
2121
SubscriptionCreateParams,
22-
SubscriptionCreateResponse,
2322
SubscriptionDeleteParams,
2423
SubscriptionDeleteResponse,
2524
SubscriptionGetParams,
2625
SubscriptionUpdateParams,
27-
SubscriptionUpdateResponse,
2826
Subscriptions,
2927
} from './subscriptions';
3028
import * as LogsAPI from './logs/logs';
@@ -340,8 +338,6 @@ export declare namespace Accounts {
340338

341339
export {
342340
Subscriptions as Subscriptions,
343-
type SubscriptionCreateResponse as SubscriptionCreateResponse,
344-
type SubscriptionUpdateResponse as SubscriptionUpdateResponse,
345341
type SubscriptionDeleteResponse as SubscriptionDeleteResponse,
346342
type SubscriptionCreateParams as SubscriptionCreateParams,
347343
type SubscriptionUpdateParams as SubscriptionUpdateParams,

src/resources/accounts/index.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,6 @@ export {
1515
export { Roles, type RoleListParams, type RoleGetParams } from './roles';
1616
export {
1717
Subscriptions,
18-
type SubscriptionCreateResponse,
19-
type SubscriptionUpdateResponse,
2018
type SubscriptionDeleteResponse,
2119
type SubscriptionCreateParams,
2220
type SubscriptionUpdateParams,

src/resources/accounts/subscriptions.ts

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ export class Subscriptions extends APIResource {
2020
create(
2121
params: SubscriptionCreateParams,
2222
options?: Core.RequestOptions,
23-
): Core.APIPromise<SubscriptionCreateResponse> {
23+
): Core.APIPromise<Shared.Subscription> {
2424
const { account_id, ...body } = params;
2525
return (
2626
this._client.post(`/accounts/${account_id}/subscriptions`, { body, ...options }) as Core.APIPromise<{
27-
result: SubscriptionCreateResponse;
27+
result: Shared.Subscription;
2828
}>
2929
)._thenUnwrap((obj) => obj.result);
3030
}
@@ -45,13 +45,13 @@ export class Subscriptions extends APIResource {
4545
subscriptionIdentifier: string,
4646
params: SubscriptionUpdateParams,
4747
options?: Core.RequestOptions,
48-
): Core.APIPromise<SubscriptionUpdateResponse> {
48+
): Core.APIPromise<Shared.Subscription> {
4949
const { account_id, ...body } = params;
5050
return (
5151
this._client.put(`/accounts/${account_id}/subscriptions/${subscriptionIdentifier}`, {
5252
body,
5353
...options,
54-
}) as Core.APIPromise<{ result: SubscriptionUpdateResponse }>
54+
}) as Core.APIPromise<{ result: Shared.Subscription }>
5555
)._thenUnwrap((obj) => obj.result);
5656
}
5757

@@ -103,10 +103,6 @@ export class Subscriptions extends APIResource {
103103
}
104104
}
105105

106-
export type SubscriptionCreateResponse = unknown | string | null;
107-
108-
export type SubscriptionUpdateResponse = unknown | string | null;
109-
110106
export interface SubscriptionDeleteResponse {
111107
/**
112108
* Subscription identifier tag.
@@ -164,8 +160,6 @@ export interface SubscriptionGetParams {
164160

165161
export declare namespace Subscriptions {
166162
export {
167-
type SubscriptionCreateResponse as SubscriptionCreateResponse,
168-
type SubscriptionUpdateResponse as SubscriptionUpdateResponse,
169163
type SubscriptionDeleteResponse as SubscriptionDeleteResponse,
170164
type SubscriptionCreateParams as SubscriptionCreateParams,
171165
type SubscriptionUpdateParams as SubscriptionUpdateParams,

src/resources/zones/index.ts

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -91,12 +91,5 @@ export {
9191
type SettingEditParams,
9292
type SettingGetParams,
9393
} from './settings';
94-
export {
95-
Subscriptions,
96-
type SubscriptionCreateResponse,
97-
type SubscriptionUpdateResponse,
98-
type SubscriptionGetResponse,
99-
type SubscriptionCreateParams,
100-
type SubscriptionUpdateParams,
101-
} from './subscriptions';
94+
export { Subscriptions } from './subscriptions';
10295
export { Zones } from './zones';

src/resources/zones/subscriptions.ts

Lines changed: 1 addition & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -1,111 +1,5 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

33
import { APIResource } from '../../resource';
4-
import * as Core from '../../core';
5-
import * as Shared from '../shared';
64

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 {}

src/resources/zones/zones.ts

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -94,14 +94,7 @@ import {
9494
ZeroRTT,
9595
} from './settings';
9696
import * as SubscriptionsAPI from './subscriptions';
97-
import {
98-
SubscriptionCreateParams,
99-
SubscriptionCreateResponse,
100-
SubscriptionGetResponse,
101-
SubscriptionUpdateParams,
102-
SubscriptionUpdateResponse,
103-
Subscriptions,
104-
} from './subscriptions';
97+
import { Subscriptions } from './subscriptions';
10598
import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../pagination';
10699

107100
export class Zones extends APIResource {
@@ -752,14 +745,7 @@ export declare namespace Zones {
752745
type HoldGetParams as HoldGetParams,
753746
};
754747

755-
export {
756-
Subscriptions as Subscriptions,
757-
type SubscriptionCreateResponse as SubscriptionCreateResponse,
758-
type SubscriptionUpdateResponse as SubscriptionUpdateResponse,
759-
type SubscriptionGetResponse as SubscriptionGetResponse,
760-
type SubscriptionCreateParams as SubscriptionCreateParams,
761-
type SubscriptionUpdateParams as SubscriptionUpdateParams,
762-
};
748+
export { Subscriptions as Subscriptions };
763749

764750
export {
765751
Plans as Plans,

tests/api-resources/zones/subscriptions.test.ts

Lines changed: 0 additions & 54 deletions
This file was deleted.

0 commit comments

Comments
 (0)