/** * Categories service. * @version 4.4.2 * @class CategoriesApi */ export class CategoriesApi { /** * Make the default {@link ApiClient} class available for developers to be able to extend it and bring * their own fetch methods into the SDK */ static get ApiClient(): typeof ApiClient; /** * Constructs a new CategoriesApi. * @alias module:api/CategoriesApi * @class * @param {module:ApiClient} [apiClient] Optional API client implementation to use, * default to {@link module:ApiClient#instance} if unspecified. */ constructor(apiClient?: any); apiClient: any; /** * Create a category * Creates a category with a given key and value pair. This endpoint supports both multidomain categories on NC (Nutanix Central) and local categories on PC (Prism Central). For multidomain categories on NC, this operation is asynchronous and returns a 202 response with a task reference. For local categories on PC, this operation is synchronous and returns a 201 response with the created category. * @param { Required> & Partial } body specification * @param {Object} args Additional Arguments * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link CreateCategoryApiResponse } and HTTP response */ createCategory(body: Required> & Partial, ...args: any): Promise; /** * Delete a category * Deletes a category with the given external identifier. This endpoint supports both multidomain categories on NC (Nutanix Central) and local categories on PC (Prism Central). For multidomain categories on NC, this operation is asynchronous and returns a 202 response with a task reference. For local categories on PC, this operation is synchronous and returns a 204 response indicating successful deletion. * @param { String } extId A globally unique identifier of an instance that is suitable for external consumption. * @param {Object} args Additional Arguments * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link DeleteCategoryApiResponse } and HTTP response */ deleteCategoryById(extId: string, ...args: any): Promise; /** * Fetch a category * Fetches the details of a category with the given external identifier. This endpoint supports both multidomain categories on NC (Nutanix Central) and local categories on PC (Prism Central). * @param { String } extId A globally unique identifier of an instance that is suitable for external consumption. * @param {Object} opts Optional parameters defined for the operation * @param { String } opts.$expand A URL query parameter that allows clients to request related resources when a resource that satisfies a particular request is retrieved. Each expanded item is evaluated relative to the entity containing the property being expanded. Other query options can be applied to an expanded property by appending a semicolon-separated list of query options, enclosed in parentheses, to the property name. Permissible system query options are $filter, $select and $orderby. If both $expand and $apply query parameters are present, $expand will be applied on entities within the groups. * @param {Object} args Additional Arguments * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link GetCategoryApiResponse } and HTTP response */ getCategoryById(extId: string, opts: { $expand: string; }, ...args: any): Promise; /** * List categories * Fetches a list of categories with pagination, filtering, sorting, selection, and optional expansion of associated entity counts. This endpoint supports both multidomain categories on NC (Nutanix Central) and local categories on PC (Prism Central).<br> Note: This endpoint only supports $expand=associations. For detailed associations with category extId, use the GET /categories/{extId}?$expand=detailedAssociations endpoint. * @param {Object} opts Optional parameters defined for the operation * @param { Number } opts.$page A URL query parameter that specifies the page number of the result set. It must be a positive integer between 0 and the maximum number of pages that are available for that resource. Any number out of this range might lead to no results. If both $page and $apply query parameters are present, $page will be applied on entities within the groups. * @param { Number } opts.$limit A URL query parameter that specifies the total number of records returned in the result set. Must be a positive integer between 1 and 100. Any number out of this range will lead to a validation error. If the limit is not provided, a default value of 50 records will be returned in the result set. If both $limit and $apply query parameters are present, $limit will be applied on entities within the groups. Default value of limit with $apply will be 5. * @param { String } opts.$filter A URL query parameter that allows clients to filter a collection of resources. The expression specified with $filter is evaluated for each resource in the collection, and only items where the expression evaluates to true are included in the response. Expression specified with the $filter must conform to the [OData V4.01](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions.
* For example, filter **$filter=name eq 'karbon-ntnx-1.0'** would filter the result on cluster name 'karbon-ntnx1.0', filter **$filter=startswith(name, 'C')** would filter on cluster name starting with 'C'. If both $filter and $apply query parameters are present, $filter will be applied on entities within the groups. * @param { String } opts.$orderby A URL query parameter that allows clients to specify the sort criteria for the returned list of objects. Resources can be sorted in ascending order using asc or descending order using desc. If asc or desc are not specified, the resources will be sorted in ascending order by default. For example, '$orderby=templateName desc' would get all templates sorted by templateName in descending order. If both $orderby and $apply query parameters are present, $orderby will be applied on entities within the groups. * @param { String } opts.$apply A URL query parameter that allows clients to specify a sequence of transformations to the entity set, such as groupby, orderby, aggregate etc. For example '$apply=groupby((property))' will get the entity set grouped by "property". The sequence must start with groupby, which may include multiple nested aggregates. It may optionally be followed by orderby and/or pagination parameters. For example '$apply=groupby((property),aggregate(property with count as totalCount))/orderby(property)/page(0)/limit(2)' will group the entity set by "property", aggregate the number of entities in each group, sort the groups by "property" and return the first two groups. The term "property" is a placeholder in these examples and should be substituted with the actual property name of the resource. * @param { String } opts.$expand A URL query parameter that allows clients to request related resources when a resource that satisfies a particular request is retrieved. Each expanded item is evaluated relative to the entity containing the property being expanded. Other query options can be applied to an expanded property by appending a semicolon-separated list of query options, enclosed in parentheses, to the property name. Permissible system query options are $filter, $select and $orderby. If both $expand and $apply query parameters are present, $expand will be applied on entities within the groups. * @param { String } opts.$select A URL query parameter that allows clients to request a specific set of properties for each entity or complex type. Expression specified with the $select must conform to the [OData V4.01](https://docs.oasis-open.org/odata/odata/v4.01/odata-v4.01-part1-protocol.html) URL conventions. If a $select expression consists of a single select item that is an asterisk (i.e., *), then all properties on the matching resource will be returned. If both $select and $apply query parameters are present, $select will be applied on entities within the groups. * @param {Object} args Additional Arguments * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link ListCategoriesApiResponse } and HTTP response */ listCategories(opts: { $page: number; $limit: number; $filter: string; $orderby: string; $apply: string; $expand: string; $select: string; }, ...args: any): Promise; /** * Share a category with project * Shares a category with a specified project. This allows the project to access the category. * @param { Required> & Partial } body specification * @param { String } categoryExtId A globally unique identifier of an instance that is suitable for external consumption. * @param {Object} args Additional Arguments * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link ShareCategoryApiResponse } and HTTP response */ shareCategory(categoryExtId: string, body: Required> & Partial, ...args: any): Promise; /** * Unshare a category with project * Unshares a category from a specified project. This removes the project's access to the category. * @param { Required> & Partial } body specification * @param { String } categoryExtId A globally unique identifier of an instance that is suitable for external consumption. * @param {Object} args Additional Arguments * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link UnshareCategoryApiResponse } and HTTP response */ unshareCategory(categoryExtId: string, body: Required> & Partial, ...args: any): Promise; /** * Update a category * Updates the description, value, and owner properties of a category. This endpoint supports both multidomain categories on NC (Nutanix Central) and local categories on PC (Prism Central). For multidomain categories on NC, this operation is asynchronous and returns a 202 response with a task reference. For local categories on PC, this operation is synchronous and returns a 200 response with the update status. * @param { Required> & Partial } body specification * @param { String } extId A globally unique identifier of an instance that is suitable for external consumption. * @param {Object} args Additional Arguments * @return {Promise} a {@link https://www.promisejs.org/|Promise}, with an object containing data of type {@link UpdateCategoryApiResponse } and HTTP response */ updateCategoryById(extId: string, body: Required> & Partial, ...args: any): Promise; #private; } import Category from "../models/prism/v4/config/Category"; import CreateCategoryApiResponse from "../models/prism/v4/config/CreateCategoryApiResponse"; import DeleteCategoryApiResponse from "../models/prism/v4/config/DeleteCategoryApiResponse"; import GetCategoryApiResponse from "../models/prism/v4/config/GetCategoryApiResponse"; import ListCategoriesApiResponse from "../models/prism/v4/config/ListCategoriesApiResponse"; import ShareCategoryRequest from "../models/prism/v4/config/ShareCategoryRequest"; import ShareCategoryApiResponse from "../models/prism/v4/config/ShareCategoryApiResponse"; import UnshareCategoryRequest from "../models/prism/v4/config/UnshareCategoryRequest"; import UnshareCategoryApiResponse from "../models/prism/v4/config/UnshareCategoryApiResponse"; import UpdateCategoryApiResponse from "../models/prism/v4/config/UpdateCategoryApiResponse"; import { ApiClient } from "../ApiClient";