import type { CustomFieldRequest } from '../models/CustomFieldRequest'; import type { CustomFieldResponse } from '../models/CustomFieldResponse'; import type { EmptyResponse } from '../models/EmptyResponse'; import type { EnumOption } from '../models/EnumOption'; import type { EnumOptionInsertRequest } from '../models/EnumOptionInsertRequest'; import type { EnumOptionRequest } from '../models/EnumOptionRequest'; import type { CancelablePromise } from '../core/CancelablePromise'; import type { BaseHttpRequest } from '../core/BaseHttpRequest'; export declare class CustomFieldsService { readonly httpRequest: BaseHttpRequest; constructor(httpRequest: BaseHttpRequest); /** * Create a custom field * Creates a new custom field in a workspace. Every custom field is required * to be created in a specific workspace, and this workspace cannot be * changed once set. * * A custom field’s name must be unique within a workspace and not conflict * with names of existing task properties such as `Due Date` or `Assignee`. * A custom field’s type must be one of `text`, `enum`, `multi_enum`, `number`, * `date`, or `people`. * * Returns the full record of the newly created custom field. * @returns any Custom field successfully created. * @throws ApiError */ createCustomField({ optPretty, optFields, limit, offset, requestBody, }: { /** * Provides “pretty” output. * Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. */ optPretty?: boolean; /** * Defines fields to return. * Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. * The id of included objects will always be returned, regardless of the field options. */ optFields?: Array; /** * Results per page. * The number of objects to return per page. The value must be between 1 and 100. */ limit?: number; /** * Offset token. * An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. * 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' */ offset?: string; /** * The custom field object to create. */ requestBody?: { data?: CustomFieldRequest; }; }): CancelablePromise<{ data?: CustomFieldResponse; }>; /** * Get a custom field * Get the complete definition of a custom field’s metadata. * * Since custom fields can be defined for one of a number of types, and * these types have different data and behaviors, there are fields that are * relevant to a particular type. For instance, as noted above, enum_options * is only relevant for the enum type and defines the set of choices that * the enum could represent. The examples below show some of these * type-specific custom field definitions. * @returns any Successfully retrieved the complete definition of a custom field’s metadata. * @throws ApiError */ getCustomField({ customFieldGid, optPretty, optFields, }: { /** * Globally unique identifier for the custom field. */ customFieldGid: string; /** * Provides “pretty” output. * Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. */ optPretty?: boolean; /** * Defines fields to return. * Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. * The id of included objects will always be returned, regardless of the field options. */ optFields?: Array; }): CancelablePromise<{ data?: CustomFieldResponse; }>; /** * Update a custom field * A specific, existing custom field can be updated by making a PUT request on the URL for that custom field. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged * When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the custom field. * A custom field’s `type` cannot be updated. * An enum custom field’s `enum_options` cannot be updated with this endpoint. Instead see “Work With Enum Options” for information on how to update `enum_options`. * Locked custom fields can only be updated by the user who locked the field. * Returns the complete updated custom field record. * @returns any The custom field was successfully updated. * @throws ApiError */ updateCustomField({ customFieldGid, optPretty, optFields, requestBody, }: { /** * Globally unique identifier for the custom field. */ customFieldGid: string; /** * Provides “pretty” output. * Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. */ optPretty?: boolean; /** * Defines fields to return. * Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. * The id of included objects will always be returned, regardless of the field options. */ optFields?: Array; /** * The custom field object with all updated properties. */ requestBody?: { data?: CustomFieldRequest; }; }): CancelablePromise<{ data?: CustomFieldResponse; }>; /** * Delete a custom field * A specific, existing custom field can be deleted by making a DELETE request on the URL for that custom field. * Locked custom fields can only be deleted by the user who locked the field. * Returns an empty data record. * @returns any The custom field was successfully deleted. * @throws ApiError */ deleteCustomField({ customFieldGid, optPretty, optFields, }: { /** * Globally unique identifier for the custom field. */ customFieldGid: string; /** * Provides “pretty” output. * Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. */ optPretty?: boolean; /** * Defines fields to return. * Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. * The id of included objects will always be returned, regardless of the field options. */ optFields?: Array; }): CancelablePromise<{ data?: EmptyResponse; }>; /** * Get a workspace's custom fields * Returns a list of the compact representation of all of the custom fields in a workspace. * @returns any Successfully retrieved all custom fields for the given workspace. * @throws ApiError */ getCustomFieldsForWorkspace({ workspaceGid, optPretty, optFields, limit, offset, }: { /** * Globally unique identifier for the workspace or organization. */ workspaceGid: string; /** * Provides “pretty” output. * Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. */ optPretty?: boolean; /** * Defines fields to return. * Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. * The id of included objects will always be returned, regardless of the field options. */ optFields?: Array; /** * Results per page. * The number of objects to return per page. The value must be between 1 and 100. */ limit?: number; /** * Offset token. * An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. * 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' */ offset?: string; }): CancelablePromise<{ data?: Array; }>; /** * Create an enum option * Creates an enum option and adds it to this custom field’s list of enum options. A custom field can have at most 100 enum options (including disabled options). By default new enum options are inserted at the end of a custom field’s list. * Locked custom fields can only have enum options added by the user who locked the field. * Returns the full record of the newly created enum option. * @returns any Custom field enum option successfully created. * @throws ApiError */ createEnumOptionForCustomField({ customFieldGid, optPretty, optFields, limit, offset, requestBody, }: { /** * Globally unique identifier for the custom field. */ customFieldGid: string; /** * Provides “pretty” output. * Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. */ optPretty?: boolean; /** * Defines fields to return. * Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. * The id of included objects will always be returned, regardless of the field options. */ optFields?: Array; /** * Results per page. * The number of objects to return per page. The value must be between 1 and 100. */ limit?: number; /** * Offset token. * An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. * 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' */ offset?: string; /** * The enum option object to create. */ requestBody?: { data?: EnumOptionRequest; }; }): CancelablePromise<{ data?: EnumOption; }>; /** * Reorder a custom field's enum * Moves a particular enum option to be either before or after another specified enum option in the custom field. * Locked custom fields can only be reordered by the user who locked the field. * @returns any Custom field enum option successfully reordered. * @throws ApiError */ insertEnumOptionForCustomField({ customFieldGid, optPretty, optFields, requestBody, }: { /** * Globally unique identifier for the custom field. */ customFieldGid: string; /** * Provides “pretty” output. * Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. */ optPretty?: boolean; /** * Defines fields to return. * Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. * The id of included objects will always be returned, regardless of the field options. */ optFields?: Array; /** * The enum option object to create. */ requestBody?: { data?: EnumOptionInsertRequest; }; }): CancelablePromise<{ data?: EnumOption; }>; /** * Update an enum option * Updates an existing enum option. Enum custom fields require at least one enabled enum option. * Locked custom fields can only be updated by the user who locked the field. * Returns the full record of the updated enum option. * @returns any Successfully updated the specified custom field enum. * @throws ApiError */ updateEnumOption({ enumOptionGid, optPretty, optFields, requestBody, }: { /** * Globally unique identifier for the enum option. */ enumOptionGid: string; /** * Provides “pretty” output. * Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. */ optPretty?: boolean; /** * Defines fields to return. * Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. * The id of included objects will always be returned, regardless of the field options. */ optFields?: Array; /** * The enum option object to update */ requestBody?: { data?: EnumOptionRequest; }; }): CancelablePromise<{ data?: EnumOption; }>; }