Skip to content

Commit d46030e

Browse files
chore(api): update composite API spec
1 parent d6ae39e commit d46030e

File tree

17 files changed

+685
-92
lines changed

17 files changed

+685
-92
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: 1923
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d01829c5ff74f82c372d7c132f3c9adcef9a7ac392e1dc7ff431f3397c94b6fb.yml
3-
openapi_spec_hash: 36f226c48f0fda588903ef75a766ccb1
1+
configured_endpoints: 1924
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-6183ef87f1b8eea6ad4bae542bfde2ec23a5526ae2b7bacdf6c6a4c48d990995.yml
3+
openapi_spec_hash: 9c8ac3d56571ebf1e170d993b71ccb4d
44
config_hash: bfa05f973c1b1797df33a05f942d5fac

api.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2949,8 +2949,13 @@ Methods:
29492949

29502950
## LOADocuments
29512951

2952+
Types:
2953+
2954+
- <code><a href="./src/resources/addressing/loa-documents.ts">LOADocumentCreateResponse</a></code>
2955+
29522956
Methods:
29532957

2958+
- <code title="post /accounts/{account_id}/addressing/loa_documents">client.addressing.loaDocuments.<a href="./src/resources/addressing/loa-documents.ts">create</a>({ ...params }) -> LOADocumentCreateResponse</code>
29542959
- <code title="get /accounts/{account_id}/addressing/loa_documents/{loa_document_id}/download">client.addressing.loaDocuments.<a href="./src/resources/addressing/loa-documents.ts">get</a>(loaDocumentId, { ...params }) -> Response</code>
29552960

29562961
## Prefixes

src/resources/addressing/addressing.ts

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,12 @@
22

33
import { APIResource } from '../../resource';
44
import * as LOADocumentsAPI from './loa-documents';
5-
import { LOADocumentGetParams, LOADocuments } from './loa-documents';
5+
import {
6+
LOADocumentCreateParams,
7+
LOADocumentCreateResponse,
8+
LOADocumentGetParams,
9+
LOADocuments,
10+
} from './loa-documents';
611
import * as ServicesAPI from './services';
712
import { ServiceListParams, ServiceListResponse, ServiceListResponsesSinglePage, Services } from './services';
813
import * as AddressMapsAPI from './address-maps/address-maps';
@@ -106,7 +111,12 @@ export declare namespace Addressing {
106111
type AddressMapGetParams as AddressMapGetParams,
107112
};
108113

109-
export { LOADocuments as LOADocuments, type LOADocumentGetParams as LOADocumentGetParams };
114+
export {
115+
LOADocuments as LOADocuments,
116+
type LOADocumentCreateResponse as LOADocumentCreateResponse,
117+
type LOADocumentCreateParams as LOADocumentCreateParams,
118+
type LOADocumentGetParams as LOADocumentGetParams,
119+
};
110120

111121
export {
112122
Prefixes as Prefixes,

src/resources/addressing/index.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,12 @@ export {
1515
type AddressMapGetParams,
1616
} from './address-maps/index';
1717
export { Addressing } from './addressing';
18-
export { LOADocuments, type LOADocumentGetParams } from './loa-documents';
18+
export {
19+
LOADocuments,
20+
type LOADocumentCreateResponse,
21+
type LOADocumentCreateParams,
22+
type LOADocumentGetParams,
23+
} from './loa-documents';
1924
export {
2025
PrefixesSinglePage,
2126
Prefixes,

src/resources/addressing/loa-documents.ts

Lines changed: 76 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,31 @@ import * as Core from '../../core';
55
import { type Response } from '../../_shims/index';
66

77
export class LOADocuments extends APIResource {
8+
/**
9+
* Submit LOA document (pdf format) under the account.
10+
*
11+
* @example
12+
* ```ts
13+
* const loaDocument =
14+
* await client.addressing.loaDocuments.create({
15+
* account_id: '258def64c72dae45f3e4c8516e2111f2',
16+
* loa_document: '@document.pdf',
17+
* });
18+
* ```
19+
*/
20+
create(
21+
params: LOADocumentCreateParams,
22+
options?: Core.RequestOptions,
23+
): Core.APIPromise<LOADocumentCreateResponse> {
24+
const { account_id, ...body } = params;
25+
return (
26+
this._client.post(
27+
`/accounts/${account_id}/addressing/loa_documents`,
28+
Core.multipartFormRequestOptions({ body, ...options }),
29+
) as Core.APIPromise<{ result: LOADocumentCreateResponse }>
30+
)._thenUnwrap((obj) => obj.result);
31+
}
32+
833
/**
934
* Download specified LOA document under the account.
1035
*
@@ -34,6 +59,52 @@ export class LOADocuments extends APIResource {
3459
}
3560
}
3661

62+
export interface LOADocumentCreateResponse {
63+
/**
64+
* Identifier for the uploaded LOA document.
65+
*/
66+
id?: string | null;
67+
68+
/**
69+
* Identifier of a Cloudflare account.
70+
*/
71+
account_id?: string;
72+
73+
created?: string;
74+
75+
/**
76+
* Name of LOA document. Max file size 10MB, and supported filetype is pdf.
77+
*/
78+
filename?: string;
79+
80+
/**
81+
* File size of the uploaded LOA document.
82+
*/
83+
size_bytes?: number;
84+
85+
/**
86+
* Whether the LOA has been verified by Cloudflare staff.
87+
*/
88+
verified?: boolean;
89+
90+
/**
91+
* Timestamp of the moment the LOA was marked as validated.
92+
*/
93+
verified_at?: string | null;
94+
}
95+
96+
export interface LOADocumentCreateParams {
97+
/**
98+
* Path param: Identifier of a Cloudflare account.
99+
*/
100+
account_id: string;
101+
102+
/**
103+
* Body param: LOA document to upload.
104+
*/
105+
loa_document: string;
106+
}
107+
37108
export interface LOADocumentGetParams {
38109
/**
39110
* Identifier of a Cloudflare account.
@@ -42,5 +113,9 @@ export interface LOADocumentGetParams {
42113
}
43114

44115
export declare namespace LOADocuments {
45-
export { type LOADocumentGetParams as LOADocumentGetParams };
116+
export {
117+
type LOADocumentCreateResponse as LOADocumentCreateResponse,
118+
type LOADocumentCreateParams as LOADocumentCreateParams,
119+
type LOADocumentGetParams as LOADocumentGetParams,
120+
};
46121
}

src/resources/addressing/prefixes/prefixes.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,11 @@ export interface PrefixCreateParams {
334334
* Body param: Description of the prefix.
335335
*/
336336
description?: string;
337+
338+
/**
339+
* Body param: Identifier for the uploaded LOA document.
340+
*/
341+
loa_document_id?: string | null;
337342
}
338343

339344
export interface PrefixListParams {

src/resources/cloudforce-one/threat-events/threat-events.ts

Lines changed: 41 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -335,9 +335,48 @@ export interface ThreatEventDeleteResponse {
335335
}
336336

337337
/**
338-
* Number of created bulk events
338+
* Detailed result of bulk event creation with auto-tag management
339339
*/
340-
export type ThreatEventBulkCreateResponse = number;
340+
export interface ThreatEventBulkCreateResponse {
341+
/**
342+
* Number of events created
343+
*/
344+
createdEventsCount: number;
345+
346+
/**
347+
* Number of indicators created
348+
*/
349+
createdIndicatorsCount: number;
350+
351+
/**
352+
* Number of tags created in SoT
353+
*/
354+
createdTagsCount: number;
355+
356+
/**
357+
* Number of errors encountered
358+
*/
359+
errorCount: number;
360+
361+
/**
362+
* Array of error details
363+
*/
364+
errors?: Array<ThreatEventBulkCreateResponse.Error>;
365+
}
366+
367+
export namespace ThreatEventBulkCreateResponse {
368+
export interface Error {
369+
/**
370+
* Error message
371+
*/
372+
error: string;
373+
374+
/**
375+
* Index of the event that caused the error
376+
*/
377+
eventIndex: number;
378+
}
379+
}
341380

342381
export interface ThreatEventEditResponse {
343382
attacker: string;

src/resources/iam/resource-groups.ts

Lines changed: 38 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,12 @@ export class ResourceGroups extends APIResource {
3030
options?: Core.RequestOptions,
3131
): Core.APIPromise<ResourceGroupCreateResponse> {
3232
const { account_id, ...body } = params;
33-
return this._client.post(`/accounts/${account_id}/iam/resource_groups`, { body, ...options });
33+
return (
34+
this._client.post(`/accounts/${account_id}/iam/resource_groups`, {
35+
body,
36+
...options,
37+
}) as Core.APIPromise<{ result: ResourceGroupCreateResponse }>
38+
)._thenUnwrap((obj) => obj.result);
3439
}
3540

3641
/**
@@ -51,10 +56,12 @@ export class ResourceGroups extends APIResource {
5156
options?: Core.RequestOptions,
5257
): Core.APIPromise<ResourceGroupUpdateResponse> {
5358
const { account_id, ...body } = params;
54-
return this._client.put(`/accounts/${account_id}/iam/resource_groups/${resourceGroupId}`, {
55-
body,
56-
...options,
57-
});
59+
return (
60+
this._client.put(`/accounts/${account_id}/iam/resource_groups/${resourceGroupId}`, {
61+
body,
62+
...options,
63+
}) as Core.APIPromise<{ result: ResourceGroupUpdateResponse }>
64+
)._thenUnwrap((obj) => obj.result);
5865
}
5966

6067
/**
@@ -125,7 +132,12 @@ export class ResourceGroups extends APIResource {
125132
options?: Core.RequestOptions,
126133
): Core.APIPromise<ResourceGroupGetResponse> {
127134
const { account_id } = params;
128-
return this._client.get(`/accounts/${account_id}/iam/resource_groups/${resourceGroupId}`, options);
135+
return (
136+
this._client.get(
137+
`/accounts/${account_id}/iam/resource_groups/${resourceGroupId}`,
138+
options,
139+
) as Core.APIPromise<{ result: ResourceGroupGetResponse }>
140+
)._thenUnwrap((obj) => obj.result);
129141
}
130142
}
131143

@@ -136,19 +148,24 @@ export class ResourceGroupListResponsesSinglePage extends SinglePage<ResourceGro
136148
*/
137149
export interface ResourceGroupCreateResponse {
138150
/**
139-
* Identifier of the group.
151+
* Identifier of the resource group.
140152
*/
141-
id?: string;
153+
id: string;
154+
155+
/**
156+
* The scope associated to the resource group
157+
*/
158+
scope: Array<ResourceGroupCreateResponse.Scope>;
142159

143160
/**
144161
* Attributes associated to the resource group.
145162
*/
146-
meta?: unknown;
163+
meta?: ResourceGroupCreateResponse.Meta;
147164

148165
/**
149-
* A scope is a combination of scope objects which provides additional context.
166+
* Name of the resource group.
150167
*/
151-
scope?: ResourceGroupCreateResponse.Scope;
168+
name?: string;
152169
}
153170

154171
export namespace ResourceGroupCreateResponse {
@@ -163,8 +180,7 @@ export namespace ResourceGroupCreateResponse {
163180
key: string;
164181

165182
/**
166-
* A list of scope objects for additional context. The number of Scope objects
167-
* should not be zero.
183+
* A list of scope objects for additional context.
168184
*/
169185
objects: Array<Scope.Object>;
170186
}
@@ -182,6 +198,15 @@ export namespace ResourceGroupCreateResponse {
182198
key: string;
183199
}
184200
}
201+
202+
/**
203+
* Attributes associated to the resource group.
204+
*/
205+
export interface Meta {
206+
key?: string;
207+
208+
value?: string;
209+
}
185210
}
186211

187212
/**

src/resources/origin-ca-certificates.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,11 @@ export class OriginCACertificates extends APIResource {
1414
* @example
1515
* ```ts
1616
* const originCACertificate =
17-
* await client.originCACertificates.create();
17+
* await client.originCACertificates.create({
18+
* csr: '-----BEGIN CERTIFICATE REQUEST-----\nMIICxzCCAa8CAQAwSDELMAkGA1UEBhMCVVMxFjAUBgNVBAgTDVNhbiBGcmFuY2lz\nY28xCzAJBgNVBAcTAkNBMRQwEgYDVQQDEwtleGFtcGxlLm5ldDCCASIwDQYJKoZI\nhvcNAQEBBQADggEPADCCAQoCggEBALxejtu4b+jPdFeFi6OUsye8TYJQBm3WfCvL\nHu5EvijMO/4Z2TImwASbwUF7Ir8OLgH+mGlQZeqyNvGoSOMEaZVXcYfpR1hlVak8\n4GGVr+04IGfOCqaBokaBFIwzclGZbzKmLGwIQioNxGfqFm6RGYGA3be2Je2iseBc\nN8GV1wYmvYE0RR+yWweJCTJ157exyRzu7sVxaEW9F87zBQLyOnwXc64rflXslRqi\ng7F7w5IaQYOl8yvmk/jEPCAha7fkiUfEpj4N12+oPRiMvleJF98chxjD4MH39c5I\nuOslULhrWunfh7GB1jwWNA9y44H0snrf+xvoy2TcHmxvma9Eln8CAwEAAaA6MDgG\nCSqGSIb3DQEJDjErMCkwJwYDVR0RBCAwHoILZXhhbXBsZS5uZXSCD3d3dy5leGFt\ncGxlLm5ldDANBgkqhkiG9w0BAQsFAAOCAQEAcBaX6dOnI8ncARrI9ZSF2AJX+8mx\npTHY2+Y2C0VvrVDGMtbBRH8R9yMbqWtlxeeNGf//LeMkSKSFa4kbpdx226lfui8/\nauRDBTJGx2R1ccUxmLZXx4my0W5iIMxunu+kez+BDlu7bTT2io0uXMRHue4i6quH\nyc5ibxvbJMjR7dqbcanVE10/34oprzXQsJ/VmSuZNXtjbtSKDlmcpw6To/eeAJ+J\nhXykcUihvHyG4A1m2R6qpANBjnA0pHexfwM/SgfzvpbvUg0T1ubmer8BgTwCKIWs\ndcWYTthM51JIqRBfNqy4QcBnX+GY05yltEEswQI55wdiS3CjTTA67sdbcQ==\n-----END CERTIFICATE REQUEST-----',
19+
* hostnames: ['example.com', '*.example.com'],
20+
* request_type: 'origin-rsa',
21+
* });
1822
* ```
1923
*/
2024
create(
@@ -156,19 +160,19 @@ export interface OriginCACertificateCreateParams {
156160
/**
157161
* The Certificate Signing Request (CSR). Must be newline-encoded.
158162
*/
159-
csr?: string;
163+
csr: string;
160164

161165
/**
162166
* Array of hostnames or wildcard names (e.g., \*.example.com) bound to the
163167
* certificate.
164168
*/
165-
hostnames?: Array<string>;
169+
hostnames: Array<string>;
166170

167171
/**
168172
* Signature type desired on certificate ("origin-rsa" (rsa), "origin-ecc" (ecdsa),
169173
* or "keyless-certificate" (for Keyless SSL servers).
170174
*/
171-
request_type?: Shared.CertificateRequestTypeParam;
175+
request_type: Shared.CertificateRequestTypeParam;
172176

173177
/**
174178
* The number of days for which the certificate should be valid.

0 commit comments

Comments
 (0)