diff --git a/src/resources/ApiKeys/ApiKeys.ts b/src/resources/ApiKeys/ApiKeys.ts index ecf4925d5..693238337 100644 --- a/src/resources/ApiKeys/ApiKeys.ts +++ b/src/resources/ApiKeys/ApiKeys.ts @@ -10,7 +10,7 @@ export default class ApiKey extends Resource { return this.api.get(ApiKey.baseUrl); } - create(apiKey: New, options?: CreateApiKeyOptions) { + create(apiKey: New, options?: CreateApiKeyOptions) { return this.api.post(this.buildPath(ApiKey.baseUrl, options), apiKey); } diff --git a/src/resources/ApiKeys/ApiKeysInterfaces.ts b/src/resources/ApiKeys/ApiKeysInterfaces.ts index e936d0072..98b80367b 100644 --- a/src/resources/ApiKeys/ApiKeysInterfaces.ts +++ b/src/resources/ApiKeys/ApiKeysInterfaces.ts @@ -1,5 +1,5 @@ import {GranularResource, PrivilegeModel} from '../BaseInterfaces.js'; - +import { ApiKeyStatus } from '../Enums.js'; export interface ApiKeyModel extends GranularResource { /** * The unique identifier of the [organization](https://docs.coveo.com/en/222/) the API key was created for. @@ -10,7 +10,7 @@ export interface ApiKeyModel extends GranularResource { * * **Example:** t4hk287bfj5sg6wskg64ckk5a */ - id?: string; + id: string; /** * Whether the API key is enabled. */ @@ -84,6 +84,18 @@ export interface ApiKeyModel extends GranularResource { * Additional configuration to be included in an API key. [to be revised] */ additionalConfiguration?: AdditionalConfigurationModel; + /** + * The expiration date of the API key. + */ + expirationDate?: number; + /** + * The status of the API key. + */ + status?: ApiKeyStatus; + /** + * The ID of the template to which the API key is bound. + */ + apiKeyTemplateId?: string } export interface CreateApiKeyOptions { @@ -138,4 +150,4 @@ interface EnforceQueryPipelineConfigurationModel { interface ImpersonationRestrictionsModel { allowedUserIds: QueryAuthenticationModel[]; -} +} \ No newline at end of file diff --git a/src/resources/Enums.ts b/src/resources/Enums.ts index 0b40a7adc..57adf1b58 100644 --- a/src/resources/Enums.ts +++ b/src/resources/Enums.ts @@ -1168,3 +1168,12 @@ export enum ProductsSortByType { export enum FeedbackConsumerType { SOURCE_MANAGEMENT_IMPROVEMENTS = 'SOURCE_MANAGEMENT_IMPROVEMENTS', } + +export enum ApiKeyStatus { + ENABLED='EXPIRED', + DISABLED='DISABLED', + DISABLED_FOR_INACTIVITY='DISABLED_FOR_INACTIVITY', + EXPIRED='EXPIRED', + SOON_TO_BE_EXPIRED='SOON_TO_BE_EXPIRED', + SOON_TO_BE_DISABLED='SOON_TO_BE_DISABLED' +}