Skip to content

Commit fc0816e

Browse files
feat(api): api update
1 parent 56936a8 commit fc0816e

File tree

15 files changed

+140
-170
lines changed

15 files changed

+140
-170
lines changed

.stats.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1713
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d6263843e5ec1c5a140afecc5ed2182585e0b4a6e57add467c670c33abe1a69e.yml
3-
openapi_spec_hash: 55d0bc06c5ebd058d3c319439babad57
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-1e19b3654a9835d48a6f365f6cbd1f564da9e0f1c82c5d1e3eaf1fee54e87d11.yml
3+
openapi_spec_hash: f340abaa8fa4e47f15da3109aa50529b
44
config_hash: 92ed089a306b4e31a35318562d26d51a

api.md

+3-8
Original file line numberDiff line numberDiff line change
@@ -4660,15 +4660,10 @@ Methods:
46604660

46614661
##### Certificates
46624662

4663-
Types:
4664-
4665-
- <code><a href="./src/resources/zero-trust/devices/policies/default/certificates.ts">CertificateEditResponse</a></code>
4666-
- <code><a href="./src/resources/zero-trust/devices/policies/default/certificates.ts">CertificateGetResponse</a></code>
4667-
46684663
Methods:
46694664

4670-
- <code title="patch /zones/{zone_id}/devices/policy/certificates">client.zeroTrust.devices.policies.default.certificates.<a href="./src/resources/zero-trust/devices/policies/default/certificates.ts">edit</a>({ ...params }) -> CertificateEditResponse | null</code>
4671-
- <code title="get /zones/{zone_id}/devices/policy/certificates">client.zeroTrust.devices.policies.default.certificates.<a href="./src/resources/zero-trust/devices/policies/default/certificates.ts">get</a>({ ...params }) -> CertificateGetResponse | null</code>
4665+
- <code title="patch /zones/{zone_id}/devices/policy/certificates">client.zeroTrust.devices.policies.default.certificates.<a href="./src/resources/zero-trust/devices/policies/default/certificates.ts">edit</a>({ ...params }) -> DevicePolicyCertificates | null</code>
4666+
- <code title="get /zones/{zone_id}/devices/policy/certificates">client.zeroTrust.devices.policies.default.certificates.<a href="./src/resources/zero-trust/devices/policies/default/certificates.ts">get</a>({ ...params }) -> DevicePolicyCertificates | null</code>
46724667

46734668
#### Custom
46744669

@@ -4789,7 +4784,7 @@ Types:
47894784

47904785
Methods:
47914786

4792-
- <code title="get /accounts/{account_id}/devices/{device_id}/override_codes">client.zeroTrust.devices.overrideCodes.<a href="./src/resources/zero-trust/devices/override-codes.ts">list</a>(deviceId, { ...params }) -> OverrideCodeListResponse | null</code>
4787+
- <code title="get /accounts/{account_id}/devices/{device_id}/override_codes">client.zeroTrust.devices.overrideCodes.<a href="./src/resources/zero-trust/devices/override-codes.ts">list</a>(deviceId, { ...params }) -> OverrideCodeListResponsesSinglePage</code>
47934788
- <code title="get /accounts/{account_id}/devices/registrations/{registration_id}/override_codes">client.zeroTrust.devices.overrideCodes.<a href="./src/resources/zero-trust/devices/override-codes.ts">get</a>(registrationId, { ...params }) -> OverrideCodeGetResponse</code>
47944789

47954790
## IdentityProviders

src/resources/zero-trust/devices/devices.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export namespace DeviceListResponse {
177177
*/
178178
export interface LastSeenUser {
179179
/**
180-
* UUID
180+
* UUID.
181181
*/
182182
id?: string;
183183

@@ -298,7 +298,7 @@ export namespace DeviceGetResponse {
298298
*/
299299
export interface LastSeenUser {
300300
/**
301-
* UUID
301+
* UUID.
302302
*/
303303
id?: string;
304304

src/resources/zero-trust/devices/dex-tests.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export interface SchemaHTTP {
5353
description?: string;
5454

5555
/**
56-
* Device settings profiles targeted by this test
56+
* Device settings profiles targeted by this test.
5757
*/
5858
target_policies?: Array<SchemaHTTP.TargetPolicy>;
5959

@@ -68,17 +68,17 @@ export interface SchemaHTTP {
6868
export namespace SchemaHTTP {
6969
export interface TargetPolicy {
7070
/**
71-
* The id of the device settings profile
71+
* The id of the device settings profile.
7272
*/
7373
id?: string;
7474

7575
/**
76-
* Whether the profile is the account default
76+
* Whether the profile is the account default.
7777
*/
7878
default?: boolean;
7979

8080
/**
81-
* The name of the device settings profile
81+
* The name of the device settings profile.
8282
*/
8383
name?: string;
8484
}

src/resources/zero-trust/devices/index.ts

+1
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export {
6161
} from './devices';
6262
export { FleetStatus, type FleetStatusGetResponse, type FleetStatusGetParams } from './fleet-status';
6363
export {
64+
OverrideCodeListResponsesSinglePage,
6465
OverrideCodes,
6566
type OverrideCodeListResponse,
6667
type OverrideCodeGetResponse,

src/resources/zero-trust/devices/override-codes.ts

+12-38
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { APIResource } from '../../../resource';
44
import * as Core from '../../../core';
5+
import { SinglePage } from '../../../pagination';
56

67
export class OverrideCodes extends APIResource {
78
/**
@@ -16,14 +17,13 @@ export class OverrideCodes extends APIResource {
1617
deviceId: string,
1718
params: OverrideCodeListParams,
1819
options?: Core.RequestOptions,
19-
): Core.APIPromise<OverrideCodeListResponse | null> {
20+
): Core.PagePromise<OverrideCodeListResponsesSinglePage, OverrideCodeListResponse> {
2021
const { account_id } = params;
21-
return (
22-
this._client.get(
23-
`/accounts/${account_id}/devices/${deviceId}/override_codes`,
24-
options,
25-
) as Core.APIPromise<{ result: OverrideCodeListResponse | null }>
26-
)._thenUnwrap((obj) => obj.result);
22+
return this._client.getAPIList(
23+
`/accounts/${account_id}/devices/${deviceId}/override_codes`,
24+
OverrideCodeListResponsesSinglePage,
25+
options,
26+
);
2727
}
2828

2929
/**
@@ -45,38 +45,9 @@ export class OverrideCodes extends APIResource {
4545
}
4646
}
4747

48-
export interface OverrideCodeListResponse {
49-
disable_for_time?: OverrideCodeListResponse.DisableForTime;
50-
}
51-
52-
export namespace OverrideCodeListResponse {
53-
export interface DisableForTime {
54-
/**
55-
* Override code that is valid for 1 hour.
56-
*/
57-
'1'?: string;
48+
export class OverrideCodeListResponsesSinglePage extends SinglePage<OverrideCodeListResponse> {}
5849

59-
/**
60-
* Override code that is valid for 12 hour2.
61-
*/
62-
'12'?: string;
63-
64-
/**
65-
* Override code that is valid for 24 hour.2.
66-
*/
67-
'24'?: string;
68-
69-
/**
70-
* Override code that is valid for 3 hours.
71-
*/
72-
'3'?: string;
73-
74-
/**
75-
* Override code that is valid for 6 hours.
76-
*/
77-
'6'?: string;
78-
}
79-
}
50+
export type OverrideCodeListResponse = unknown;
8051

8152
export interface OverrideCodeGetResponse {
8253
disable_for_time?: Record<string, string>;
@@ -90,10 +61,13 @@ export interface OverrideCodeGetParams {
9061
account_id: string;
9162
}
9263

64+
OverrideCodes.OverrideCodeListResponsesSinglePage = OverrideCodeListResponsesSinglePage;
65+
9366
export declare namespace OverrideCodes {
9467
export {
9568
type OverrideCodeListResponse as OverrideCodeListResponse,
9669
type OverrideCodeGetResponse as OverrideCodeGetResponse,
70+
OverrideCodeListResponsesSinglePage as OverrideCodeListResponsesSinglePage,
9771
type OverrideCodeListParams as OverrideCodeListParams,
9872
type OverrideCodeGetParams as OverrideCodeGetParams,
9973
};

src/resources/zero-trust/devices/policies/custom/custom.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ export interface CustomCreateParams {
108108
* Body param: The wirefilter expression to match devices. Available values:
109109
* "identity.email", "identity.groups.id", "identity.groups.name",
110110
* "identity.groups.email", "identity.service_token_uuid",
111-
* "identity.saml_attributes", "network", "os.name", "os.version"
111+
* "identity.saml_attributes", "network", "os.name", "os.version".
112112
*/
113113
match: string;
114114

@@ -333,7 +333,7 @@ export interface CustomEditParams {
333333
* Body param: The wirefilter expression to match devices. Available values:
334334
* "identity.email", "identity.groups.id", "identity.groups.name",
335335
* "identity.groups.email", "identity.service_token_uuid",
336-
* "identity.saml_attributes", "network", "os.name", "os.version"
336+
* "identity.saml_attributes", "network", "os.name", "os.version".
337337
*/
338338
match?: string;
339339

src/resources/zero-trust/devices/policies/default/certificates.ts

+6-11
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { APIResource } from '../../../../../resource';
44
import * as Core from '../../../../../core';
5+
import * as PoliciesAPI from '../policies';
56

67
export class Certificates extends APIResource {
78
/**
@@ -12,36 +13,32 @@ export class Certificates extends APIResource {
1213
edit(
1314
params: CertificateEditParams,
1415
options?: Core.RequestOptions,
15-
): Core.APIPromise<CertificateEditResponse | null> {
16+
): Core.APIPromise<PoliciesAPI.DevicePolicyCertificates | null> {
1617
const { zone_id, ...body } = params;
1718
return (
1819
this._client.patch(`/zones/${zone_id}/devices/policy/certificates`, {
1920
body,
2021
...options,
21-
}) as Core.APIPromise<{ result: CertificateEditResponse | null }>
22+
}) as Core.APIPromise<{ result: PoliciesAPI.DevicePolicyCertificates | null }>
2223
)._thenUnwrap((obj) => obj.result);
2324
}
2425

2526
/**
26-
* Fetches device certificate provisioning
27+
* Fetches device certificate provisioning.
2728
*/
2829
get(
2930
params: CertificateGetParams,
3031
options?: Core.RequestOptions,
31-
): Core.APIPromise<CertificateGetResponse | null> {
32+
): Core.APIPromise<PoliciesAPI.DevicePolicyCertificates | null> {
3233
const { zone_id } = params;
3334
return (
3435
this._client.get(`/zones/${zone_id}/devices/policy/certificates`, options) as Core.APIPromise<{
35-
result: CertificateGetResponse | null;
36+
result: PoliciesAPI.DevicePolicyCertificates | null;
3637
}>
3738
)._thenUnwrap((obj) => obj.result);
3839
}
3940
}
4041

41-
export type CertificateEditResponse = unknown | string;
42-
43-
export type CertificateGetResponse = unknown | string;
44-
4542
export interface CertificateEditParams {
4643
/**
4744
* Path param:
@@ -61,8 +58,6 @@ export interface CertificateGetParams {
6158

6259
export declare namespace Certificates {
6360
export {
64-
type CertificateEditResponse as CertificateEditResponse,
65-
type CertificateGetResponse as CertificateGetResponse,
6661
type CertificateEditParams as CertificateEditParams,
6762
type CertificateGetParams as CertificateGetParams,
6863
};

src/resources/zero-trust/devices/policies/default/default.ts

+1-9
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,7 @@ import { APIResource } from '../../../../../resource';
44
import * as Core from '../../../../../core';
55
import * as PoliciesAPI from '../policies';
66
import * as CertificatesAPI from './certificates';
7-
import {
8-
CertificateEditParams,
9-
CertificateEditResponse,
10-
CertificateGetParams,
11-
CertificateGetResponse,
12-
Certificates,
13-
} from './certificates';
7+
import { CertificateEditParams, CertificateGetParams, Certificates } from './certificates';
148
import * as ExcludesAPI from './excludes';
159
import { ExcludeGetParams, ExcludeUpdateParams, Excludes } from './excludes';
1610
import * as FallbackDomainsAPI from './fallback-domains';
@@ -404,8 +398,6 @@ export declare namespace Default {
404398

405399
export {
406400
Certificates as Certificates,
407-
type CertificateEditResponse as CertificateEditResponse,
408-
type CertificateGetResponse as CertificateGetResponse,
409401
type CertificateEditParams as CertificateEditParams,
410402
type CertificateGetParams as CertificateGetParams,
411403
};

src/resources/zero-trust/devices/policies/default/index.ts

+1-7
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3-
export {
4-
Certificates,
5-
type CertificateEditResponse,
6-
type CertificateGetResponse,
7-
type CertificateEditParams,
8-
type CertificateGetParams,
9-
} from './certificates';
3+
export { Certificates, type CertificateEditParams, type CertificateGetParams } from './certificates';
104
export {
115
Default,
126
type DefaultEditResponse,

src/resources/zero-trust/devices/policies/policies.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export interface SettingsPolicy {
163163
* The wirefilter expression to match devices. Available values: "identity.email",
164164
* "identity.groups.id", "identity.groups.name", "identity.groups.email",
165165
* "identity.service_token_uuid", "identity.saml_attributes", "network", "os.name",
166-
* "os.version"
166+
* "os.version".
167167
*/
168168
match?: string;
169169

@@ -221,12 +221,12 @@ export namespace SettingsPolicy {
221221

222222
export interface TargetTest {
223223
/**
224-
* The id of the DEX test targeting this policy
224+
* The id of the DEX test targeting this policy.
225225
*/
226226
id?: string;
227227

228228
/**
229-
* The name of the DEX test targeting this policy
229+
* The name of the DEX test targeting this policy.
230230
*/
231231
name?: string;
232232
}

src/resources/zero-trust/devices/posture/integrations.ts

+8-8
Original file line numberDiff line numberDiff line change
@@ -304,13 +304,13 @@ export namespace IntegrationCreateParams {
304304

305305
/**
306306
* If present, this id will be passed in the `CF-Access-Client-ID` header when
307-
* hitting the `api_url`
307+
* hitting the `api_url`.
308308
*/
309309
access_client_id?: string;
310310

311311
/**
312312
* If present, this secret will be passed in the `CF-Access-Client-Secret` header
313-
* when hitting the `api_url`
313+
* when hitting the `api_url`.
314314
*/
315315
access_client_secret?: string;
316316
}
@@ -330,13 +330,13 @@ export namespace IntegrationCreateParams {
330330
export interface TeamsDevicesCustomS2sConfigRequest {
331331
/**
332332
* This id will be passed in the `CF-Access-Client-ID` header when hitting the
333-
* `api_url`
333+
* `api_url`.
334334
*/
335335
access_client_id: string;
336336

337337
/**
338338
* This secret will be passed in the `CF-Access-Client-Secret` header when hitting
339-
* the `api_url`
339+
* the `api_url`.
340340
*/
341341
access_client_secret: string;
342342

@@ -509,13 +509,13 @@ export namespace IntegrationEditParams {
509509

510510
/**
511511
* If present, this id will be passed in the `CF-Access-Client-ID` header when
512-
* hitting the `api_url`
512+
* hitting the `api_url`.
513513
*/
514514
access_client_id?: string;
515515

516516
/**
517517
* If present, this secret will be passed in the `CF-Access-Client-Secret` header
518-
* when hitting the `api_url`
518+
* when hitting the `api_url`.
519519
*/
520520
access_client_secret?: string;
521521
}
@@ -535,13 +535,13 @@ export namespace IntegrationEditParams {
535535
export interface TeamsDevicesCustomS2sConfigRequest {
536536
/**
537537
* This id will be passed in the `CF-Access-Client-ID` header when hitting the
538-
* `api_url`
538+
* `api_url`.
539539
*/
540540
access_client_id: string;
541541

542542
/**
543543
* This secret will be passed in the `CF-Access-Client-Secret` header when hitting
544-
* the `api_url`
544+
* the `api_url`.
545545
*/
546546
access_client_secret: string;
547547

0 commit comments

Comments
 (0)