keys.d.ts 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. import { BaseCollection } from "./base_collection";
  2. import { Key } from "../models/key";
  3. import { KeyParamsWithPagination } from "../interfaces/key_params_with_pagination";
  4. import { PaginatedResult } from "../interfaces/paginated_result";
  5. import { ProjectOnly } from "../interfaces/project_only";
  6. import { CreateKeyData } from "../types/create_key_data";
  7. import { UpdateKeyData } from "../types/update_key_data";
  8. import { BulkResult } from "../interfaces/bulk_result";
  9. interface GetKeyParams extends ProjectOnly {
  10. disable_references?: number;
  11. }
  12. type CreateKeyParams = {
  13. keys?: CreateKeyData[];
  14. use_automations?: boolean;
  15. };
  16. export type UpdateKeyDataWithId = UpdateKeyData & {
  17. key_id: string | number;
  18. };
  19. export type BulkUpdateKeyParams = {
  20. keys?: UpdateKeyDataWithId[];
  21. use_automations?: boolean;
  22. };
  23. type KeyDeleted = {
  24. project_id: string;
  25. key_removed: boolean;
  26. keys_locked?: number;
  27. };
  28. type KeysBulkDeleted = {
  29. project_id: string;
  30. keys_removed: boolean;
  31. keys_locked: number;
  32. };
  33. export declare class Keys extends BaseCollection {
  34. protected static rootElementName: string;
  35. protected static rootElementNameSingular: string;
  36. protected static prefixURI: string;
  37. protected static elementClass: typeof Key;
  38. list(request_params: KeyParamsWithPagination): Promise<PaginatedResult<Key>>;
  39. create(key_params: CreateKeyParams, request_params: ProjectOnly): Promise<BulkResult<Key>>;
  40. get(key_id: string | number, request_params: GetKeyParams): Promise<Key>;
  41. update(key_id: string | number, key_params: UpdateKeyData, request_params: ProjectOnly): Promise<Key>;
  42. delete(key_id: string | number, request_params: ProjectOnly): Promise<KeyDeleted>;
  43. bulk_update(key_params: BulkUpdateKeyParams, request_params: ProjectOnly): Promise<BulkResult<Key>>;
  44. bulk_delete(key_ids: number[] | string[], request_params: ProjectOnly): Promise<KeysBulkDeleted>;
  45. }
  46. export {};