Skip to content

Commit

Permalink
feat(api): OpenAPI spec update via Stainless API (#1138)
Browse files Browse the repository at this point in the history
  • Loading branch information
stainless-app[bot] authored Jul 15, 2024
1 parent 92e700f commit f0d1706
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 25 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: 1256
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-7bc261aaae82e045d5b257d76a8e4dedcc8102a8b20f0d32d091e41296624124.yml
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-8698fc16cc1cd7549c7f51bf3f3118b80e198b25fee1f20e4aaeb226608dafd1.yml
30 changes: 20 additions & 10 deletions src/resources/hyperdrive/hyperdrive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,6 @@ export interface Configuration {
*/
host: string;

/**
* The port (default: 5432 for Postgres) of your origin database.
*/
port: number;

/**
* Specifies the URL scheme used to connect to your origin database.
*/
Expand All @@ -35,6 +30,16 @@ export interface Configuration {
* The user of your origin database.
*/
user: string;

/**
* The Client ID of the Access token to use when connecting to the origin database
*/
access_client_id?: string;

/**
* The port (default: 5432 for Postgres) of your origin database.
*/
port?: number;
}

export interface ConfigurationParam {
Expand All @@ -48,11 +53,6 @@ export interface ConfigurationParam {
*/
host: string;

/**
* The port (default: 5432 for Postgres) of your origin database.
*/
port: number;

/**
* Specifies the URL scheme used to connect to your origin database.
*/
Expand All @@ -62,6 +62,16 @@ export interface ConfigurationParam {
* The user of your origin database.
*/
user: string;

/**
* The Client ID of the Access token to use when connecting to the origin database
*/
access_client_id?: string;

/**
* The port (default: 5432 for Postgres) of your origin database.
*/
port?: number;
}

export interface Hyperdrive {
Expand Down
19 changes: 5 additions & 14 deletions tests/api-resources/hyperdrive/configs.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,7 @@ describe('resource configs', () => {
const responsePromise = cloudflare.hyperdrive.configs.create({
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
name: 'example-hyperdrive',
origin: {
database: 'postgres',
host: 'database.example.com',
port: 5432,
scheme: 'postgres',
user: 'postgres',
},
origin: { database: 'postgres', host: 'database.example.com', scheme: 'postgres', user: 'postgres' },
});
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
Expand All @@ -38,6 +32,7 @@ describe('resource configs', () => {
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
name: 'example-hyperdrive',
origin: {
access_client_id: '0123456789abcdef0123456789abcdef.access',
database: 'postgres',
host: 'database.example.com',
port: 5432,
Expand All @@ -53,13 +48,7 @@ describe('resource configs', () => {
const responsePromise = cloudflare.hyperdrive.configs.update('023e105f4ecef8ad9ca31a8372d0c353', {
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
name: 'example-hyperdrive',
origin: {
database: 'postgres',
host: 'database.example.com',
port: 5432,
scheme: 'postgres',
user: 'postgres',
},
origin: { database: 'postgres', host: 'database.example.com', scheme: 'postgres', user: 'postgres' },
});
const rawResponse = await responsePromise.asResponse();
expect(rawResponse).toBeInstanceOf(Response);
Expand All @@ -76,6 +65,7 @@ describe('resource configs', () => {
account_id: '023e105f4ecef8ad9ca31a8372d0c353',
name: 'example-hyperdrive',
origin: {
access_client_id: '0123456789abcdef0123456789abcdef.access',
database: 'postgres',
host: 'database.example.com',
port: 5432,
Expand Down Expand Up @@ -145,6 +135,7 @@ describe('resource configs', () => {
caching: { disabled: false, max_age: 60, stale_while_revalidate: 15 },
name: 'example-hyperdrive',
origin: {
access_client_id: '0123456789abcdef0123456789abcdef.access',
database: 'postgres',
host: 'database.example.com',
port: 5432,
Expand Down

0 comments on commit f0d1706

Please sign in to comment.