// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

import { APIResource } from '../../resource';
import { isRequestOptions } from '../../core';
import * as Core from '../../core';
import { CursorPaginationAfter, type CursorPaginationAfterParams } from '../../pagination';

export class Keys extends APIResource {
  /**
   * Lists all distinct tag keys used across resources in an account.
   */
  list(
    params?: KeyListParams,
    options?: Core.RequestOptions,
  ): Core.PagePromise<KeyListResponsesCursorPaginationAfter, KeyListResponse>;
  list(
    options?: Core.RequestOptions,
  ): Core.PagePromise<KeyListResponsesCursorPaginationAfter, KeyListResponse>;
  list(
    params: KeyListParams | Core.RequestOptions = {},
    options?: Core.RequestOptions,
  ): Core.PagePromise<KeyListResponsesCursorPaginationAfter, KeyListResponse> {
    if (isRequestOptions(params)) {
      return this.list({}, params);
    }
    const { account_id = this._client.accountId, ...query } = params;
    return this._client.getAPIList(
      `/accounts/${account_id}/tags/keys`,
      KeyListResponsesCursorPaginationAfter,
      { query, ...options },
    );
  }
}

export class KeyListResponsesCursorPaginationAfter extends CursorPaginationAfter<KeyListResponse> {}

export type KeyListResponse = string;

export interface KeyListParams extends CursorPaginationAfterParams {
  /**
   * Path param: Identifier.
   */
  account_id?: string;
}

Keys.KeyListResponsesCursorPaginationAfter = KeyListResponsesCursorPaginationAfter;

export declare namespace Keys {
  export {
    type KeyListResponse as KeyListResponse,
    KeyListResponsesCursorPaginationAfter as KeyListResponsesCursorPaginationAfter,
    type KeyListParams as KeyListParams,
  };
}
