cloudflare
Version:
The official TypeScript library for the Cloudflare API
97 lines • 2.83 kB
TypeScript
import { APIResource } from "../../../core/resource.js";
import { APIPromise } from "../../../core/api-promise.js";
import { PagePromise, SinglePage } from "../../../core/pagination.js";
import { RequestOptions } from "../../../internal/request-options.js";
export declare class BaseCategories extends APIResource {
static readonly _key: readonly ['zeroTrust', 'resourceLibrary', 'categories'];
/**
* List application categories.
*
* @example
* ```ts
* // Automatically fetches more pages as needed.
* for await (const categoryListResponse of client.zeroTrust.resourceLibrary.categories.list(
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* )) {
* // ...
* }
* ```
*/
list(params: CategoryListParams, options?: RequestOptions): PagePromise<CategoryListResponsesSinglePage, CategoryListResponse>;
/**
* Get application category by ID.
*
* @example
* ```ts
* const category =
* await client.zeroTrust.resourceLibrary.categories.get(
* 12,
* { account_id: '023e105f4ecef8ad9ca31a8372d0c353' },
* );
* ```
*/
get(id: number, params: CategoryGetParams, options?: RequestOptions): APIPromise<CategoryGetResponse>;
}
export declare class Categories extends BaseCategories {
}
export type CategoryListResponsesSinglePage = SinglePage<CategoryListResponse>;
export interface CategoryListResponse {
/**
* Returns the category ID.
*/
id: number;
/**
* Returns the category creation time.
*/
created_at: string;
/**
* Returns the category description.
*/
description: string;
/**
* Returns the category name.
*/
name: string;
}
export interface CategoryGetResponse {
/**
* Returns the category ID.
*/
id: number;
/**
* Returns the category creation time.
*/
created_at: string;
/**
* Returns the category description.
*/
description: string;
/**
* Returns the category name.
*/
name: string;
}
export interface CategoryListParams {
/**
* Path param: Account ID.
*/
account_id: string;
/**
* Query param: Limit of number of results to return.
*/
limit?: number;
/**
* Query param: Offset of results to return.
*/
offset?: number;
}
export interface CategoryGetParams {
/**
* Account ID.
*/
account_id: string;
}
export declare namespace Categories {
export { type CategoryListResponse as CategoryListResponse, type CategoryGetResponse as CategoryGetResponse, type CategoryListResponsesSinglePage as CategoryListResponsesSinglePage, type CategoryListParams as CategoryListParams, type CategoryGetParams as CategoryGetParams, };
}
//# sourceMappingURL=categories.d.ts.map