cloudflare
Version:
The official TypeScript library for the Cloudflare API
59 lines (52 loc) • 1.67 kB
text/typescript
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
import { APIResource } from '../../core/resource';
import { APIPromise } from '../../core/api-promise';
import { RequestOptions } from '../../internal/request-options';
import { path } from '../../internal/utils/path';
export class BaseActivationCheck extends APIResource {
static override readonly _key: readonly ['zones', 'activationCheck'] = Object.freeze([
'zones',
'activationCheck',
] as const);
/**
* Triggeres a new activation check for a PENDING Zone. This can be triggered every
* 5 min for paygo/ent customers, every hour for FREE Zones.
*
* @example
* ```ts
* const response = await client.zones.activationCheck.trigger(
* { zone_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
trigger(
params: ActivationCheckTriggerParams,
options?: RequestOptions,
): APIPromise<ActivationCheckTriggerResponse> {
const { zone_id } = params;
return (
this._client.put(path`/zones/${zone_id}/activation_check`, options) as APIPromise<{
result: ActivationCheckTriggerResponse;
}>
)._thenUnwrap((obj) => obj.result);
}
}
export class ActivationCheck extends BaseActivationCheck {}
export interface ActivationCheckTriggerResponse {
/**
* Identifier.
*/
id?: string;
}
export interface ActivationCheckTriggerParams {
/**
* Zone ID
*/
zone_id: string;
}
export declare namespace ActivationCheck {
export {
type ActivationCheckTriggerResponse as ActivationCheckTriggerResponse,
type ActivationCheckTriggerParams as ActivationCheckTriggerParams,
};
}