-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(api): update via SDK Studio (#521)
- Loading branch information
1 parent
bde582f
commit 5a50a1d
Showing
10 changed files
with
480 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
configured_endpoints: 1281 | ||
configured_endpoints: 1286 | ||
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9a8e3aedb1193065fd84ae0b74a4a4c2d217ff2a821096f825a7798bbb921d76.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,280 @@ | ||
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. | ||
|
||
import * as Core from '../../core'; | ||
import { APIResource } from '../../resource'; | ||
import * as ConnectorsAPI from './connectors'; | ||
import { SinglePage } from '../../pagination'; | ||
|
||
export class Connectors extends APIResource { | ||
/** | ||
* Replace Connector | ||
*/ | ||
update( | ||
connectorId: string, | ||
params: ConnectorUpdateParams, | ||
options?: Core.RequestOptions, | ||
): Core.APIPromise<ConnectorUpdateResponse> { | ||
const { account_id, ...body } = params; | ||
return ( | ||
this._client.put(`/accounts/${account_id}/magic/connectors/${connectorId}`, { | ||
body, | ||
...options, | ||
}) as Core.APIPromise<{ result: ConnectorUpdateResponse }> | ||
)._thenUnwrap((obj) => obj.result); | ||
} | ||
|
||
/** | ||
* List Connectors | ||
*/ | ||
list( | ||
params: ConnectorListParams, | ||
options?: Core.RequestOptions, | ||
): Core.PagePromise<ConnectorListResponsesSinglePage, ConnectorListResponse> { | ||
const { account_id } = params; | ||
return this._client.getAPIList( | ||
`/accounts/${account_id}/magic/connectors`, | ||
ConnectorListResponsesSinglePage, | ||
options, | ||
); | ||
} | ||
|
||
/** | ||
* Update Connector | ||
*/ | ||
edit( | ||
connectorId: string, | ||
params: ConnectorEditParams, | ||
options?: Core.RequestOptions, | ||
): Core.APIPromise<ConnectorEditResponse> { | ||
const { account_id, ...body } = params; | ||
return ( | ||
this._client.patch(`/accounts/${account_id}/magic/connectors/${connectorId}`, { | ||
body, | ||
...options, | ||
}) as Core.APIPromise<{ result: ConnectorEditResponse }> | ||
)._thenUnwrap((obj) => obj.result); | ||
} | ||
|
||
/** | ||
* Fetch Connector | ||
*/ | ||
get( | ||
connectorId: string, | ||
params: ConnectorGetParams, | ||
options?: Core.RequestOptions, | ||
): Core.APIPromise<ConnectorGetResponse> { | ||
const { account_id } = params; | ||
return ( | ||
this._client.get( | ||
`/accounts/${account_id}/magic/connectors/${connectorId}`, | ||
options, | ||
) as Core.APIPromise<{ result: ConnectorGetResponse }> | ||
)._thenUnwrap((obj) => obj.result); | ||
} | ||
} | ||
|
||
export class ConnectorListResponsesSinglePage extends SinglePage<ConnectorListResponse> {} | ||
|
||
export interface ConnectorUpdateResponse { | ||
id: string; | ||
|
||
activated: boolean; | ||
|
||
interrupt_window_duration_hours: number; | ||
|
||
interrupt_window_hour_of_day: number; | ||
|
||
last_updated: string; | ||
|
||
notes: string; | ||
|
||
timezone: string; | ||
|
||
device?: ConnectorUpdateResponse.Device; | ||
|
||
last_heartbeat?: string; | ||
|
||
last_seen_version?: string; | ||
} | ||
|
||
export namespace ConnectorUpdateResponse { | ||
export interface Device { | ||
id: string; | ||
|
||
serial_number?: string; | ||
} | ||
} | ||
|
||
export interface ConnectorListResponse { | ||
id: string; | ||
|
||
activated: boolean; | ||
|
||
interrupt_window_duration_hours: number; | ||
|
||
interrupt_window_hour_of_day: number; | ||
|
||
last_updated: string; | ||
|
||
notes: string; | ||
|
||
timezone: string; | ||
|
||
device?: ConnectorListResponse.Device; | ||
|
||
last_heartbeat?: string; | ||
|
||
last_seen_version?: string; | ||
} | ||
|
||
export namespace ConnectorListResponse { | ||
export interface Device { | ||
id: string; | ||
|
||
serial_number?: string; | ||
} | ||
} | ||
|
||
export interface ConnectorEditResponse { | ||
id: string; | ||
|
||
activated: boolean; | ||
|
||
interrupt_window_duration_hours: number; | ||
|
||
interrupt_window_hour_of_day: number; | ||
|
||
last_updated: string; | ||
|
||
notes: string; | ||
|
||
timezone: string; | ||
|
||
device?: ConnectorEditResponse.Device; | ||
|
||
last_heartbeat?: string; | ||
|
||
last_seen_version?: string; | ||
} | ||
|
||
export namespace ConnectorEditResponse { | ||
export interface Device { | ||
id: string; | ||
|
||
serial_number?: string; | ||
} | ||
} | ||
|
||
export interface ConnectorGetResponse { | ||
id: string; | ||
|
||
activated: boolean; | ||
|
||
interrupt_window_duration_hours: number; | ||
|
||
interrupt_window_hour_of_day: number; | ||
|
||
last_updated: string; | ||
|
||
notes: string; | ||
|
||
timezone: string; | ||
|
||
device?: ConnectorGetResponse.Device; | ||
|
||
last_heartbeat?: string; | ||
|
||
last_seen_version?: string; | ||
} | ||
|
||
export namespace ConnectorGetResponse { | ||
export interface Device { | ||
id: string; | ||
|
||
serial_number?: string; | ||
} | ||
} | ||
|
||
export interface ConnectorUpdateParams { | ||
/** | ||
* Path param: | ||
*/ | ||
account_id: number; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
activated?: boolean; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
interrupt_window_duration_hours?: number; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
interrupt_window_hour_of_day?: number; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
notes?: string; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
timezone?: string; | ||
} | ||
|
||
export interface ConnectorListParams { | ||
account_id: number; | ||
} | ||
|
||
export interface ConnectorEditParams { | ||
/** | ||
* Path param: | ||
*/ | ||
account_id: number; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
activated?: boolean; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
interrupt_window_duration_hours?: number; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
interrupt_window_hour_of_day?: number; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
notes?: string; | ||
|
||
/** | ||
* Body param: | ||
*/ | ||
timezone?: string; | ||
} | ||
|
||
export interface ConnectorGetParams { | ||
account_id: number; | ||
} | ||
|
||
export namespace Connectors { | ||
export import ConnectorUpdateResponse = ConnectorsAPI.ConnectorUpdateResponse; | ||
export import ConnectorListResponse = ConnectorsAPI.ConnectorListResponse; | ||
export import ConnectorEditResponse = ConnectorsAPI.ConnectorEditResponse; | ||
export import ConnectorGetResponse = ConnectorsAPI.ConnectorGetResponse; | ||
export import ConnectorListResponsesSinglePage = ConnectorsAPI.ConnectorListResponsesSinglePage; | ||
export import ConnectorUpdateParams = ConnectorsAPI.ConnectorUpdateParams; | ||
export import ConnectorListParams = ConnectorsAPI.ConnectorListParams; | ||
export import ConnectorEditParams = ConnectorsAPI.ConnectorEditParams; | ||
export import ConnectorGetParams = ConnectorsAPI.ConnectorGetParams; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.