cloudflare
Version:
The official TypeScript library for the Cloudflare API
383 lines • 12.6 kB
TypeScript
import { APIResource } from "../../core/resource.js";
import { APIPromise } from "../../core/api-promise.js";
import { PagePromise, V4PagePaginationArray, type V4PagePaginationArrayParams } from "../../core/pagination.js";
import { RequestOptions } from "../../internal/request-options.js";
export declare class BaseTargetEnvironments extends APIResource {
static readonly _key: readonly ['vulnerabilityScanner', 'targetEnvironments'];
/**
* Creates a new target environment for the account.
*
* @example
* ```ts
* const targetEnvironment =
* await client.vulnerabilityScanner.targetEnvironments.create(
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* name: 'Production Zone',
* target: {
* type: 'zone',
* zone_tag: 'd8e8fca2dc0f896fd7cb4cb0031ba249',
* },
* },
* );
* ```
*/
create(params: TargetEnvironmentCreateParams, options?: RequestOptions): APIPromise<TargetEnvironmentCreateResponse>;
/**
* Replaces a target environment. All fields must be provided.
*
* @example
* ```ts
* const targetEnvironment =
* await client.vulnerabilityScanner.targetEnvironments.update(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* {
* account_id: '023e105f4ecef8ad9ca31a8372d0c353',
* name: 'Production Zone',
* target: {
* type: 'zone',
* zone_tag: 'd8e8fca2dc0f896fd7cb4cb0031ba249',
* },
* },
* );
* ```
*/
update(targetEnvironmentID: string, params: TargetEnvironmentUpdateParams, options?: RequestOptions): APIPromise<TargetEnvironmentUpdateResponse>;
/**
* Returns all target environments for the account.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const targetEnvironmentListResponse of client.vulnerabilityScanner.targetEnvironments.list(
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* )) {
* // ...
* }
* ```
*/
list(params: TargetEnvironmentListParams, options?: RequestOptions): PagePromise<TargetEnvironmentListResponsesV4PagePaginationArray, TargetEnvironmentListResponse>;
/**
* Removes a target environment.
*
* @example
* ```ts
* const targetEnvironment =
* await client.vulnerabilityScanner.targetEnvironments.delete(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
delete(targetEnvironmentID: string, params: TargetEnvironmentDeleteParams, options?: RequestOptions): APIPromise<TargetEnvironmentDeleteResponse | null>;
/**
* Updates a target environment with only the provided fields; omitted fields
* remain unchanged.
*
* @example
* ```ts
* const response =
* await client.vulnerabilityScanner.targetEnvironments.edit(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
edit(targetEnvironmentID: string, params: TargetEnvironmentEditParams, options?: RequestOptions): APIPromise<TargetEnvironmentEditResponse>;
/**
* Returns a single target environment by ID.
*
* @example
* ```ts
* const targetEnvironment =
* await client.vulnerabilityScanner.targetEnvironments.get(
* '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e',
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
get(targetEnvironmentID: string, params: TargetEnvironmentGetParams, options?: RequestOptions): APIPromise<TargetEnvironmentGetResponse>;
}
export declare class TargetEnvironments extends BaseTargetEnvironments {
}
export type TargetEnvironmentListResponsesV4PagePaginationArray = V4PagePaginationArray<TargetEnvironmentListResponse>;
export interface TargetEnvironmentCreateResponse {
/**
* Target environment identifier.
*/
id: string;
/**
* Human-readable name.
*/
name: string;
/**
* Identifies the Cloudflare asset to scan. Uses a `type` discriminator. Currently
* the service supports only `zone` targets.
*/
target: TargetEnvironmentCreateResponse.Target;
/**
* Optional description providing additional context.
*/
description?: string | null;
}
export declare namespace TargetEnvironmentCreateResponse {
/**
* Identifies the Cloudflare asset to scan. Uses a `type` discriminator. Currently
* the service supports only `zone` targets.
*/
interface Target {
type: 'zone';
/**
* Cloudflare zone tag. The zone must belong to the account.
*/
zone_tag: string;
}
}
export interface TargetEnvironmentUpdateResponse {
/**
* Target environment identifier.
*/
id: string;
/**
* Human-readable name.
*/
name: string;
/**
* Identifies the Cloudflare asset to scan. Uses a `type` discriminator. Currently
* the service supports only `zone` targets.
*/
target: TargetEnvironmentUpdateResponse.Target;
/**
* Optional description providing additional context.
*/
description?: string | null;
}
export declare namespace TargetEnvironmentUpdateResponse {
/**
* Identifies the Cloudflare asset to scan. Uses a `type` discriminator. Currently
* the service supports only `zone` targets.
*/
interface Target {
type: 'zone';
/**
* Cloudflare zone tag. The zone must belong to the account.
*/
zone_tag: string;
}
}
export interface TargetEnvironmentListResponse {
/**
* Target environment identifier.
*/
id: string;
/**
* Human-readable name.
*/
name: string;
/**
* Identifies the Cloudflare asset to scan. Uses a `type` discriminator. Currently
* the service supports only `zone` targets.
*/
target: TargetEnvironmentListResponse.Target;
/**
* Optional description providing additional context.
*/
description?: string | null;
}
export declare namespace TargetEnvironmentListResponse {
/**
* Identifies the Cloudflare asset to scan. Uses a `type` discriminator. Currently
* the service supports only `zone` targets.
*/
interface Target {
type: 'zone';
/**
* Cloudflare zone tag. The zone must belong to the account.
*/
zone_tag: string;
}
}
export type TargetEnvironmentDeleteResponse = unknown;
export interface TargetEnvironmentEditResponse {
/**
* Target environment identifier.
*/
id: string;
/**
* Human-readable name.
*/
name: string;
/**
* Identifies the Cloudflare asset to scan. Uses a `type` discriminator. Currently
* the service supports only `zone` targets.
*/
target: TargetEnvironmentEditResponse.Target;
/**
* Optional description providing additional context.
*/
description?: string | null;
}
export declare namespace TargetEnvironmentEditResponse {
/**
* Identifies the Cloudflare asset to scan. Uses a `type` discriminator. Currently
* the service supports only `zone` targets.
*/
interface Target {
type: 'zone';
/**
* Cloudflare zone tag. The zone must belong to the account.
*/
zone_tag: string;
}
}
export interface TargetEnvironmentGetResponse {
/**
* Target environment identifier.
*/
id: string;
/**
* Human-readable name.
*/
name: string;
/**
* Identifies the Cloudflare asset to scan. Uses a `type` discriminator. Currently
* the service supports only `zone` targets.
*/
target: TargetEnvironmentGetResponse.Target;
/**
* Optional description providing additional context.
*/
description?: string | null;
}
export declare namespace TargetEnvironmentGetResponse {
/**
* Identifies the Cloudflare asset to scan. Uses a `type` discriminator. Currently
* the service supports only `zone` targets.
*/
interface Target {
type: 'zone';
/**
* Cloudflare zone tag. The zone must belong to the account.
*/
zone_tag: string;
}
}
export interface TargetEnvironmentCreateParams {
/**
* Path param: Account identifier.
*/
account_id: string;
/**
* Body param: Human-readable name.
*/
name: string;
/**
* Body param: Identifies the Cloudflare asset to scan. Uses a `type`
* discriminator. Currently the service supports only `zone` targets.
*/
target: TargetEnvironmentCreateParams.Target;
/**
* Body param: Optional description.
*/
description?: string | null;
}
export declare namespace TargetEnvironmentCreateParams {
/**
* Identifies the Cloudflare asset to scan. Uses a `type` discriminator. Currently
* the service supports only `zone` targets.
*/
interface Target {
type: 'zone';
/**
* Cloudflare zone tag. The zone must belong to the account.
*/
zone_tag: string;
}
}
export interface TargetEnvironmentUpdateParams {
/**
* Path param: Account identifier.
*/
account_id: string;
/**
* Body param: Human-readable name.
*/
name: string;
/**
* Body param: Identifies the Cloudflare asset to scan. Uses a `type`
* discriminator. Currently the service supports only `zone` targets.
*/
target: TargetEnvironmentUpdateParams.Target;
/**
* Body param: Optional description.
*/
description?: string | null;
}
export declare namespace TargetEnvironmentUpdateParams {
/**
* Identifies the Cloudflare asset to scan. Uses a `type` discriminator. Currently
* the service supports only `zone` targets.
*/
interface Target {
type: 'zone';
/**
* Cloudflare zone tag. The zone must belong to the account.
*/
zone_tag: string;
}
}
export interface TargetEnvironmentListParams extends V4PagePaginationArrayParams {
/**
* Path param: Account identifier.
*/
account_id: string;
}
export interface TargetEnvironmentDeleteParams {
/**
* Account identifier.
*/
account_id: string;
}
export interface TargetEnvironmentEditParams {
/**
* Path param: Account identifier.
*/
account_id: string;
/**
* Body param: Optional description. Omit to leave unchanged, set to `null` to
* clear, or provide a string to update.
*/
description?: string | null;
/**
* Body param: Human-readable name.
*/
name?: string;
/**
* Body param: Identifies the Cloudflare asset to scan. Uses a `type`
* discriminator. Currently the service supports only `zone` targets.
*/
target?: TargetEnvironmentEditParams.Target;
}
export declare namespace TargetEnvironmentEditParams {
/**
* Identifies the Cloudflare asset to scan. Uses a `type` discriminator. Currently
* the service supports only `zone` targets.
*/
interface Target {
type: 'zone';
/**
* Cloudflare zone tag. The zone must belong to the account.
*/
zone_tag: string;
}
}
export interface TargetEnvironmentGetParams {
/**
* Account identifier.
*/
account_id: string;
}
export declare namespace TargetEnvironments {
export { type TargetEnvironmentCreateResponse as TargetEnvironmentCreateResponse, type TargetEnvironmentUpdateResponse as TargetEnvironmentUpdateResponse, type TargetEnvironmentListResponse as TargetEnvironmentListResponse, type TargetEnvironmentDeleteResponse as TargetEnvironmentDeleteResponse, type TargetEnvironmentEditResponse as TargetEnvironmentEditResponse, type TargetEnvironmentGetResponse as TargetEnvironmentGetResponse, type TargetEnvironmentListResponsesV4PagePaginationArray as TargetEnvironmentListResponsesV4PagePaginationArray, type TargetEnvironmentCreateParams as TargetEnvironmentCreateParams, type TargetEnvironmentUpdateParams as TargetEnvironmentUpdateParams, type TargetEnvironmentListParams as TargetEnvironmentListParams, type TargetEnvironmentDeleteParams as TargetEnvironmentDeleteParams, type TargetEnvironmentEditParams as TargetEnvironmentEditParams, type TargetEnvironmentGetParams as TargetEnvironmentGetParams, };
}
//# sourceMappingURL=target-environments.d.ts.map