Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#193)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored and stainless-bot committed Mar 21, 2024
1 parent 3506528 commit 282f368
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 8 deletions.
17 changes: 11 additions & 6 deletions src/resources/pages/projects/deployments/deployments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,12 @@ export class Deployments extends APIResource {
params: DeploymentListParams,
options?: Core.RequestOptions,
): Core.APIPromise<DeploymentListResponse> {
const { account_id } = params;
const { account_id, ...query } = params;
return (
this._client.get(
`/accounts/${account_id}/pages/projects/${projectName}/deployments`,
options,
) as Core.APIPromise<{ result: DeploymentListResponse }>
this._client.get(`/accounts/${account_id}/pages/projects/${projectName}/deployments`, {
query,
...options,
}) as Core.APIPromise<{ result: DeploymentListResponse }>
)._thenUnwrap((obj) => obj.result);
}

Expand Down Expand Up @@ -136,9 +136,14 @@ export interface DeploymentCreateParams {

export interface DeploymentListParams {
/**
* Identifier
* Path param: Identifier
*/
account_id: string;

/**
* Query param: What type of deployments to fetch.
*/
env?: 'production' | 'preview';
}

export interface DeploymentDeleteParams {
Expand Down
20 changes: 20 additions & 0 deletions src/resources/pages/projects/projects.ts
Original file line number Diff line number Diff line change
Expand Up @@ -670,6 +670,11 @@ export namespace PagesProjects {
* Service binding.
*/
export interface ServiceBinding {
/**
* The entrypoint to bind to.
*/
entrypoint?: string | null;

/**
* The Service environment.
*/
Expand Down Expand Up @@ -1039,6 +1044,11 @@ export namespace PagesProjects {
* Service binding.
*/
export interface ServiceBinding {
/**
* The entrypoint to bind to.
*/
entrypoint?: string | null;

/**
* The Service environment.
*/
Expand Down Expand Up @@ -1510,6 +1520,11 @@ export namespace ProjectCreateParams {
* Service binding.
*/
export interface ServiceBinding {
/**
* The entrypoint to bind to.
*/
entrypoint?: string | null;

/**
* The Service environment.
*/
Expand Down Expand Up @@ -1879,6 +1894,11 @@ export namespace ProjectCreateParams {
* Service binding.
*/
export interface ServiceBinding {
/**
* The entrypoint to bind to.
*/
entrypoint?: string | null;

/**
* The Service environment.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ describe('resource deployments', () => {
test.skip('list: required and optional params', async () => {
const response = await cloudflare.pages.projects.deployments.list('this-is-my-project-01', {
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
env: 'preview',
});
});

Expand Down
16 changes: 14 additions & 2 deletions tests/api-resources/pages/projects/projects.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,13 @@ describe('resource projects', () => {
placement: { mode: 'smart' },
queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } },
r2_buckets: { R2_BINDING: { name: 'some-bucket' } },
services: { SERVICE_BINDING: { environment: 'production', service: 'example-worker' } },
services: {
SERVICE_BINDING: {
entrypoint: 'MyHandler',
environment: 'production',
service: 'example-worker',
},
},
vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } },
},
production: {
Expand All @@ -71,7 +77,13 @@ describe('resource projects', () => {
placement: { mode: 'smart' },
queue_producers: { QUEUE_PRODUCER_BINDING: { name: 'some-queue' } },
r2_buckets: { R2_BINDING: { name: 'some-bucket' } },
services: { SERVICE_BINDING: { environment: 'production', service: 'example-worker' } },
services: {
SERVICE_BINDING: {
entrypoint: 'MyHandler',
environment: 'production',
service: 'example-worker',
},
},
vectorize_bindings: { VECTORIZE: { index_name: 'my_index' } },
},
},
Expand Down

0 comments on commit 282f368

Please sign in to comment.