Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#708)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Jun 1, 2024
1 parent 06fe826 commit 27a3019
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
configured_endpoints: 1321
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-b8c414b18922a386e73932ac947fcbc82fe780da9cdcd5212e3224ebbf6c4b4e.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-e58442197b639c81df6c79a12d873505a3be89908ae4a4567c1ac1a63e4c9309.yml
22 changes: 15 additions & 7 deletions src/resources/cloudforce-one/requests/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import * as Core from '../../../core';
import { APIResource } from '../../../resource';
import * as MessageAPI from './message';
import * as Shared from '../../shared';

export class MessageResource extends APIResource {
/**
Expand Down Expand Up @@ -51,12 +52,10 @@ export class MessageResource extends APIResource {
messageIdentifer: number,
options?: Core.RequestOptions,
): Core.APIPromise<MessageDeleteResponse> {
return (
this._client.delete(
`/accounts/${accountIdentifier}/cloudforce-one/requests/${requestIdentifier}/message/${messageIdentifer}`,
options,
) as Core.APIPromise<{ result: MessageDeleteResponse }>
)._thenUnwrap((obj) => obj.result);
return this._client.delete(
`/accounts/${accountIdentifier}/cloudforce-one/requests/${requestIdentifier}/message/${messageIdentifer}`,
options,
);
}

/**
Expand Down Expand Up @@ -109,7 +108,16 @@ export interface Message {
created?: string;
}

export type MessageDeleteResponse = unknown | Array<unknown> | string;
export interface MessageDeleteResponse {
errors: Array<Shared.ResponseInfo>;

messages: Array<Shared.ResponseInfo>;

/**
* Whether the API call was successful
*/
success: true;
}

export type MessageGetResponse = Array<Message>;

Expand Down
22 changes: 15 additions & 7 deletions src/resources/cloudforce-one/requests/priority.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import * as Core from '../../../core';
import { APIResource } from '../../../resource';
import * as PriorityAPI from './priority';
import * as Shared from '../../shared';
import * as RequestsAPI from './requests';

export class PriorityResource extends APIResource {
Expand Down Expand Up @@ -47,12 +48,10 @@ export class PriorityResource extends APIResource {
priorityIdentifer: string,
options?: Core.RequestOptions,
): Core.APIPromise<PriorityDeleteResponse> {
return (
this._client.delete(
`/accounts/${accountIdentifier}/cloudforce-one/requests/priority/${priorityIdentifer}`,
options,
) as Core.APIPromise<{ result: PriorityDeleteResponse }>
)._thenUnwrap((obj) => obj.result);
return this._client.delete(
`/accounts/${accountIdentifier}/cloudforce-one/requests/priority/${priorityIdentifer}`,
options,
);
}

/**
Expand Down Expand Up @@ -147,7 +146,16 @@ export interface PriorityEdit {
tlp: 'clear' | 'amber' | 'amber-strict' | 'green' | 'red';
}

export type PriorityDeleteResponse = unknown | Array<unknown> | string;
export interface PriorityDeleteResponse {
errors: Array<Shared.ResponseInfo>;

messages: Array<Shared.ResponseInfo>;

/**
* Whether the API call was successful
*/
success: true;
}

export interface PriorityCreateParams {
/**
Expand Down
22 changes: 15 additions & 7 deletions src/resources/cloudforce-one/requests/requests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import * as Core from '../../../core';
import { APIResource } from '../../../resource';
import * as RequestsAPI from './requests';
import * as Shared from '../../shared';
import * as MessageAPI from './message';
import * as PriorityAPI from './priority';
import { V4PagePaginationArray, type V4PagePaginationArrayParams } from '../../../pagination';
Expand Down Expand Up @@ -71,12 +72,10 @@ export class Requests extends APIResource {
requestIdentifier: string,
options?: Core.RequestOptions,
): Core.APIPromise<RequestDeleteResponse> {
return (
this._client.delete(
`/accounts/${accountIdentifier}/cloudforce-one/requests/${requestIdentifier}`,
options,
) as Core.APIPromise<{ result: RequestDeleteResponse }>
)._thenUnwrap((obj) => obj.result);
return this._client.delete(
`/accounts/${accountIdentifier}/cloudforce-one/requests/${requestIdentifier}`,
options,
);
}

/**
Expand Down Expand Up @@ -280,7 +279,16 @@ export interface RequestConstants {

export type RequestTypes = Array<string>;

export type RequestDeleteResponse = unknown | Array<unknown> | string;
export interface RequestDeleteResponse {
errors: Array<Shared.ResponseInfo>;

messages: Array<Shared.ResponseInfo>;

/**
* Whether the API call was successful
*/
success: true;
}

export interface RequestCreateParams {
/**
Expand Down

0 comments on commit 27a3019

Please sign in to comment.