/** This is spectacularly generated code by spectacular based on Qlik Cloud Services APIs */ import Auth from '../auth/auth.js'; import ListableResource from '../listable.js'; import type { Config } from '../types/types.js'; export declare enum CollectionTypes { Private = "private", Public = "public", Publicgoverned = "publicgoverned" } export declare enum ItemResourceTypeEnum { App = "app", Collection = "collection", Qlikview = "qlikview", Insight = "insight", Qvapp = "qvapp", Genericlink = "genericlink", Sharingservicetask = "sharingservicetask", Note = "note", Dataasset = "dataasset", Dataset = "dataset", Automation = "automation", AutomlExperiment = "automl-experiment", AutomlDeployment = "automl-deployment" } export type CollectionLinksResponseBody = { items?: Link; self?: Link; [key: string]: any; }; export type CollectionMetaResponseBody = { /** Multiple items. */ items?: ItemsResultResponseBody; [key: string]: any; }; /** A collection. @param createdAt - The RFC3339 datetime when the collection was created. @param creatorId - The ID of the user who created the collection. This property is only populated if the JWT contains a userId. @param description - @param full - States if a collection has reached its items limit or not @param id - The collection's unique identifier. @param itemCount - The number of items that have been added to the collection that the user has access to. @param links - @param meta - Collection metadata and computed fields. @param name - @param tenantId - The ID of the tenant that owns the collection. This property is populated by using JWT. @param type - @param updatedAt - The RFC3339 datetime when the collection was last updated. @param updaterId - The ID of the user who last updated the collection. This property is only populated if the JWT contains a userId. @param auth - Auth object used to make requests */ export declare class CollectionResultResponseBody { auth: Auth; createdAt: string; creatorId?: string; description?: string; full?: boolean; id: string; itemCount: number; links: CollectionLinksResponseBody; meta?: CollectionMetaResponseBody; name: string; tenantId: string; type: 'private' | 'public' | 'favorite' | 'publicgoverned' | string; updatedAt: string; updaterId?: string; [key: string]: any; constructor({ createdAt, creatorId, description, full, id, itemCount, links, meta, name, tenantId, type, updatedAt, updaterId, ...rest }: { createdAt: string; creatorId?: string; description?: string; full?: boolean; id: string; itemCount: number; links: CollectionLinksResponseBody; meta?: CollectionMetaResponseBody; name: string; tenantId: string; type: 'private' | 'public' | 'favorite' | 'publicgoverned' | string; updatedAt: string; updaterId?: string; }, auth?: Auth); /** Removes an item from a collection. Removes an item from a collection. @param itemId - The item's unique identifier. */ deleteItem(itemId: string): Promise; /** Finds and returns an item. See GET /items/{id} Returns an item in a specific collection. @param itemId - The item's unique identifier. */ getItem(itemId: string): Promise; /** Finds and returns items from a collection that the user has access to. Retrieves items in a collection. @param limit - The maximum number of resources to return for a request. The limit must be an integer between 1 and 100 (inclusive). @param name - The case-insensitive string used to search for a resource by name. @param next - The cursor to the next page of resources. Provide either the next or prev cursor, but not both. @param prev - The cursor to the previous page of resources. Provide either the next or prev cursor, but not both. @param query - The case-insensitive string used to search for a resource by name or description. @param resourceId - The case-sensitive string used to search for an item by resourceId. If resourceId is provided, then resourceType must be provided. Provide either the resourceId or resourceLink, but not both. @param resourceLink - The case-sensitive string used to search for an item by resourceLink. If resourceLink is provided, then resourceType must be provided. Provide either the resourceId or resourceLink, but not both. @param resourceType - The case-sensitive string used to search for an item by resourceType. @param shared - Whether or not to return items in a shared space. @param sort - The property of a resource to sort on (default sort is +createdAt). The supported properties are createdAt, updatedAt, and name. A property must be prefixed by + or - to indicate ascending or descending sort order respectively. @param spaceId - The space's unique identifier (supports \'personal\' as spaceId). @param noActions - If set to true, the user's available actions for each item will not be evaluated meaning the actions-array will be omitted from the response (reduces response time). */ getItems(queryParams?: { limit?: number; name?: string; next?: string; prev?: string; query?: string; resourceId?: string; resourceLink?: string; resourceType?: ItemResourceTypeEnum; shared?: boolean; sort?: '+createdAt' | '-createdAt' | '+name' | '-name' | '+updatedAt' | '-updatedAt'; spaceId?: string; noActions?: boolean; }): Promise; /** Adds an item to a collection and returns the item. Adds an item to a collection. @param data - */ createItem(data: CollectionsAddCollectionItemRequestBody): Promise; /** Deletes a collection and removes all items from the collection. Deletes a collection. */ delete(): Promise; /** Updates a collection and returns the new collection. Omitted and unsupported fields are ignored. To unset a field, provide the field's zero value. Updates a collection. @param data - */ set(data: CollectionsUpdateCollectionRequestBody): Promise; } export type CollectionsAddCollectionItemRequestBody = { /** The item's unique identifier. */ id: string; [key: string]: any; }; export type CollectionsCreateCollectionRequestBody = { description?: string; name: string; type: CollectionTypes; [key: string]: any; }; export type CollectionsListCollectionItemsResponseBody = { data: Array; [key: string]: any; }; export type CollectionsUpdateCollectionRequestBody = { description?: string; name?: string; [key: string]: any; }; export type ItemLinksResponseBody = { collections?: Link; open?: Link; self?: Link; thumbnail?: Link; [key: string]: any; }; export type ItemMetaResponseBody = { /** The actions that the user can perform on the item. */ actions: Array; /** An array of collections that the item is part of. */ collections: Array; /** The flag that indicates if item is in the user's favorites collection. */ isFavorited: boolean; /** An array of tags that the item is part of. */ tags: Array; [key: string]: any; }; export type ItemResultResponseBody = { /** The actions that the user can perform on the item. */ actions: Array; /** The ID of the collections that the item has been added to. */ collectionIds: Array; /** The RFC3339 datetime when the item was created. */ createdAt: string; /** The ID of the user who created the item. This is only populated if the JWT contains a userId. */ creatorId?: string; description?: string; /** The item's unique identifier. */ id: string; /** The flag that indicates if item is in the user's favorites collection. */ isFavorited: boolean; itemViews?: ItemViewsResponseBody; links: ItemLinksResponseBody; /** Item metadata and computed fields. */ meta: ItemMetaResponseBody; name: string; /** The ID of the user who owns the item. */ ownerId?: string; resourceAttributes: object; /** The RFC3339 datetime when the resource that the item references was created. */ resourceCreatedAt: string; resourceCustomAttributes: object; /** The case-sensitive string used to search for an item by resourceId. If resourceId is provided, then resourceType must be provided. Provide either the resourceId or resourceLink, but not both. */ resourceId?: string; /** The case-sensitive string used to search for an item by resourceLink. If resourceLink is provided, then resourceType must be provided. Provide either the resourceId or resourceLink, but not both. */ resourceLink?: string; /** The RFC3339 datetime when the resource last reload ended. */ resourceReloadEndTime?: string; /** If the resource last reload was successful or not. */ resourceReloadStatus?: string; resourceSize?: ItemsResourceSizeResponseBody; /** Optional field defining the item's subtype, if any. */ resourceSubType?: string; /** The case-sensitive string defining the item's type. */ resourceType: ItemResourceTypeEnum; /** The RFC3339 datetime when the resource that the item references was last updated. */ resourceUpdatedAt: string; /** The space's unique identifier. */ spaceId?: string; /** The ID of the tenant that owns the item. This is populated using the JWT. */ tenantId: string; /** The item thumbnail's unique identifier. This is optional for internal resources. */ thumbnailId?: string; /** The RFC3339 datetime when the item was last updated. */ updatedAt: string; /** ID of the user who last updated the item. This is only populated if the JWT contains a userId. */ updaterId?: string; [key: string]: any; }; export type ItemsLinksResponseBody = { collection?: Link; next?: Link; prev?: Link; self?: Link; [key: string]: any; }; export type ItemsResourceSizeResponseBody = { /** Size of the app on disk in bytes. */ appFile?: number; /** Size of the app in memory in bytes. */ appMemory?: number; [key: string]: any; }; export type ItemsResultResponseBody = { data: Array; links: ItemsLinksResponseBody; [key: string]: any; }; export type ItemTagResponseBody = { /** The ID of the tag/collection. */ id: string; /** The name of the tag/collection. */ name: string; [key: string]: any; }; export type ItemViewsResponseBody = { /** Total number of views the resource got during the last 28 days. */ total?: number; /** Trend in views over the last 4 weeks. */ trend?: number; /** Number of unique users who viewed the resource during the last 28 days. */ unique?: number; /** Number of apps this dataset is used in (datasets only). */ usedBy?: number; week?: Array; [key: string]: any; }; export type ItemViewsWeeksResponseBody = { /** The RFC3339 datetime representing the start of the referenced week. */ start?: string; /** Total number of views the resource got during the referenced week. */ total?: number; /** Number of unique users who viewed the resource during the referenced week. */ unique?: number; [key: string]: any; }; export type Link = { href?: string; [key: string]: any; }; export declare class Collections { auth: Auth; config: Config; constructor(config: Config | Auth); /** Finds and returns the user's favorites collection. Retrieves the user's favorites collection. */ getFavorites(): Promise; /** Finds and returns a collection. Returns a collection. @param collectionId - The collection's unique identifier. */ get(collectionId: string): Promise; /** Finds and returns the collections that the user can access. This endpoint does not return the user's favorites collection. Retrieves collections that the user has access to. @param creatorId - The case-sensitive string used to search for a resource by creatorId. @param id - The collection's unique identifier. @param includeItems - Includes the list of items belonging to the collections. Supported parameters are 'limit', 'sort' and 'resourceType'. Supported formats are json formatted string or deep object style using square brackets. @param limit - The maximum number of resources to return for a request. The limit must be an integer between 1 and 100 (inclusive). @param name - The case-sensitive string used to search for a collection by name. @param next - The cursor to the next page of resources. Provide either the next or prev cursor, but not both. @param prev - The cursor to the previous page of resources. Provide either the next or prev cursor, but not both. @param query - The case-insensitive string used to search for a resource by name or description. @param sort - The property of a resource to sort on (default sort is +createdAt). The supported properties are createdAt, updatedAt, and name. A property must be prefixed by + or - to indicate ascending or descending sort order respectively. @param type - The case-sensitive string used to filter for a collection by type. @param types - A commaseparated case-sensitive string used to filter by multiple types. */ getCollections(queryParams?: { creatorId?: string; id?: string; includeItems?: string; limit?: number; name?: string; next?: string; prev?: string; query?: string; sort?: '+createdAt' | '-createdAt' | '+name' | '-name' | '+updatedAt' | '-updatedAt'; type?: CollectionTypes; types?: Array; }): Promise>; /** Creates and returns a new collection. Collections can have the same name. Creates a new collection. @param data - */ create(data: CollectionsCreateCollectionRequestBody): Promise; }