Skip to content

Commit 1efe99b

Browse files
feat(api): api update
1 parent 298d367 commit 1efe99b

File tree

6 files changed

+16
-10
lines changed

6 files changed

+16
-10
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 1782
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-eb90b7fb6b9b4fdf8aa58c6f60980875a8dc855114fb2f84a4998024d7087f69.yml
3-
openapi_spec_hash: 7eabd8352835bf80892dbb494fdf3ef4
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d2a66f62f007704db30b02dc6072a9c9a3363f229521fd5c8d1db94cdaddf682.yml
3+
openapi_spec_hash: 5439122fed13eb566c770576999e67fb
44
config_hash: eda5b3d9487ce675d1fadf88153b457d

api.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7718,7 +7718,7 @@ Types:
77187718

77197719
Methods:
77207720

7721-
- <code title="put /zones/{zone_id}/snippets/snippet_rules">client.snippets.rules.<a href="./src/resources/snippets/rules.ts">update</a>([ ...body ]) -> RuleUpdateResponsesSinglePage</code>
7721+
- <code title="put /zones/{zone_id}/snippets/snippet_rules">client.snippets.rules.<a href="./src/resources/snippets/rules.ts">update</a>({ ...params }) -> RuleUpdateResponsesSinglePage</code>
77227722
- <code title="get /zones/{zone_id}/snippets/snippet_rules">client.snippets.rules.<a href="./src/resources/snippets/rules.ts">list</a>({ ...params }) -> RuleListResponsesSinglePage</code>
77237723
- <code title="delete /zones/{zone_id}/snippets/snippet_rules">client.snippets.rules.<a href="./src/resources/snippets/rules.ts">delete</a>({ ...params }) -> RuleDeleteResponsesSinglePage</code>
77247724

src/resources/snippets/rules.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@ export class Rules extends APIResource {
1212
params: RuleUpdateParams,
1313
options?: Core.RequestOptions,
1414
): Core.PagePromise<RuleUpdateResponsesSinglePage, RuleUpdateResponse> {
15-
const { zone_id, body } = params;
15+
const { zone_id, ...body } = params;
1616
return this._client.getAPIList(
1717
`/zones/${zone_id}/snippets/snippet_rules`,
1818
RuleUpdateResponsesSinglePage,
19-
{ body: body, method: 'put', ...options },
19+
{ body, method: 'put', ...options },
2020
);
2121
}
2222

@@ -171,14 +171,14 @@ export interface RuleUpdateParams {
171171
/**
172172
* Body param: A list of snippet rules.
173173
*/
174-
body: Array<RuleUpdateParams.Body>;
174+
rules: Array<RuleUpdateParams.Rule>;
175175
}
176176

177177
export namespace RuleUpdateParams {
178178
/**
179179
* A snippet rule.
180180
*/
181-
export interface Body {
181+
export interface Rule {
182182
/**
183183
* The expression defining which traffic will match the rule.
184184
*/

src/resources/workflows/instances/instances.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -335,6 +335,11 @@ export interface InstanceListParams extends V4PagePaginationArrayParams {
335335
*/
336336
account_id: string;
337337

338+
/**
339+
* Query param: `page` and `cursor` are mutually exclusive, use one or the other.
340+
*/
341+
cursor?: string;
342+
338343
/**
339344
* Query param: Accepts ISO 8601 with no timezone offsets and in UTC.
340345
*/

tests/api-resources/snippets/rules.test.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ describe('resource rules', () => {
1313
test('update: only required params', async () => {
1414
const responsePromise = client.snippets.rules.update({
1515
zone_id: '9f1839b6152d298aca64c4e906b6d074',
16-
body: [{ expression: 'ip.src ne 1.1.1.1', snippet_name: 'my_snippet' }],
16+
rules: [{ expression: 'ip.src eq 1.1.1.1', snippet_name: 'my_snippet' }],
1717
});
1818
const rawResponse = await responsePromise.asResponse();
1919
expect(rawResponse).toBeInstanceOf(Response);
@@ -27,9 +27,9 @@ describe('resource rules', () => {
2727
test('update: required and optional params', async () => {
2828
const response = await client.snippets.rules.update({
2929
zone_id: '9f1839b6152d298aca64c4e906b6d074',
30-
body: [
30+
rules: [
3131
{
32-
expression: 'ip.src ne 1.1.1.1',
32+
expression: 'ip.src eq 1.1.1.1',
3333
snippet_name: 'my_snippet',
3434
description: 'Execute my_snippet when IP address is 1.1.1.1.',
3535
enabled: true,

tests/api-resources/workflows/instances/instances.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ describe('resource instances', () => {
4444
test('list: required and optional params', async () => {
4545
const response = await client.workflows.instances.list('x', {
4646
account_id: 'account_id',
47+
cursor: 'cursor',
4748
date_end: '2019-12-27T18:11:19.117Z',
4849
date_start: '2019-12-27T18:11:19.117Z',
4950
page: 1,

0 commit comments

Comments
 (0)