Skip to content

Commit

Permalink
feat(cloud_connector): define body param name (#2283)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and meorphis committed Jan 13, 2025
1 parent fceb4d0 commit e9b85b4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -7106,7 +7106,7 @@ Types:

Methods:

- <code title="put /zones/{zone_id}/cloud_connector/rules">client.cloudConnector.rules.<a href="./src/resources/cloud-connector/rules.ts">update</a>([ ...body ]) -> RuleUpdateResponse</code>
- <code title="put /zones/{zone_id}/cloud_connector/rules">client.cloudConnector.rules.<a href="./src/resources/cloud-connector/rules.ts">update</a>([ ...rules ]) -> RuleUpdateResponse</code>
- <code title="get /zones/{zone_id}/cloud_connector/rules">client.cloudConnector.rules.<a href="./src/resources/cloud-connector/rules.ts">list</a>({ ...params }) -> RuleListResponsesSinglePage</code>

# BotnetFeed
Expand Down
12 changes: 6 additions & 6 deletions src/resources/cloud-connector/rules.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ export class Rules extends APIResource {
* Put Rules
*/
update(params: RuleUpdateParams, options?: Core.RequestOptions): Core.APIPromise<RuleUpdateResponse> {
const { zone_id, body } = params;
const { zone_id, rules } = params;
return (
this._client.put(`/zones/${zone_id}/cloud_connector/rules`, {
body: body,
body: rules,
...options,
}) as Core.APIPromise<{ result: RuleUpdateResponse }>
)._thenUnwrap((obj) => obj.result);
Expand Down Expand Up @@ -116,11 +116,11 @@ export interface RuleUpdateParams {
/**
* Body param: List of Cloud Connector rules
*/
body: Array<RuleUpdateParams.Body>;
rules: Array<RuleUpdateParams.Rule>;
}

export namespace RuleUpdateParams {
export interface Body {
export interface Rule {
id?: string;

description?: string;
Expand All @@ -132,15 +132,15 @@ export namespace RuleUpdateParams {
/**
* Parameters of Cloud Connector Rule
*/
parameters?: Body.Parameters;
parameters?: Rule.Parameters;

/**
* Cloud Provider type
*/
provider?: 'aws_s3' | 'r2' | 'gcp_storage' | 'azure_storage';
}

export namespace Body {
export namespace Rule {
/**
* Parameters of Cloud Connector Rule
*/
Expand Down
4 changes: 2 additions & 2 deletions tests/api-resources/cloud-connector/rules.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ describe('resource rules', () => {
test('update: only required params', async () => {
const responsePromise = client.cloudConnector.rules.update({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
body: [{}],
rules: [{}],
});
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
Expand All @@ -27,7 +27,7 @@ describe('resource rules', () => {
test('update: required and optional params', async () => {
const response = await client.cloudConnector.rules.update({
zone_id: '023e105f4ecef8ad9ca31a8372d0c353',
body: [
rules: [
{
id: '95c365e17e1b46599cd99e5b231fac4e',
description: 'Rule description',
Expand Down

0 comments on commit e9b85b4

Please sign in to comment.