// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. import { APIResource } from '../../../core/resource'; import { PagePromise, SinglePage } from '../../../core/pagination'; import { RequestOptions } from '../../../internal/request-options'; import { path } from '../../../internal/utils/path'; export class BaseReferences extends APIResource { static override readonly _key: readonly ['loadBalancers', 'monitors', 'references'] = Object.freeze([ 'loadBalancers', 'monitors', 'references', ] as const); /** * Get the list of resources that reference the provided monitor. * * @example * ```ts * // Automatically fetches more pages as needed. * for await (const referenceGetResponse of client.loadBalancers.monitors.references.get( * 'f1aba936b94213e5b8dca0c0dbf1f9cc', * { account_id: '023e105f4ecef8ad9ca31a8372d0c353' }, * )) { * // ... * } * ``` */ get( monitorID: string, params: ReferenceGetParams, options?: RequestOptions, ): PagePromise { const { account_id } = params; return this._client.getAPIList( path`/accounts/${account_id}/load_balancers/monitors/${monitorID}/references`, SinglePage, options, ); } } export class References extends BaseReferences {} export type ReferenceGetResponsesSinglePage = SinglePage; export interface ReferenceGetResponse { reference_type?: '*' | 'referral' | 'referrer'; resource_id?: string; resource_name?: string; resource_type?: string; } export interface ReferenceGetParams { /** * Identifier. */ account_id: string; } export declare namespace References { export { type ReferenceGetResponse as ReferenceGetResponse, type ReferenceGetResponsesSinglePage as ReferenceGetResponsesSinglePage, type ReferenceGetParams as ReferenceGetParams, }; }