Skip to content

Commit a2783a9

Browse files
feat(api): update via SDK Studio (#333)
1 parent 0fbaed3 commit a2783a9

File tree

13 files changed

+359
-1
lines changed

13 files changed

+359
-1
lines changed

.stats.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
configured_endpoints: 1256
1+
configured_endpoints: 1259

api.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6357,3 +6357,29 @@ Methods:
63576357
- <code title="delete /accounts/{account_identifier}/cloudforce-one/requests/priority/{priority_identifer}">client.cloudforceOne.requests.priority.<a href="./src/resources/cloudforce-one/requests/priority.ts">delete</a>(accountIdentifier, priorityIdentifer) -> PriorityDeleteResponse</code>
63586358
- <code title="get /accounts/{account_identifier}/cloudforce-one/requests/priority/{priority_identifer}">client.cloudforceOne.requests.priority.<a href="./src/resources/cloudforce-one/requests/priority.ts">get</a>(accountIdentifier, priorityIdentifer) -> Item</code>
63596359
- <code title="get /accounts/{account_identifier}/cloudforce-one/requests/priority/quota">client.cloudforceOne.requests.priority.<a href="./src/resources/cloudforce-one/requests/priority.ts">quota</a>(accountIdentifier) -> Quota</code>
6360+
6361+
# EventNotifications
6362+
6363+
## R2
6364+
6365+
### Configuration
6366+
6367+
Types:
6368+
6369+
- <code><a href="./src/resources/event-notifications/r2/configuration/configuration.ts">ConfigurationGetResponse</a></code>
6370+
6371+
Methods:
6372+
6373+
- <code title="get /accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration">client.eventNotifications.r2.configuration.<a href="./src/resources/event-notifications/r2/configuration/configuration.ts">get</a>(bucketName, { ...params }) -> ConfigurationGetResponse</code>
6374+
6375+
#### Queues
6376+
6377+
Types:
6378+
6379+
- <code><a href="./src/resources/event-notifications/r2/configuration/queues.ts">QueueUpdateResponse</a></code>
6380+
- <code><a href="./src/resources/event-notifications/r2/configuration/queues.ts">QueueDeleteResponse</a></code>
6381+
6382+
Methods:
6383+
6384+
- <code title="put /accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration/queues/{queue_id}">client.eventNotifications.r2.configuration.queues.<a href="./src/resources/event-notifications/r2/configuration/queues.ts">update</a>(bucketName, queueId, { ...params }) -> QueueUpdateResponse</code>
6385+
- <code title="delete /accounts/{account_id}/event_notifications/r2/{bucket_name}/configuration/queues/{queue_id}">client.eventNotifications.r2.configuration.queues.<a href="./src/resources/event-notifications/r2/configuration/queues.ts">delete</a>(bucketName, queueId, { ...params }) -> QueueDeleteResponse</code>

src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,7 @@ export class Cloudflare extends Core.APIClient {
222222
snippets: API.Snippets = new API.Snippets(this);
223223
calls: API.Calls = new API.Calls(this);
224224
cloudforceOne: API.CloudforceOne = new API.CloudforceOne(this);
225+
eventNotifications: API.EventNotifications = new API.EventNotifications(this);
225226

226227
protected override defaultQuery(): Core.DefaultQuery | undefined {
227228
return this._options.defaultQuery;
@@ -549,6 +550,8 @@ export namespace Cloudflare {
549550

550551
export import CloudforceOne = API.CloudforceOne;
551552

553+
export import EventNotifications = API.EventNotifications;
554+
552555
export import AuditLog = API.AuditLog;
553556
export import CloudflareTunnel = API.CloudflareTunnel;
554557
export import ErrorData = API.ErrorData;
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import { APIResource } from 'cloudflare/resource';
4+
import * as R2API from 'cloudflare/resources/event-notifications/r2/r2';
5+
6+
export class EventNotifications extends APIResource {
7+
r2: R2API.R2 = new R2API.R2(this._client);
8+
}
9+
10+
export namespace EventNotifications {
11+
export import R2 = R2API.R2;
12+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
export { EventNotifications } from './event-notifications';
4+
export { R2 } from './r2/index';
Lines changed: 82 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import * as Core from 'cloudflare/core';
4+
import { APIResource } from 'cloudflare/resource';
5+
import * as ConfigurationAPI from 'cloudflare/resources/event-notifications/r2/configuration/configuration';
6+
import * as QueuesAPI from 'cloudflare/resources/event-notifications/r2/configuration/queues';
7+
8+
export class Configuration extends APIResource {
9+
queues: QueuesAPI.Queues = new QueuesAPI.Queues(this._client);
10+
11+
/**
12+
* Returns all notification rules for each queue for which bucket notifications are
13+
* produced.
14+
*/
15+
get(
16+
bucketName: string,
17+
params: ConfigurationGetParams,
18+
options?: Core.RequestOptions,
19+
): Core.APIPromise<ConfigurationGetResponse> {
20+
const { account_id } = params;
21+
return (
22+
this._client.get(
23+
`/accounts/${account_id}/event_notifications/r2/${bucketName}/configuration`,
24+
options,
25+
) as Core.APIPromise<{ result: ConfigurationGetResponse }>
26+
)._thenUnwrap((obj) => obj.result);
27+
}
28+
}
29+
30+
export type ConfigurationGetResponse = Record<string, Record<string, ConfigurationGetResponse.mq_detail>>;
31+
32+
export namespace ConfigurationGetResponse {
33+
export interface mq_detail {
34+
/**
35+
* Queue ID that will receive notifications based on the configured rules
36+
*/
37+
queue: string;
38+
39+
/**
40+
* Array of rules to drive notifications
41+
*/
42+
rules: Array<mq_detail.Rule>;
43+
}
44+
45+
export namespace mq_detail {
46+
export interface Rule {
47+
/**
48+
* Array of R2 object actions that will trigger notifications
49+
*/
50+
actions: Array<
51+
'PutObject' | 'CopyObject' | 'DeleteObject' | 'CompleteMultipartUpload' | 'AbortMultipartUpload'
52+
>;
53+
54+
/**
55+
* Notifications will be sent only for objects with this prefix
56+
*/
57+
prefix?: string;
58+
59+
/**
60+
* Notifications will be sent only for objects with this suffix
61+
*/
62+
suffix?: string;
63+
}
64+
}
65+
}
66+
67+
export interface ConfigurationGetParams {
68+
/**
69+
* Identifier
70+
*/
71+
account_id: string;
72+
}
73+
74+
export namespace Configuration {
75+
export import ConfigurationGetResponse = ConfigurationAPI.ConfigurationGetResponse;
76+
export import ConfigurationGetParams = ConfigurationAPI.ConfigurationGetParams;
77+
export import Queues = QueuesAPI.Queues;
78+
export import QueueUpdateResponse = QueuesAPI.QueueUpdateResponse;
79+
export import QueueDeleteResponse = QueuesAPI.QueueDeleteResponse;
80+
export import QueueUpdateParams = QueuesAPI.QueueUpdateParams;
81+
export import QueueDeleteParams = QueuesAPI.QueueDeleteParams;
82+
}
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
export { ConfigurationGetResponse, ConfigurationGetParams, Configuration } from './configuration';
4+
export {
5+
QueueUpdateResponse,
6+
QueueDeleteResponse,
7+
QueueUpdateParams,
8+
QueueDeleteParams,
9+
Queues,
10+
} from './queues';
Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import * as Core from 'cloudflare/core';
4+
import { APIResource } from 'cloudflare/resource';
5+
import * as QueuesAPI from 'cloudflare/resources/event-notifications/r2/configuration/queues';
6+
7+
export class Queues extends APIResource {
8+
/**
9+
* Define the rules for a given queue which will determine event notification
10+
* production.
11+
*/
12+
update(
13+
bucketName: string,
14+
queueId: string,
15+
params: QueueUpdateParams,
16+
options?: Core.RequestOptions,
17+
): Core.APIPromise<QueueUpdateResponse> {
18+
const { account_id, ...body } = params;
19+
return (
20+
this._client.put(
21+
`/accounts/${account_id}/event_notifications/r2/${bucketName}/configuration/queues/${queueId}`,
22+
{ body, ...options },
23+
) as Core.APIPromise<{ result: QueueUpdateResponse }>
24+
)._thenUnwrap((obj) => obj.result);
25+
}
26+
27+
/**
28+
* Turn off all event notifications configured for delivery to a given queue. No
29+
* further notifications will be produced for the queue once complete.
30+
*/
31+
delete(
32+
bucketName: string,
33+
queueId: string,
34+
params: QueueDeleteParams,
35+
options?: Core.RequestOptions,
36+
): Core.APIPromise<QueueDeleteResponse> {
37+
const { account_id } = params;
38+
return (
39+
this._client.delete(
40+
`/accounts/${account_id}/event_notifications/r2/${bucketName}/configuration/queues/${queueId}`,
41+
options,
42+
) as Core.APIPromise<{ result: QueueDeleteResponse }>
43+
)._thenUnwrap((obj) => obj.result);
44+
}
45+
}
46+
47+
export interface QueueUpdateResponse {
48+
event_notification_detail_id?: string;
49+
}
50+
51+
export type QueueDeleteResponse = unknown | Array<unknown> | string;
52+
53+
export interface QueueUpdateParams {
54+
/**
55+
* Path param: Identifier
56+
*/
57+
account_id: string;
58+
59+
/**
60+
* Body param: Array of rules to drive notifications
61+
*/
62+
rules?: Array<QueueUpdateParams.Rule>;
63+
}
64+
65+
export namespace QueueUpdateParams {
66+
export interface Rule {
67+
/**
68+
* Array of R2 object actions that will trigger notifications
69+
*/
70+
actions: Array<
71+
'PutObject' | 'CopyObject' | 'DeleteObject' | 'CompleteMultipartUpload' | 'AbortMultipartUpload'
72+
>;
73+
74+
/**
75+
* Notifications will be sent only for objects with this prefix
76+
*/
77+
prefix?: string;
78+
79+
/**
80+
* Notifications will be sent only for objects with this suffix
81+
*/
82+
suffix?: string;
83+
}
84+
}
85+
86+
export interface QueueDeleteParams {
87+
/**
88+
* Identifier
89+
*/
90+
account_id: string;
91+
}
92+
93+
export namespace Queues {
94+
export import QueueUpdateResponse = QueuesAPI.QueueUpdateResponse;
95+
export import QueueDeleteResponse = QueuesAPI.QueueDeleteResponse;
96+
export import QueueUpdateParams = QueuesAPI.QueueUpdateParams;
97+
export import QueueDeleteParams = QueuesAPI.QueueDeleteParams;
98+
}
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
export { ConfigurationGetResponse, ConfigurationGetParams, Configuration } from './configuration/index';
4+
export { R2 } from './r2';
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2+
3+
import { APIResource } from 'cloudflare/resource';
4+
import * as ConfigurationAPI from 'cloudflare/resources/event-notifications/r2/configuration/configuration';
5+
6+
export class R2 extends APIResource {
7+
configuration: ConfigurationAPI.Configuration = new ConfigurationAPI.Configuration(this._client);
8+
}
9+
10+
export namespace R2 {
11+
export import Configuration = ConfigurationAPI.Configuration;
12+
export import ConfigurationGetResponse = ConfigurationAPI.ConfigurationGetResponse;
13+
export import ConfigurationGetParams = ConfigurationAPI.ConfigurationGetParams;
14+
}

0 commit comments

Comments
 (0)