import { APIResource } from "../../../core/resource.mjs"; import { APIPromise } from "../../../core/api-promise.mjs"; import { PagePromise, V4PagePaginationArray, type V4PagePaginationArrayParams } from "../../../core/pagination.mjs"; import { RequestOptions } from "../../../internal/request-options.mjs"; export declare class BaseCredentials extends APIResource { static readonly _key: readonly ['vulnerabilityScanner', 'credentialSets', 'credentials']; /** * Creates a new credential within a credential set. * * @example * ```ts * const credential = * await client.vulnerabilityScanner.credentialSets.credentials.create( * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * location: 'header', * location_name: 'Authorization', * name: 'Admin API key', * value: 'Bearer EXAMPLE_TOKEN', * }, * ); * ``` */ create(credentialSetID: string, params: CredentialCreateParams, options?: RequestOptions): APIPromise; /** * Replaces a credential. All fields must be provided. * * @example * ```ts * const credential = * await client.vulnerabilityScanner.credentialSets.credentials.update( * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * credential_set_id: * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * location: 'header', * location_name: 'Authorization', * name: 'Admin API key', * value: 'Bearer EXAMPLE_TOKEN', * }, * ); * ``` */ update(credentialID: string, params: CredentialUpdateParams, options?: RequestOptions): APIPromise; /** * Returns all credentials within a credential set. * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const credentialListResponse of client.vulnerabilityScanner.credentialSets.credentials.list( * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * )) { * // ... * } * ``` */ list(credentialSetID: string, params: CredentialListParams, options?: RequestOptions): PagePromise; /** * Deletes a credential. * * @example * ```ts * const credential = * await client.vulnerabilityScanner.credentialSets.credentials.delete( * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * credential_set_id: * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * }, * ); * ``` */ delete(credentialID: string, params: CredentialDeleteParams, options?: RequestOptions): APIPromise; /** * Updates a credential with only the provided fields; omitted fields remain * unchanged. * * @example * ```ts * const response = * await client.vulnerabilityScanner.credentialSets.credentials.edit( * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * credential_set_id: * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * }, * ); * ``` */ edit(credentialID: string, params: CredentialEditParams, options?: RequestOptions): APIPromise; /** * Returns a single credential by ID. * * @example * ```ts * const credential = * await client.vulnerabilityScanner.credentialSets.credentials.get( * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * { * account_id: '023e105f4ecef8ad9ca31a8372d0c353', * credential_set_id: * '182bd5e5-6e1a-4fe4-a799-aa6d9a6ab26e', * }, * ); * ``` */ get(credentialID: string, params: CredentialGetParams, options?: RequestOptions): APIPromise; } export declare class Credentials extends BaseCredentials { } export type CredentialListResponsesV4PagePaginationArray = V4PagePaginationArray; /** * A credential attached to API requests during scanning. The credential `value` is * write-only and never returned in responses. */ export interface CredentialCreateResponse { /** * Credential identifier. */ id: string; /** * Parent credential set identifier. */ credential_set_id: string; /** * Where the credential is attached in outgoing requests. */ location: 'header' | 'cookie'; /** * Name of the header or cookie where the credential is attached. */ location_name: string; /** * Human-readable name. */ name: string; } /** * A credential attached to API requests during scanning. The credential `value` is * write-only and never returned in responses. */ export interface CredentialUpdateResponse { /** * Credential identifier. */ id: string; /** * Parent credential set identifier. */ credential_set_id: string; /** * Where the credential is attached in outgoing requests. */ location: 'header' | 'cookie'; /** * Name of the header or cookie where the credential is attached. */ location_name: string; /** * Human-readable name. */ name: string; } /** * A credential attached to API requests during scanning. The credential `value` is * write-only and never returned in responses. */ export interface CredentialListResponse { /** * Credential identifier. */ id: string; /** * Parent credential set identifier. */ credential_set_id: string; /** * Where the credential is attached in outgoing requests. */ location: 'header' | 'cookie'; /** * Name of the header or cookie where the credential is attached. */ location_name: string; /** * Human-readable name. */ name: string; } export type CredentialDeleteResponse = unknown; /** * A credential attached to API requests during scanning. The credential `value` is * write-only and never returned in responses. */ export interface CredentialEditResponse { /** * Credential identifier. */ id: string; /** * Parent credential set identifier. */ credential_set_id: string; /** * Where the credential is attached in outgoing requests. */ location: 'header' | 'cookie'; /** * Name of the header or cookie where the credential is attached. */ location_name: string; /** * Human-readable name. */ name: string; } /** * A credential attached to API requests during scanning. The credential `value` is * write-only and never returned in responses. */ export interface CredentialGetResponse { /** * Credential identifier. */ id: string; /** * Parent credential set identifier. */ credential_set_id: string; /** * Where the credential is attached in outgoing requests. */ location: 'header' | 'cookie'; /** * Name of the header or cookie where the credential is attached. */ location_name: string; /** * Human-readable name. */ name: string; } export interface CredentialCreateParams { /** * Path param: Identifier. */ account_id: string; /** * Body param: Where the credential is attached in outgoing requests. */ location: 'header' | 'cookie'; /** * Body param: Name of the header or cookie where the credential is attached. */ location_name: string; /** * Body param: Human-readable name. */ name: string; /** * Body param: The credential value (e.g. API key, session token). Write-only. * Never returned in responses. */ value: string; } export interface CredentialUpdateParams { /** * Path param: Identifier. */ account_id: string; /** * Path param: Credential set identifier. */ credential_set_id: string; /** * Body param: Where the credential is attached in outgoing requests. */ location: 'header' | 'cookie'; /** * Body param: Name of the header or cookie where the credential is attached. */ location_name: string; /** * Body param: Human-readable name. */ name: string; /** * Body param: The credential value. Write-only. Never returned in responses. */ value: string; } export interface CredentialListParams extends V4PagePaginationArrayParams { /** * Path param: Identifier. */ account_id: string; } export interface CredentialDeleteParams { /** * Identifier. */ account_id: string; /** * Credential set identifier. */ credential_set_id: string; } export interface CredentialEditParams { /** * Path param: Identifier. */ account_id: string; /** * Path param: Credential set identifier. */ credential_set_id: string; /** * Body param: Where the credential is attached in outgoing requests. */ location?: 'header' | 'cookie'; /** * Body param: Name of the header or cookie where the credential is attached. */ location_name?: string; /** * Body param: Human-readable name. */ name?: string; /** * Body param: The credential value. Write-only. Never returned in responses. */ value?: string; } export interface CredentialGetParams { /** * Identifier. */ account_id: string; /** * Credential set identifier. */ credential_set_id: string; } export declare namespace Credentials { export { type CredentialCreateResponse as CredentialCreateResponse, type CredentialUpdateResponse as CredentialUpdateResponse, type CredentialListResponse as CredentialListResponse, type CredentialDeleteResponse as CredentialDeleteResponse, type CredentialEditResponse as CredentialEditResponse, type CredentialGetResponse as CredentialGetResponse, type CredentialListResponsesV4PagePaginationArray as CredentialListResponsesV4PagePaginationArray, type CredentialCreateParams as CredentialCreateParams, type CredentialUpdateParams as CredentialUpdateParams, type CredentialListParams as CredentialListParams, type CredentialDeleteParams as CredentialDeleteParams, type CredentialEditParams as CredentialEditParams, type CredentialGetParams as CredentialGetParams, }; } //# sourceMappingURL=credentials.d.mts.map