import { HttpService, IHttpCancelRequestToken, IHttpService } from '@kontent-ai/core-sdk'; import { AssetElementsBuilder, AssetRenditionModels, CollectionModels, CustomAppModels, LanguageVariantElementsBuilder, LanguageVariantModels, PreviewModels, ProjectUserModels, SpaceModels, WebSpotlightModels } from '../models'; import { IManagementClientConfig } from '../config'; import { ContentItemContracts, LanguageVariantContracts } from '../contracts'; import { AssetFolderModels, AssetModels, ContentTypeElementsBuilder, ContentTypeModels, ContentTypeSnippetElements, ContentTypeSnippetModels, LanguageModels, TaxonomyModels, WebhookModels, WorkflowModels } from '../models'; import { AddAssetFoldersQuery, AddAssetQuery, AddContentItemQuery, AddContentTypeQuery, AddContentTypeSnippetQuery, AddLanguageQuery, AddTaxonomyQuery, AddWebhookQuery, AssetIdentifierQuery, CancelScheduledPublishingOfLanguageVariantQuery, ContentItemIdentifierQuery, ContentTypeCodenameAndIdIdentifierQuery, ContentTypeIdentifierQuery, CreateNewVersionOfLanguageVariantQuery, DataQuery, DataQueryOptional, DeleteAssetQuery, DeleteContentItemQuery, DeleteContentTypeQuery, DeleteContentTypeSnippetQuery, DeleteLanguageVariantQuery, DeleteTaxonomyQuery, DeleteWebhookQuery, GetTaxonomyQuery, GetWebhookQuery, LanguageIdAndCodenameIdentifierQuery, LanguageIdentifierQuery, ListAssetFoldersQuery, ListAssetsQuery, ListContentItemsQuery, ListContentTypeSnippetsQuery, ListContentTypesQuery, ListLanguagesQuery, ListLanguageVariantsOfContentTypeQuery, ListLanguageVariantsOfContentTypeWithComponentsQuery, ListLanguageVariantsOfItemQuery, ListLanguageVariantsBySpaceQuery, ListTaxonomiesQuery, ListWebhooksQuery, ModifyAssetFoldersQuery, ModifyContentTypeQuery, ModifyContentTypeSnippetQuery, ModifyLanguageQuery, EnvironmentIdentifierQuery, EnvironmentInformationQuery, PublishLanguageVariantQuery, TaxonomyIdentifierQuery, UnpublishLanguageVariantQuery, UpdateContentItemQuery, UploadBinaryFileQuery, UpsertAssetQuery, UpsertContentItemQuery, UpsertLanguageVariantQuery, ViewAssetsQuery, ViewContentItemQuery, ViewContentTypeQuery, ViewContentTypeSnippetQuery, ViewLanguageQuery, ViewLanguageVariantQuery, WebhookIdentifierQuery, ModifyTaxonomyQuery, PostQuery, ActionQuery, PatchQuery, PutQuery, DeleteQuery, GetQuery, CancelScheduledUnpublishingOfLanguageVariantQuery, EnableWebhookQuery, DisableWebhookQuery, ListCollectionsQuery, CollectionIdentifierQuery, ListLanguageVariantsByCollectionQuery, SetCollectionsQuery, UploadAssetFromUrlQuery, ListSubscriptionProjectsQuery, ViewSubscriptionProjectQuery, ListSubscriptionUsersQuery, UserIdentifierQuery, ViewSubscriptionUserQuery, ActivateUserInAllProjectsQuery, DeactivateUserInAllProjectsQuery, ListRolesQuery, InviteProjectUserQuery, ChangeUserRolesQuery, RoleIdentifierQuery, ViewRoleQuery, ListAssetRenditionsQuery, ModifyAssetRenditionQuery, AddAssetRenditionQuery, RenditionIdentifierQuery, ViewAssetRenditionQuery, ChangeWorkflowOfLanguageOrVariantQuery, ListWorkflowsQuery, WorkflowIdentifierQuery, DeleteWorkflowQuery, AddWorkflowQuery, UpdateWorkflowQuery, StartEnvironmentValidationQuery, TaskIdentifierQuery, CheckEnvironmentValidationQuery, ListEnvironmentValidationIssuesQuery, AddSpaceQuery, DeleteSpaceQuery, ListSpacesQuery, ModifySpaceQuery, ViewSpaceQuery, SpaceIdentifierQuery, GetPreviewConfigurationQuery, ModifyPreviewConfigurationQuery, GetLivePreviewConfigurationQuery, ChangeLivePreviewConfigurationQuery, ActivateWebSpotlightQuery, DeactivateWebSpotlightQuery, CheckWebSpotlightStatusQuery, ListCustomAppsQuery, AddCustomAppQuery, CustomAppsIdentifierQuery, GetCustomAppQuery, ModifyCustomAppQuery, DeleteCustomAppQuery, FilterItemsWithVariantsQuery, BulkGetItemsWithVariantsQuery } from '../queries'; import { sdkInfo } from '../sdk-info.generated'; import { ManagementQueryService, IMappingService, MappingService } from '../services'; import { IManagementClient } from './imanagement-client.interface'; import { CancelToken } from 'axios'; import { GetEnvironmentCloningStateQuery } from '../queries/environments'; import { DeleteEnvironmentQuery } from '../queries/environments/delete-environment-query'; import { EnvironmentModels } from '../models/environments/environment.models'; import { CloneEnvironmentQuery } from '../queries/environments/clone-environment-query'; import { MarkEnvironmentAsProductionQuery } from '../queries/environments/mark-environment-as-production-query'; import { ModifyEnvironmentQuery } from '../queries/environments/modify-environment-query'; export class ManagementClient implements IManagementClient { protected readonly queryService: ManagementQueryService; private httpService: IHttpService; public readonly mappingService: IMappingService = new MappingService(); constructor(protected readonly config: IManagementClientConfig) { const httpService = config.httpService ? config.httpService : new HttpService(); this.queryService = new ManagementQueryService(config, httpService, { host: sdkInfo.host, name: sdkInfo.name, version: sdkInfo.version }); this.httpService = httpService; } filterItemsWithVariants(): DataQuery { return new DataQuery( this.config, this.queryService, (config, queryService, data) => new FilterItemsWithVariantsQuery(config, queryService, data) ); } bulkGetItemsWithVariants(): DataQuery { return new DataQuery( this.config, this.queryService, (config, queryService, data) => new BulkGetItemsWithVariantsQuery(config, queryService, data) ); } createCancelToken(): IHttpCancelRequestToken { return this.httpService.createCancelToken(); } post(): ActionQuery> { return new ActionQuery>( this.config, this.queryService, (config, queryService, action) => new DataQuery( config, queryService, (nConfig, nQueryService, data) => new PostQuery(nConfig, nQueryService, action, data) ) ); } patch(): ActionQuery> { return new ActionQuery>( this.config, this.queryService, (config, queryService, action) => new DataQuery( config, queryService, (nConfig, nQueryService, data) => new PatchQuery(nConfig, nQueryService, action, data) ) ); } put(): ActionQuery> { return new ActionQuery>( this.config, this.queryService, (config, queryService, action) => new DataQuery( config, queryService, (nConfig, nQueryService, data) => new PutQuery(nConfig, nQueryService, action, data) ) ); } delete(): ActionQuery { return new ActionQuery( this.config, this.queryService, (config, queryService, action) => new DeleteQuery(config, queryService, action) ); } get(): ActionQuery { return new ActionQuery( this.config, this.queryService, (config, queryService, action) => new GetQuery(config, queryService, action) ); } createNewVersionOfLanguageVariant(): ContentItemIdentifierQuery< LanguageIdAndCodenameIdentifierQuery > { return new ContentItemIdentifierQuery< LanguageIdAndCodenameIdentifierQuery >( this.config, this.queryService, (config, queryService, contentItemIdentifier) => new LanguageIdAndCodenameIdentifierQuery( config, queryService, (nConfig, nQueryService, languageIdentifier) => new CreateNewVersionOfLanguageVariantQuery( nConfig, nQueryService, contentItemIdentifier, languageIdentifier ) ) ); } unpublishLanguageVariant(): ContentItemIdentifierQuery< LanguageIdAndCodenameIdentifierQuery< DataQueryOptional > > { return new ContentItemIdentifierQuery< LanguageIdAndCodenameIdentifierQuery< DataQueryOptional > >( this.config, this.queryService, (config, queryService, contentItemIdentifier) => new LanguageIdAndCodenameIdentifierQuery< DataQueryOptional >( config, queryService, (nConfig, nQueryService, languageIdentifier) => new DataQueryOptional< UnpublishLanguageVariantQuery, WorkflowModels.IUnpublishLanguageVarianthData >( nConfig, nQueryService, (pConfig, pQueryService, data) => new UnpublishLanguageVariantQuery( pConfig, pQueryService, contentItemIdentifier, languageIdentifier, data ) ) ) ); } cancelSheduledPublishingOfLanguageVariant(): ContentItemIdentifierQuery< LanguageIdAndCodenameIdentifierQuery > { return new ContentItemIdentifierQuery< LanguageIdAndCodenameIdentifierQuery >( this.config, this.queryService, (config, queryService, contentItemIdentifier) => new LanguageIdAndCodenameIdentifierQuery( config, queryService, (nConfig, nQueryService, languageIdentifier) => new CancelScheduledPublishingOfLanguageVariantQuery( nConfig, nQueryService, contentItemIdentifier, languageIdentifier ) ) ); } cancelSheduledUnpublishingOfLanguageVariant(): ContentItemIdentifierQuery< LanguageIdAndCodenameIdentifierQuery > { return new ContentItemIdentifierQuery< LanguageIdAndCodenameIdentifierQuery >( this.config, this.queryService, (config, queryService, contentItemIdentifier) => new LanguageIdAndCodenameIdentifierQuery( config, queryService, (nConfig, nQueryService, languageIdentifier) => new CancelScheduledUnpublishingOfLanguageVariantQuery( nConfig, nQueryService, contentItemIdentifier, languageIdentifier ) ) ); } changeWorkflowOfLanguageVariant(): ContentItemIdentifierQuery< LanguageIdAndCodenameIdentifierQuery< DataQuery > > { return new ContentItemIdentifierQuery< LanguageIdAndCodenameIdentifierQuery< DataQuery > >( this.config, this.queryService, (config, queryService, contentItemIdentifier) => new LanguageIdAndCodenameIdentifierQuery< DataQuery< ChangeWorkflowOfLanguageOrVariantQuery, WorkflowModels.IChangeWorkflowOfLanguageVariantData > >( config, queryService, (nConfig, nQueryService, languageIdentifier) => new DataQuery< ChangeWorkflowOfLanguageOrVariantQuery, WorkflowModels.IChangeWorkflowOfLanguageVariantData >(nConfig, nQueryService, (mConfig, mQueryservice, data) => { return new ChangeWorkflowOfLanguageOrVariantQuery( config, queryService, contentItemIdentifier, languageIdentifier, data ); }) ) ); } listWorkflows(): ListWorkflowsQuery { return new ListWorkflowsQuery(this.config, this.queryService); } deleteWorkflow(): WorkflowIdentifierQuery { return new WorkflowIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new DeleteWorkflowQuery(config, queryService, identifier) ); } addWorkflow(): DataQuery { return new DataQuery( this.config, this.queryService, (config, queryService, data) => new AddWorkflowQuery(config, queryService, data) ); } updateWorkflow(): WorkflowIdentifierQuery> { return new WorkflowIdentifierQuery>( this.config, this.queryService, (config, queryService, identifier) => new DataQuery( config, queryService, (nConfig, nQueryService, data) => new UpdateWorkflowQuery(nConfig, nQueryService, data, identifier) ) ); } publishLanguageVariant(): ContentItemIdentifierQuery< LanguageIdAndCodenameIdentifierQuery< DataQueryOptional > > { return new ContentItemIdentifierQuery< LanguageIdAndCodenameIdentifierQuery< DataQueryOptional > >( this.config, this.queryService, (config, queryService, contentItemIdentifier) => new LanguageIdAndCodenameIdentifierQuery< DataQueryOptional >( config, queryService, (nConfig, nQueryService, languageIdentifier) => new DataQueryOptional( nConfig, nQueryService, (pConfig, pQueryService, data) => new PublishLanguageVariantQuery( pConfig, pQueryService, contentItemIdentifier, languageIdentifier, data ) ) ) ); } listContentTypeSnippets(): ListContentTypeSnippetsQuery { return new ListContentTypeSnippetsQuery(this.config, this.queryService); } viewContentTypeSnippet(): ContentTypeIdentifierQuery { return new ContentTypeIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new ViewContentTypeSnippetQuery(config, queryService, identifier) ); } deleteContentTypeSnippet(): ContentTypeIdentifierQuery { return new ContentTypeIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new DeleteContentTypeSnippetQuery(config, queryService, identifier) ); } addContentTypeSnippet(): DataQuery< AddContentTypeSnippetQuery, (builder: ContentTypeSnippetElements) => ContentTypeSnippetModels.IAddContentTypeSnippetData > { return new DataQuery< AddContentTypeSnippetQuery, (builder: ContentTypeSnippetElements) => ContentTypeSnippetModels.IAddContentTypeSnippetData >( this.config, this.queryService, (config, queryService, data) => new AddContentTypeSnippetQuery(config, queryService, data) ); } viewLanguageVariant(): ContentItemIdentifierQuery> { return new ContentItemIdentifierQuery>( this.config, this.queryService, (config, queryService, contentItemIdentifier) => new LanguageIdAndCodenameIdentifierQuery( config, queryService, (nConfig, nQueryService, languageIdentifier) => new ViewLanguageVariantQuery(nConfig, nQueryService, contentItemIdentifier, languageIdentifier) ) ); } upsertLanguageVariant(): ContentItemIdentifierQuery< LanguageIdAndCodenameIdentifierQuery< DataQuery< UpsertLanguageVariantQuery, (builder: LanguageVariantElementsBuilder) => LanguageVariantContracts.IUpsertLanguageVariantPostContract > > > { return new ContentItemIdentifierQuery< LanguageIdAndCodenameIdentifierQuery< DataQuery< UpsertLanguageVariantQuery, ( builder: LanguageVariantElementsBuilder ) => LanguageVariantContracts.IUpsertLanguageVariantPostContract > > >( this.config, this.queryService, (config, queryService, contentItemIdentifier) => new LanguageIdAndCodenameIdentifierQuery< DataQuery< UpsertLanguageVariantQuery, ( builder: LanguageVariantElementsBuilder ) => LanguageVariantContracts.IUpsertLanguageVariantPostContract > >( config, queryService, (nConfig, nQueryService, languageIdentifier) => new DataQuery< UpsertLanguageVariantQuery, ( builder: LanguageVariantElementsBuilder ) => LanguageVariantContracts.IUpsertLanguageVariantPostContract >( nConfig, nQueryService, (mConfig, mQueryService, elements) => new UpsertLanguageVariantQuery( mConfig, mQueryService, contentItemIdentifier, languageIdentifier, elements ) ) ) ); } deleteLanguageVariant(): ContentItemIdentifierQuery< LanguageIdAndCodenameIdentifierQuery > { return new ContentItemIdentifierQuery>( this.config, this.queryService, (config, queryService, contentItemIdentifier) => new LanguageIdAndCodenameIdentifierQuery( config, queryService, (nConfig, nQueryService, languageIdentifier) => new DeleteLanguageVariantQuery( nConfig, nQueryService, contentItemIdentifier, languageIdentifier ) ) ); } startEnvironmentValidation(): StartEnvironmentValidationQuery { return new StartEnvironmentValidationQuery(this.config, this.queryService); } checkEnvironmentValidation(): TaskIdentifierQuery { return new TaskIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new CheckEnvironmentValidationQuery(config, queryService, identifier) ); } listEnvironmentValidationIssues(): TaskIdentifierQuery { return new TaskIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new ListEnvironmentValidationIssuesQuery(config, queryService, identifier) ); } deleteContentType(): ContentTypeIdentifierQuery { return new ContentTypeIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new DeleteContentTypeQuery(config, queryService, identifier) ); } addContentType(): DataQuery< AddContentTypeQuery, (builder: ContentTypeElementsBuilder) => ContentTypeModels.IAddContentTypeData > { return new DataQuery< AddContentTypeQuery, (builder: ContentTypeElementsBuilder) => ContentTypeModels.IAddContentTypeData >( this.config, this.queryService, (config, queryService, data) => new AddContentTypeQuery(config, queryService, data) ); } modifyContentTypeSnippet(): ContentTypeIdentifierQuery< DataQuery > { return new ContentTypeIdentifierQuery< DataQuery >( this.config, this.queryService, (config, queryService, identifier) => new DataQuery( config, queryService, (nConfig, nQueryService, data) => new ModifyContentTypeSnippetQuery(nConfig, nQueryService, identifier, data) ) ); } modifyContentType(): ContentTypeIdentifierQuery< DataQuery > { return new ContentTypeIdentifierQuery< DataQuery >( this.config, this.queryService, (config, queryService, identifier) => new DataQuery( config, queryService, (nConfig, nQueryService, data) => new ModifyContentTypeQuery(nConfig, nQueryService, identifier, data) ) ); } modifyTaxonomy(): TaxonomyIdentifierQuery> { return new TaxonomyIdentifierQuery>( this.config, this.queryService, (config, queryService, identifier) => new DataQuery( config, queryService, (nConfig, nQueryService, data) => new ModifyTaxonomyQuery(nConfig, nQueryService, identifier, data) ) ); } viewContentType(): ContentTypeIdentifierQuery { return new ContentTypeIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new ViewContentTypeQuery(config, queryService, identifier) ); } listContentTypes(): ListContentTypesQuery { return new ListContentTypesQuery(this.config, this.queryService); } listAssetRenditions(): AssetIdentifierQuery { return new AssetIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new ListAssetRenditionsQuery(config, queryService, identifier) ); } addAssetRendition(): AssetIdentifierQuery< DataQuery > { return new AssetIdentifierQuery>( this.config, this.queryService, (config, queryService, identifier) => new DataQuery( config, queryService, (nConfig, nQueryService, data) => new AddAssetRenditionQuery(nConfig, nQueryService, identifier, data) ) ); } modifyAssetRendition(): AssetIdentifierQuery< RenditionIdentifierQuery> > { return new AssetIdentifierQuery< RenditionIdentifierQuery< DataQuery > >( this.config, this.queryService, (config, queryService, assetIdentifier) => new RenditionIdentifierQuery< DataQuery >(config, queryService, (mConfig, mQueryService, renditionIdentifier) => { return new DataQuery( config, queryService, (nConfig, nQueryService, data) => new ModifyAssetRenditionQuery( nConfig, nQueryService, assetIdentifier, renditionIdentifier, data ) ); }) ); } viewAssetRendition(): AssetIdentifierQuery> { return new AssetIdentifierQuery>( this.config, this.queryService, (config, queryService, assetIdentifier) => new RenditionIdentifierQuery( config, queryService, (xConfig, xQueryService, renditionIdentifier) => { return new ViewAssetRenditionQuery(config, queryService, assetIdentifier, renditionIdentifier); } ) ); } deleteTaxonomy(): TaxonomyIdentifierQuery { return new TaxonomyIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new DeleteTaxonomyQuery(config, queryService, identifier) ); } addTaxonomy(): DataQuery { return new DataQuery( this.config, this.queryService, (config, queryService, data) => new AddTaxonomyQuery(config, queryService, data) ); } listTaxonomies(): ListTaxonomiesQuery { return new ListTaxonomiesQuery(this.config, this.queryService); } getTaxonomy(): TaxonomyIdentifierQuery { return new TaxonomyIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new GetTaxonomyQuery(config, queryService, identifier) ); } deleteAsset(): AssetIdentifierQuery { return new AssetIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new DeleteAssetQuery(config, queryService, identifier) ); } upsertAsset(): AssetIdentifierQuery< DataQuery AssetModels.IUpsertAssetRequestData> > { return new AssetIdentifierQuery< DataQuery AssetModels.IUpsertAssetRequestData> >( this.config, this.queryService, (config, queryService, identifier) => new DataQuery AssetModels.IUpsertAssetRequestData>( this.config, this.queryService, (xConfig, xQueryService, data) => new UpsertAssetQuery(config, queryService, identifier, data) ) ); } addAsset(): DataQuery AssetModels.IAddAssetRequestData> { return new DataQuery AssetModels.IAddAssetRequestData>( this.config, this.queryService, (config, queryService, data) => new AddAssetQuery(config, queryService, data) ); } uploadBinaryFile(): DataQuery { return new DataQuery( this.config, this.queryService, (config, queryService, data) => new UploadBinaryFileQuery(config, queryService, data) ); } uploadAssetFromUrl(): DataQuery { return new DataQuery( this.config, this.queryService, (config, queryService, data) => new UploadAssetFromUrlQuery(config, queryService, data) ); } viewAsset(): AssetIdentifierQuery { return new AssetIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new ViewAssetsQuery(config, queryService, identifier) ); } listAssets(): ListAssetsQuery { return new ListAssetsQuery(this.config, this.queryService); } listContentItems(): ListContentItemsQuery { return new ListContentItemsQuery(this.config, this.queryService); } viewContentItem(): ContentItemIdentifierQuery { return new ContentItemIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new ViewContentItemQuery(config, queryService, identifier) ); } addContentItem(): DataQuery { return new DataQuery( this.config, this.queryService, (config, queryService, data) => new AddContentItemQuery(config, queryService, data) ); } updateContentItem(): ContentItemIdentifierQuery< DataQuery > { return new ContentItemIdentifierQuery< DataQuery >( this.config, this.queryService, (config, queryService, identifier) => new DataQuery( config, queryService, (nConfig, nQueryService, data) => new UpdateContentItemQuery(nConfig, nQueryService, data, identifier) ) ); } upsertContentItem(): ContentItemIdentifierQuery< DataQuery > { return new ContentItemIdentifierQuery< DataQuery >( this.config, this.queryService, (config, queryService, identifier) => new DataQuery( config, queryService, (nConfig, nQueryService, data) => new UpsertContentItemQuery(nConfig, nQueryService, data, identifier) ) ); } deleteContentItem(): ContentItemIdentifierQuery { return new ContentItemIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new DeleteContentItemQuery(config, queryService, identifier) ); } listLanguageVariantsOfItem(): ContentItemIdentifierQuery { return new ContentItemIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new ListLanguageVariantsOfItemQuery(config, queryService, identifier) ); } listLanguageVariantsOfContentType(): ContentTypeCodenameAndIdIdentifierQuery { return new ContentTypeCodenameAndIdIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new ListLanguageVariantsOfContentTypeQuery(config, queryService, identifier) ); } listLanguageVariantsByCollection(): CollectionIdentifierQuery { return new CollectionIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new ListLanguageVariantsByCollectionQuery(config, queryService, identifier) ); } listLanguageVariantsBySpace(): SpaceIdentifierQuery { return new SpaceIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new ListLanguageVariantsBySpaceQuery(config, queryService, identifier) ); } listLanguageVariantsOfContentTypeWithComponents(): ContentTypeCodenameAndIdIdentifierQuery { return new ContentTypeCodenameAndIdIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new ListLanguageVariantsOfContentTypeWithComponentsQuery(config, queryService, identifier) ); } listLanguages(): ListLanguagesQuery { return new ListLanguagesQuery(this.config, this.queryService); } viewLanguage(): LanguageIdentifierQuery { return new LanguageIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new ViewLanguageQuery(config, queryService, identifier) ); } addLanguage(): DataQuery { return new DataQuery( this.config, this.queryService, (config, queryService, data) => new AddLanguageQuery(config, queryService, data) ); } modifyLanguage(): LanguageIdentifierQuery> { return new LanguageIdentifierQuery>( this.config, this.queryService, (config, queryService, identifier) => new DataQuery( config, queryService, (nConfig, nQueryService, data) => new ModifyLanguageQuery(nConfig, nQueryService, identifier, data) ) ); } deleteWebhook(): WebhookIdentifierQuery { return new WebhookIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new DeleteWebhookQuery(config, queryService, identifier) ); } addWebhook(): DataQuery { return new DataQuery( this.config, this.queryService, (config, queryService, data) => new AddWebhookQuery(config, queryService, data) ); } enableWebhook(): WebhookIdentifierQuery { return new WebhookIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new EnableWebhookQuery(config, queryService, identifier) ); } disableWebhook(): WebhookIdentifierQuery { return new WebhookIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new DisableWebhookQuery(config, queryService, identifier) ); } getWebhook(): WebhookIdentifierQuery { return new WebhookIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new GetWebhookQuery(config, queryService, identifier) ); } listWebhooks(): ListWebhooksQuery { return new ListWebhooksQuery(this.config, this.queryService); } environmentInformation(): EnvironmentInformationQuery { return new EnvironmentInformationQuery(this.config, this.queryService); } listAssetFolders(): ListAssetFoldersQuery { return new ListAssetFoldersQuery(this.config, this.queryService); } addAssetFolders(): DataQuery { return new DataQuery( this.config, this.queryService, (config, queryService, data) => new AddAssetFoldersQuery(config, queryService, data) ); } modifyAssetFolders(): DataQuery { return new DataQuery( this.config, this.queryService, (config, queryService, data) => new ModifyAssetFoldersQuery(config, queryService, data) ); } listCollections(): ListCollectionsQuery { return new ListCollectionsQuery(this.config, this.queryService); } setCollections(): DataQuery { return new DataQuery( this.config, this.queryService, (config, queryService, data) => new SetCollectionsQuery(config, queryService, data) ); } createLanguageVariantEditUrl(data: { variantId: string; languageCodename: string; elementCodename?: string; nestedItemId?: string; nestedItemElementCodename?: string; }): string { let url: string = `https://app.kontent.ai/goto/edit-item/project/${this.config.environmentId}/variant-codename/${data.languageCodename}/item/${data.variantId}`; if (data.elementCodename) { url += `/element/${data.elementCodename}`; } if (data.nestedItemId) { url += `/item/${data.nestedItemId}`; if (data.nestedItemElementCodename) { url += `/element/${data.nestedItemElementCodename}`; } } return url; } listSubscriptionProjects(): ListSubscriptionProjectsQuery { return new ListSubscriptionProjectsQuery(this.config, this.queryService); } listSubscriptionUsers(): ListSubscriptionUsersQuery { return new ListSubscriptionUsersQuery(this.config, this.queryService); } viewSubscriptionProject(): EnvironmentIdentifierQuery { return new EnvironmentIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new ViewSubscriptionProjectQuery(config, queryService, identifier) ); } viewSubscriptionUser(): UserIdentifierQuery { return new UserIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new ViewSubscriptionUserQuery(config, queryService, identifier) ); } activateUserInAllProjects(): UserIdentifierQuery { return new UserIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new ActivateUserInAllProjectsQuery(config, queryService, identifier) ); } deactivateUserInAllProjects(): UserIdentifierQuery { return new UserIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new DeactivateUserInAllProjectsQuery(config, queryService, identifier) ); } listRoles(): ListRolesQuery { return new ListRolesQuery(this.config, this.queryService); } viewRole(): RoleIdentifierQuery { return new RoleIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new ViewRoleQuery(config, queryService, identifier) ); } getPreviewConfiguration(): GetPreviewConfigurationQuery { return new GetPreviewConfigurationQuery(this.config, this.queryService); } modifyPreviewConfiguration(): DataQuery< ModifyPreviewConfigurationQuery, PreviewModels.IModifyPreviewConfigurationData > { return new DataQuery( this.config, this.queryService, (config, queryService, data) => new ModifyPreviewConfigurationQuery(config, queryService, data) ); } getLivePreviewConfiguration(): GetLivePreviewConfigurationQuery { return new GetLivePreviewConfigurationQuery(this.config, this.queryService); } changeLivePreviewConfiguration(): DataQuery< ChangeLivePreviewConfigurationQuery, PreviewModels.IChangeLivePreviewConfigurationData > { return new DataQuery( this.config, this.queryService, (config, queryService, data) => new ChangeLivePreviewConfigurationQuery(config, queryService, data) ); } inviteUser(): DataQuery { return new DataQuery( this.config, this.queryService, (config, queryService, data) => new InviteProjectUserQuery(config, queryService, data) ); } changeUserRoles(): UserIdentifierQuery> { return new UserIdentifierQuery>( this.config, this.queryService, (config, queryService, identifier) => new DataQuery( config, queryService, (nConfig, nQueryService, data) => new ChangeUserRolesQuery(nConfig, nQueryService, identifier, data) ) ); } getEnvironmentCloningState(): GetEnvironmentCloningStateQuery { return new GetEnvironmentCloningStateQuery(this.config, this.queryService); } deleteEnvironment(): DeleteEnvironmentQuery { return new DeleteEnvironmentQuery(this.config, this.queryService); } modifyEnvironment(): DataQuery { return new DataQuery( this.config, this.queryService, (config, queryService, data) => new ModifyEnvironmentQuery(config, queryService, data) ); } cloneEnvironment(): DataQuery { return new DataQuery( this.config, this.queryService, (config, queryService, data) => new CloneEnvironmentQuery(config, queryService, data) ); } markEnvironmentAsProduction(): DataQuery< MarkEnvironmentAsProductionQuery, EnvironmentModels.IMarkEnvironmentAsProductionData > { return new DataQuery( this.config, this.queryService, (config, queryService, data) => new MarkEnvironmentAsProductionQuery(config, queryService, data) ); } addSpace(): DataQuery { return new DataQuery( this.config, this.queryService, (config, queryService, data) => new AddSpaceQuery(config, queryService, data) ); } deleteSpace(): SpaceIdentifierQuery { return new SpaceIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new DeleteSpaceQuery(config, queryService, identifier) ); } listSpaces(): ListSpacesQuery { return new ListSpacesQuery(this.config, this.queryService); } modifySpace(): SpaceIdentifierQuery> { return new SpaceIdentifierQuery>( this.config, this.queryService, (config, queryService, identifier) => new DataQuery( config, queryService, (nConfig, nQueryService, data) => new ModifySpaceQuery(nConfig, nQueryService, identifier, data) ) ); } viewSpace(): SpaceIdentifierQuery { return new SpaceIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new ViewSpaceQuery(config, queryService, identifier) ); } /** * @deprecated Web Spotlight has been discontinued and this method will be removed in a future version. */ activateWebSpotlight(): DataQuery { return new DataQuery( this.config, this.queryService, (config, queryService, data) => new ActivateWebSpotlightQuery(config, queryService, data) ); } /** * @deprecated Web Spotlight has been discontinued and this method will be removed in a future version. */ deactivateWebSpotlight(): DeactivateWebSpotlightQuery { return new DeactivateWebSpotlightQuery(this.config, this.queryService); } /** * @deprecated Web Spotlight has been discontinued and this method will be removed in a future version. */ checkWebSpotlightStatus(): CheckWebSpotlightStatusQuery { return new CheckWebSpotlightStatusQuery(this.config, this.queryService); } modifyCustomApp(): CustomAppsIdentifierQuery< DataQuery > { return new CustomAppsIdentifierQuery< DataQuery >( this.config, this.queryService, (config, queryService, identifier) => new DataQuery( config, queryService, (nConfig, nQueryService, data) => new ModifyCustomAppQuery(nConfig, nQueryService, identifier, data) ) ); } deleteCustomApp(): CustomAppsIdentifierQuery { return new CustomAppsIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new DeleteCustomAppQuery(config, queryService, identifier) ); } addCustomApp(): DataQuery { return new DataQuery( this.config, this.queryService, (config, queryService, data) => new AddCustomAppQuery(config, queryService, data) ); } listCustomApps(): ListCustomAppsQuery { return new ListCustomAppsQuery(this.config, this.queryService); } getCustomApp(): CustomAppsIdentifierQuery { return new CustomAppsIdentifierQuery( this.config, this.queryService, (config, queryService, identifier) => new GetCustomAppQuery(config, queryService, identifier) ); } }