cloudflare
Version:
The official TypeScript library for the Cloudflare API
99 lines • 4.13 kB
JavaScript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from "../../core/resource.mjs";
import { SinglePage } from "../../core/pagination.mjs";
import { buildHeaders } from "../../internal/headers.mjs";
import { path } from "../../internal/utils/path.mjs";
export var BaseCloudIntegrations = /* @__PURE__ */ (() => {
class BaseCloudIntegrations extends APIResource {
/**
* Create a new Cloud Integration (Closed Beta).
*/
create(params, options) {
const { account_id, forwarded, ...body } = params;
return this._client.post(path `/accounts/${account_id}/magic/cloud/providers`, {
body,
...options,
headers: buildHeaders([
{ ...(forwarded != null ? { forwarded: forwarded } : undefined) },
options?.headers,
]),
})._thenUnwrap((obj) => obj.result);
}
/**
* Update a Cloud Integration (Closed Beta).
*/
update(providerID, params, options) {
const { account_id, ...body } = params;
return this._client.put(path `/accounts/${account_id}/magic/cloud/providers/${providerID}`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* List Cloud Integrations (Closed Beta).
*/
list(params, options) {
const { account_id, ...query } = params;
return this._client.getAPIList(path `/accounts/${account_id}/magic/cloud/providers`, (SinglePage), { query, ...options });
}
/**
* Delete a Cloud Integration (Closed Beta).
*/
delete(providerID, params, options) {
const { account_id } = params;
return this._client.delete(path `/accounts/${account_id}/magic/cloud/providers/${providerID}`, options)._thenUnwrap((obj) => obj.result);
}
/**
* Run discovery for a Cloud Integration (Closed Beta).
*/
discover(providerID, params, options) {
const { account_id, v2 } = params;
return this._client.post(path `/accounts/${account_id}/magic/cloud/providers/${providerID}/discover`, {
query: { v2 },
...options,
});
}
/**
* Run discovery for all Cloud Integrations in an account (Closed Beta).
*/
discoverAll(params, options) {
const { account_id } = params;
return this._client.post(path `/accounts/${account_id}/magic/cloud/providers/discover`, options);
}
/**
* Update a Cloud Integration (Closed Beta).
*/
edit(providerID, params, options) {
const { account_id, ...body } = params;
return this._client.patch(path `/accounts/${account_id}/magic/cloud/providers/${providerID}`, {
body,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Read a Cloud Integration (Closed Beta).
*/
get(providerID, params, options) {
const { account_id, ...query } = params;
return this._client.get(path `/accounts/${account_id}/magic/cloud/providers/${providerID}`, {
query,
...options,
})._thenUnwrap((obj) => obj.result);
}
/**
* Get initial configuration to complete Cloud Integration setup (Closed Beta).
*/
initialSetup(providerID, params, options) {
const { account_id } = params;
return this._client.get(path `/accounts/${account_id}/magic/cloud/providers/${providerID}/initial_setup`, options)._thenUnwrap((obj) => obj.result);
}
}
BaseCloudIntegrations._key = Object.freeze([
'magicCloudNetworking',
'cloudIntegrations',
]);
return BaseCloudIntegrations;
})();
export class CloudIntegrations extends BaseCloudIntegrations {
}
//# sourceMappingURL=cloud-integrations.mjs.map