diff --git a/changelog.md b/changelog.md index 14f5e57..958e0f0 100644 --- a/changelog.md +++ b/changelog.md @@ -2,9 +2,11 @@ ## Unreleased +- remove unused imports, organize imports and fix import issues ([#32](https://github.com/hasura/ndc-open-api-lambda/pull/32)) + ## [[0.1.0](https://github.com/hasura/ndc-open-api-lambda/releases/tag/v0.1.0)] 2024-06-03 -- Update `ghcr.io/hasura/ndc-nodejs-lambda` to version `v1.4.0` and remove env var `NDC_LAMBDA_SDK_VERSION` ([30](https://github.com/hasura/ndc-open-api-lambda/pull/30)). +- Update `ghcr.io/hasura/ndc-nodejs-lambda` to version `v1.4.0` and remove env var `NDC_LAMBDA_SDK_VERSION` ([#30](https://github.com/hasura/ndc-open-api-lambda/pull/30)). - API requests support forwarding headers that are sent to the data connector. Manual addition of headers via the `--headers` flag and `NDC_OAS_HEADERS` env var has been removed ([#28](https://github.com/hasura/ndc-open-api-lambda/pull/28)). - Added support for adding secruity param as a query param in `api.ts` ([#27](https://github.com/hasura/ndc-open-api-lambda/pull/27)) - Added support for `@save` annotation to preserve user's changes ([#24](https://github.com/hasura/ndc-open-api-lambda/pull/24)) diff --git a/src/app/generator/functions-ts-generator.test.ts b/src/app/generator/functions-ts-generator.test.ts index 6013ffc..e819bad 100644 --- a/src/app/generator/functions-ts-generator.test.ts +++ b/src/app/generator/functions-ts-generator.test.ts @@ -1,14 +1,9 @@ import * as assert from "assert"; import * as context from "../context"; -import * as legacyApiTsGenerator from "../parser/open-api/api-generator"; -import * as apiTsGenerator from "./api-ts-generator"; -import * as functionTsGenerator from "./functions-ts-generator"; -import * as headerParser from "../parser/open-api/header-parser"; -import * as prettier from "prettier"; import path from "path"; import { readFileSync, writeFileSync } from "fs"; -import * as types from "./types"; -import * as schemaParser from "../parser/open-api/schema-parser"; +import * as generator from "."; +import { cleanupAndFormat } from "../writer/functions-ts-writer"; const CircularJSON = require("circular-json"); @@ -19,8 +14,6 @@ const tests: { openApiUri: string; // for now, we only consider files on disks in test cases goldenFile: string; baseUrl?: string; - _legacyApiComponents?: legacyApiTsGenerator.ApiComponents; - _generatedApiTsComponents?: types.GeneratedApiTsCode; _goldenFileContent?: string; }[] = [ { @@ -86,6 +79,42 @@ const tests: { goldenFile: "./golden-files/kubernetes", baseUrl: "http://localhost:9191", }, + { + name: "AtlassianJira", + openApiUri: "./open-api-docs/atlassian-jira.json", + goldenFile: "./golden-files/atlassian-jira", + baseUrl: "", + }, + { + name: "1Password", + openApiUri: "./open-api-docs/1password.json", + goldenFile: "./golden-files/1password", + baseUrl: "", + }, + { + name: "AwsCloudMap", + openApiUri: "./open-api-docs/aws-cloud-map.json", + goldenFile: "./golden-files/aws-cloud-map", + baseUrl: "", + }, + { + name: "AmazonWorkspaces", + openApiUri: "./open-api-docs/amazon-workspaces.json", + goldenFile: "./golden-files/amazon-workspaces", + baseUrl: "", + }, + { + name: "AckoInsurance", + openApiUri: "./open-api-docs/acko-insurance.json", + goldenFile: "./golden-files/acko-insurance", + baseUrl: "", + }, + { + name: "MicrosoftWorkloadMonitor", + openApiUri: "./open-api-docs/microsoft-workload-monitor.json", + goldenFile: "./golden-files/microsoft-workload-monitor", + baseUrl: "", + }, ]; describe("functions-ts-generator", async () => { @@ -98,6 +127,16 @@ async function testGenerateFunctionsTsCode() { before(async () => { const relativeDirectorToTestFiles = "../../../tests/test-data/"; + context + .getInstance() + .setOutputDirectory( + path.resolve( + __dirname, + relativeDirectorToTestFiles, + "golden-files", + ), + ); + testCase.openApiUri = path.resolve( __dirname, relativeDirectorToTestFiles, @@ -111,35 +150,26 @@ async function testGenerateFunctionsTsCode() { testCase._goldenFileContent = readFileSync( testCase.goldenFile, ).toString(); - - testCase._generatedApiTsComponents = - await apiTsGenerator.generateApiTsCode(testCase.openApiUri); - - const parsedSchemastore = schemaParser.getParsedSchemaStore( - testCase._generatedApiTsComponents.typeNames, - testCase._generatedApiTsComponents.schemaComponents, - ); - testCase._generatedApiTsComponents.schemaStore = parsedSchemastore; - - testCase._legacyApiComponents = - testCase._generatedApiTsComponents.legacyTypedApiComponents; }); it(`should generate functions.ts file content for ${testCase.name}`, async () => { - let got = await functionTsGenerator.generateFunctionsTsCode( - testCase._legacyApiComponents!, - testCase._generatedApiTsComponents!, - testCase.baseUrl, - ); - - got.fileContent = await prettier.format(got.fileContent, { - parser: "typescript", + const got = await generator.generateCode({ + openApiUri: testCase.openApiUri, + baseUrl: testCase.baseUrl, }); - assert.equal(got.fileContent, testCase._goldenFileContent); + const gotFunctionTs = got.filter( + (item) => item.fileType === "functions-ts", + )[0]!; + + const gotApiTs = got.filter((item) => item.fileType === "api-ts")[0]!; + + await cleanupAndFormat(gotFunctionTs, gotApiTs); + + assert.equal(gotFunctionTs.fileContent, testCase._goldenFileContent); // uncomment to update golden file - // writeFileSync(testCase.goldenFile, got.fileContent); + // writeFileSync(testCase.goldenFile, gotFunctionTs.fileContent); }); } }); diff --git a/src/app/parser/typescript/cleanup.test.ts b/src/app/parser/typescript/cleanup.test.ts new file mode 100644 index 0000000..efa3e62 --- /dev/null +++ b/src/app/parser/typescript/cleanup.test.ts @@ -0,0 +1,63 @@ +import * as assert from "assert"; +import path from "path"; +import * as appTypes from "../../types"; +import * as fs from "fs"; +import * as cleanup from "./cleanup"; + +const tests: { + name: string; + _files?: appTypes.GeneratedCode[]; + _goldenFileContent?: string; + _functionsTsFile?: appTypes.GeneratedCode; + _goldenFilePath?: string; +}[] = [ + { + name: "atlassian-jira", + }, +]; + +describe("cleanup::fixImports", async () => { + for (const testCase of tests) { + before(async () => { + const testFileDir = path.resolve( + __dirname, + "./test-data/cleanup-tests/", + testCase.name, + ); + + const apiFilePath = path.resolve(testFileDir, "api"); + const functionsFilePath = path.resolve(testFileDir, "test"); + testCase._goldenFilePath = path.resolve(testFileDir, "golden-file"); + testCase._goldenFileContent = fs + .readFileSync(testCase._goldenFilePath) + .toString(); + + const apiTsFile: appTypes.GeneratedCode = { + fileContent: fs.readFileSync(apiFilePath).toString(), + filePath: `${apiFilePath}.ts`, + fileType: "api-ts", + }; + + const functionsTsFile: appTypes.GeneratedCode = { + fileContent: fs.readFileSync(functionsFilePath).toString(), + filePath: `${functionsFilePath}.ts`, + fileType: "functions-ts", + }; + + testCase._files = [apiTsFile, functionsTsFile]; + testCase._functionsTsFile = functionsTsFile; + }); + + it(`${testCase.name}`, async () => { + cleanup.fixImports(testCase._files!); + + assert.equal( + testCase._functionsTsFile!.fileContent, + testCase._goldenFileContent!, + ); + + // update golden file + // fs.writeFileSync(testCase._goldenFilePath!, testCase._functionsTsFile!.fileContent); + }); + } +}); diff --git a/src/app/parser/typescript/cleanup.ts b/src/app/parser/typescript/cleanup.ts new file mode 100644 index 0000000..180738a --- /dev/null +++ b/src/app/parser/typescript/cleanup.ts @@ -0,0 +1,34 @@ +import * as ts from "ts-morph"; +import * as types from "../../types"; +import * as context from "../../context"; +import * as fs from "fs"; + +export function fixImports(generatedCodeList: types.GeneratedCode[]) { + let project: ts.Project; + if (fs.existsSync(context.getInstance().getTsConfigFilePath())) { + project = new ts.Project({ + tsConfigFilePath: context.getInstance().getTsConfigFilePath(), + }); + } else { + project = new ts.Project(); + } + + for (const generatedCode of generatedCodeList) { + project.createSourceFile( + generatedCode.filePath, + generatedCode.fileContent, + { + overwrite: true, + }, + ); + } + + for (const sourceFile of project.getSourceFiles()) { + sourceFile.fixMissingImports().organizeImports(); + + const code = generatedCodeList.filter( + (item) => item.filePath === sourceFile.getFilePath(), + )[0]!; + code.fileContent = sourceFile.getFullText(); + } +} diff --git a/src/app/parser/typescript/fomat.ts b/src/app/parser/typescript/fomat.ts new file mode 100644 index 0000000..501451e --- /dev/null +++ b/src/app/parser/typescript/fomat.ts @@ -0,0 +1,16 @@ +import * as prettier from "prettier"; +import * as logger from "../../../util/logger"; + +export async function format(code: string): Promise { + try { + code = await prettier.format(code, { + parser: "typescript", + }); + } catch (e) { + logger.error( + "Error while formatting code. The resulting code will be unformatted and may contain syntax errors. Error: ", + e, + ); + } + return code; +} diff --git a/src/app/parser/typescript/test-data/cleanup-tests/atlassian-jira/api b/src/app/parser/typescript/test-data/cleanup-tests/atlassian-jira/api new file mode 100644 index 0000000..89721c9 --- /dev/null +++ b/src/app/parser/typescript/test-data/cleanup-tests/atlassian-jira/api @@ -0,0 +1,24004 @@ +import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; + +export interface ActorInputBean { + /** The name of the group to add as a default actor. This parameter cannot be used with the `groupId` parameter. As a group's name can change,use of `groupId` is recommended. This parameter accepts a comma-separated list. For example, `"group":["project-admin", "jira-developers"]`. */ + group?: string[]; + /** The ID of the group to add as a default actor. This parameter cannot be used with the `group` parameter This parameter accepts a comma-separated list. For example, `"groupId":["77f6ab39-e755-4570-a6ae-2d7a8df0bcb8", "0c011f85-69ed-49c4-a801-3b18d0f771bc"]`. */ + groupId?: string[]; + /** The account IDs of the users to add as default actors. This parameter accepts a comma-separated list. For example, `"user":["5b10a2844c20165700ede21g", "5b109f2e9729b51b54dc274d"]`. */ + user?: string[]; +} + +export interface ActorsMap { + /** The name of the group to add. This parameter cannot be used with the `groupId` parameter. As a group's name can change, use of `groupId` is recommended. */ + group?: string[]; + /** The ID of the group to add. This parameter cannot be used with the `group` parameter. */ + groupId?: string[]; + /** The user account ID of the user to add. */ + user?: string[]; +} + +export interface AddFieldBean { + /** The ID of the field to add. */ + fieldId: string; +} + +export interface AddGroupBean { + /** The name of the group. */ + name: string; + [key: string]: any; +} + +/** Details of notifications which should be added to the notification scheme. */ +export interface AddNotificationsDetails { + /** The list of notifications which should be added to the notification scheme. */ + notificationSchemeEvents: NotificationSchemeEventDetails[]; + [key: string]: any; +} + +/** Announcement banner configuration. */ +export interface AnnouncementBannerConfiguration { + /** Hash of the banner data. The client detects updates by comparing hash IDs. */ + hashId?: string; + /** Flag indicating if the announcement banner can be dismissed by the user. */ + isDismissible?: boolean; + /** Flag indicating if the announcement banner is enabled or not. */ + isEnabled?: boolean; + /** The text on the announcement banner. */ + message?: string; + /** Visibility of the announcement banner. */ + visibility?: "PUBLIC" | "PRIVATE"; +} + +/** Configuration of the announcement banner. */ +export interface AnnouncementBannerConfigurationUpdate { + /** Flag indicating if the announcement banner can be dismissed by the user. */ + isDismissible?: boolean; + /** Flag indicating if the announcement banner is enabled or not. */ + isEnabled?: boolean; + /** The text on the announcement banner. */ + message?: string; + /** Visibility of the announcement banner. Can be public or private. */ + visibility?: string; +} + +/** The application the linked item is in. */ +export interface Application { + /** The name of the application. Used in conjunction with the (remote) object icon title to display a tooltip for the link's icon. The tooltip takes the format "\[application name\] icon title". Blank items are excluded from the tooltip title. If both items are blank, the icon tooltop displays as "Web Link". Grouping and sorting of links may place links without an application name last. */ + name?: string; + /** The name-spaced type of the application, used by registered rendering apps. */ + type?: string; + [key: string]: any; +} + +/** Details of an application property. */ +export interface ApplicationProperty { + /** The allowed values, if applicable. */ + allowedValues?: string[]; + /** The default value of the application property. */ + defaultValue?: string; + /** The description of the application property. */ + desc?: string; + example?: string; + /** The ID of the application property. The ID and key are the same. */ + id?: string; + /** The key of the application property. The ID and key are the same. */ + key?: string; + /** The name of the application property. */ + name?: string; + /** The data type of the application property. */ + type?: string; + /** The new value. */ + value?: string; +} + +/** Details of an application role. */ +export interface ApplicationRole { + /** + * The groups that are granted default access for this application role. As a group's name can change, use of `defaultGroupsDetails` is recommended to identify a groups. + * @uniqueItems true + */ + defaultGroups?: string[]; + /** The groups that are granted default access for this application role. */ + defaultGroupsDetails?: GroupName[]; + /** Deprecated. */ + defined?: boolean; + /** The groups associated with the application role. */ + groupDetails?: GroupName[]; + /** + * The groups associated with the application role. As a group's name can change, use of `groupDetails` is recommended to identify a groups. + * @uniqueItems true + */ + groups?: string[]; + hasUnlimitedSeats?: boolean; + /** The key of the application role. */ + key?: string; + /** The display name of the application role. */ + name?: string; + /** + * The maximum count of users on your license. + * @format int32 + */ + numberOfSeats?: number; + /** Indicates if the application role belongs to Jira platform (`jira-core`). */ + platform?: boolean; + /** + * The count of users remaining on your license. + * @format int32 + */ + remainingSeats?: number; + /** Determines whether this application role should be selected by default on user creation. */ + selectedByDefault?: boolean; + /** + * The number of users counting against your license. + * @format int32 + */ + userCount?: number; + /** The [type of users](https://confluence.atlassian.com/x/lRW3Ng) being counted against your license. */ + userCountDescription?: string; +} + +/** Details of a field configuration to issue type mappings. */ +export interface AssociateFieldConfigurationsWithIssueTypesRequest { + /** + * Field configuration to issue type mappings. + * @uniqueItems true + */ + mappings: FieldConfigurationToIssueTypeMapping[]; +} + +/** Details of an item associated with the changed record. */ +export interface AssociatedItemBean { + /** The ID of the associated record. */ + id?: string; + /** The name of the associated record. */ + name?: string; + /** The ID of the associated parent record. */ + parentId?: string; + /** The name of the associated parent record. */ + parentName?: string; + /** The type of the associated record. */ + typeName?: string; +} + +/** Details about an attachment. */ +export interface Attachment { + /** Details of the user who added the attachment. */ + author?: UserDetails; + /** The content of the attachment. */ + content?: string; + /** + * The datetime the attachment was created. + * @format date-time + */ + created?: string; + /** The file name of the attachment. */ + filename?: string; + /** The ID of the attachment. */ + id?: string; + /** The MIME type of the attachment. */ + mimeType?: string; + /** The URL of the attachment details response. */ + self?: string; + /** + * The size of the attachment. + * @format int64 + */ + size?: number; + /** The URL of a thumbnail representing the attachment. */ + thumbnail?: string; + [key: string]: any; +} + +export interface AttachmentArchive { + entries?: AttachmentArchiveEntry[]; + moreAvailable?: boolean; + /** @format int32 */ + totalEntryCount?: number; + /** @format int32 */ + totalNumberOfEntriesAvailable?: number; +} + +export interface AttachmentArchiveEntry { + abbreviatedName?: string; + /** @format int64 */ + entryIndex?: number; + mediaType?: string; + name?: string; + /** @format int64 */ + size?: number; +} + +export interface AttachmentArchiveImpl { + /** The list of the items included in the archive. */ + entries?: AttachmentArchiveEntry[]; + /** + * The number of items in the archive. + * @format int32 + */ + totalEntryCount?: number; +} + +/** Metadata for an item in an attachment archive. */ +export interface AttachmentArchiveItemReadable { + /** + * The position of the item within the archive. + * @format int64 + */ + index?: number; + /** The label for the archive item. */ + label?: string; + /** The MIME type of the archive item. */ + mediaType?: string; + /** The path of the archive item. */ + path?: string; + /** The size of the archive item. */ + size?: string; +} + +/** Metadata for an archive (for example a zip) and its contents. */ +export interface AttachmentArchiveMetadataReadable { + /** The list of the items included in the archive. */ + entries?: AttachmentArchiveItemReadable[]; + /** + * The ID of the attachment. + * @format int64 + */ + id?: number; + /** The MIME type of the attachment. */ + mediaType?: string; + /** The name of the archive file. */ + name?: string; + /** + * The number of items included in the archive. + * @format int64 + */ + totalEntryCount?: number; +} + +/** Metadata for an issue attachment. */ +export interface AttachmentMetadata { + /** Details of the user who attached the file. */ + author?: User; + /** The URL of the attachment. */ + content?: string; + /** + * The datetime the attachment was created. + * @format date-time + */ + created?: string; + /** The name of the attachment file. */ + filename?: string; + /** + * The ID of the attachment. + * @format int64 + */ + id?: number; + /** The MIME type of the attachment. */ + mimeType?: string; + /** Additional properties of the attachment. */ + properties?: Record; + /** + * The URL of the attachment metadata details. + * @format uri + */ + self?: string; + /** + * The size of the attachment. + * @format int64 + */ + size?: number; + /** The URL of a thumbnail representing the attachment. */ + thumbnail?: string; +} + +/** Details of the instance's attachment settings. */ +export interface AttachmentSettings { + /** Whether the ability to add attachments is enabled. */ + enabled?: boolean; + /** + * The maximum size of attachments permitted, in bytes. + * @format int64 + */ + uploadLimit?: number; +} + +/** An audit record. */ +export interface AuditRecordBean { + /** The list of items associated with the changed record. */ + associatedItems?: AssociatedItemBean[]; + /** Deprecated, use `authorAccountId` instead. The key of the user who created the audit record. */ + authorKey?: string; + /** The category of the audit record. For a list of these categories, see the help article [Auditing in Jira applications](https://confluence.atlassian.com/x/noXKM). */ + category?: string; + /** The list of values changed in the record event. */ + changedValues?: ChangedValueBean[]; + /** + * The date and time on which the audit record was created. + * @format date-time + */ + created?: string; + /** The description of the audit record. */ + description?: string; + /** The event the audit record originated from. */ + eventSource?: string; + /** + * The ID of the audit record. + * @format int64 + */ + id?: number; + /** Details of an item associated with the changed record. */ + objectItem?: AssociatedItemBean; + /** The URL of the computer where the creation of the audit record was initiated. */ + remoteAddress?: string; + /** The summary of the audit record. */ + summary?: string; +} + +/** Container for a list of audit records. */ +export interface AuditRecords { + /** + * The requested or default limit on the number of audit items to be returned. + * @format int32 + */ + limit?: number; + /** + * The number of audit items skipped before the first item in this list. + * @format int32 + */ + offset?: number; + /** The list of audit items. */ + records?: AuditRecordBean[]; + /** + * The total number of audit items returned. + * @format int64 + */ + total?: number; +} + +/** A field auto-complete suggestion. */ +export interface AutoCompleteSuggestion { + /** The display name of a suggested item. If `fieldValue` or `predicateValue` are provided, the matching text is highlighted with the HTML bold tag. */ + displayName?: string; + /** The value of a suggested item. */ + value?: string; +} + +/** The results from a JQL query. */ +export interface AutoCompleteSuggestions { + /** The list of suggested item. */ + results?: AutoCompleteSuggestion[]; +} + +/** The details of the available dashboard gadget. */ +export interface AvailableDashboardGadget { + /** The module key of the gadget type. */ + moduleKey?: string; + /** The title of the gadget. */ + title: string; + /** The URI of the gadget type. */ + uri?: string; +} + +/** The list of available gadgets. */ +export interface AvailableDashboardGadgetsResponse { + /** The list of available gadgets. */ + gadgets: AvailableDashboardGadget[]; +} + +/** Details of an avatar. */ +export interface Avatar { + /** The file name of the avatar icon. Returned for system avatars. */ + fileName?: string; + /** The ID of the avatar. */ + id: string; + /** Whether the avatar can be deleted. */ + isDeletable?: boolean; + /** Whether the avatar is used in Jira. For example, shown as a project's avatar. */ + isSelected?: boolean; + /** Whether the avatar is a system avatar. */ + isSystemAvatar?: boolean; + /** The owner of the avatar. For a system avatar the owner is null (and nothing is returned). For non-system avatars this is the appropriate identifier, such as the ID for a project or the account ID for a user. */ + owner?: string; + /** The list of avatar icon URLs. */ + urls?: Record; + [key: string]: any; +} + +export interface AvatarUrlsBean { + /** + * The URL of the item's 16x16 pixel avatar. + * @format uri + */ + "16x16"?: string; + /** + * The URL of the item's 24x24 pixel avatar. + * @format uri + */ + "24x24"?: string; + /** + * The URL of the item's 32x32 pixel avatar. + * @format uri + */ + "32x32"?: string; + /** + * The URL of the item's 48x48 pixel avatar. + * @format uri + */ + "48x48"?: string; +} + +/** Details about system and custom avatars. */ +export interface Avatars { + /** Custom avatars list. */ + custom?: Avatar[]; + /** System avatars list. */ + system?: Avatar[]; +} + +/** Details of the options to create for a custom field. */ +export interface BulkCustomFieldOptionCreateRequest { + /** Details of options to create. */ + options?: CustomFieldOptionCreate[]; +} + +/** Details of the options to update for a custom field. */ +export interface BulkCustomFieldOptionUpdateRequest { + /** Details of the options to update. */ + options?: CustomFieldOptionUpdate[]; +} + +/** A container for the watch status of a list of issues. */ +export interface BulkIssueIsWatching { + /** The map of issue ID to boolean watch status. */ + issuesIsWatching?: Record; +} + +/** Bulk issue property update request details. */ +export interface BulkIssuePropertyUpdateRequest { + /** EXPERIMENTAL. The Jira expression to calculate the value of the property. The value of the expression must be an object that can be converted to JSON, such as a number, boolean, string, list, or map. The context variables available to the expression are `issue` and `user`. Issues for which the expression returns a value whose JSON representation is longer than 32768 characters are ignored. */ + expression?: string; + /** The bulk operation filter. */ + filter?: IssueFilterForBulkPropertySet; + /** The value of the property. The value must be a [valid](https://tools.ietf.org/html/rfc4627), non-empty JSON blob. The maximum length is 32768 characters. */ + value?: any; +} + +export interface BulkOperationErrorResult { + /** Error messages from an operation. */ + elementErrors?: ErrorCollection; + /** @format int32 */ + failedElementNumber?: number; + /** @format int32 */ + status?: number; +} + +/** Details of global and project permissions granted to the user. */ +export interface BulkPermissionGrants { + /** + * List of permissions granted to the user. + * @uniqueItems true + */ + globalPermissions: string[]; + /** + * List of project permissions and the projects and issues those permissions provide access to. + * @uniqueItems true + */ + projectPermissions: BulkProjectPermissionGrants[]; +} + +/** Details of global permissions to look up and project permissions with associated projects and issues to look up. */ +export interface BulkPermissionsRequestBean { + /** The account ID of a user. */ + accountId?: string; + /** + * Global permissions to look up. + * @uniqueItems true + */ + globalPermissions?: string[]; + /** + * Project permissions with associated projects and issues to look up. + * @uniqueItems true + */ + projectPermissions?: BulkProjectPermissions[]; +} + +/** List of project permissions and the projects and issues those permissions grant access to. */ +export interface BulkProjectPermissionGrants { + /** + * IDs of the issues the user has the permission for. + * @uniqueItems true + */ + issues: number[]; + /** A project permission, */ + permission: string; + /** + * IDs of the projects the user has the permission for. + * @uniqueItems true + */ + projects: number[]; +} + +/** Details of project permissions and associated issues and projects to look up. */ +export interface BulkProjectPermissions { + /** + * List of issue IDs. + * @uniqueItems true + */ + issues?: number[]; + /** + * List of project permissions. + * @uniqueItems true + */ + permissions: string[]; + /** + * List of project IDs. + * @uniqueItems true + */ + projects?: number[]; +} + +/** A change item. */ +export interface ChangeDetails { + /** The name of the field changed. */ + field?: string; + /** The ID of the field changed. */ + fieldId?: string; + /** The type of the field changed. */ + fieldtype?: string; + /** The details of the original value. */ + from?: string; + /** The details of the original value as a string. */ + fromString?: string; + /** The details of the new value. */ + to?: string; +} + +/** The account ID of the new owner. */ +export interface ChangeFilterOwner { + /** The account ID of the new owner. */ + accountId: string; +} + +/** Details of names changed in the record event. */ +export interface ChangedValueBean { + /** The value of the field before the change. */ + changedFrom?: string; + /** The value of the field after the change. */ + changedTo?: string; + /** The name of the field changed. */ + fieldName?: string; +} + +/** Details of a changed worklog. */ +export interface ChangedWorklog { + /** Details of properties associated with the change. */ + properties?: EntityProperty[]; + /** + * The datetime of the change. + * @format int64 + */ + updatedTime?: number; + /** + * The ID of the worklog. + * @format int64 + */ + worklogId?: number; +} + +/** List of changed worklogs. */ +export interface ChangedWorklogs { + lastPage?: boolean; + /** + * The URL of the next list of changed worklogs. + * @format uri + */ + nextPage?: string; + /** + * The URL of this changed worklogs list. + * @format uri + */ + self?: string; + /** + * The datetime of the first worklog item in the list. + * @format int64 + */ + since?: number; + /** + * The datetime of the last worklog item in the list. + * @format int64 + */ + until?: number; + /** Changed worklog list. */ + values?: ChangedWorklog[]; +} + +/** A changelog. */ +export interface Changelog { + /** The user who made the change. */ + author?: UserDetails; + /** + * The date on which the change took place. + * @format date-time + */ + created?: string; + /** The history metadata associated with the changed. */ + historyMetadata?: HistoryMetadata; + /** The ID of the changelog. */ + id?: string; + /** The list of items changed. */ + items?: ChangeDetails[]; +} + +/** Details of an issue navigator column item. */ +export interface ColumnItem { + /** The issue navigator column label. */ + label?: string; + /** The issue navigator column value. */ + value?: string; +} + +/** A comment. */ +export interface Comment { + /** The ID of the user who created the comment. */ + author?: UserDetails; + /** The comment text in [Atlassian Document Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/). */ + body?: any; + /** + * The date and time at which the comment was created. + * @format date-time + */ + created?: string; + /** The ID of the comment. */ + id?: string; + /** Whether the comment was added from an email sent by a person who is not part of the issue. See [Allow external emails to be added as comments on issues](https://support.atlassian.com/jira-service-management-cloud/docs/allow-external-emails-to-be-added-as-comments-on-issues/)for information on setting up this feature. */ + jsdAuthorCanSeeRequest?: boolean; + /** Whether the comment is visible in Jira Service Desk. Defaults to true when comments are created in the Jira Cloud Platform. This includes when the site doesn't use Jira Service Desk or the project isn't a Jira Service Desk project and, therefore, there is no Jira Service Desk for the issue to be visible on. To create a comment with its visibility in Jira Service Desk set to false, use the Jira Service Desk REST API [Create request comment](https://developer.atlassian.com/cloud/jira/service-desk/rest/#api-rest-servicedeskapi-request-issueIdOrKey-comment-post) operation. */ + jsdPublic?: boolean; + /** A list of comment properties. Optional on create and update. */ + properties?: EntityProperty[]; + /** The rendered version of the comment. */ + renderedBody?: string; + /** The URL of the comment. */ + self?: string; + /** The ID of the user who updated the comment last. */ + updateAuthor?: UserDetails; + /** + * The date and time at which the comment was updated last. + * @format date-time + */ + updated?: string; + /** The group or role to which this comment is visible. Optional on create and update. */ + visibility?: Visibility; + [key: string]: any; +} + +/** Count of issues assigned to a component. */ +export interface ComponentIssuesCount { + /** + * The count of issues assigned to a component. + * @format int64 + */ + issueCount?: number; + /** + * The URL for this count of issues for a component. + * @format uri + */ + self?: string; +} + +/** Details about a component with a count of the issues it contains. */ +export interface ComponentWithIssueCount { + /** The details of the user associated with `assigneeType`, if any. See `realAssignee` for details of the user assigned to issues created with this component. */ + assignee?: User; + /** + * The nominal user type used to determine the assignee for issues created with this component. See `realAssigneeType` for details on how the type of the user, and hence the user, assigned to issues is determined. Takes the following values: + * + * * `PROJECT_LEAD` the assignee to any issues created with this component is nominally the lead for the project the component is in. + * * `COMPONENT_LEAD` the assignee to any issues created with this component is nominally the lead for the component. + * * `UNASSIGNED` an assignee is not set for issues created with this component. + * * `PROJECT_DEFAULT` the assignee to any issues created with this component is nominally the default assignee for the project that the component is in. + */ + assigneeType?: "PROJECT_DEFAULT" | "COMPONENT_LEAD" | "PROJECT_LEAD" | "UNASSIGNED"; + /** The description for the component. */ + description?: string; + /** The unique identifier for the component. */ + id?: string; + /** Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but the component lead is not set, then `false` is returned. */ + isAssigneeTypeValid?: boolean; + /** + * Count of issues for the component. + * @format int64 + */ + issueCount?: number; + /** The user details for the component's lead user. */ + lead?: User; + /** The name for the component. */ + name?: string; + /** The key of the project to which the component is assigned. */ + project?: string; + /** + * Not used. + * @format int64 + */ + projectId?: number; + /** The user assigned to issues created with this component, when `assigneeType` does not identify a valid assignee. */ + realAssignee?: User; + /** + * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set from the `assigneeType`. For example, `assigneeType` is set to `COMPONENT_LEAD` but no component lead is set. This property is set to one of the following values: + * + * * `PROJECT_LEAD` when `assigneeType` is `PROJECT_LEAD` and the project lead has permission to be assigned issues in the project that the component is in. + * * `COMPONENT_LEAD` when `assignee`Type is `COMPONENT_LEAD` and the component lead has permission to be assigned issues in the project that the component is in. + * * `UNASSIGNED` when `assigneeType` is `UNASSIGNED` and Jira is configured to allow unassigned issues. + * * `PROJECT_DEFAULT` when none of the preceding cases are true. + */ + realAssigneeType?: "PROJECT_DEFAULT" | "COMPONENT_LEAD" | "PROJECT_LEAD" | "UNASSIGNED"; + /** + * The URL for this count of the issues contained in the component. + * @format uri + */ + self?: string; +} + +/** A JQL query clause that consists of nested clauses. For example, `(labels in (urgent, blocker) OR lastCommentedBy = currentUser()). Note that, where nesting is not defined, the parser nests JQL clauses based on the operator precedence. For example, "A OR B AND C" is parsed as "(A OR B) AND C". See Setting the precedence of operators for more information about precedence in JQL queries.` */ +export interface CompoundClause { + /** The list of nested clauses. */ + clauses: JqlQueryClause[]; + /** The operator between the clauses. */ + operator: "and" | "or" | "not"; +} + +/** Details about the configuration of Jira. */ +export interface Configuration { + /** Whether the ability to add attachments to issues is enabled. */ + attachmentsEnabled?: boolean; + /** Whether the ability to link issues is enabled. */ + issueLinkingEnabled?: boolean; + /** Whether the ability to create subtasks for issues is enabled. */ + subTasksEnabled?: boolean; + /** The configuration of time tracking. */ + timeTrackingConfiguration?: TimeTrackingConfiguration; + /** Whether the ability to track time is enabled. This property is deprecated. */ + timeTrackingEnabled?: boolean; + /** Whether the ability to create unassigned issues is enabled. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for details. */ + unassignedIssuesAllowed?: boolean; + /** Whether the ability for users to vote on issues is enabled. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for details. */ + votingEnabled?: boolean; + /** Whether the ability for users to watch issues is enabled. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for details. */ + watchingEnabled?: boolean; +} + +/** A list of custom field details. */ +export interface ConnectCustomFieldValue { + /** The type of custom field. */ + _type: + | "StringIssueField" + | "NumberIssueField" + | "RichTextIssueField" + | "SingleSelectIssueField" + | "MultiSelectIssueField" + | "TextIssueField"; + /** The custom field ID. */ + fieldID: number; + /** The issue ID. */ + issueID: number; + /** The value of number type custom field when `_type` is `NumberIssueField`. */ + number?: number; + /** The value of single select and multiselect custom field type when `_type` is `SingleSelectIssueField` or `MultiSelectIssueField`. */ + optionID?: string; + /** The value of richText type custom field when `_type` is `RichTextIssueField`. */ + richText?: string; + /** The value of string type custom field when `_type` is `StringIssueField`. */ + string?: string; + /** The value of of text custom field type when `_type` is `TextIssueField`. */ + text?: string; +} + +/** Details of updates for a custom field. */ +export interface ConnectCustomFieldValues { + /** The list of custom field update details. */ + updateValueList?: ConnectCustomFieldValue[]; +} + +/** + * A [Connect module](https://developer.atlassian.com/cloud/jira/platform/about-jira-modules/) in the same format as in the + * [app descriptor](https://developer.atlassian.com/cloud/jira/platform/app-descriptor/). + * @example {"description":{"value":"field with team"},"extractions":[{"name":"categoryName","path":"category","type":"text"}],"key":"team-field","name":{"value":"Team"},"type":"single_select"} + */ +export type ConnectModule = object; + +/** @example {"jiraEntityProperties":[{"entityType":"issue","key":"dynamic-attachment-entity-property","keyConfigurations":[{"extractions":[{"alias":"attachmentExtension","objectName":"extension","type":"text"}],"propertyKey":"attachment"}],"name":{"value":"Attachment Index Document"}}],"jiraIssueFields":[{"description":{"value":"A dynamically added single-select field"},"extractions":[{"name":"categoryName","path":"category","type":"text"}],"key":"dynamic-select-field","name":{"value":"Dynamic single select"},"type":"single_select"}]} */ +export interface ConnectModules { + /** + * A list of app modules in the same format as the `modules` property in the + * [app descriptor](https://developer.atlassian.com/cloud/jira/platform/app-descriptor/). + */ + modules: ConnectModule[]; +} + +/** A workflow transition rule. */ +export interface ConnectWorkflowTransitionRule { + /** A rule configuration. */ + configuration: RuleConfiguration; + /** The ID of the transition rule. */ + id: string; + /** The key of the rule, as defined in the Connect app descriptor. */ + key: string; + transition?: WorkflowTransition; +} + +/** The list of features on a project. */ +export interface ContainerForProjectFeatures { + /** The project features. */ + features?: ProjectFeature[]; +} + +/** Container for a list of registered webhooks. Webhook details are returned in the same order as the request. */ +export interface ContainerForRegisteredWebhooks { + /** A list of registered webhooks. */ + webhookRegistrationResult?: RegisteredWebhook[]; +} + +/** Container for a list of webhook IDs. */ +export interface ContainerForWebhookIDs { + /** A list of webhook IDs. */ + webhookIds: number[]; +} + +/** A container for a list of workflow schemes together with the projects they are associated with. */ +export interface ContainerOfWorkflowSchemeAssociations { + /** A list of workflow schemes together with projects they are associated with. */ + values: WorkflowSchemeAssociations[]; +} + +/** A context. */ +export interface Context { + /** + * The ID of the context. + * @format int64 + */ + id?: number; + /** The name of the context. */ + name?: string; + /** The scope of the context. */ + scope?: Scope; +} + +/** The project and issue type mapping with a matching custom field context. */ +export interface ContextForProjectAndIssueType { + /** The ID of the custom field context. */ + contextId: string; + /** The ID of the issue type. */ + issueTypeId: string; + /** The ID of the project. */ + projectId: string; +} + +/** Details of the contextual configuration for a custom field. */ +export interface ContextualConfiguration { + /** The field configuration. */ + configuration?: any; + /** The ID of the field context the configuration is associated with. */ + fieldContextId: string; + /** The ID of the configuration. */ + id: string; + /** The field value schema. */ + schema?: any; +} + +/** The converted JQL queries. */ +export interface ConvertedJQLQueries { + /** List of queries containing user information that could not be mapped to an existing user */ + queriesWithUnknownUsers?: JQLQueryWithUnknownUsers[]; + /** The list of converted query strings with account IDs in place of user identifiers. */ + queryStrings?: string[]; +} + +/** The details of a created custom field context. */ +export interface CreateCustomFieldContext { + /** The description of the context. */ + description?: string; + /** The ID of the context. */ + id?: string; + /** The list of issue types IDs for the context. If the list is empty, the context refers to all issue types. */ + issueTypeIds?: string[]; + /** The name of the context. */ + name: string; + /** The list of project IDs associated with the context. If the list is empty, the context is global. */ + projectIds?: string[]; +} + +/** Details of an notification scheme. */ +export interface CreateNotificationSchemeDetails { + /** + * The description of the notification scheme. + * @maxLength 4000 + */ + description?: string; + /** + * The name of the notification scheme. Must be unique (case-insensitive). + * @maxLength 255 + */ + name: string; + /** The list of notifications which should be added to the notification scheme. */ + notificationSchemeEvents?: NotificationSchemeEventDetails[]; + [key: string]: any; +} + +/** Details of an issue priority. */ +export interface CreatePriorityDetails { + /** + * The description of the priority. + * @maxLength 255 + */ + description?: string; + /** + * The URL of an icon for the priority. Accepted protocols are HTTP and HTTPS. Built in icons can also be used. + * @maxLength 255 + */ + iconUrl?: + | "/images/icons/priorities/blocker.png" + | "/images/icons/priorities/critical.png" + | "/images/icons/priorities/high.png" + | "/images/icons/priorities/highest.png" + | "/images/icons/priorities/low.png" + | "/images/icons/priorities/lowest.png" + | "/images/icons/priorities/major.png" + | "/images/icons/priorities/medium.png" + | "/images/icons/priorities/minor.png" + | "/images/icons/priorities/trivial.png"; + /** + * The name of the priority. Must be unique. + * @maxLength 60 + */ + name: string; + /** The status color of the priority in 3-digit or 6-digit hexadecimal format. */ + statusColor: string; + [key: string]: any; +} + +/** Details about the project. */ +export interface CreateProjectDetails { + /** The default assignee when creating issues for this project. */ + assigneeType?: "PROJECT_LEAD" | "UNASSIGNED"; + /** + * An integer value for the project's avatar. + * @format int64 + */ + avatarId?: number; + /** + * The ID of the project's category. A complete list of category IDs is found using the [Get all project categories](#api-rest-api-3-projectCategory-get) operation. + * @format int64 + */ + categoryId?: number; + /** A brief description of the project. */ + description?: string; + /** + * The ID of the field configuration scheme for the project. Use the [Get all field configuration schemes](#api-rest-api-3-fieldconfigurationscheme-get) operation to get a list of field configuration scheme IDs. If you specify the field configuration scheme you cannot specify the project template key. + * @format int64 + */ + fieldConfigurationScheme?: number; + /** + * The ID of the issue security scheme for the project, which enables you to control who can and cannot view issues. Use the [Get issue security schemes](#api-rest-api-3-issuesecurityschemes-get) resource to get all issue security scheme IDs. + * @format int64 + */ + issueSecurityScheme?: number; + /** + * The ID of the issue type scheme for the project. Use the [Get all issue type schemes](#api-rest-api-3-issuetypescheme-get) operation to get a list of issue type scheme IDs. If you specify the issue type scheme you cannot specify the project template key. + * @format int64 + */ + issueTypeScheme?: number; + /** + * The ID of the issue type screen scheme for the project. Use the [Get all issue type screen schemes](#api-rest-api-3-issuetypescreenscheme-get) operation to get a list of issue type screen scheme IDs. If you specify the issue type screen scheme you cannot specify the project template key. + * @format int64 + */ + issueTypeScreenScheme?: number; + /** Project keys must be unique and start with an uppercase letter followed by one or more uppercase alphanumeric characters. The maximum length is 10 characters. */ + key: string; + /** This parameter is deprecated because of privacy changes. Use `leadAccountId` instead. See the [migration guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. The user name of the project lead. Either `lead` or `leadAccountId` must be set when creating a project. Cannot be provided with `leadAccountId`. */ + lead?: string; + /** + * The account ID of the project lead. Either `lead` or `leadAccountId` must be set when creating a project. Cannot be provided with `lead`. + * @maxLength 128 + */ + leadAccountId?: string; + /** The name of the project. */ + name: string; + /** + * The ID of the notification scheme for the project. Use the [Get notification schemes](#api-rest-api-3-notificationscheme-get) resource to get a list of notification scheme IDs. + * @format int64 + */ + notificationScheme?: number; + /** + * The ID of the permission scheme for the project. Use the [Get all permission schemes](#api-rest-api-3-permissionscheme-get) resource to see a list of all permission scheme IDs. + * @format int64 + */ + permissionScheme?: number; + /** A predefined configuration for a project. The type of the `projectTemplateKey` must match with the type of the `projectTypeKey`. */ + projectTemplateKey?: + | "com.pyxis.greenhopper.jira:gh-simplified-agility-kanban" + | "com.pyxis.greenhopper.jira:gh-simplified-agility-scrum" + | "com.pyxis.greenhopper.jira:gh-simplified-basic" + | "com.pyxis.greenhopper.jira:gh-simplified-kanban-classic" + | "com.pyxis.greenhopper.jira:gh-simplified-scrum-classic" + | "com.atlassian.servicedesk:simplified-it-service-management" + | "com.atlassian.servicedesk:simplified-general-service-desk" + | "com.atlassian.servicedesk:simplified-general-service-desk-it" + | "com.atlassian.servicedesk:simplified-general-service-desk-business" + | "com.atlassian.servicedesk:simplified-internal-service-desk" + | "com.atlassian.servicedesk:simplified-external-service-desk" + | "com.atlassian.servicedesk:simplified-hr-service-desk" + | "com.atlassian.servicedesk:simplified-facilities-service-desk" + | "com.atlassian.servicedesk:simplified-legal-service-desk" + | "com.atlassian.servicedesk:simplified-marketing-service-desk" + | "com.atlassian.servicedesk:simplified-finance-service-desk" + | "com.atlassian.servicedesk:simplified-analytics-service-desk" + | "com.atlassian.servicedesk:simplified-halp-service-desk" + | "com.atlassian.servicedesk:simplified-custom-project-service-desk" + | "com.atlassian.jira-core-project-templates:jira-core-simplified-content-management" + | "com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval" + | "com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking" + | "com.atlassian.jira-core-project-templates:jira-core-simplified-process-control" + | "com.atlassian.jira-core-project-templates:jira-core-simplified-procurement" + | "com.atlassian.jira-core-project-templates:jira-core-simplified-project-management" + | "com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment" + | "com.atlassian.jira-core-project-templates:jira-core-simplified-task-"; + /** The [project type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes), which defines the application-specific feature set. If you don't specify the project template you have to specify the project type. */ + projectTypeKey?: "software" | "service_desk" | "business"; + /** A link to information about this project, such as project documentation */ + url?: string; + /** + * The ID of the workflow scheme for the project. Use the [Get all workflow schemes](#api-rest-api-3-workflowscheme-get) operation to get a list of workflow scheme IDs. If you specify the workflow scheme you cannot specify the project template key. + * @format int64 + */ + workflowScheme?: number; +} + +/** Details of an issue resolution. */ +export interface CreateResolutionDetails { + /** + * The description of the resolution. + * @maxLength 255 + */ + description?: string; + /** + * The name of the resolution. Must be unique (case-insensitive). + * @maxLength 60 + */ + name: string; + [key: string]: any; +} + +/** The details of a UI modification. */ +export interface CreateUiModificationDetails { + /** List of contexts of the UI modification. The maximum number of contexts is 1000. */ + contexts?: UiModificationContextDetails[]; + /** The data of the UI modification. The maximum size of the data is 50000 characters. */ + data?: string; + /** The description of the UI modification. The maximum length is 255 characters. */ + description?: string; + /** The name of the UI modification. The maximum length is 255 characters. */ + name: string; +} + +export interface CreateUpdateRoleRequestBean { + /** A description of the project role. Required when fully updating a project role. Optional when creating or partially updating a project role. */ + description?: string; + /** The name of the project role. Must be unique. Cannot begin or end with whitespace. The maximum length is 255 characters. Required when creating a project role. Optional when partially updating a project role. */ + name?: string; +} + +/** A workflow transition condition. */ +export interface CreateWorkflowCondition { + /** The list of workflow conditions. */ + conditions?: CreateWorkflowCondition[]; + /** EXPERIMENTAL. The configuration of the transition rule. */ + configuration?: Record; + /** The compound condition operator. */ + operator?: "AND" | "OR"; + /** The type of the transition rule. */ + type?: string; +} + +/** The details of a workflow. */ +export interface CreateWorkflowDetails { + /** The description of the workflow. The maximum length is 1000 characters. */ + description?: string; + /** The name of the workflow. The name must be unique. The maximum length is 255 characters. Characters can be separated by a whitespace but the name cannot start or end with a whitespace. */ + name: string; + /** + * The statuses of the workflow. Any status that does not include a transition is added to the workflow without a transition. + * @uniqueItems true + */ + statuses: CreateWorkflowStatusDetails[]; + /** + * The transitions of the workflow. For the request to be valid, these transitions must: + * + * * include one *initial* transition. + * * not use the same name for a *global* and *directed* transition. + * * have a unique name for each *global* transition. + * * have a unique 'to' status for each *global* transition. + * * have unique names for each transition from a status. + * * not have a 'from' status on *initial* and *global* transitions. + * * have a 'from' status on *directed* transitions. + * + * All the transition statuses must be included in `statuses`. + */ + transitions: CreateWorkflowTransitionDetails[]; +} + +/** The details of a transition status. */ +export interface CreateWorkflowStatusDetails { + /** The ID of the status. */ + id: string; + /** The properties of the status. */ + properties?: Record; +} + +/** The details of a workflow transition. */ +export interface CreateWorkflowTransitionDetails { + /** The description of the transition. The maximum length is 1000 characters. */ + description?: string; + /** The statuses the transition can start from. */ + from?: string[]; + /** The name of the transition. The maximum length is 60 characters. */ + name: string; + /** The properties of the transition. */ + properties?: Record; + /** The rules of the transition. */ + rules?: CreateWorkflowTransitionRulesDetails; + /** The screen of the transition. */ + screen?: CreateWorkflowTransitionScreenDetails; + /** The status the transition goes to. */ + to: string; + /** The type of the transition. */ + type: "global" | "initial" | "directed"; +} + +/** A workflow transition rule. */ +export interface CreateWorkflowTransitionRule { + /** EXPERIMENTAL. The configuration of the transition rule. */ + configuration?: Record; + /** The type of the transition rule. */ + type: string; +} + +/** The details of a workflow transition rules. */ +export interface CreateWorkflowTransitionRulesDetails { + /** The workflow conditions. */ + conditions?: CreateWorkflowCondition; + /** + * The workflow post functions. + * + * **Note:** The default post functions are always added to the *initial* transition, as in: + * + * "postFunctions": [ + * { + * "type": "IssueCreateFunction" + * }, + * { + * "type": "IssueReindexFunction" + * }, + * { + * "type": "FireIssueEventFunction", + * "configuration": { + * "event": { + * "id": "1", + * "name": "issue_created" + * } + * } + * } + * ] + * + * **Note:** The default post functions are always added to the *global* and *directed* transitions, as in: + * + * "postFunctions": [ + * { + * "type": "UpdateIssueStatusFunction" + * }, + * { + * "type": "CreateCommentFunction" + * }, + * { + * "type": "GenerateChangeHistoryFunction" + * }, + * { + * "type": "IssueReindexFunction" + * }, + * { + * "type": "FireIssueEventFunction", + * "configuration": { + * "event": { + * "id": "13", + * "name": "issue_generic" + * } + * } + * } + * ] + */ + postFunctions?: CreateWorkflowTransitionRule[]; + /** + * The workflow validators. + * + * **Note:** The default permission validator is always added to the *initial* transition, as in: + * + * "validators": [ + * { + * "type": "PermissionValidator", + * "configuration": { + * "permissionKey": "CREATE_ISSUES" + * } + * } + * ] + */ + validators?: CreateWorkflowTransitionRule[]; +} + +/** The details of a transition screen. */ +export interface CreateWorkflowTransitionScreenDetails { + /** The ID of the screen. */ + id: string; +} + +/** Details about a created issue or subtask. */ +export interface CreatedIssue { + /** The ID of the created issue or subtask. */ + id?: string; + /** The key of the created issue or subtask. */ + key?: string; + /** The URL of the created issue or subtask. */ + self?: string; + /** The response code and messages related to any requested transition. */ + transition?: NestedResponse; + /** The response code and messages related to any requested watchers. */ + watchers?: NestedResponse; +} + +/** Details about the issues created and the errors for requests that failed. */ +export interface CreatedIssues { + /** Error details for failed issue creation requests. */ + errors?: BulkOperationErrorResult[]; + /** Details of the issues created. */ + issues?: CreatedIssue[]; +} + +export type CustomContextVariable = BaseCustomContextVariable & + ( + | BaseCustomContextVariableTypeMapping<"issue", IssueContextVariable> + | BaseCustomContextVariableTypeMapping<"json", JsonContextVariable> + | BaseCustomContextVariableTypeMapping<"user", UserContextVariable> + ); + +/** Details of configurations for a custom field. */ +export interface CustomFieldConfigurations { + /** + * The list of custom field configuration details. + * @maxItems 1000 + * @minItems 1 + * @uniqueItems true + */ + configurations: ContextualConfiguration[]; +} + +/** The details of a custom field context. */ +export interface CustomFieldContext { + /** The description of the context. */ + description: string; + /** The ID of the context. */ + id: string; + /** Whether the context apply to all issue types. */ + isAnyIssueType: boolean; + /** Whether the context is global. */ + isGlobalContext: boolean; + /** The name of the context. */ + name: string; +} + +export type CustomFieldContextDefaultValue = BaseCustomFieldContextDefaultValue & + ( + | BaseCustomFieldContextDefaultValueTypeMapping<"datepicker", CustomFieldContextDefaultValueDate> + | BaseCustomFieldContextDefaultValueTypeMapping<"datetimepicker", CustomFieldContextDefaultValueDateTime> + | BaseCustomFieldContextDefaultValueTypeMapping<"float", CustomFieldContextDefaultValueFloat> + | BaseCustomFieldContextDefaultValueTypeMapping<"forge.datetime", CustomFieldContextDefaultValueForgeDateTimeField> + | BaseCustomFieldContextDefaultValueTypeMapping<"forge.group", CustomFieldContextDefaultValueForgeGroupField> + | BaseCustomFieldContextDefaultValueTypeMapping< + "forge.group.list", + CustomFieldContextDefaultValueForgeMultiGroupField + > + | BaseCustomFieldContextDefaultValueTypeMapping<"forge.number", CustomFieldContextDefaultValueForgeNumberField> + | BaseCustomFieldContextDefaultValueTypeMapping<"forge.object", CustomFieldContextDefaultValueForgeObjectField> + | BaseCustomFieldContextDefaultValueTypeMapping<"forge.string", CustomFieldContextDefaultValueForgeStringField> + | BaseCustomFieldContextDefaultValueTypeMapping< + "forge.string.list", + CustomFieldContextDefaultValueForgeMultiStringField + > + | BaseCustomFieldContextDefaultValueTypeMapping<"forge.user", CustomFieldContextDefaultValueForgeUserField> + | BaseCustomFieldContextDefaultValueTypeMapping< + "forge.user.list", + CustomFieldContextDefaultValueForgeMultiUserField + > + | BaseCustomFieldContextDefaultValueTypeMapping< + "grouppicker.multiple", + CustomFieldContextDefaultValueMultipleGroupPicker + > + | BaseCustomFieldContextDefaultValueTypeMapping< + "grouppicker.single", + CustomFieldContextDefaultValueSingleGroupPicker + > + | BaseCustomFieldContextDefaultValueTypeMapping<"labels", CustomFieldContextDefaultValueLabels> + | BaseCustomFieldContextDefaultValueTypeMapping<"multi.user.select", CustomFieldContextDefaultValueMultiUserPicker> + | BaseCustomFieldContextDefaultValueTypeMapping<"option.cascading", CustomFieldContextDefaultValueCascadingOption> + | BaseCustomFieldContextDefaultValueTypeMapping<"option.multiple", CustomFieldContextDefaultValueMultipleOption> + | BaseCustomFieldContextDefaultValueTypeMapping<"option.single", CustomFieldContextDefaultValueSingleOption> + | BaseCustomFieldContextDefaultValueTypeMapping<"project", CustomFieldContextDefaultValueProject> + | BaseCustomFieldContextDefaultValueTypeMapping<"readonly", CustomFieldContextDefaultValueReadOnly> + | BaseCustomFieldContextDefaultValueTypeMapping<"single.user.select", CustomFieldContextSingleUserPickerDefaults> + | BaseCustomFieldContextDefaultValueTypeMapping<"textarea", CustomFieldContextDefaultValueTextArea> + | BaseCustomFieldContextDefaultValueTypeMapping<"textfield", CustomFieldContextDefaultValueTextField> + | BaseCustomFieldContextDefaultValueTypeMapping<"url", CustomFieldContextDefaultValueURL> + | BaseCustomFieldContextDefaultValueTypeMapping< + "version.multiple", + CustomFieldContextDefaultValueMultipleVersionPicker + > + | BaseCustomFieldContextDefaultValueTypeMapping<"version.single", CustomFieldContextDefaultValueSingleVersionPicker> + ); + +/** The default value for a cascading select custom field. */ +export interface CustomFieldContextDefaultValueCascadingOption { + /** The ID of the default cascading option. */ + cascadingOptionId?: string; + /** The ID of the context. */ + contextId: string; + /** The ID of the default option. */ + optionId: string; + type: string; +} + +/** The default value for a Date custom field. */ +export interface CustomFieldContextDefaultValueDate { + /** The default date in ISO format. Ignored if `useCurrent` is true. */ + date?: string; + type: string; + /** + * Whether to use the current date. + * @default false + */ + useCurrent?: boolean; +} + +/** The default value for a date time custom field. */ +export interface CustomFieldContextDefaultValueDateTime { + /** The default date-time in ISO format. Ignored if `useCurrent` is true. */ + dateTime?: string; + type: string; + /** + * Whether to use the current date. + * @default false + */ + useCurrent?: boolean; +} + +/** Default value for a float (number) custom field. */ +export interface CustomFieldContextDefaultValueFloat { + /** + * The default floating-point number. + * @format double + */ + number: number; + type: string; +} + +/** The default value for a Forge date time custom field. */ +export interface CustomFieldContextDefaultValueForgeDateTimeField { + /** The ID of the context. */ + contextId: string; + /** The default date-time in ISO format. Ignored if `useCurrent` is true. */ + dateTime?: string; + type: string; + /** + * Whether to use the current date. + * @default false + */ + useCurrent?: boolean; +} + +/** The default value for a Forge group custom field. */ +export interface CustomFieldContextDefaultValueForgeGroupField { + /** The ID of the context. */ + contextId: string; + /** The ID of the the default group. */ + groupId: string; + type: string; +} + +/** The default value for a Forge collection of groups custom field. */ +export interface CustomFieldContextDefaultValueForgeMultiGroupField { + /** The ID of the context. */ + contextId: string; + /** + * The IDs of the default groups. + * @uniqueItems true + */ + groupIds: string[]; + type: string; +} + +/** The default text for a Forge collection of strings custom field. */ +export interface CustomFieldContextDefaultValueForgeMultiStringField { + type: string; + /** List of string values. The maximum length for a value is 254 characters. */ + values?: string[]; +} + +/** Defaults for a Forge collection of users custom field. */ +export interface CustomFieldContextDefaultValueForgeMultiUserField { + /** The IDs of the default users. */ + accountIds: string[]; + /** The ID of the context. */ + contextId: string; + type: string; +} + +/** Default value for a Forge number custom field. */ +export interface CustomFieldContextDefaultValueForgeNumberField { + /** The ID of the context. */ + contextId: string; + /** + * The default floating-point number. + * @format double + */ + number: number; + type: string; +} + +/** The default value for a Forge object custom field. */ +export interface CustomFieldContextDefaultValueForgeObjectField { + /** The default JSON object. */ + object?: object; + type: string; +} + +/** The default text for a Forge string custom field. */ +export interface CustomFieldContextDefaultValueForgeStringField { + /** The ID of the context. */ + contextId: string; + /** The default text. The maximum length is 254 characters. */ + text?: string; + type: string; +} + +/** Defaults for a Forge user custom field. */ +export interface CustomFieldContextDefaultValueForgeUserField { + /** The ID of the default user. */ + accountId: string; + /** The ID of the context. */ + contextId: string; + type: string; + /** Filter for a User Picker (single) custom field. */ + userFilter: UserFilter; +} + +/** Default value for a labels custom field. */ +export interface CustomFieldContextDefaultValueLabels { + /** The default labels value. */ + labels: string[]; + type: string; +} + +/** The default value for a User Picker (multiple) custom field. */ +export interface CustomFieldContextDefaultValueMultiUserPicker { + /** The IDs of the default users. */ + accountIds: string[]; + /** The ID of the context. */ + contextId: string; + type: string; +} + +/** The default value for a multiple group picker custom field. */ +export interface CustomFieldContextDefaultValueMultipleGroupPicker { + /** The ID of the context. */ + contextId: string; + /** + * The IDs of the default groups. + * @uniqueItems true + */ + groupIds: string[]; + type: string; +} + +/** The default value for a multi-select custom field. */ +export interface CustomFieldContextDefaultValueMultipleOption { + /** The ID of the context. */ + contextId: string; + /** The list of IDs of the default options. */ + optionIds: string[]; + type: string; +} + +/** The default value for a multiple version picker custom field. */ +export interface CustomFieldContextDefaultValueMultipleVersionPicker { + type: string; + /** + * The IDs of the default versions. + * @uniqueItems true + */ + versionIds: string[]; + /** The order the pickable versions are displayed in. If not provided, the released-first order is used. Available version orders are `"releasedFirst"` and `"unreleasedFirst"`. */ + versionOrder?: string; +} + +/** The default value for a project custom field. */ +export interface CustomFieldContextDefaultValueProject { + /** The ID of the context. */ + contextId: string; + /** The ID of the default project. */ + projectId: string; + type: string; +} + +/** The default text for a read only custom field. */ +export interface CustomFieldContextDefaultValueReadOnly { + /** The default text. The maximum length is 255 characters. */ + text?: string; + type: string; +} + +/** The default value for a group picker custom field. */ +export interface CustomFieldContextDefaultValueSingleGroupPicker { + /** The ID of the context. */ + contextId: string; + /** The ID of the the default group. */ + groupId: string; + type: string; +} + +/** The default value for a single select custom field. */ +export interface CustomFieldContextDefaultValueSingleOption { + /** The ID of the context. */ + contextId: string; + /** The ID of the default option. */ + optionId: string; + type: string; +} + +/** The default value for a version picker custom field. */ +export interface CustomFieldContextDefaultValueSingleVersionPicker { + type: string; + /** The ID of the default version. */ + versionId: string; + /** The order the pickable versions are displayed in. If not provided, the released-first order is used. Available version orders are `"releasedFirst"` and `"unreleasedFirst"`. */ + versionOrder?: string; +} + +/** The default text for a text area custom field. */ +export interface CustomFieldContextDefaultValueTextArea { + /** The default text. The maximum length is 32767 characters. */ + text?: string; + type: string; +} + +/** The default text for a text custom field. */ +export interface CustomFieldContextDefaultValueTextField { + /** The default text. The maximum length is 254 characters. */ + text?: string; + type: string; +} + +/** The default value for a URL custom field. */ +export interface CustomFieldContextDefaultValueURL { + /** The ID of the context. */ + contextId: string; + type: string; + /** The default URL. */ + url: string; +} + +/** Default values to update. */ +export interface CustomFieldContextDefaultValueUpdate { + defaultValues?: CustomFieldContextDefaultValue[]; +} + +/** Details of the custom field options for a context. */ +export interface CustomFieldContextOption { + /** Whether the option is disabled. */ + disabled: boolean; + /** The ID of the custom field option. */ + id: string; + /** For cascading options, the ID of the custom field option containing the cascading option. */ + optionId?: string; + /** The value of the custom field option. */ + value: string; +} + +/** Details of a context to project association. */ +export interface CustomFieldContextProjectMapping { + /** The ID of the context. */ + contextId: string; + /** Whether context is global. */ + isGlobalContext?: boolean; + /** The ID of the project. */ + projectId?: string; +} + +/** Defaults for a User Picker (single) custom field. */ +export interface CustomFieldContextSingleUserPickerDefaults { + /** The ID of the default user. */ + accountId: string; + /** The ID of the context. */ + contextId: string; + type: string; + /** Filter for a User Picker (single) custom field. */ + userFilter: UserFilter; +} + +/** Details of a custom field context. */ +export interface CustomFieldContextUpdateDetails { + /** The description of the custom field context. The maximum length is 255 characters. */ + description?: string; + /** The name of the custom field context. The name must be unique. The maximum length is 255 characters. */ + name?: string; +} + +/** A list of custom field options for a context. */ +export interface CustomFieldCreatedContextOptionsList { + /** The created custom field options. */ + options?: CustomFieldContextOption[]; +} + +export interface CustomFieldDefinitionJsonBean { + /** The description of the custom field, which is displayed in Jira. */ + description?: string; + /** The name of the custom field, which is displayed in Jira. This is not the unique identifier. */ + name: string; + /** + * The searcher defines the way the field is searched in Jira. For example, *com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher*. + * The search UI (basic search and JQL search) will display different operations and values for the field, based on the field searcher. You must specify a searcher that is valid for the field type, as listed below (abbreviated values shown): + * + * * `cascadingselect`: `cascadingselectsearcher` + * * `datepicker`: `daterange` + * * `datetime`: `datetimerange` + * * `float`: `exactnumber` or `numberrange` + * * `grouppicker`: `grouppickersearcher` + * * `importid`: `exactnumber` or `numberrange` + * * `labels`: `labelsearcher` + * * `multicheckboxes`: `multiselectsearcher` + * * `multigrouppicker`: `multiselectsearcher` + * * `multiselect`: `multiselectsearcher` + * * `multiuserpicker`: `userpickergroupsearcher` + * * `multiversion`: `versionsearcher` + * * `project`: `projectsearcher` + * * `radiobuttons`: `multiselectsearcher` + * * `readonlyfield`: `textsearcher` + * * `select`: `multiselectsearcher` + * * `textarea`: `textsearcher` + * * `textfield`: `textsearcher` + * * `url`: `exacttextsearcher` + * * `userpicker`: `userpickergroupsearcher` + * * `version`: `versionsearcher` + * + * If no searcher is provided, the field isn't searchable. However, [Forge custom fields](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-) have a searcher set automatically, so are always searchable. + */ + searcherKey?: + | "com.atlassian.jira.plugin.system.customfieldtypes:cascadingselectsearcher" + | "com.atlassian.jira.plugin.system.customfieldtypes:daterange" + | "com.atlassian.jira.plugin.system.customfieldtypes:datetimerange" + | "com.atlassian.jira.plugin.system.customfieldtypes:exactnumber" + | "com.atlassian.jira.plugin.system.customfieldtypes:exacttextsearcher" + | "com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher" + | "com.atlassian.jira.plugin.system.customfieldtypes:labelsearcher" + | "com.atlassian.jira.plugin.system.customfieldtypes:multiselectsearcher" + | "com.atlassian.jira.plugin.system.customfieldtypes:numberrange" + | "com.atlassian.jira.plugin.system.customfieldtypes:projectsearcher" + | "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher" + | "com.atlassian.jira.plugin.system.customfieldtypes:userpickergroupsearcher" + | "com.atlassian.jira.plugin.system.customfieldtypes:versionsearcher"; + /** + * The type of the custom field. These built-in custom field types are available: + * + * * `cascadingselect`: Enables values to be selected from two levels of select lists (value: `com.atlassian.jira.plugin.system.customfieldtypes:cascadingselect`) + * * `datepicker`: Stores a date using a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:datepicker`) + * * `datetime`: Stores a date with a time component (value: `com.atlassian.jira.plugin.system.customfieldtypes:datetime`) + * * `float`: Stores and validates a numeric (floating point) input (value: `com.atlassian.jira.plugin.system.customfieldtypes:float`) + * * `grouppicker`: Stores a user group using a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:grouppicker`) + * * `importid`: A read-only field that stores the ID the issue had in the system it was imported from (value: `com.atlassian.jira.plugin.system.customfieldtypes:importid`) + * * `labels`: Stores labels (value: `com.atlassian.jira.plugin.system.customfieldtypes:labels`) + * * `multicheckboxes`: Stores multiple values using checkboxes (value: ``) + * * `multigrouppicker`: Stores multiple user groups using a picker control (value: ``) + * * `multiselect`: Stores multiple values using a select list (value: `com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes`) + * * `multiuserpicker`: Stores multiple users using a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:multigrouppicker`) + * * `multiversion`: Stores multiple versions from the versions available in a project using a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:multiversion`) + * * `project`: Stores a project from a list of projects that the user is permitted to view (value: `com.atlassian.jira.plugin.system.customfieldtypes:project`) + * * `radiobuttons`: Stores a value using radio buttons (value: `com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons`) + * * `readonlyfield`: Stores a read-only text value, which can only be populated via the API (value: `com.atlassian.jira.plugin.system.customfieldtypes:readonlyfield`) + * * `select`: Stores a value from a configurable list of options (value: `com.atlassian.jira.plugin.system.customfieldtypes:select`) + * * `textarea`: Stores a long text string using a multiline text area (value: `com.atlassian.jira.plugin.system.customfieldtypes:textarea`) + * * `textfield`: Stores a text string using a single-line text box (value: `com.atlassian.jira.plugin.system.customfieldtypes:textfield`) + * * `url`: Stores a URL (value: `com.atlassian.jira.plugin.system.customfieldtypes:url`) + * * `userpicker`: Stores a user using a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:userpicker`) + * * `version`: Stores a version using a picker control (value: `com.atlassian.jira.plugin.system.customfieldtypes:version`) + * + * To create a field based on a [Forge custom field type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/#jira-custom-field-type--beta-), use the ID of the Forge custom field type as the value. For example, `ari:cloud:ecosystem::extension/e62f20a2-4b61-4dbe-bfb9-9a88b5e3ac84/548c5df1-24aa-4f7c-bbbb-3038d947cb05/static/my-cf-type-key`. + */ + type: string; +} + +/** Details of a custom option for a field. */ +export interface CustomFieldOption { + /** + * The URL of these custom field option details. + * @format uri + */ + self?: string; + /** The value of the custom field option. */ + value?: string; +} + +/** Details of a custom field option to create. */ +export interface CustomFieldOptionCreate { + /** Whether the option is disabled. */ + disabled?: boolean; + /** For cascading options, the ID of the custom field object containing the cascading option. */ + optionId?: string; + /** The value of the custom field option. */ + value: string; +} + +/** Details of a custom field option for a context. */ +export interface CustomFieldOptionUpdate { + /** Whether the option is disabled. */ + disabled?: boolean; + /** The ID of the custom field option. */ + id: string; + /** The value of the custom field option. */ + value?: string; +} + +/** Details about the replacement for a deleted version. */ +export interface CustomFieldReplacement { + /** + * The ID of the custom field in which to replace the version number. + * @format int64 + */ + customFieldId?: number; + /** + * The version number to use as a replacement for the deleted version. + * @format int64 + */ + moveTo?: number; +} + +/** A list of custom field options for a context. */ +export interface CustomFieldUpdatedContextOptionsList { + /** The updated custom field options. */ + options?: CustomFieldOptionUpdate[]; +} + +/** A list of issue IDs and the value to update a custom field to. */ +export interface CustomFieldValueUpdate { + /** The list of issue IDs. */ + issueIds: number[]; + /** + * The value for the custom field. The value must be compatible with the [custom field type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/#data-types) as follows: + * + * * `string` the value must be a string. + * * `number` the value must be a number. + * * `datetime` the value must be a string that represents a date in the ISO format or the simplified extended ISO format. For example, `"2023-01-18T12:00:00-03:00"` or `"2023-01-18T12:00:00.000Z"`. However, the milliseconds part is ignored. + * * `user` the value must be an object that contains the `accountId` field. + * * `group` the value must be an object that contains the group `name` or `groupId` field. Because group names can change, we recommend using `groupId`. + * + * A list of appropriate values must be provided if the field is of the `list` [collection type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/#collection-types). + */ + value: any; +} + +/** Details of updates for a custom field. */ +export interface CustomFieldValueUpdateDetails { + /** The list of custom field update details. */ + updates?: CustomFieldValueUpdate[]; +} + +/** Details of a dashboard. */ +export interface Dashboard { + /** + * The automatic refresh interval for the dashboard in milliseconds. + * @format int32 + */ + automaticRefreshMs?: number; + description?: string; + /** The details of any edit share permissions for the dashboard. */ + editPermissions?: SharePermission[]; + /** The ID of the dashboard. */ + id?: string; + /** Whether the dashboard is selected as a favorite by the user. */ + isFavourite?: boolean; + /** Whether the current user has permission to edit the dashboard. */ + isWritable?: boolean; + /** The name of the dashboard. */ + name?: string; + /** The owner of the dashboard. */ + owner?: UserBean; + /** + * The number of users who have this dashboard as a favorite. + * @format int64 + */ + popularity?: number; + /** + * The rank of this dashboard. + * @format int32 + */ + rank?: number; + /** + * The URL of these dashboard details. + * @format uri + */ + self?: string; + /** The details of any view share permissions for the dashboard. */ + sharePermissions?: SharePermission[]; + /** Whether the current dashboard is system dashboard. */ + systemDashboard?: boolean; + /** The URL of the dashboard. */ + view?: string; +} + +/** Details of a dashboard. */ +export interface DashboardDetails { + /** The description of the dashboard. */ + description?: string; + /** The edit permissions for the dashboard. */ + editPermissions: SharePermission[]; + /** The name of the dashboard. */ + name: string; + /** The share permissions for the dashboard. */ + sharePermissions: SharePermission[]; +} + +/** Details of a gadget. */ +export interface DashboardGadget { + /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ + color: "blue" | "red" | "yellow" | "green" | "cyan" | "purple" | "gray" | "white"; + /** + * The ID of the gadget instance. + * @format int64 + */ + id: number; + /** The module key of the gadget type. */ + moduleKey?: string; + /** The position of the gadget. */ + position: DashboardGadgetPosition; + /** The title of the gadget. */ + title: string; + /** The URI of the gadget type. */ + uri?: string; +} + +/** Details of a gadget position. */ +export interface DashboardGadgetPosition { + /** @format int32 */ + "The column position of the gadget.": number; + /** @format int32 */ + "The row position of the gadget.": number; +} + +/** The list of gadgets on the dashboard. */ +export interface DashboardGadgetResponse { + /** The list of gadgets. */ + gadgets: DashboardGadget[]; +} + +/** Details of the settings for a dashboard gadget. */ +export interface DashboardGadgetSettings { + /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ + color?: string; + /** Whether to ignore the validation of module key and URI. For example, when a gadget is created that is a part of an application that isn't installed. */ + ignoreUriAndModuleKeyValidation?: boolean; + /** The module key of the gadget type. Can't be provided with `uri`. */ + moduleKey?: string; + /** The position of the gadget. When the gadget is placed into the position, other gadgets in the same column are moved down to accommodate it. */ + position?: DashboardGadgetPosition; + /** The title of the gadget. */ + title?: string; + /** The URI of the gadget type. Can't be provided with `moduleKey`. */ + uri?: string; +} + +/** The details of the gadget to update. */ +export interface DashboardGadgetUpdateRequest { + /** The color of the gadget. Should be one of `blue`, `red`, `yellow`, `green`, `cyan`, `purple`, `gray`, or `white`. */ + color?: string; + /** The position of the gadget. */ + position?: DashboardGadgetPosition; + /** The title of the gadget. */ + title?: string; +} + +/** Details of the scope of the default sharing for new filters and dashboards. */ +export interface DefaultShareScope { + /** + * The scope of the default sharing for new filters and dashboards: + * + * * `AUTHENTICATED` Shared with all logged-in users. + * * `GLOBAL` Shared with all logged-in users. This shows as `AUTHENTICATED` in the response. + * * `PRIVATE` Not shared with any users. + */ + scope: "GLOBAL" | "AUTHENTICATED" | "PRIVATE"; +} + +/** Details about the default workflow. */ +export interface DefaultWorkflow { + /** Whether a draft workflow scheme is created or updated when updating an active workflow scheme. The draft is updated with the new default workflow. Defaults to `false`. */ + updateDraftIfNeeded?: boolean; + /** The name of the workflow to set as the default workflow. */ + workflow: string; +} + +export interface DeleteAndReplaceVersionBean { + /** An array of custom field IDs (`customFieldId`) and version IDs (`moveTo`) to update when the fields contain the deleted version. */ + customFieldReplacementList?: CustomFieldReplacement[]; + /** + * The ID of the version to update `affectedVersion` to when the field contains the deleted version. + * @format int64 + */ + moveAffectedIssuesTo?: number; + /** + * The ID of the version to update `fixVersion` to when the field contains the deleted version. + * @format int64 + */ + moveFixIssuesTo?: number; +} + +/** Details about a workflow. */ +export interface DeprecatedWorkflow { + default?: boolean; + /** The description of the workflow. */ + description?: string; + /** The datetime the workflow was last modified. */ + lastModifiedDate?: string; + /** This property is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + lastModifiedUser?: string; + /** The account ID of the user that last modified the workflow. */ + lastModifiedUserAccountId?: string; + /** The name of the workflow. */ + name?: string; + /** The scope where this workflow applies */ + scope?: Scope; + /** + * The number of steps included in the workflow. + * @format int32 + */ + steps?: number; +} + +/** An entity property, for more information see [Entity properties](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/). */ +export interface EntityProperty { + /** The key of the property. Required on create and update. */ + key?: string; + /** The value of the property. Required on create and update. */ + value?: any; +} + +export interface EntityPropertyDetails { + /** + * The entity property ID. + * @example 123 + */ + entityId: number; + /** + * The entity property key. + * @example "mykey" + */ + key: string; + /** + * The new value of the entity property. + * @example "newValue" + */ + value: string; +} + +/** Error messages from an operation. */ +export interface ErrorCollection { + /** The list of error messages produced by this operation. For example, "input parameter 'key' must be provided" */ + errorMessages?: string[]; + /** The list of errors by parameter returned by the operation. For example,"projectKey": "Project keys must start with an uppercase letter, followed by one or more uppercase alphanumeric characters." */ + errors?: Record; + /** @format int32 */ + status?: number; +} + +/** @example {"message":"The request is not from a Connect app."} */ +export interface ErrorMessage { + /** The error message. */ + message: string; +} + +/** Details about a notification associated with an event. */ +export interface EventNotification { + /** The email address. */ + emailAddress?: string; + /** Expand options that include additional event notification details in the response. */ + expand?: string; + /** The custom user or group field. */ + field?: FieldDetails; + /** The specified group. */ + group?: GroupName; + /** + * The ID of the notification. + * @format int64 + */ + id?: number; + /** Identifies the recipients of the notification. */ + notificationType?: + | "CurrentAssignee" + | "Reporter" + | "CurrentUser" + | "ProjectLead" + | "ComponentLead" + | "User" + | "Group" + | "ProjectRole" + | "EmailAddress" + | "AllWatchers" + | "UserCustomField" + | "GroupCustomField"; + /** + * As a group's name can change, use of `recipient` is recommended. The identifier associated with the `notificationType` value that defines the receiver of the notification, where the receiver isn't implied by `notificationType` value. So, when `notificationType` is: + * + * * `User` The `parameter` is the user account ID. + * * `Group` The `parameter` is the group name. + * * `ProjectRole` The `parameter` is the project role ID. + * * `UserCustomField` The `parameter` is the ID of the custom field. + * * `GroupCustomField` The `parameter` is the ID of the custom field. + */ + parameter?: string; + /** The specified project role. */ + projectRole?: ProjectRole; + /** + * The identifier associated with the `notificationType` value that defines the receiver of the notification, where the receiver isn't implied by the `notificationType` value. So, when `notificationType` is: + * + * * `User`, `recipient` is the user account ID. + * * `Group`, `recipient` is the group ID. + * * `ProjectRole`, `recipient` is the project role ID. + * * `UserCustomField`, `recipient` is the ID of the custom field. + * * `GroupCustomField`, `recipient` is the ID of the custom field. + */ + recipient?: string; + /** The specified user. */ + user?: UserDetails; +} + +/** Details about a failed webhook. */ +export interface FailedWebhook { + /** The webhook body. */ + body?: string; + /** + * The time the webhook was added to the list of failed webhooks (that is, the time of the last failed retry). + * @format int64 + */ + failureTime: number; + /** The webhook ID, as sent in the `X-Atlassian-Webhook-Identifier` header with the webhook. */ + id: string; + /** The original webhook destination. */ + url: string; +} + +/** A page of failed webhooks. */ +export interface FailedWebhooks { + /** + * The maximum number of items on the page. If the list of values is shorter than this number, then there are no more pages. + * @format int32 + */ + maxResults: number; + /** + * The URL to the next page of results. Present only if the request returned at least one result.The next page may be empty at the time of receiving the response, but new failed webhooks may appear in time. You can save the URL to the next page and query for new results periodically (for example, every hour). + * @format uri + */ + next?: string; + /** The list of webhooks. */ + values: FailedWebhook[]; +} + +/** Details of a field. */ +export interface Field { + /** + * Number of contexts where the field is used. + * @format int64 + */ + contextsCount?: number; + /** The description of the field. */ + description?: string; + /** The ID of the field. */ + id: string; + /** Whether the field is locked. */ + isLocked?: boolean; + /** Whether the field is shown on screen or not. */ + isUnscreenable?: boolean; + /** The key of the field. */ + key?: string; + /** Information about the most recent use of a field. */ + lastUsed?: FieldLastUsed; + /** The name of the field. */ + name: string; + /** + * Number of projects where the field is used. + * @format int64 + */ + projectsCount?: number; + /** The schema of a field. */ + schema: JsonTypeBean; + /** + * Number of screens where the field is used. + * @format int64 + */ + screensCount?: number; + /** The searcher key of the field. Returned for custom fields. */ + searcherKey?: string; +} + +/** A clause that asserts whether a field was changed. For example, `status CHANGED AFTER startOfMonth(-1M)`.See [CHANGED](https://confluence.atlassian.com/x/dgiiLQ#Advancedsearching-operatorsreference-CHANGEDCHANGED) for more information about the CHANGED operator. */ +export interface FieldChangedClause { + /** A field used in a JQL query. See [Advanced searching - fields reference](https://confluence.atlassian.com/x/dAiiLQ) for more information about fields in JQL queries. */ + field: JqlQueryField; + /** The operator applied to the field. */ + operator: "changed"; + /** The list of time predicates. */ + predicates: JqlQueryClauseTimePredicate[]; +} + +/** Details of a field configuration. */ +export interface FieldConfiguration { + /** The description of the field configuration. */ + description: string; + /** + * The ID of the field configuration. + * @format int64 + */ + id: number; + /** Whether the field configuration is the default. */ + isDefault?: boolean; + /** The name of the field configuration. */ + name: string; +} + +/** Details of a field configuration. */ +export interface FieldConfigurationDetails { + /** + * The description of the field configuration. + * @maxLength 255 + */ + description?: string; + /** + * The name of the field configuration. Must be unique. + * @maxLength 255 + */ + name: string; +} + +/** The field configuration for an issue type. */ +export interface FieldConfigurationIssueTypeItem { + /** The ID of the field configuration. */ + fieldConfigurationId: string; + /** The ID of the field configuration scheme. */ + fieldConfigurationSchemeId: string; + /** The ID of the issue type or *default*. When set to *default* this field configuration issue type item applies to all issue types without a field configuration. */ + issueTypeId: string; +} + +/** A field within a field configuration. */ +export interface FieldConfigurationItem { + /** The description of the field within the field configuration. */ + description?: string; + /** The ID of the field within the field configuration. */ + id: string; + /** Whether the field is hidden in the field configuration. */ + isHidden?: boolean; + /** Whether the field is required in the field configuration. */ + isRequired?: boolean; + /** The renderer type for the field within the field configuration. */ + renderer?: string; +} + +/** Details of field configuration items. */ +export interface FieldConfigurationItemsDetails { + /** Details of fields in a field configuration. */ + fieldConfigurationItems: FieldConfigurationItem[]; +} + +/** Details of a field configuration scheme. */ +export interface FieldConfigurationScheme { + /** The description of the field configuration scheme. */ + description?: string; + /** The ID of the field configuration scheme. */ + id: string; + /** The name of the field configuration scheme. */ + name: string; +} + +/** Associated field configuration scheme and project. */ +export interface FieldConfigurationSchemeProjectAssociation { + /** The ID of the field configuration scheme. If the field configuration scheme ID is `null`, the operation assigns the default field configuration scheme. */ + fieldConfigurationSchemeId?: string; + /** The ID of the project. */ + projectId: string; +} + +/** Project list with assigned field configuration schema. */ +export interface FieldConfigurationSchemeProjects { + /** Details of a field configuration scheme. */ + fieldConfigurationScheme?: FieldConfigurationScheme; + /** The IDs of projects using the field configuration scheme. */ + projectIds: string[]; +} + +/** The field configuration to issue type mapping. */ +export interface FieldConfigurationToIssueTypeMapping { + /** The ID of the field configuration. */ + fieldConfigurationId: string; + /** The ID of the issue type or *default*. When set to *default* this field configuration issue type item applies to all issue types without a field configuration. An issue type can be included only once in a request. */ + issueTypeId: string; +} + +/** Details about a field. */ +export interface FieldDetails { + /** + * The names that can be used to reference the field in an advanced search. For more information, see [Advanced searching - fields reference](https://confluence.atlassian.com/x/gwORLQ). + * @uniqueItems true + */ + clauseNames?: string[]; + /** Whether the field is a custom field. */ + custom?: boolean; + /** The ID of the field. */ + id?: string; + /** The key of the field. */ + key?: string; + /** The name of the field. */ + name?: string; + /** Whether the field can be used as a column on the issue navigator. */ + navigable?: boolean; + /** Whether the content of the field can be used to order lists. */ + orderable?: boolean; + /** The data schema for the field. */ + schema?: JsonTypeBean; + /** The scope of the field. */ + scope?: Scope; + /** Whether the content of the field can be searched. */ + searchable?: boolean; +} + +/** Information about the most recent use of a field. */ +export interface FieldLastUsed { + /** + * Last used value type: + * + * * *TRACKED*: field is tracked and a last used date is available. + * * *NOT\_TRACKED*: field is not tracked, last used date is not available. + * * *NO\_INFORMATION*: field is tracked, but no last used date is available. + */ + type?: "TRACKED" | "NOT_TRACKED" | "NO_INFORMATION"; + /** + * The date when the value of the field last changed. + * @format date-time + */ + value?: string; +} + +/** The metadata describing an issue field. */ +export interface FieldMetadata { + /** The list of values allowed in the field. */ + allowedValues?: any[]; + /** The URL that can be used to automatically complete the field. */ + autoCompleteUrl?: string; + /** The configuration properties. */ + configuration?: Record; + /** The default value of the field. */ + defaultValue?: any; + /** Whether the field has a default value. */ + hasDefaultValue?: boolean; + /** The key of the field. */ + key: string; + /** The name of the field. */ + name: string; + /** The list of operations that can be performed on the field. */ + operations: string[]; + /** Whether the field is required. */ + required: boolean; + /** The data type of the field. */ + schema: JsonTypeBean; +} + +/** Details of a field that can be used in advanced searches. */ +export interface FieldReferenceData { + /** Whether the field provide auto-complete suggestions. */ + auto?: "true" | "false"; + /** If the item is a custom field, the ID of the custom field. */ + cfid?: string; + /** Whether this field has been deprecated. */ + deprecated?: "true" | "false"; + /** The searcher key of the field, only passed when the field is deprecated. */ + deprecatedSearcherKey?: string; + /** + * The display name contains the following: + * + * * for system fields, the field name. For example, `Summary`. + * * for collapsed custom fields, the field name followed by a hyphen and then the field name and field type. For example, `Component - Component[Dropdown]`. + * * for other custom fields, the field name followed by a hyphen and then the custom field ID. For example, `Component - cf[10061]`. + */ + displayName?: string; + /** The valid search operators for the field. */ + operators?: string[]; + /** Whether the field can be used in a query's `ORDER BY` clause. */ + orderable?: "true" | "false"; + /** Whether the content of this field can be searched. */ + searchable?: "true" | "false"; + /** The data types of items in the field. */ + types?: string[]; + /** The field identifier. */ + value?: string; +} + +/** Details of an operation to perform on a field. */ +export interface FieldUpdateOperation { + /** + * The value to add to the field. + * @example "triaged" + */ + add?: any; + /** + * The field value to copy from another issue. + * @example {"issuelinks":{"sourceIssues":[{"key":"FP-5"}]}} + */ + copy?: any; + /** + * The value to edit in the field. + * @example {"originalEstimate":"1w 1d","remainingEstimate":"4d"} + */ + edit?: any; + /** + * The value to removed from the field. + * @example "blocker" + */ + remove?: any; + /** + * The value to set in the field. + * @example "A new summary" + */ + set?: any; +} + +/** A clause that asserts the current value of a field. For example, `summary ~ test`. */ +export interface FieldValueClause { + /** A field used in a JQL query. See [Advanced searching - fields reference](https://confluence.atlassian.com/x/dAiiLQ) for more information about fields in JQL queries. */ + field: JqlQueryField; + /** Details of an operand in a JQL clause. */ + operand: JqlQueryClauseOperand; + /** The operator between the field and operand. */ + operator: "=" | "!=" | ">" | "<" | ">=" | "<=" | "in" | "not in" | "~" | "~=" | "is" | "is not"; +} + +/** A clause that asserts a previous value of a field. For example, `status WAS "Resolved" BY currentUser() BEFORE "2019/02/02"`. See [WAS](https://confluence.atlassian.com/x/dgiiLQ#Advancedsearching-operatorsreference-WASWAS) for more information about the WAS operator. */ +export interface FieldWasClause { + /** A field used in a JQL query. See [Advanced searching - fields reference](https://confluence.atlassian.com/x/dAiiLQ) for more information about fields in JQL queries. */ + field: JqlQueryField; + /** Details of an operand in a JQL clause. */ + operand: JqlQueryClauseOperand; + /** The operator between the field and operand. */ + operator: "was" | "was in" | "was not in" | "was not"; + /** The list of time predicates. */ + predicates: JqlQueryClauseTimePredicate[]; +} + +/** Key fields from the linked issue. */ +export interface Fields { + /** The assignee of the linked issue. */ + assignee?: UserDetails; + /** The type of the linked issue. */ + issueType?: IssueTypeDetails; + /** The type of the linked issue. */ + issuetype?: IssueTypeDetails; + /** The priority of the linked issue. */ + priority?: Priority; + /** The status of the linked issue. */ + status?: StatusDetails; + /** The summary description of the linked issue. */ + summary?: string; + /** The time tracking of the linked issue. */ + timetracking?: TimeTrackingDetails; +} + +/** Details about a filter. */ +export interface Filter { + /** A description of the filter. */ + description?: string; + /** The groups and projects that can edit the filter. */ + editPermissions?: SharePermission[]; + /** Whether the filter is selected as a favorite. */ + favourite?: boolean; + /** + * The count of how many users have selected this filter as a favorite, including the filter owner. + * @format int64 + */ + favouritedCount?: number; + /** The unique identifier for the filter. */ + id?: string; + /** The JQL query for the filter. For example, *project = SSP AND issuetype = Bug*. */ + jql?: string; + /** The name of the filter. Must be unique. */ + name: string; + /** The user who owns the filter. This is defaulted to the creator of the filter, however Jira administrators can change the owner of a shared filter in the admin settings. */ + owner?: User; + /** + * A URL to view the filter results in Jira, using the [Search for issues using JQL](#api-rest-api-3-filter-search-get) operation with the filter's JQL string to return the filter results. For example, *https://your-domain.atlassian.net/rest/api/3/search?jql=project+%3D+SSP+AND+issuetype+%3D+Bug*. + * @format uri + */ + searchUrl?: string; + /** + * The URL of the filter. + * @format uri + */ + self?: string; + /** The groups and projects that the filter is shared with. */ + sharePermissions?: SharePermission[]; + /** A paginated list of the users that the filter is shared with. This includes users that are members of the groups or can browse the projects that the filter is shared with. */ + sharedUsers?: UserList; + /** A paginated list of the users that are subscribed to the filter. */ + subscriptions?: FilterSubscriptionsList; + /** + * A URL to view the filter results in Jira, using the ID of the filter. For example, *https://your-domain.atlassian.net/issues/?filter=10100*. + * @format uri + */ + viewUrl?: string; +} + +/** Details of a filter. */ +export interface FilterDetails { + /** The description of the filter. */ + description?: string; + /** The groups and projects that can edit the filter. This can be specified when updating a filter, but not when creating a filter. */ + editPermissions?: SharePermission[]; + /** Expand options that include additional filter details in the response. */ + expand?: string; + /** Whether the filter is selected as a favorite by any users, not including the filter owner. */ + favourite?: boolean; + /** + * The count of how many users have selected this filter as a favorite, including the filter owner. + * @format int64 + */ + favouritedCount?: number; + /** The unique identifier for the filter. */ + id?: string; + /** The JQL query for the filter. For example, *project = SSP AND issuetype = Bug*. */ + jql?: string; + /** The name of the filter. */ + name: string; + /** The user who owns the filter. Defaults to the creator of the filter, however, Jira administrators can change the owner of a shared filter in the admin settings. */ + owner?: User; + /** + * A URL to view the filter results in Jira, using the [Search for issues using JQL](#api-rest-api-3-filter-search-get) operation with the filter's JQL string to return the filter results. For example, *https://your-domain.atlassian.net/rest/api/3/search?jql=project+%3D+SSP+AND+issuetype+%3D+Bug*. + * @format uri + */ + searchUrl?: string; + /** + * The URL of the filter. + * @format uri + */ + self?: string; + /** The groups and projects that the filter is shared with. This can be specified when updating a filter, but not when creating a filter. */ + sharePermissions?: SharePermission[]; + /** The users that are subscribed to the filter. */ + subscriptions?: FilterSubscription[]; + /** + * A URL to view the filter results in Jira, using the ID of the filter. For example, *https://your-domain.atlassian.net/issues/?filter=10100*. + * @format uri + */ + viewUrl?: string; +} + +/** Details of a user or group subscribing to a filter. */ +export interface FilterSubscription { + /** The group subscribing to filter. */ + group?: GroupName; + /** + * The ID of the filter subscription. + * @format int64 + */ + id?: number; + /** The user subscribing to filter. */ + user?: User; +} + +/** A paginated list of subscriptions to a filter. */ +export interface FilterSubscriptionsList { + /** + * The index of the last item returned on the page. + * @format int32 + */ + "end-index"?: number; + /** The list of items. */ + items?: FilterSubscription[]; + /** + * The maximum number of results that could be on the page. + * @format int32 + */ + "max-results"?: number; + /** + * The number of items on the page. + * @format int32 + */ + size?: number; + /** + * The index of the first item returned on the page. + * @format int32 + */ + "start-index"?: number; +} + +/** A group found in a search. */ +export interface FoundGroup { + /** The ID of the group, which uniquely identifies the group across all Atlassian products. For example, *952d12c3-5b5b-4d04-bb32-44d383afc4b2*. */ + groupId?: string; + /** The group name with the matched query string highlighted with the HTML bold tag. */ + html?: string; + labels?: GroupLabel[]; + /** The name of the group. The name of a group is mutable, to reliably identify a group use ``groupId`.` */ + name?: string; +} + +/** The list of groups found in a search, including header text (Showing X of Y matching groups) and total of matched groups. */ +export interface FoundGroups { + groups?: FoundGroup[]; + /** Header text indicating the number of groups in the response and the total number of groups found in the search. */ + header?: string; + /** + * The total number of groups found in the search. + * @format int32 + */ + total?: number; +} + +/** The list of users found in a search, including header text (Showing X of Y matching users) and total of matched users. */ +export interface FoundUsers { + /** Header text indicating the number of users in the response and the total number of users found in the search. */ + header?: string; + /** + * The total number of users found in the search. + * @format int32 + */ + total?: number; + users?: UserPickerUser[]; +} + +/** List of users and groups found in a search. */ +export interface FoundUsersAndGroups { + /** The list of groups found in a search, including header text (Showing X of Y matching groups) and total of matched groups. */ + groups?: FoundGroups; + /** The list of users found in a search, including header text (Showing X of Y matching users) and total of matched users. */ + users?: FoundUsers; +} + +/** An operand that is a function. See [Advanced searching - functions reference](https://confluence.atlassian.com/x/dwiiLQ) for more information about JQL functions. */ +export interface FunctionOperand { + /** The list of function arguments. */ + arguments: string[]; + /** Encoded operand, which can be used directly in a JQL query. */ + encodedOperand?: string; + /** The name of the function. */ + function: string; +} + +/** Details of functions that can be used in advanced searches. */ +export interface FunctionReferenceData { + /** The display name of the function. */ + displayName?: string; + /** Whether the function can take a list of arguments. */ + isList?: "true" | "false"; + /** The data types returned by the function. */ + types?: string[]; + /** The function identifier. */ + value?: string; +} + +export interface GlobalScopeBean { + /** + * Defines the behavior of the option in the global context.If notSelectable is set, the option cannot be set as the field's value. This is useful for archiving an option that has previously been selected but shouldn't be used anymore.If defaultValue is set, the option is selected by default. + * @uniqueItems true + */ + attributes?: ("notSelectable" | "defaultValue")[]; +} + +export interface Group { + /** Expand options that include additional group details in the response. */ + expand?: string; + /** The ID of the group, which uniquely identifies the group across all Atlassian products. For example, *952d12c3-5b5b-4d04-bb32-44d383afc4b2*. */ + groupId?: string | null; + /** The name of group. */ + name?: string; + /** + * The URL for these group details. + * @format uri + */ + self?: string; + /** A paginated list of the users that are members of the group. A maximum of 50 users is returned in the list, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 50 users, use`?expand=users[51:100]`. */ + users?: PagedListUserDetailsApplicationUser; +} + +/** Details about a group. */ +export interface GroupDetails { + /** The ID of the group, which uniquely identifies the group across all Atlassian products. For example, *952d12c3-5b5b-4d04-bb32-44d383afc4b2*. */ + groupId?: string | null; + /** The name of the group. */ + name?: string; +} + +/** A group label. */ +export interface GroupLabel { + /** The group label name. */ + text?: string; + /** The title of the group label. */ + title?: string; + /** The type of the group label. */ + type?: "ADMIN" | "SINGLE" | "MULTIPLE"; +} + +/** Details about a group. */ +export interface GroupName { + /** The ID of the group, which uniquely identifies the group across all Atlassian products. For example, *952d12c3-5b5b-4d04-bb32-44d383afc4b2*. */ + groupId?: string | null; + /** The name of group. */ + name?: string; + /** + * The URL for these group details. + * @format uri + */ + self?: string; +} + +/** Jira instance health check results. Deprecated and no longer returned. */ +export interface HealthCheckResult { + /** The description of the Jira health check item. */ + description?: string; + /** The name of the Jira health check item. */ + name?: string; + /** Whether the Jira health check item passed or failed. */ + passed?: boolean; +} + +/** The project issue type hierarchy. */ +export interface Hierarchy { + /** + * The ID of the base level. This property is deprecated, see [Change notice: Removing hierarchy level IDs from next-gen APIs](https://developer.atlassian.com/cloud/jira/platform/change-notice-removing-hierarchy-level-ids-from-next-gen-apis/). + * @format int64 + */ + baseLevelId?: number; + /** Details about the hierarchy level. */ + levels?: SimplifiedHierarchyLevel[]; +} + +/** Details of issue history metadata. */ +export interface HistoryMetadata { + /** The activity described in the history record. */ + activityDescription?: string; + /** The key of the activity described in the history record. */ + activityDescriptionKey?: string; + /** Details of the user whose action created the history record. */ + actor?: HistoryMetadataParticipant; + /** Details of the cause that triggered the creation the history record. */ + cause?: HistoryMetadataParticipant; + /** The description of the history record. */ + description?: string; + /** The description key of the history record. */ + descriptionKey?: string; + /** The description of the email address associated the history record. */ + emailDescription?: string; + /** The description key of the email address associated the history record. */ + emailDescriptionKey?: string; + /** Additional arbitrary information about the history record. */ + extraData?: Record; + /** Details of the system that generated the history record. */ + generator?: HistoryMetadataParticipant; + /** The type of the history record. */ + type?: string; + [key: string]: any; +} + +/** Details of user or system associated with a issue history metadata item. */ +export interface HistoryMetadataParticipant { + /** The URL to an avatar for the user or system associated with a history record. */ + avatarUrl?: string; + /** The display name of the user or system associated with a history record. */ + displayName?: string; + /** The key of the display name of the user or system associated with a history record. */ + displayNameKey?: string; + /** The ID of the user or system associated with a history record. */ + id?: string; + /** The type of the user or system associated with a history record. */ + type?: string; + /** The URL of the user or system associated with a history record. */ + url?: string; + [key: string]: any; +} + +/** + * An icon. If no icon is defined: + * + * * for a status icon, no status icon displays in Jira. + * * for the remote object icon, the default link icon displays in Jira. + */ +export interface Icon { + /** The URL of the tooltip, used only for a status icon. If not set, the status icon in Jira is not clickable. */ + link?: string; + /** + * The title of the icon. This is used as follows: + * + * * For a status icon it is used as a tooltip on the icon. If not set, the status icon doesn't display a tooltip in Jira. + * * For the remote object icon it is used in conjunction with the application name to display a tooltip for the link's icon. The tooltip takes the format "\[application name\] icon title". Blank itemsare excluded from the tooltip title. If both items are blank, the icon tooltop displays as "Web Link". + */ + title?: string; + /** The URL of an icon that displays at 16x16 pixel in Jira. */ + url16x16?: string; + [key: string]: any; +} + +/** An icon. */ +export interface IconBean { + /** The URL of the tooltip, used only for a status icon. */ + link?: string; + /** The title of the icon, for use as a tooltip on the icon. */ + title?: string; + /** The URL of a 16x16 pixel icon. */ + url16x16?: string; +} + +export interface IdBean { + /** + * The ID of the permission scheme to associate with the project. Use the [Get all permission schemes](#api-rest-api-3-permissionscheme-get) resource to get a list of permission scheme IDs. + * @format int64 + */ + id: number; +} + +export interface IdOrKeyBean { + /** + * The ID of the referenced item. + * @format int64 + */ + id?: number; + /** The key of the referenced item. */ + key?: string; +} + +export interface IncludedFields { + /** @uniqueItems true */ + actuallyIncluded?: string[]; + /** @uniqueItems true */ + excluded?: string[]; + /** @uniqueItems true */ + included?: string[]; +} + +/** Details about an issue. */ +export interface IssueBean { + /** Details of changelogs associated with the issue. */ + changelog?: PageOfChangelogs; + /** The metadata for the fields on the issue that can be amended. */ + editmeta?: IssueUpdateMetadata; + /** Expand options that include additional issue details in the response. */ + expand?: string; + fields?: Record; + fieldsToInclude?: IncludedFields; + /** The ID of the issue. */ + id?: string; + /** The key of the issue. */ + key?: string; + /** The ID and name of each field present on the issue. */ + names?: Record; + /** The operations that can be performed on the issue. */ + operations?: Operations; + /** Details of the issue properties identified in the request. */ + properties?: Record; + /** The rendered value of each field present on the issue. */ + renderedFields?: Record; + /** The schema describing each field present on the issue. */ + schema?: Record; + /** + * The URL of the issue details. + * @format uri + */ + self?: string; + /** The transitions that can be performed on the issue. */ + transitions?: IssueTransition[]; + /** The versions of each field on the issue. */ + versionedRepresentations?: Record>; +} + +/** A list of changelog IDs. */ +export interface IssueChangelogIds { + /** + * The list of changelog IDs. + * @uniqueItems true + */ + changelogIds: number[]; +} + +export interface IssueCommentListRequestBean { + /** + * The list of comment IDs. A maximum of 1000 IDs can be specified. + * @uniqueItems true + */ + ids: number[]; +} + +/** An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) specified by ID or key. All the fields of the issue object are available in the Jira expression. */ +export interface IssueContextVariable { + /** + * The issue ID. + * @format int64 + */ + id?: number; + /** The issue key. */ + key?: string; + /** Type of custom context variable. */ + type: string; +} + +/** The wrapper for the issue creation metadata for a list of projects. */ +export interface IssueCreateMetadata { + /** Expand options that include additional project details in the response. */ + expand?: string; + /** List of projects and their issue creation metadata. */ + projects?: ProjectIssueCreateMetadata[]; +} + +/** Lists of issues and entity properties. See [Entity properties](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/) for more information. */ +export interface IssueEntityProperties { + /** + * A list of entity property IDs. + * @maxItems 10000 + * @minItems 1 + * @uniqueItems true + */ + entitiesIds?: number[]; + /** A list of entity property keys and values. */ + properties?: Record; +} + +/** An issue ID with entity property values. See [Entity properties](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/) for more information. */ +export interface IssueEntityPropertiesForMultiUpdate { + /** + * The ID of the issue. + * @format int64 + */ + issueID?: number; + /** Entity properties to set on the issue. The maximum length of an issue property value is 32768 characters. */ + properties?: Record; +} + +/** Details about an issue event. */ +export interface IssueEvent { + /** + * The ID of the event. + * @format int64 + */ + id?: number; + /** The name of the event. */ + name?: string; +} + +/** Details of the options for a select list issue field. */ +export interface IssueFieldOption { + /** Details of the projects the option is available in. */ + config?: IssueFieldOptionConfiguration; + /** + * The unique identifier for the option. This is only unique within the select field's set of options. + * @format int64 + */ + id: number; + /** The properties of the object, as arbitrary key-value pairs. These properties can be searched using JQL, if the extractions (see [Issue Field Option Property Index](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/)) are defined in the descriptor for the issue field module. */ + properties?: Record; + /** The option's name, which is displayed in Jira. */ + value: string; +} + +/** Details of the projects the option is available in. */ +export interface IssueFieldOptionConfiguration { + /** + * DEPRECATED + * @uniqueItems true + */ + attributes?: ("notSelectable" | "defaultValue")[]; + /** Defines the projects that the option is available in. If the scope is not defined, then the option is available in all projects. */ + scope?: IssueFieldOptionScopeBean; +} + +export interface IssueFieldOptionCreateBean { + /** Details of the projects the option is available in. */ + config?: IssueFieldOptionConfiguration; + /** The properties of the option as arbitrary key-value pairs. These properties can be searched using JQL, if the extractions (see https://developer.atlassian.com/cloud/jira/platform/modules/issue-field-option-property-index/) are defined in the descriptor for the issue field module. */ + properties?: Record; + /** The option's name, which is displayed in Jira. */ + value: string; + [key: string]: any; +} + +export interface IssueFieldOptionScopeBean { + /** Defines the behavior of the option within the global context. If this property is set, even if set to an empty object, then the option is available in all projects. */ + global?: GlobalScopeBean; + /** + * DEPRECATED + * @uniqueItems true + */ + projects?: number[]; + /** + * Defines the projects in which the option is available and the behavior of the option within each project. Specify one object per project. The behavior of the option in a project context overrides the behavior in the global context. + * @uniqueItems true + */ + projects2?: ProjectScopeBean[]; +} + +/** Bulk operation filter details. */ +export interface IssueFilterForBulkPropertyDelete { + /** The value of properties to perform the bulk operation on. */ + currentValue?: any; + /** + * List of issues to perform the bulk delete operation on. + * @uniqueItems true + */ + entityIds?: number[]; +} + +/** Bulk operation filter details. */ +export interface IssueFilterForBulkPropertySet { + /** The value of properties to perform the bulk operation on. */ + currentValue?: any; + /** + * List of issues to perform the bulk operation on. + * @uniqueItems true + */ + entityIds?: number[]; + /** Whether the bulk operation occurs only when the property is present on or absent from an issue. */ + hasProperty?: boolean; +} + +/** Details of a link between issues. */ +export interface IssueLink { + /** The ID of the issue link. */ + id?: string; + /** Provides details about the linked issue. If presenting this link in a user interface, use the `inward` field of the issue link type to label the link. */ + inwardIssue: LinkedIssue; + /** Provides details about the linked issue. If presenting this link in a user interface, use the `outward` field of the issue link type to label the link. */ + outwardIssue: LinkedIssue; + /** + * The URL of the issue link. + * @format uri + */ + self?: string; + /** The type of link between the issues. */ + type: IssueLinkType; +} + +/** + * This object is used as follows: + * + * * In the [ issueLink](#api-rest-api-3-issueLink-post) resource it defines and reports on the type of link between the issues. Find a list of issue link types with [Get issue link types](#api-rest-api-3-issueLinkType-get). + * * In the [ issueLinkType](#api-rest-api-3-issueLinkType-post) resource it defines and reports on issue link types. + */ +export interface IssueLinkType { + /** + * The ID of the issue link type and is used as follows: + * + * * In the [ issueLink](#api-rest-api-3-issueLink-post) resource it is the type of issue link. Required on create when `name` isn't provided. Otherwise, read only. + * * In the [ issueLinkType](#api-rest-api-3-issueLinkType-post) resource it is read only. + */ + id?: string; + /** + * The description of the issue link type inward link and is used as follows: + * + * * In the [ issueLink](#api-rest-api-3-issueLink-post) resource it is read only. + * * In the [ issueLinkType](#api-rest-api-3-issueLinkType-post) resource it is required on create and optional on update. Otherwise, read only. + */ + inward?: string; + /** + * The name of the issue link type and is used as follows: + * + * * In the [ issueLink](#api-rest-api-3-issueLink-post) resource it is the type of issue link. Required on create when `id` isn't provided. Otherwise, read only. + * * In the [ issueLinkType](#api-rest-api-3-issueLinkType-post) resource it is required on create and optional on update. Otherwise, read only. + */ + name?: string; + /** + * The description of the issue link type outward link and is used as follows: + * + * * In the [ issueLink](#api-rest-api-3-issueLink-post) resource it is read only. + * * In the [ issueLinkType](#api-rest-api-3-issueLinkType-post) resource it is required on create and optional on update. Otherwise, read only. + */ + outward?: string; + /** + * The URL of the issue link type. Read only. + * @format uri + */ + self?: string; +} + +/** A list of issue link type beans. */ +export interface IssueLinkTypes { + /** The issue link type bean. */ + issueLinkTypes?: IssueLinkType[]; +} + +/** A list of issue IDs. */ +export interface IssueList { + /** The list of issue IDs. */ + issueIds: string[]; +} + +/** A list of matched issues or errors for each JQL query, in the order the JQL queries were passed. */ +export interface IssueMatches { + matches: IssueMatchesForJQL[]; +} + +/** A list of the issues matched to a JQL query or details of errors encountered during matching. */ +export interface IssueMatchesForJQL { + /** + * A list of errors. + * @uniqueItems true + */ + errors: string[]; + /** + * A list of issue IDs. + * @uniqueItems true + */ + matchedIssues: number[]; +} + +/** A list of issues suggested for use in auto-completion. */ +export interface IssuePickerSuggestions { + /** A list of issues for an issue type suggested for use in auto-completion. */ + sections?: IssuePickerSuggestionsIssueType[]; +} + +/** A type of issue suggested for use in auto-completion. */ +export interface IssuePickerSuggestionsIssueType { + /** The ID of the type of issues suggested for use in auto-completion. */ + id?: string; + /** A list of issues suggested for use in auto-completion. */ + issues?: SuggestedIssue[]; + /** The label of the type of issues suggested for use in auto-completion. */ + label?: string; + /** If no issue suggestions are found, returns a message indicating no suggestions were found, */ + msg?: string; + /** If issue suggestions are found, returns a message indicating the number of issues suggestions found and returned. */ + sub?: string; +} + +/** Issue security level member. */ +export interface IssueSecurityLevelMember { + /** The user or group being granted the permission. It consists of a `type` and a type-dependent `parameter`. See [Holder object](../api-group-permission-schemes/#holder-object) in *Get all permission schemes* for more information. */ + holder: PermissionHolder; + /** + * The ID of the issue security level member. + * @format int64 + */ + id: number; + /** + * The ID of the issue security level. + * @format int64 + */ + issueSecurityLevelId: number; +} + +/** Details of an issue transition. */ +export interface IssueTransition { + /** Expand options that include additional transition details in the response. */ + expand?: string; + /** Details of the fields associated with the issue transition screen. Use this information to populate `fields` and `update` in a transition request. */ + fields?: Record; + /** Whether there is a screen associated with the issue transition. */ + hasScreen?: boolean; + /** The ID of the issue transition. Required when specifying a transition to undertake. */ + id?: string; + /** Whether the transition is available to be performed. */ + isAvailable?: boolean; + /** Whether the issue has to meet criteria before the issue transition is applied. */ + isConditional?: boolean; + /** Whether the issue transition is global, that is, the transition is applied to issues regardless of their status. */ + isGlobal?: boolean; + /** Whether this is the initial issue transition for the workflow. */ + isInitial?: boolean; + looped?: boolean; + /** The name of the issue transition. */ + name?: string; + /** Details of the issue status after the transition. */ + to?: StatusDetails; + [key: string]: any; +} + +export interface IssueTypeCreateBean { + /** The description of the issue type. */ + description?: string; + /** + * The hierarchy level of the issue type. Use: + * + * * `-1` for Subtask. + * * `0` for Base. + * + * Defaults to `0`. + * @format int32 + */ + hierarchyLevel?: number; + /** The unique name for the issue type. The maximum length is 60 characters. */ + name: string; + /** + * Deprecated. Use `hierarchyLevel` instead. See the [deprecation notice](https://community.developer.atlassian.com/t/deprecation-of-the-epic-link-parent-link-and-other-related-fields-in-rest-apis-and-webhooks/54048) for details. + * + * Whether the issue type is `subtype` or `standard`. Defaults to `standard`. + */ + type?: "subtask" | "standard"; +} + +/** Details about an issue type. */ +export interface IssueTypeDetails { + /** + * The ID of the issue type's avatar. + * @format int64 + */ + avatarId?: number; + /** The description of the issue type. */ + description?: string; + /** + * Unique ID for next-gen projects. + * @format uuid + */ + entityId?: string; + /** + * Hierarchy level of the issue type. + * @format int32 + */ + hierarchyLevel?: number; + /** The URL of the issue type's avatar. */ + iconUrl?: string; + /** The ID of the issue type. */ + id?: string; + /** The name of the issue type. */ + name?: string; + /** Details of the next-gen projects the issue type is available in. */ + scope?: Scope; + /** The URL of these issue type details. */ + self?: string; + /** Whether this issue type is used to create subtasks. */ + subtask?: boolean; +} + +/** The list of issue type IDs. */ +export interface IssueTypeIds { + /** The list of issue type IDs. */ + issueTypeIds: string[]; +} + +/** The list of issue type IDs to be removed from the field configuration scheme. */ +export interface IssueTypeIdsToRemove { + /** The list of issue type IDs. Must contain unique values not longer than 255 characters and not be empty. Maximum of 100 IDs. */ + issueTypeIds: string[]; +} + +/** Details of an issue type. */ +export interface IssueTypeInfo { + /** + * The avatar of the issue type. + * @format int64 + */ + avatarId?: number; + /** + * The ID of the issue type. + * @format int64 + */ + id?: number; + /** The name of the issue type. */ + name?: string; +} + +/** Details of the issue creation metadata for an issue type. */ +export interface IssueTypeIssueCreateMetadata { + /** + * The ID of the issue type's avatar. + * @format int64 + */ + avatarId?: number; + /** The description of the issue type. */ + description?: string; + /** + * Unique ID for next-gen projects. + * @format uuid + */ + entityId?: string; + /** Expand options that include additional issue type metadata details in the response. */ + expand?: string; + /** List of the fields available when creating an issue for the issue type. */ + fields?: Record; + /** + * Hierarchy level of the issue type. + * @format int32 + */ + hierarchyLevel?: number; + /** The URL of the issue type's avatar. */ + iconUrl?: string; + /** The ID of the issue type. */ + id?: string; + /** The name of the issue type. */ + name?: string; + /** Details of the next-gen projects the issue type is available in. */ + scope?: Scope; + /** The URL of these issue type details. */ + self?: string; + /** Whether this issue type is used to create subtasks. */ + subtask?: boolean; +} + +/** Details of an issue type scheme. */ +export interface IssueTypeScheme { + /** The ID of the default issue type of the issue type scheme. */ + defaultIssueTypeId?: string; + /** The description of the issue type scheme. */ + description?: string; + /** The ID of the issue type scheme. */ + id: string; + /** Whether the issue type scheme is the default. */ + isDefault?: boolean; + /** The name of the issue type scheme. */ + name: string; +} + +/** Details of an issue type scheme and its associated issue types. */ +export interface IssueTypeSchemeDetails { + /** The ID of the default issue type of the issue type scheme. This ID must be included in `issueTypeIds`. */ + defaultIssueTypeId?: string; + /** The description of the issue type scheme. The maximum length is 4000 characters. */ + description?: string; + /** The list of issue types IDs of the issue type scheme. At least one standard issue type ID is required. */ + issueTypeIds: string[]; + /** The name of the issue type scheme. The name must be unique. The maximum length is 255 characters. */ + name: string; +} + +/** The ID of an issue type scheme. */ +export interface IssueTypeSchemeID { + /** The ID of the issue type scheme. */ + issueTypeSchemeId: string; +} + +/** Issue type scheme item. */ +export interface IssueTypeSchemeMapping { + /** The ID of the issue type. */ + issueTypeId: string; + /** The ID of the issue type scheme. */ + issueTypeSchemeId: string; +} + +/** Details of the association between an issue type scheme and project. */ +export interface IssueTypeSchemeProjectAssociation { + /** The ID of the issue type scheme. */ + issueTypeSchemeId: string; + /** The ID of the project. */ + projectId: string; +} + +/** Issue type scheme with a list of the projects that use it. */ +export interface IssueTypeSchemeProjects { + /** Details of an issue type scheme. */ + issueTypeScheme: IssueTypeScheme; + /** The IDs of the projects using the issue type scheme. */ + projectIds: string[]; +} + +/** Details of the name, description, and default issue type for an issue type scheme. */ +export interface IssueTypeSchemeUpdateDetails { + /** The ID of the default issue type of the issue type scheme. */ + defaultIssueTypeId?: string; + /** The description of the issue type scheme. The maximum length is 4000 characters. */ + description?: string; + /** The name of the issue type scheme. The name must be unique. The maximum length is 255 characters. */ + name?: string; +} + +/** Details of an issue type screen scheme. */ +export interface IssueTypeScreenScheme { + /** The description of the issue type screen scheme. */ + description?: string; + /** The ID of the issue type screen scheme. */ + id: string; + /** The name of the issue type screen scheme. */ + name: string; +} + +/** The details of an issue type screen scheme. */ +export interface IssueTypeScreenSchemeDetails { + /** The description of the issue type screen scheme. The maximum length is 255 characters. */ + description?: string; + /** The IDs of the screen schemes for the issue type IDs and *default*. A *default* entry is required to create an issue type screen scheme, it defines the mapping for all issue types without a screen scheme. */ + issueTypeMappings: IssueTypeScreenSchemeMapping[]; + /** The name of the issue type screen scheme. The name must be unique. The maximum length is 255 characters. */ + name: string; +} + +/** The ID of an issue type screen scheme. */ +export interface IssueTypeScreenSchemeId { + /** The ID of the issue type screen scheme. */ + id: string; +} + +/** The screen scheme for an issue type. */ +export interface IssueTypeScreenSchemeItem { + /** The ID of the issue type or *default*. Only issue types used in classic projects are accepted. When creating an issue screen scheme, an entry for *default* must be provided and defines the mapping for all issue types without a screen scheme. Otherwise, a *default* entry can't be provided. */ + issueTypeId: string; + /** The ID of the issue type screen scheme. */ + issueTypeScreenSchemeId: string; + /** The ID of the screen scheme. */ + screenSchemeId: string; +} + +/** The IDs of the screen schemes for the issue type IDs. */ +export interface IssueTypeScreenSchemeMapping { + /** The ID of the issue type or *default*. Only issue types used in classic projects are accepted. An entry for *default* must be provided and defines the mapping for all issue types without a screen scheme. */ + issueTypeId: string; + /** The ID of the screen scheme. Only screen schemes used in classic projects are accepted. */ + screenSchemeId: string; +} + +/** A list of issue type screen scheme mappings. */ +export interface IssueTypeScreenSchemeMappingDetails { + /** The list of issue type to screen scheme mappings. A *default* entry cannot be specified because a default entry is added when an issue type screen scheme is created. */ + issueTypeMappings: IssueTypeScreenSchemeMapping[]; +} + +/** Associated issue type screen scheme and project. */ +export interface IssueTypeScreenSchemeProjectAssociation { + /** The ID of the issue type screen scheme. */ + issueTypeScreenSchemeId?: string; + /** The ID of the project. */ + projectId?: string; +} + +/** Details of an issue type screen scheme. */ +export interface IssueTypeScreenSchemeUpdateDetails { + /** The description of the issue type screen scheme. The maximum length is 255 characters. */ + description?: string; + /** The name of the issue type screen scheme. The name must be unique. The maximum length is 255 characters. */ + name?: string; +} + +/** Issue type screen scheme with a list of the projects that use it. */ +export interface IssueTypeScreenSchemesProjects { + /** Details of an issue type screen scheme. */ + issueTypeScreenScheme: IssueTypeScreenScheme; + /** The IDs of the projects using the issue type screen scheme. */ + projectIds: string[]; +} + +/** Mapping of an issue type to a context. */ +export interface IssueTypeToContextMapping { + /** The ID of the context. */ + contextId: string; + /** Whether the context is mapped to any issue type. */ + isAnyIssueType?: boolean; + /** The ID of the issue type. */ + issueTypeId?: string; +} + +export interface IssueTypeUpdateBean { + /** + * The ID of an issue type avatar. + * @format int64 + */ + avatarId?: number; + /** The description of the issue type. */ + description?: string; + /** The unique name for the issue type. The maximum length is 60 characters. */ + name?: string; +} + +/** Status details for an issue type. */ +export interface IssueTypeWithStatus { + /** The ID of the issue type. */ + id: string; + /** The name of the issue type. */ + name: string; + /** The URL of the issue type's status details. */ + self: string; + /** List of status details for the issue type. */ + statuses: StatusDetails[]; + /** Whether this issue type represents subtasks. */ + subtask: boolean; +} + +/** Details about the mapping between an issue type and a workflow. */ +export interface IssueTypeWorkflowMapping { + /** The ID of the issue type. Not required if updating the issue type-workflow mapping. */ + issueType?: string; + /** Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the workflow scheme cannot be edited. Defaults to `false`. Only applicable when updating the workflow-issue types mapping. */ + updateDraftIfNeeded?: boolean; + /** The name of the workflow. */ + workflow?: string; +} + +/** Details about the mapping between issue types and a workflow. */ +export interface IssueTypesWorkflowMapping { + /** Whether the workflow is the default workflow for the workflow scheme. */ + defaultMapping?: boolean; + /** The list of issue type IDs. */ + issueTypes?: string[]; + /** Whether a draft workflow scheme is created or updated when updating an active workflow scheme. The draft is updated with the new workflow-issue types mapping. Defaults to `false`. */ + updateDraftIfNeeded?: boolean; + /** The name of the workflow. Optional if updating the workflow-issue types mapping. */ + workflow?: string; +} + +/** Details of an issue update request. */ +export interface IssueUpdateDetails { + /** List of issue screen fields to update, specifying the sub-field to update and its value for each field. This field provides a straightforward option when setting a sub-field. When multiple sub-fields or other operations are required, use `update`. Fields included in here cannot be included in `update`. */ + fields?: Record; + /** Additional issue history details. */ + historyMetadata?: HistoryMetadata; + /** Details of issue properties to be add or update. */ + properties?: EntityProperty[]; + /** Details of a transition. Required when performing a transition, optional when creating or editing an issue. */ + transition?: IssueTransition; + /** A Map containing the field field name and a list of operations to perform on the issue screen field. Note that fields included in here cannot be included in `fields`. */ + update?: Record; + [key: string]: any; +} + +/** A list of editable field details. */ +export interface IssueUpdateMetadata { + fields?: Record; +} + +/** List of issues and JQL queries. */ +export interface IssuesAndJQLQueries { + /** + * A list of issue IDs. + * @uniqueItems true + */ + issueIds: number[]; + /** A list of JQL queries. */ + jqls: string[]; +} + +/** The description of the page of issues loaded by the provided JQL query. */ +export interface IssuesJqlMetaDataBean { + /** + * The number of issues that were loaded in this evaluation. + * @format int32 + */ + count: number; + /** + * The maximum number of issues that could be loaded in this evaluation. + * @format int32 + */ + maxResults: number; + /** + * The index of the first issue. + * @format int64 + */ + startAt: number; + /** + * The total number of issues the JQL returned. + * @format int64 + */ + totalCount: number; + /** Any warnings related to the JQL query. Present only if the validation mode was set to `warn`. */ + validationWarnings?: string[]; +} + +/** Meta data describing the `issues` context variable. */ +export interface IssuesMetaBean { + /** The description of the page of issues loaded by the provided JQL query. */ + jql?: IssuesJqlMetaDataBean; +} + +export interface IssuesUpdateBean { + issueUpdates?: IssueUpdateDetails[]; + [key: string]: any; +} + +/** The JQL queries to be converted. */ +export interface JQLPersonalDataMigrationRequest { + /** A list of queries with user identifiers. Maximum of 100 queries. */ + queryStrings?: string[]; +} + +/** JQL queries that contained users that could not be found */ +export interface JQLQueryWithUnknownUsers { + /** The converted query, with accountIDs instead of user identifiers, or 'unknown' for users that could not be found */ + convertedQuery?: string; + /** The original query, for reference */ + originalQuery?: string; +} + +/** Lists of JQL reference data. */ +export interface JQLReferenceData { + /** List of JQL query reserved words. */ + jqlReservedWords?: string[]; + /** List of fields usable in JQL queries. */ + visibleFieldNames?: FieldReferenceData[]; + /** List of functions usable in JQL queries. */ + visibleFunctionNames?: FunctionReferenceData[]; +} + +/** The JQL specifying the issues available in the evaluated Jira expression under the `issues` context variable. */ +export interface JexpIssues { + /** The JQL query that specifies the set of issues available in the Jira expression. */ + jql?: JexpJqlIssues; +} + +/** The JQL specifying the issues available in the evaluated Jira expression under the `issues` context variable. Not all issues returned by the JQL query are loaded, only those described by the `startAt` and `maxResults` properties. To determine whether it is necessary to iterate to ensure all the issues returned by the JQL query are evaluated, inspect `meta.issues.jql.count` in the response. */ +export interface JexpJqlIssues { + /** + * The maximum number of issues to return from the JQL query. Inspect `meta.issues.jql.maxResults` in the response to ensure the maximum value has not been exceeded. + * @format int32 + */ + maxResults?: number; + /** The JQL query. */ + query?: string; + /** + * The index of the first issue to return from the JQL query. + * @format int64 + */ + startAt?: number; + /** + * Determines how to validate the JQL query and treat the validation results. + * @default "strict" + */ + validation?: "strict" | "warn" | "none"; +} + +/** Details about the analysed Jira expression. */ +export interface JiraExpressionAnalysis { + /** Details about the complexity of the analysed Jira expression. */ + complexity?: JiraExpressionComplexity; + /** A list of validation errors. Not included if the expression is valid. */ + errors?: JiraExpressionValidationError[]; + /** The analysed expression. */ + expression: string; + /** EXPERIMENTAL. The inferred type of the expression. */ + type?: string; + /** Whether the expression is valid and the interpreter will evaluate it. Note that the expression may fail at runtime (for example, if it executes too many expensive operations). */ + valid: boolean; +} + +/** Details about the complexity of the analysed Jira expression. */ +export interface JiraExpressionComplexity { + /** + * Information that can be used to determine how many [expensive operations](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#expensive-operations) the evaluation of the expression will perform. This information may be a formula or number. For example: + * + * * `issues.map(i => i.comments)` performs as many expensive operations as there are issues on the issues list. So this parameter returns `N`, where `N` is the size of issue list. + * * `new Issue(10010).comments` gets comments for one issue, so its complexity is `2` (`1` to retrieve issue 10010 from the database plus `1` to get its comments). + */ + expensiveOperations: string; + /** Variables used in the formula, mapped to the parts of the expression they refer to. */ + variables?: Record; +} + +export interface JiraExpressionEvalContextBean { + /** + * The ID of the board that is available under the `board` variable when evaluating the expression. + * @format int64 + */ + board?: number; + /** + * Custom context variables and their types. These variable types are available for use in a custom context: + * + * * `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) specified as an Atlassian account ID. + * * `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) specified by ID or key. All the fields of the issue object are available in the Jira expression. + * * `json`: A JSON object containing custom content. + * * `list`: A JSON list of `user`, `issue`, or `json` variable types. + */ + custom?: CustomContextVariable[]; + /** + * The ID of the customer request that is available under the `customerRequest` variable when evaluating the expression. This is the same as the ID of the underlying Jira issue, but the customer request context variable will have a different type. + * @format int64 + */ + customerRequest?: number; + /** The issue that is available under the `issue` variable when evaluating the expression. */ + issue?: IdOrKeyBean; + /** The collection of issues that is available under the `issues` variable when evaluating the expression. */ + issues?: JexpIssues; + /** The project that is available under the `project` variable when evaluating the expression. */ + project?: IdOrKeyBean; + /** + * The ID of the service desk that is available under the `serviceDesk` variable when evaluating the expression. + * @format int64 + */ + serviceDesk?: number; + /** + * The ID of the sprint that is available under the `sprint` variable when evaluating the expression. + * @format int64 + */ + sprint?: number; +} + +export interface JiraExpressionEvalRequestBean { + /** The context in which the Jira expression is evaluated. */ + context?: JiraExpressionEvalContextBean; + /** + * The Jira expression to evaluate. + * @example "{ key: issue.key, type: issue.issueType.name, links: issue.links.map(link => link.linkedIssue.id) }" + */ + expression: string; +} + +export interface JiraExpressionEvaluationMetaDataBean { + /** Contains information about the expression complexity. For example, the number of steps it took to evaluate the expression. */ + complexity?: JiraExpressionsComplexityBean; + /** Contains information about the `issues` variable in the context. For example, is the issues were loaded with JQL, information about the page will be included here. */ + issues?: IssuesMetaBean; +} + +/** Details of Jira expressions for analysis. */ +export interface JiraExpressionForAnalysis { + /** Context variables and their types. The type checker assumes that [common context variables](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#context-variables), such as `issue` or `project`, are available in context and sets their type. Use this property to override the default types or provide details of new variables. */ + contextVariables?: Record; + /** + * The list of Jira expressions to analyse. + * @example "issues.map(issue => issue.properties['property_key'])" + */ + expressions: string[]; +} + +/** The result of evaluating a Jira expression. */ +export interface JiraExpressionResult { + /** Contains various characteristics of the performed expression evaluation. */ + meta?: JiraExpressionEvaluationMetaDataBean; + /** The value of the evaluated expression. It may be a primitive JSON value or a Jira REST API object. (Some expressions do not produce any meaningful results—for example, an expression that returns a lambda function—if that's the case a simple string representation is returned. These string representations should not be relied upon and may change without notice.) */ + value: any; +} + +/** + * Details about syntax and type errors. The error details apply to the entire expression, unless the object includes: + * + * * `line` and `column` + * * `expression` + */ +export interface JiraExpressionValidationError { + /** + * The text column in which the error occurred. + * @format int32 + */ + column?: number; + /** The part of the expression in which the error occurred. */ + expression?: string; + /** + * The text line in which the error occurred. + * @format int32 + */ + line?: number; + /** + * Details about the error. + * @example "!, -, typeof, (, IDENTIFIER, null, true, false, NUMBER, STRING, TEMPLATE_LITERAL, new, [ or { expected, > encountered." + */ + message: string; + /** The error type. */ + type: "syntax" | "type" | "other"; +} + +/** Details about the analysed Jira expression. */ +export interface JiraExpressionsAnalysis { + /** The results of Jira expressions analysis. */ + results: JiraExpressionAnalysis[]; +} + +export interface JiraExpressionsComplexityBean { + /** The number of Jira REST API beans returned in the response. */ + beans: JiraExpressionsComplexityValueBean; + /** The number of expensive operations executed while evaluating the expression. Expensive operations are those that load additional data, such as entity properties, comments, or custom fields. */ + expensiveOperations: JiraExpressionsComplexityValueBean; + /** The number of primitive values returned in the response. */ + primitiveValues: JiraExpressionsComplexityValueBean; + /** The number of steps it took to evaluate the expression, where a step is a high-level operation performed by the expression. A step is an operation such as arithmetic, accessing a property, accessing a context variable, or calling a function. */ + steps: JiraExpressionsComplexityValueBean; +} + +export interface JiraExpressionsComplexityValueBean { + /** + * The maximum allowed complexity. The evaluation will fail if this value is exceeded. + * @format int32 + */ + limit: number; + /** + * The complexity value of the current expression. + * @format int32 + */ + value: number; +} + +/** Details of a status. */ +export interface JiraStatus { + /** The description of the status. */ + description?: string; + /** The ID of the status. */ + id?: string; + /** The name of the status. */ + name?: string; + /** The scope of the status. */ + scope?: StatusScope; + /** The category of the status. */ + statusCategory?: "TODO" | "IN_PROGRESS" | "DONE"; + /** + * Projects and issue types where the status is used. Only available if the `usages` expand is requested. + * @uniqueItems true + */ + usages?: ProjectIssueTypes[]; +} + +/** Jql function precomputation. */ +export interface JqlFunctionPrecomputationBean { + arguments?: string[]; + /** @format date-time */ + created?: string; + field?: string; + functionKey?: string; + functionName?: string; + id?: string; + operator?: string; + /** @format date-time */ + updated?: string; + /** @format date-time */ + used?: string; + value?: string; +} + +/** Precomputation id and its new value. */ +export interface JqlFunctionPrecomputationUpdateBean { + /** @format int64 */ + id: number; + value: string; +} + +/** List of pairs (id and value) for precomputation updates. */ +export interface JqlFunctionPrecomputationUpdateRequestBean { + values?: JqlFunctionPrecomputationUpdateBean[]; +} + +/** A list of JQL queries to parse. */ +export interface JqlQueriesToParse { + /** + * A list of queries to parse. + * @minLength 1 + */ + queries: string[]; +} + +/** The list of JQL queries to sanitize for the given account IDs. */ +export interface JqlQueriesToSanitize { + /** The list of JQL queries to sanitize. Must contain unique values. Maximum of 20 queries. */ + queries: JqlQueryToSanitize[]; +} + +/** A parsed JQL query. */ +export interface JqlQuery { + /** Details of the order-by JQL clause. */ + orderBy?: JqlQueryOrderByClause; + /** A JQL query clause. */ + where?: JqlQueryClause; +} + +/** A JQL query clause. */ +export type JqlQueryClause = CompoundClause | FieldValueClause | FieldWasClause | FieldChangedClause; + +/** Details of an operand in a JQL clause. */ +export type JqlQueryClauseOperand = ListOperand | ValueOperand | FunctionOperand | KeywordOperand; + +/** A time predicate for a temporal JQL clause. */ +export interface JqlQueryClauseTimePredicate { + /** Details of an operand in a JQL clause. */ + operand: JqlQueryClauseOperand; + /** The operator between the field and the operand. */ + operator: "before" | "after" | "from" | "to" | "on" | "during" | "by"; +} + +/** A field used in a JQL query. See [Advanced searching - fields reference](https://confluence.atlassian.com/x/dAiiLQ) for more information about fields in JQL queries. */ +export interface JqlQueryField { + /** The encoded name of the field, which can be used directly in a JQL query. */ + encodedName?: string; + /** The name of the field. */ + name: string; + /** When the field refers to a value in an entity property, details of the entity property value. */ + property?: JqlQueryFieldEntityProperty[]; +} + +/** Details of an entity property. */ +export interface JqlQueryFieldEntityProperty { + /** + * The object on which the property is set. + * @example "issue" + */ + entity: string; + /** + * The key of the property. + * @example "stats" + */ + key: string; + /** + * The path in the property value to query. + * @example "comments.count" + */ + path: string; + /** + * The type of the property value extraction. Not available if the extraction for the property is not registered on the instance with the [Entity property](https://developer.atlassian.com/cloud/jira/platform/modules/entity-property/) module. + * @example "number" + */ + type?: "number" | "string" | "text" | "date" | "user"; +} + +/** Details of the order-by JQL clause. */ +export interface JqlQueryOrderByClause { + /** The list of order-by clause fields and their ordering directives. */ + fields: JqlQueryOrderByClauseElement[]; +} + +/** An element of the order-by JQL clause. */ +export interface JqlQueryOrderByClauseElement { + /** The direction in which to order the results. */ + direction?: "asc" | "desc"; + /** A field used in a JQL query. See [Advanced searching - fields reference](https://confluence.atlassian.com/x/dAiiLQ) for more information about fields in JQL queries. */ + field: JqlQueryField; +} + +/** The JQL query to sanitize for the account ID. If the account ID is null, sanitizing is performed for an anonymous user. */ +export interface JqlQueryToSanitize { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + * @maxLength 128 + */ + accountId?: string | null; + /** The query to sanitize. */ + query: string; +} + +/** An operand that can be part of a list operand. */ +export type JqlQueryUnitaryOperand = ValueOperand | FunctionOperand | KeywordOperand; + +/** A JSON object with custom content. */ +export interface JsonContextVariable { + /** Type of custom context variable. */ + type: string; + /** A JSON object containing custom content. */ + value?: object; +} + +export interface JsonNode { + array?: boolean; + bigDecimal?: boolean; + bigInteger?: boolean; + bigIntegerValue?: number; + binary?: boolean; + binaryValue?: string[]; + boolean?: boolean; + booleanValue?: boolean; + containerNode?: boolean; + decimalValue?: number; + double?: boolean; + /** @format double */ + doubleValue?: number; + elements?: object; + fieldNames?: object; + fields?: object; + floatingPointNumber?: boolean; + int?: boolean; + /** @format int32 */ + intValue?: number; + integralNumber?: boolean; + long?: boolean; + /** @format int64 */ + longValue?: number; + missingNode?: boolean; + null?: boolean; + number?: boolean; + numberType?: "INT" | "LONG" | "BIG_INTEGER" | "FLOAT" | "DOUBLE" | "BIG_DECIMAL"; + numberValue?: number; + object?: boolean; + pojo?: boolean; + textValue?: string; + textual?: boolean; + valueAsBoolean?: boolean; + /** @format double */ + valueAsDouble?: number; + /** @format int32 */ + valueAsInt?: number; + /** @format int64 */ + valueAsLong?: number; + valueAsText?: string; + valueNode?: boolean; +} + +/** The schema of a field. */ +export interface JsonTypeBean { + /** If the field is a custom field, the configuration of the field. */ + configuration?: Record; + /** If the field is a custom field, the URI of the field. */ + custom?: string; + /** + * If the field is a custom field, the custom ID of the field. + * @format int64 + */ + customId?: number; + /** When the data type is an array, the name of the field items within the array. */ + items?: string; + /** If the field is a system field, the name of the field. */ + system?: string; + /** The data type of the field. */ + type: string; +} + +/** An operand that is a JQL keyword. See [Advanced searching - keywords reference](https://confluence.atlassian.com/jiracorecloud/advanced-searching-keywords-reference-765593717.html#Advancedsearching-keywordsreference-EMPTYEMPTY) for more information about operand keywords. */ +export interface KeywordOperand { + /** The keyword that is the operand value. */ + keyword: "empty"; +} + +/** Details about a license for the Jira instance. */ +export interface License { + /** The applications under this license. */ + applications: LicensedApplication[]; +} + +/** A license metric */ +export interface LicenseMetric { + /** The key of the license metric. */ + key?: string; + /** The value for the license metric. */ + value?: string; +} + +/** Details about a licensed Jira application. */ +export interface LicensedApplication { + /** The ID of the application. */ + id: string; + /** The licensing plan. */ + plan: "UNLICENSED" | "FREE" | "PAID"; +} + +/** Details a link group, which defines issue operations. */ +export interface LinkGroup { + groups?: LinkGroup[]; + /** Details about the operations available in this version. */ + header?: SimpleLink; + id?: string; + links?: SimpleLink[]; + styleClass?: string; + /** @format int32 */ + weight?: number; +} + +export interface LinkIssueRequestJsonBean { + /** A comment. */ + comment?: Comment; + /** The ID or key of a linked issue. */ + inwardIssue: LinkedIssue; + /** The ID or key of a linked issue. */ + outwardIssue: LinkedIssue; + /** + * This object is used as follows: + * + * * In the [ issueLink](#api-rest-api-3-issueLink-post) resource it defines and reports on the type of link between the issues. Find a list of issue link types with [Get issue link types](#api-rest-api-3-issueLinkType-get). + * * In the [ issueLinkType](#api-rest-api-3-issueLinkType-post) resource it defines and reports on issue link types. + */ + type: IssueLinkType; +} + +/** The ID or key of a linked issue. */ +export interface LinkedIssue { + /** The fields associated with the issue. */ + fields?: Fields; + /** The ID of an issue. Required if `key` isn't provided. */ + id?: string; + /** The key of an issue. Required if `id` isn't provided. */ + key?: string; + /** + * The URL of the issue. + * @format uri + */ + self?: string; +} + +/** An operand that is a list of values. */ +export interface ListOperand { + /** Encoded operand, which can be used directly in a JQL query. */ + encodedOperand?: string; + /** + * The list of operand values. + * @minLength 1 + */ + values: JqlQueryUnitaryOperand[]; +} + +export type ListWrapperCallbackApplicationRole = object; + +export type ListWrapperCallbackGroupName = object; + +/** Details of a locale. */ +export interface Locale { + /** The locale code. The Java the locale format is used: a two character language code (ISO 639), an underscore, and two letter country code (ISO 3166). For example, en\_US represents a locale of English (United States). Required on create. */ + locale?: string; +} + +export interface MoveFieldBean { + /** + * The ID of the screen tab field after which to place the moved screen tab field. Required if `position` isn't provided. + * @format uri + */ + after?: string; + /** The named position to which the screen tab field should be moved. Required if `after` isn't provided. */ + position?: "Earlier" | "Later" | "First" | "Last"; +} + +/** A list of issues and their respective properties to set or update. See [Entity properties](https://developer.atlassian.com/cloud/jira/platform/jira-entity-properties/) for more information. */ +export interface MultiIssueEntityProperties { + /** A list of issue IDs and their respective properties. */ + issues?: IssueEntityPropertiesForMultiUpdate[]; +} + +/** A custom field and its new value with a list of issue to update. */ +export interface MultipleCustomFieldValuesUpdate { + /** The ID or key of the custom field. For example, `customfield_10010`. */ + customField: string; + /** The list of issue IDs. */ + issueIds: number[]; + /** + * The value for the custom field. The value must be compatible with the [custom field type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/#data-types) as follows: + * + * * `string` the value must be a string. + * * `number` the value must be a number. + * * `datetime` the value must be a string that represents a date in the ISO format or the simplified extended ISO format. For example, `"2023-01-18T12:00:00-03:00"` or `"2023-01-18T12:00:00.000Z"`. However, the milliseconds part is ignored. + * * `user` the value must be an object that contains the `accountId` field. + * * `group` the value must be an object that contains the group `name` or `groupId` field. Because group names can change, we recommend using `groupId`. + * + * A list of appropriate values must be provided if the field is of the `list` [collection type](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field/#collection-types). + */ + value: any; +} + +/** List of updates for a custom fields. */ +export interface MultipleCustomFieldValuesUpdateDetails { + updates?: MultipleCustomFieldValuesUpdate[]; +} + +export interface NestedResponse { + /** Error messages from an operation. */ + errorCollection?: ErrorCollection; + /** @format int32 */ + status?: number; + warningCollection?: WarningCollection; +} + +/** The user details. */ +export interface NewUserDetails { + /** Deprecated, do not use. */ + applicationKeys?: string[]; + /** This property is no longer available. If the user has an Atlassian account, their display name is not changed. If the user does not have an Atlassian account, they are sent an email asking them set up an account. */ + displayName?: string; + /** The email address for the user. */ + emailAddress: string; + /** This property is no longer available. See the [migration guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + key?: string; + /** This property is no longer available. See the [migration guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + name?: string; + /** This property is no longer available. If the user has an Atlassian account, their password is not changed. If the user does not have an Atlassian account, they are sent an email asking them set up an account. */ + password?: string; + /** The URL of the user. */ + self?: string; + [key: string]: any; +} + +/** Details about a notification. */ +export interface Notification { + /** The HTML body of the email notification for the issue. */ + htmlBody?: string; + /** Restricts the notifications to users with the specified permissions. */ + restrict?: NotificationRecipientsRestrictions; + /** The subject of the email notification for the issue. If this is not specified, then the subject is set to the issue key and summary. */ + subject?: string; + /** The plain text body of the email notification for the issue. */ + textBody?: string; + /** The recipients of the email notification for the issue. */ + to?: NotificationRecipients; + [key: string]: any; +} + +/** Details about a notification event. */ +export interface NotificationEvent { + /** The description of the event. */ + description?: string; + /** + * The ID of the event. The event can be a [Jira system event](https://confluence.atlassian.com/x/8YdKLg#Creatinganotificationscheme-eventsEvents) or a [custom event](https://confluence.atlassian.com/x/AIlKLg). + * @format int64 + */ + id?: number; + /** The name of the event. */ + name?: string; + /** The template of the event. Only custom events configured by Jira administrators have template. */ + templateEvent?: NotificationEvent; +} + +/** Details of the users and groups to receive the notification. */ +export interface NotificationRecipients { + /** Whether the notification should be sent to the issue's assignees. */ + assignee?: boolean; + /** List of groupIds to receive the notification. */ + groupIds?: string[]; + /** List of groups to receive the notification. */ + groups?: GroupName[]; + /** Whether the notification should be sent to the issue's reporter. */ + reporter?: boolean; + /** List of users to receive the notification. */ + users?: UserDetails[]; + /** Whether the notification should be sent to the issue's voters. */ + voters?: boolean; + /** Whether the notification should be sent to the issue's watchers. */ + watchers?: boolean; + [key: string]: any; +} + +/** Details of the group membership or permissions needed to receive the notification. */ +export interface NotificationRecipientsRestrictions { + /** List of groupId memberships required to receive the notification. */ + groupIds?: string[]; + /** List of group memberships required to receive the notification. */ + groups?: GroupName[]; + /** List of permissions required to receive the notification. */ + permissions?: RestrictedPermission[]; +} + +/** Details about a notification scheme. */ +export interface NotificationScheme { + /** The description of the notification scheme. */ + description?: string; + /** Expand options that include additional notification scheme details in the response. */ + expand?: string; + /** + * The ID of the notification scheme. + * @format int64 + */ + id?: number; + /** The name of the notification scheme. */ + name?: string; + /** The notification events and associated recipients. */ + notificationSchemeEvents?: NotificationSchemeEvent[]; + /** The list of project IDs associated with the notification scheme. */ + projects?: number[]; + /** The scope of the notification scheme. */ + scope?: Scope; + self?: string; +} + +export interface NotificationSchemeAndProjectMappingJsonBean { + notificationSchemeId?: string; + projectId?: string; +} + +/** Details about a notification scheme event. */ +export interface NotificationSchemeEvent { + /** Details about a notification event. */ + event?: NotificationEvent; + notifications?: EventNotification[]; +} + +/** Details of a notification scheme event. */ +export interface NotificationSchemeEventDetails { + /** The ID of the event. */ + event: NotificationSchemeEventTypeId; + /** + * The list of notifications mapped to a specified event. + * @maxLength 255 + */ + notifications: NotificationSchemeNotificationDetails[]; + [key: string]: any; +} + +/** The ID of an event that is being mapped to notifications. */ +export interface NotificationSchemeEventTypeId { + /** The ID of the notification scheme event. */ + id: string; + [key: string]: any; +} + +/** The ID of a notification scheme. */ +export interface NotificationSchemeId { + /** The ID of a notification scheme. */ + id: string; + [key: string]: any; +} + +/** + * Details of a notification within a notification scheme. + * @maxLength 255 + */ +export interface NotificationSchemeNotificationDetails { + /** The notification type, e.g `CurrentAssignee`, `Group`, `EmailAddress`. */ + notificationType: string; + /** The value corresponding to the specified notification type. */ + parameter?: string; + [key: string]: any; +} + +/** @example {"message":"An example message.","statusCode":200} */ +export interface OperationMessage { + /** The human-readable message that describes the result. */ + message: string; + /** The status code of the response. */ + statusCode: number; +} + +/** Details of the operations that can be performed on the issue. */ +export interface Operations { + /** Details of the link groups defining issue operations. */ + linkGroups?: LinkGroup[]; + [key: string]: any; +} + +/** An ordered list of custom field option IDs and information on where to move them. */ +export interface OrderOfCustomFieldOptions { + /** The ID of the custom field option or cascading option to place the moved options after. Required if `position` isn't provided. */ + after?: string; + /** A list of IDs of custom field options to move. The order of the custom field option IDs in the list is the order they are given after the move. The list must contain custom field options or cascading options, but not both. */ + customFieldOptionIds: string[]; + /** The position the custom field options should be moved to. Required if `after` isn't provided. */ + position?: "First" | "Last"; +} + +/** An ordered list of issue type IDs and information about where to move them. */ +export interface OrderOfIssueTypes { + /** The ID of the issue type to place the moved issue types after. Required if `position` isn't provided. */ + after?: string; + /** A list of the issue type IDs to move. The order of the issue type IDs in the list is the order they are given after the move. */ + issueTypeIds: string[]; + /** The position the issue types should be moved to. Required if `after` isn't provided. */ + position?: "First" | "Last"; +} + +/** A page of items. */ +export interface PageBeanChangelog { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: Changelog[]; +} + +/** A page of items. */ +export interface PageBeanComment { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: Comment[]; +} + +/** A page of items. */ +export interface PageBeanComponentWithIssueCount { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: ComponentWithIssueCount[]; +} + +/** A page of items. */ +export interface PageBeanContext { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: Context[]; +} + +/** A page of items. */ +export interface PageBeanContextForProjectAndIssueType { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: ContextForProjectAndIssueType[]; +} + +/** A page of items. */ +export interface PageBeanContextualConfiguration { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: ContextualConfiguration[]; +} + +/** A page of items. */ +export interface PageBeanCustomFieldContext { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: CustomFieldContext[]; +} + +/** A page of items. */ +export interface PageBeanCustomFieldContextDefaultValue { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: CustomFieldContextDefaultValue[]; +} + +/** A page of items. */ +export interface PageBeanCustomFieldContextOption { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: CustomFieldContextOption[]; +} + +/** A page of items. */ +export interface PageBeanCustomFieldContextProjectMapping { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: CustomFieldContextProjectMapping[]; +} + +/** A page of items. */ +export interface PageBeanDashboard { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: Dashboard[]; +} + +/** A page of items. */ +export interface PageBeanField { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: Field[]; +} + +/** A page of items. */ +export interface PageBeanFieldConfigurationDetails { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: FieldConfigurationDetails[]; +} + +/** A page of items. */ +export interface PageBeanFieldConfigurationIssueTypeItem { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: FieldConfigurationIssueTypeItem[]; +} + +/** A page of items. */ +export interface PageBeanFieldConfigurationItem { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: FieldConfigurationItem[]; +} + +/** A page of items. */ +export interface PageBeanFieldConfigurationScheme { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: FieldConfigurationScheme[]; +} + +/** A page of items. */ +export interface PageBeanFieldConfigurationSchemeProjects { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: FieldConfigurationSchemeProjects[]; +} + +/** A page of items. */ +export interface PageBeanFilterDetails { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: FilterDetails[]; +} + +/** A page of items. */ +export interface PageBeanGroupDetails { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: GroupDetails[]; +} + +/** A page of items. */ +export interface PageBeanIssueFieldOption { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: IssueFieldOption[]; +} + +/** A page of items. */ +export interface PageBeanIssueSecurityLevelMember { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: IssueSecurityLevelMember[]; +} + +/** A page of items. */ +export interface PageBeanIssueTypeScheme { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: IssueTypeScheme[]; +} + +/** A page of items. */ +export interface PageBeanIssueTypeSchemeMapping { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: IssueTypeSchemeMapping[]; +} + +/** A page of items. */ +export interface PageBeanIssueTypeSchemeProjects { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: IssueTypeSchemeProjects[]; +} + +/** A page of items. */ +export interface PageBeanIssueTypeScreenScheme { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: IssueTypeScreenScheme[]; +} + +/** A page of items. */ +export interface PageBeanIssueTypeScreenSchemeItem { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: IssueTypeScreenSchemeItem[]; +} + +/** A page of items. */ +export interface PageBeanIssueTypeScreenSchemesProjects { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: IssueTypeScreenSchemesProjects[]; +} + +/** A page of items. */ +export interface PageBeanIssueTypeToContextMapping { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: IssueTypeToContextMapping[]; +} + +/** A page of items. */ +export interface PageBeanJqlFunctionPrecomputationBean { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: JqlFunctionPrecomputationBean[]; +} + +/** A page of items. */ +export interface PageBeanNotificationScheme { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: NotificationScheme[]; +} + +/** A page of items. */ +export interface PageBeanNotificationSchemeAndProjectMappingJsonBean { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: NotificationSchemeAndProjectMappingJsonBean[]; +} + +/** A page of items. */ +export interface PageBeanPriority { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: Priority[]; +} + +/** A page of items. */ +export interface PageBeanProject { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: Project[]; +} + +/** A page of items. */ +export interface PageBeanProjectDetails { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: ProjectDetails[]; +} + +/** A page of items. */ +export interface PageBeanResolutionJsonBean { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: ResolutionJsonBean[]; +} + +/** A page of items. */ +export interface PageBeanScreen { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: Screen[]; +} + +/** A page of items. */ +export interface PageBeanScreenScheme { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: ScreenScheme[]; +} + +/** A page of items. */ +export interface PageBeanScreenWithTab { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: ScreenWithTab[]; +} + +/** A page of items. */ +export interface PageBeanString { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: string[]; +} + +/** A page of items. */ +export interface PageBeanUiModificationDetails { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: UiModificationDetails[]; +} + +/** A page of items. */ +export interface PageBeanUser { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: User[]; +} + +/** A page of items. */ +export interface PageBeanUserDetails { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: UserDetails[]; +} + +/** A page of items. */ +export interface PageBeanUserKey { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: UserKey[]; +} + +/** A page of items. */ +export interface PageBeanVersion { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: Version[]; +} + +/** A page of items. */ +export interface PageBeanWebhook { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: Webhook[]; +} + +/** A page of items. */ +export interface PageBeanWorkflow { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: Workflow[]; +} + +/** A page of items. */ +export interface PageBeanWorkflowScheme { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: WorkflowScheme[]; +} + +/** A page of items. */ +export interface PageBeanWorkflowTransitionRules { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * If there is another page of results, the URL of the next page. + * @format uri + */ + nextPage?: string; + /** + * The URL of the page. + * @format uri + */ + self?: string; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: WorkflowTransitionRules[]; +} + +/** A page of changelogs. */ +export interface PageOfChangelogs { + /** The list of changelogs. */ + histories?: Changelog[]; + /** + * The maximum number of results that could be on the page. + * @format int32 + */ + maxResults?: number; + /** + * The index of the first item returned on the page. + * @format int32 + */ + startAt?: number; + /** + * The number of results on the page. + * @format int32 + */ + total?: number; +} + +/** A page of comments. */ +export interface PageOfComments { + /** The list of comments. */ + comments?: Comment[]; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** + * The index of the first item returned. + * @format int64 + */ + startAt?: number; + /** + * The number of items returned. + * @format int64 + */ + total?: number; + [key: string]: any; +} + +/** A page containing dashboard details. */ +export interface PageOfDashboards { + /** List of dashboards. */ + dashboards?: Dashboard[]; + /** + * The maximum number of results that could be on the page. + * @format int32 + */ + maxResults?: number; + /** The URL of the next page of results, if any. */ + next?: string; + /** The URL of the previous page of results, if any. */ + prev?: string; + /** + * The index of the first item returned on the page. + * @format int32 + */ + startAt?: number; + /** + * The number of results on the page. + * @format int32 + */ + total?: number; +} + +export interface PageOfStatuses { + /** Whether this is the last page. */ + isLast?: boolean; + /** + * The maximum number of items that could be returned. + * @format int32 + */ + maxResults?: number; + /** The URL of the next page of results, if any. */ + nextPage?: string; + /** The URL of this page. */ + self?: string; + /** + * The index of the first item returned on the page. + * @format int64 + */ + startAt?: number; + /** + * Number of items that satisfy the search. + * @format int64 + */ + total?: number; + /** The list of items. */ + values?: JiraStatus[]; +} + +/** Paginated list of worklog details */ +export interface PageOfWorklogs { + /** + * The maximum number of results that could be on the page. + * @format int32 + */ + maxResults?: number; + /** + * The index of the first item returned on the page. + * @format int32 + */ + startAt?: number; + /** + * The number of results on the page. + * @format int32 + */ + total?: number; + /** List of worklogs. */ + worklogs?: Worklog[]; + [key: string]: any; +} + +/** A paged list. To access additional details append `[start-index:end-index]` to the expand request. For example, `?expand=sharedUsers[10:40]` returns a list starting at item 10 and finishing at item 40. */ +export interface PagedListUserDetailsApplicationUser { + /** + * The index of the last item returned on the page. + * @format int32 + */ + "end-index"?: number; + /** The list of items. */ + items?: UserDetails[]; + /** + * The maximum number of results that could be on the page. + * @format int32 + */ + "max-results"?: number; + /** + * The number of items on the page. + * @format int32 + */ + size?: number; + /** + * The index of the first item returned on the page. + * @format int32 + */ + "start-index"?: number; +} + +export interface PaginatedResponseComment { + /** @format int32 */ + maxResults?: number; + results?: Comment[]; + /** @format int64 */ + startAt?: number; + /** @format int64 */ + total?: number; +} + +/** A list of parsed JQL queries. */ +export interface ParsedJqlQueries { + /** + * A list of parsed JQL queries. + * @minLength 1 + */ + queries: ParsedJqlQuery[]; +} + +/** + * Details of a parsed JQL query. + * @minLength 1 + */ +export interface ParsedJqlQuery { + /** + * The list of syntax or validation errors. + * @uniqueItems true + */ + errors?: string[]; + /** The JQL query that was parsed and validated. */ + query: string; + /** The syntax tree of the query. Empty if the query was invalid. */ + structure?: JqlQuery; +} + +/** Details about a permission granted to a user or group. */ +export interface PermissionGrant { + /** The user or group being granted the permission. It consists of a `type`, a type-dependent `parameter` and a type-dependent `value`. See [Holder object](../api-group-permission-schemes/#holder-object) in *Get all permission schemes* for more information. */ + holder?: PermissionHolder; + /** + * The ID of the permission granted details. + * @format int64 + */ + id?: number; + /** The permission to grant. This permission can be one of the built-in permissions or a custom permission added by an app. See [Built-in permissions](../api-group-permission-schemes/#built-in-permissions) in *Get all permission schemes* for more information about the built-in permissions. See the [project permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation for more information about custom permissions. */ + permission?: string; + /** + * The URL of the permission granted details. + * @format uri + */ + self?: string; +} + +/** List of permission grants. */ +export interface PermissionGrants { + /** Expand options that include additional permission grant details in the response. */ + expand?: string; + /** Permission grants list. */ + permissions?: PermissionGrant[]; +} + +/** Details of a user, group, field, or project role that holds a permission. See [Holder object](../api-group-permission-schemes/#holder-object) in *Get all permission schemes* for more information. */ +export interface PermissionHolder { + /** Expand options that include additional permission holder details in the response. */ + expand?: string; + /** As a group's name can change, use of `value` is recommended. The identifier associated withthe `type` value that defines the holder of the permission. */ + parameter?: string; + /** The type of permission holder. */ + type: string; + /** The identifier associated with the `type` value that defines the holder of the permission. */ + value?: string; +} + +/** Details of a permission scheme. */ +export interface PermissionScheme { + /** A description for the permission scheme. */ + description?: string; + /** The expand options available for the permission scheme. */ + expand?: string; + /** + * The ID of the permission scheme. + * @format int64 + */ + id?: number; + /** The name of the permission scheme. Must be unique. */ + name: string; + /** The permission scheme to create or update. See [About permission schemes and grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more information. */ + permissions?: PermissionGrant[]; + /** The scope of the permission scheme. */ + scope?: Scope; + /** + * The URL of the permission scheme. + * @format uri + */ + self?: string; + [key: string]: any; +} + +/** List of all permission schemes. */ +export interface PermissionSchemes { + /** Permission schemes list. */ + permissionSchemes?: PermissionScheme[]; +} + +/** Details about permissions. */ +export interface Permissions { + /** List of permissions. */ + permissions?: Record; +} + +export interface PermissionsKeysBean { + /** A list of permission keys. */ + permissions: string[]; +} + +/** A list of projects in which a user is granted permissions. */ +export interface PermittedProjects { + /** A list of projects. */ + projects?: ProjectIdentifierBean[]; +} + +/** An issue priority. */ +export interface Priority { + /** The description of the issue priority. */ + description?: string; + /** The URL of the icon for the issue priority. */ + iconUrl?: string; + /** The ID of the issue priority. */ + id?: string; + /** Whether this priority is the default. */ + isDefault?: boolean; + /** The name of the issue priority. */ + name?: string; + /** The URL of the issue priority. */ + self?: string; + /** The color used to indicate the issue priority. */ + statusColor?: string; + [key: string]: any; +} + +/** The ID of an issue priority. */ +export interface PriorityId { + /** The ID of the issue priority. */ + id: string; + [key: string]: any; +} + +/** Details about a project. */ +export interface Project { + /** Whether the project is archived. */ + archived?: boolean; + /** The user who archived the project. */ + archivedBy?: User; + /** + * The date when the project was archived. + * @format date-time + */ + archivedDate?: string; + /** The default assignee when creating issues for this project. */ + assigneeType?: "PROJECT_LEAD" | "UNASSIGNED"; + /** The URLs of the project's avatars. */ + avatarUrls?: AvatarUrlsBean; + /** List of the components contained in the project. */ + components?: ProjectComponent[]; + /** Whether the project is marked as deleted. */ + deleted?: boolean; + /** The user who marked the project as deleted. */ + deletedBy?: User; + /** + * The date when the project was marked as deleted. + * @format date-time + */ + deletedDate?: string; + /** A brief description of the project. */ + description?: string; + /** An email address associated with the project. */ + email?: string; + /** Expand options that include additional project details in the response. */ + expand?: string; + /** Whether the project is selected as a favorite. */ + favourite?: boolean; + /** The ID of the project. */ + id?: string; + /** Insights about the project. */ + insight?: ProjectInsight; + /** Whether the project is private. */ + isPrivate?: boolean; + /** The issue type hierarchy for the project. */ + issueTypeHierarchy?: Hierarchy; + /** List of the issue types available in the project. */ + issueTypes?: IssueTypeDetails[]; + /** The key of the project. */ + key?: string; + /** The project landing page info. */ + landingPageInfo?: ProjectLandingPageInfo; + /** The username of the project lead. */ + lead?: User; + /** The name of the project. */ + name?: string; + /** User permissions on the project */ + permissions?: ProjectPermissions; + /** The category the project belongs to. */ + projectCategory?: ProjectCategory; + /** The [project type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the project. */ + projectTypeKey?: "software" | "service_desk" | "business"; + /** Map of project properties */ + properties?: Record; + /** + * The date when the project is deleted permanently. + * @format date-time + */ + retentionTillDate?: string; + /** The name and self URL for each role defined in the project. For more information, see [Create project role](#api-rest-api-3-role-post). */ + roles?: Record; + /** + * The URL of the project details. + * @format uri + */ + self?: string; + /** Whether the project is simplified. */ + simplified?: boolean; + /** The type of the project. */ + style?: "classic" | "next-gen"; + /** A link to information about this project, such as project documentation. */ + url?: string; + /** + * Unique ID for next-gen projects. + * @format uuid + */ + uuid?: string; + /** The versions defined in the project. For more information, see [Create version](#api-rest-api-3-version-post). */ + versions?: Version[]; +} + +/** List of project avatars. */ +export interface ProjectAvatars { + /** List of avatars added to Jira. These avatars may be deleted. */ + custom?: Avatar[]; + /** List of avatars included with Jira. These avatars cannot be deleted. */ + system?: Avatar[]; +} + +/** A project category. */ +export interface ProjectCategory { + /** The description of the project category. */ + description?: string; + /** The ID of the project category. */ + id?: string; + /** The name of the project category. Required on create, optional on update. */ + name?: string; + /** + * The URL of the project category. + * @format uri + */ + self?: string; +} + +/** Details about a project component. */ +export interface ProjectComponent { + /** The details of the user associated with `assigneeType`, if any. See `realAssignee` for details of the user assigned to issues created with this component. */ + assignee?: User; + /** + * The nominal user type used to determine the assignee for issues created with this component. See `realAssigneeType` for details on how the type of the user, and hence the user, assigned to issues is determined. Can take the following values: + * + * * `PROJECT_LEAD` the assignee to any issues created with this component is nominally the lead for the project the component is in. + * * `COMPONENT_LEAD` the assignee to any issues created with this component is nominally the lead for the component. + * * `UNASSIGNED` an assignee is not set for issues created with this component. + * * `PROJECT_DEFAULT` the assignee to any issues created with this component is nominally the default assignee for the project that the component is in. + * + * Default value: `PROJECT_DEFAULT`. + * Optional when creating or updating a component. + */ + assigneeType?: "PROJECT_DEFAULT" | "COMPONENT_LEAD" | "PROJECT_LEAD" | "UNASSIGNED"; + /** The description for the component. Optional when creating or updating a component. */ + description?: string; + /** The unique identifier for the component. */ + id?: string; + /** Whether a user is associated with `assigneeType`. For example, if the `assigneeType` is set to `COMPONENT_LEAD` but the component lead is not set, then `false` is returned. */ + isAssigneeTypeValid?: boolean; + /** The user details for the component's lead user. */ + lead?: User; + /** + * The accountId of the component's lead user. The accountId uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + * @maxLength 128 + */ + leadAccountId?: string; + /** This property is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + leadUserName?: string; + /** The unique name for the component in the project. Required when creating a component. Optional when updating a component. The maximum length is 255 characters. */ + name?: string; + /** The key of the project the component is assigned to. Required when creating a component. Can't be updated. */ + project?: string; + /** + * The ID of the project the component is assigned to. + * @format int64 + */ + projectId?: number; + /** The user assigned to issues created with this component, when `assigneeType` does not identify a valid assignee. */ + realAssignee?: User; + /** + * The type of the assignee that is assigned to issues created with this component, when an assignee cannot be set from the `assigneeType`. For example, `assigneeType` is set to `COMPONENT_LEAD` but no component lead is set. This property is set to one of the following values: + * + * * `PROJECT_LEAD` when `assigneeType` is `PROJECT_LEAD` and the project lead has permission to be assigned issues in the project that the component is in. + * * `COMPONENT_LEAD` when `assignee`Type is `COMPONENT_LEAD` and the component lead has permission to be assigned issues in the project that the component is in. + * * `UNASSIGNED` when `assigneeType` is `UNASSIGNED` and Jira is configured to allow unassigned issues. + * * `PROJECT_DEFAULT` when none of the preceding cases are true. + */ + realAssigneeType?: "PROJECT_DEFAULT" | "COMPONENT_LEAD" | "PROJECT_LEAD" | "UNASSIGNED"; + /** + * The URL of the component. + * @format uri + */ + self?: string; +} + +/** Details about a project. */ +export interface ProjectDetails { + /** The URLs of the project's avatars. */ + avatarUrls?: AvatarUrlsBean; + /** The ID of the project. */ + id?: string; + /** The key of the project. */ + key?: string; + /** The name of the project. */ + name?: string; + /** The category the project belongs to. */ + projectCategory?: UpdatedProjectCategory; + /** The [project type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes) of the project. */ + projectTypeKey?: "software" | "service_desk" | "business"; + /** The URL of the project details. */ + self?: string; + /** Whether or not the project is simplified. */ + simplified?: boolean; +} + +/** A project's sender email address. */ +export interface ProjectEmailAddress { + /** The email address. */ + emailAddress?: string; + /** When using a custom domain, the status of the email address. */ + emailAddressStatus?: string[]; +} + +/** Details of a project feature. */ +export interface ProjectFeature { + /** The key of the feature. */ + feature?: string; + /** URI for the image representing the feature. */ + imageUri?: string; + /** Localized display description for the feature. */ + localisedDescription?: string; + /** Localized display name for the feature. */ + localisedName?: string; + /** List of keys of the features required to enable the feature. */ + prerequisites?: string[]; + /** + * The ID of the project. + * @format int64 + */ + projectId?: number; + /** The state of the feature. When updating the state of a feature, only ENABLED and DISABLED are supported. Responses can contain all values */ + state?: "ENABLED" | "DISABLED" | "COMING_SOON"; + /** Whether the state of the feature can be updated. */ + toggleLocked?: boolean; +} + +/** Details of the feature state. */ +export interface ProjectFeatureState { + /** The feature state. */ + state?: "ENABLED" | "DISABLED" | "COMING_SOON"; +} + +/** Project ID details. */ +export interface ProjectId { + /** The ID of the project. */ + id: string; +} + +/** The identifiers for a project. */ +export interface ProjectIdentifierBean { + /** + * The ID of the project. + * @format int64 + */ + id?: number; + /** The key of the project. */ + key?: string; +} + +/** Identifiers for a project. */ +export interface ProjectIdentifiers { + /** + * The ID of the created project. + * @format int64 + */ + id: number; + /** The key of the created project. */ + key: string; + /** + * The URL of the created project. + * @format uri + */ + self: string; +} + +/** A list of project IDs. */ +export interface ProjectIds { + /** The IDs of projects. */ + projectIds: string[]; +} + +/** Additional details about a project. */ +export interface ProjectInsight { + /** + * The last issue update time. + * @format date-time + */ + lastIssueUpdateTime?: string; + /** + * Total issue count. + * @format int64 + */ + totalIssueCount?: number; +} + +/** Details of the issue creation metadata for a project. */ +export interface ProjectIssueCreateMetadata { + /** List of the project's avatars, returning the avatar size and associated URL. */ + avatarUrls?: AvatarUrlsBean; + /** Expand options that include additional project issue create metadata details in the response. */ + expand?: string; + /** The ID of the project. */ + id?: string; + /** List of the issue types supported by the project. */ + issuetypes?: IssueTypeIssueCreateMetadata[]; + /** The key of the project. */ + key?: string; + /** The name of the project. */ + name?: string; + /** The URL of the project. */ + self?: string; +} + +/** List of issue level security items in a project. */ +export interface ProjectIssueSecurityLevels { + /** Issue level security items list. */ + levels: SecurityLevel[]; +} + +/** The hierarchy of issue types within a project. */ +export interface ProjectIssueTypeHierarchy { + /** Details of an issue type hierarchy level. */ + hierarchy?: ProjectIssueTypesHierarchyLevel[]; + /** + * The ID of the project. + * @format int64 + */ + projectId?: number; +} + +/** The project and issue type mapping. */ +export interface ProjectIssueTypeMapping { + /** The ID of the issue type. */ + issueTypeId: string; + /** The ID of the project. */ + projectId: string; +} + +/** The project and issue type mappings. */ +export interface ProjectIssueTypeMappings { + /** The project and issue type mappings. */ + mappings: ProjectIssueTypeMapping[]; +} + +/** Projects and issue types where the status is used. Only available if the `usages` expand is requested. */ +export interface ProjectIssueTypes { + /** + * IDs of the issue types + * @uniqueItems true + */ + issueTypes?: string[]; + /** Project ID details. */ + project?: ProjectId; +} + +/** Details of an issue type hierarchy level. */ +export interface ProjectIssueTypesHierarchyLevel { + /** + * The ID of the issue type hierarchy level. This property is deprecated, see [Change notice: Removing hierarchy level IDs from next-gen APIs](https://developer.atlassian.com/cloud/jira/platform/change-notice-removing-hierarchy-level-ids-from-next-gen-apis/). + * @format uuid + */ + entityId?: string; + /** The list of issue types in the hierarchy level. */ + issueTypes?: IssueTypeInfo[]; + /** + * The level of the issue type hierarchy level. + * @format int32 + */ + level?: number; + /** The name of the issue type hierarchy level. */ + name?: string; +} + +export interface ProjectLandingPageInfo { + attributes?: Record; + /** @format int64 */ + boardId?: number; + boardName?: string; + projectKey?: string; + projectType?: string; + queueCategory?: string; + /** @format int64 */ + queueId?: number; + queueName?: string; + simpleBoard?: boolean; + simplified?: boolean; + url?: string; +} + +/** Permissions which a user has on a project. */ +export interface ProjectPermissions { + /** Whether the logged user can edit the project. */ + canEdit?: boolean; +} + +/** Details about the roles in a project. */ +export interface ProjectRole { + /** The list of users who act in this role. */ + actors?: RoleActor[]; + /** Whether this role is the admin role for the project. */ + admin?: boolean; + /** Whether the calling user is part of this role. */ + currentUserRole?: boolean; + /** Whether this role is the default role for the project */ + default?: boolean; + /** The description of the project role. */ + description?: string; + /** + * The ID of the project role. + * @format int64 + */ + id?: number; + /** The name of the project role. */ + name?: string; + /** Whether the roles are configurable for this project. */ + roleConfigurable?: boolean; + /** The scope of the role. Indicated for roles associated with [next-gen projects](https://confluence.atlassian.com/x/loMyO). */ + scope?: Scope; + /** + * The URL the project role details. + * @format uri + */ + self?: string; + /** The translated name of the project role. */ + translatedName?: string; +} + +export interface ProjectRoleActorsUpdateBean { + /** + * The actors to add to the project role. + * + * Add groups using: + * + * * `atlassian-group-role-actor` and a list of group names. + * * `atlassian-group-role-actor-id` and a list of group IDs. + * + * As a group's name can change, use of `atlassian-group-role-actor-id` is recommended. For example, `"atlassian-group-role-actor-id":["eef79f81-0b89-4fca-a736-4be531a10869","77f6ab39-e755-4570-a6ae-2d7a8df0bcb8"]`. + * + * Add users using `atlassian-user-role-actor` and a list of account IDs. For example, `"atlassian-user-role-actor":["12345678-9abc-def1-2345-6789abcdef12", "abcdef12-3456-789a-bcde-f123456789ab"]`. + */ + categorisedActors?: Record; + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + * @format int64 + */ + id?: number; +} + +/** Details about a project role. */ +export interface ProjectRoleDetails { + /** Whether this role is the admin role for the project. */ + admin?: boolean; + /** Whether this role is the default role for the project. */ + default?: boolean; + /** The description of the project role. */ + description?: string; + /** + * The ID of the project role. + * @format int64 + */ + id?: number; + /** The name of the project role. */ + name?: string; + /** Whether the roles are configurable for this project. */ + roleConfigurable?: boolean; + /** The scope of the role. Indicated for roles associated with [next-gen projects](https://confluence.atlassian.com/x/loMyO). */ + scope?: Scope; + /** + * The URL the project role details. + * @format uri + */ + self?: string; + /** The translated name of the project role. */ + translatedName?: string; +} + +/** Details of the group associated with the role. */ +export interface ProjectRoleGroup { + /** The display name of the group. */ + displayName?: string; + /** The ID of the group. */ + groupId?: string; + /** The name of the group. As a group's name can change, use of `groupId` is recommended to identify the group. */ + name?: string; +} + +/** Details of the user associated with the role. */ +export interface ProjectRoleUser { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. Returns *unknown* if the record is deleted and corrupted, for example, as the result of a server import. + * @maxLength 128 + */ + accountId?: string; +} + +export interface ProjectScopeBean { + /** + * Defines the behavior of the option in the project.If notSelectable is set, the option cannot be set as the field's value. This is useful for archiving an option that has previously been selected but shouldn't be used anymore.If defaultValue is set, the option is selected by default. + * @uniqueItems true + */ + attributes?: ("notSelectable" | "defaultValue")[]; + /** + * The ID of the project that the option's behavior applies to. + * @format int64 + */ + id?: number; +} + +/** Details about a project type. */ +export interface ProjectType { + /** The color of the project type. */ + color?: string; + /** The key of the project type's description. */ + descriptionI18nKey?: string; + /** The formatted key of the project type. */ + formattedKey?: string; + /** The icon of the project type. */ + icon?: string; + /** The key of the project type. */ + key?: string; +} + +/** Property key details. */ +export interface PropertyKey { + /** The key of the property. */ + key?: string; + /** The URL of the property. */ + self?: string; +} + +/** List of property keys. */ +export interface PropertyKeys { + /** Property key details. */ + keys?: PropertyKey[]; +} + +/** Details about the status mappings for publishing a draft workflow scheme. */ +export interface PublishDraftWorkflowScheme { + /** + * Mappings of statuses to new statuses for issue types. + * @uniqueItems true + */ + statusMappings?: StatusMapping[]; +} + +/** Properties that identify a published workflow. */ +export interface PublishedWorkflowId { + /** The entity ID of the workflow. */ + entityId?: string; + /** The name of the workflow. */ + name: string; +} + +/** ID of a registered webhook or error messages explaining why a webhook wasn't registered. */ +export interface RegisteredWebhook { + /** + * The ID of the webhook. Returned if the webhook is created. + * @format int64 + */ + createdWebhookId?: number; + /** Error messages specifying why the webhook creation failed. */ + errors?: string[]; +} + +/** Details of an issue remote link. */ +export interface RemoteIssueLink { + /** Details of the remote application the linked item is in. */ + application?: Application; + /** The global ID of the link, such as the ID of the item on the remote system. */ + globalId?: string; + /** + * The ID of the link. + * @format int64 + */ + id?: number; + /** Details of the item linked to. */ + object?: RemoteObject; + /** Description of the relationship between the issue and the linked item. */ + relationship?: string; + /** + * The URL of the link. + * @format uri + */ + self?: string; +} + +/** Details of the identifiers for a created or updated remote issue link. */ +export interface RemoteIssueLinkIdentifies { + /** + * The ID of the remote issue link, such as the ID of the item on the remote system. + * @format int64 + */ + id?: number; + /** The URL of the remote issue link. */ + self?: string; +} + +/** Details of a remote issue link. */ +export interface RemoteIssueLinkRequest { + /** Details of the remote application the linked item is in. For example, trello. */ + application?: Application; + /** + * An identifier for the remote item in the remote system. For example, the global ID for a remote item in Confluence would consist of the app ID and page ID, like this: `appId=456&pageId=123`. + * + * Setting this field enables the remote issue link details to be updated or deleted using remote system and item details as the record identifier, rather than using the record's Jira ID. + * + * The maximum length is 255 characters. + */ + globalId?: string; + /** Details of the item linked to. */ + object: RemoteObject; + /** Description of the relationship between the issue and the linked item. If not set, the relationship description "links to" is used in Jira. */ + relationship?: string; + [key: string]: any; +} + +/** The linked item. */ +export interface RemoteObject { + /** Details of the icon for the item. If no icon is defined, the default link icon is used in Jira. */ + icon?: Icon; + /** The status of the item. */ + status?: Status; + /** The summary details of the item. */ + summary?: string; + /** The title of the item. */ + title: string; + /** The URL of the item. */ + url: string; + [key: string]: any; +} + +export interface RemoveOptionFromIssuesResult { + /** A collection of errors related to unchanged issues. The collection size is limited, which means not all errors may be returned. */ + errors?: SimpleErrorCollection; + /** The IDs of the modified issues. */ + modifiedIssues?: number[]; + /** The IDs of the unchanged issues, those issues where errors prevent modification. */ + unmodifiedIssues?: number[]; +} + +/** Change the order of issue priorities. */ +export interface ReorderIssuePriorities { + /** The ID of the priority. Required if `position` isn't provided. */ + after?: string; + /** The list of issue IDs to be reordered. Cannot contain duplicates nor after ID. */ + ids: string[]; + /** The position for issue priorities to be moved to. Required if `after` isn't provided. */ + position?: string; +} + +/** Change the order of issue resolutions. */ +export interface ReorderIssueResolutionsRequest { + /** The ID of the resolution. Required if `position` isn't provided. */ + after?: string; + /** The list of resolution IDs to be reordered. Cannot contain duplicates nor after ID. */ + ids: string[]; + /** The position for issue resolutions to be moved to. Required if `after` isn't provided. */ + position?: string; +} + +/** Details of an issue resolution. */ +export interface Resolution { + /** The description of the issue resolution. */ + description?: string; + /** The ID of the issue resolution. */ + id?: string; + /** The name of the issue resolution. */ + name?: string; + /** + * The URL of the issue resolution. + * @format uri + */ + self?: string; +} + +/** The ID of an issue resolution. */ +export interface ResolutionId { + /** The ID of the issue resolution. */ + id: string; + [key: string]: any; +} + +export interface ResolutionJsonBean { + default?: boolean; + description?: string; + iconUrl?: string; + id?: string; + name?: string; + self?: string; +} + +/** Details of the permission. */ +export interface RestrictedPermission { + /** The ID of the permission. Either `id` or `key` must be specified. Use [Get all permissions](#api-rest-api-3-permissions-get) to get the list of permissions. */ + id?: string; + /** The key of the permission. Either `id` or `key` must be specified. Use [Get all permissions](#api-rest-api-3-permissions-get) to get the list of permissions. */ + key?: string; + [key: string]: any; +} + +export interface RichText { + empty?: boolean; + emptyAdf?: boolean; + finalised?: boolean; + valueSet?: boolean; +} + +/** Details about a user assigned to a project role. */ +export interface RoleActor { + actorGroup?: ProjectRoleGroup; + actorUser?: ProjectRoleUser; + /** + * The avatar of the role actor. + * @format uri + */ + avatarUrl?: string; + /** The display name of the role actor. For users, depending on the user’s privacy setting, this may return an alternative value for the user's name. */ + displayName?: string; + /** + * The ID of the role actor. + * @format int64 + */ + id?: number; + /** This property is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + name?: string; + /** The type of role actor. */ + type?: "atlassian-group-role-actor" | "atlassian-user-role-actor"; +} + +/** A rule configuration. */ +export interface RuleConfiguration { + /** + * EXPERIMENTAL: Whether the rule is disabled. + * @default false + */ + disabled?: boolean; + /** + * EXPERIMENTAL: A tag used to filter rules in [Get workflow transition rule configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-transition-rules/#api-rest-api-3-workflow-rule-config-get). + * @maxLength 255 + */ + tag?: string; + /** Configuration of the rule, as it is stored by the Connect app on the rule configuration page. */ + value: string; +} + +/** The sanitized JQL queries for the given account IDs. */ +export interface SanitizedJqlQueries { + /** The list of sanitized JQL queries. */ + queries?: SanitizedJqlQuery[]; +} + +/** Details of the sanitized JQL query. */ +export interface SanitizedJqlQuery { + /** + * The account ID of the user for whom sanitization was performed. + * @maxLength 128 + */ + accountId?: string | null; + /** The list of errors. */ + errors?: ErrorCollection; + /** The initial query. */ + initialQuery?: string; + /** The sanitized query, if there were no errors. */ + sanitizedQuery?: string | null; +} + +/** The projects the item is associated with. Indicated for items associated with [next-gen projects](https://confluence.atlassian.com/x/loMyO). */ +export interface Scope { + /** The project the item has scope in. */ + project?: ProjectDetails; + /** The type of scope. */ + type?: "PROJECT" | "TEMPLATE"; + [key: string]: any; +} + +/** A screen. */ +export interface Screen { + /** The description of the screen. */ + description?: string; + /** + * The ID of the screen. + * @format int64 + */ + id?: number; + /** The name of the screen. */ + name?: string; + /** The scope of the screen. */ + scope?: Scope; +} + +/** Details of a screen. */ +export interface ScreenDetails { + /** The description of the screen. The maximum length is 255 characters. */ + description?: string; + /** The name of the screen. The name must be unique. The maximum length is 255 characters. */ + name: string; +} + +/** A screen scheme. */ +export interface ScreenScheme { + /** The description of the screen scheme. */ + description?: string; + /** + * The ID of the screen scheme. + * @format int64 + */ + id?: number; + /** Details of the issue type screen schemes associated with the screen scheme. */ + issueTypeScreenSchemes?: PageBeanIssueTypeScreenScheme; + /** The name of the screen scheme. */ + name?: string; + /** The IDs of the screens for the screen types of the screen scheme. */ + screens?: ScreenTypes; +} + +/** Details of a screen scheme. */ +export interface ScreenSchemeDetails { + /** The description of the screen scheme. The maximum length is 255 characters. */ + description?: string; + /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ + name: string; + /** The IDs of the screens for the screen types of the screen scheme. Only screens used in classic projects are accepted. */ + screens: ScreenTypes; +} + +/** The ID of a screen scheme. */ +export interface ScreenSchemeId { + /** + * The ID of the screen scheme. + * @format int64 + */ + id: number; +} + +/** The IDs of the screens for the screen types of the screen scheme. */ +export interface ScreenTypes { + /** + * The ID of the create screen. + * @format int64 + */ + create?: number; + /** + * The ID of the default screen. Required when creating a screen scheme. + * @format int64 + */ + default?: number; + /** + * The ID of the edit screen. + * @format int64 + */ + edit?: number; + /** + * The ID of the view screen. + * @format int64 + */ + view?: number; +} + +/** A screen with tab details. */ +export interface ScreenWithTab { + /** The description of the screen. */ + description?: string; + /** + * The ID of the screen. + * @format int64 + */ + id?: number; + /** The name of the screen. */ + name?: string; + /** The scope of the screen. */ + scope?: Scope; + /** The tab for the screen. */ + tab?: ScreenableTab; +} + +/** A screen tab field. */ +export interface ScreenableField { + /** The ID of the screen tab field. */ + id?: string; + /** The name of the screen tab field. Required on create and update. The maximum length is 255 characters. */ + name?: string; +} + +/** A screen tab. */ +export interface ScreenableTab { + /** + * The ID of the screen tab. + * @format int64 + */ + id?: number; + /** The name of the screen tab. The maximum length is 255 characters. */ + name: string; +} + +/** Details of how to filter and list search auto complete information. */ +export interface SearchAutoCompleteFilter { + /** + * Include collapsed fields for fields that have non-unique names. + * @default false + */ + includeCollapsedFields?: boolean; + /** List of project IDs used to filter the visible field details returned. */ + projectIds?: number[]; +} + +export interface SearchRequestBean { + /** + * Use [expand](em>#expansion) to include additional information about issues in the response. Note that, unlike the majority of instances where `expand` is specified, `expand` is defined as a list of values. The expand options are: + * + * * `renderedFields` Returns field values rendered in HTML format. + * * `names` Returns the display name of each field. + * * `schema` Returns the schema describing a field type. + * * `transitions` Returns all possible transitions for the issue. + * * `operations` Returns all possible operations for the issue. + * * `editmeta` Returns information about how each field can be edited. + * * `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * * `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each version of a field's value, with the highest numbered item representing the most recent version. + */ + expand?: string[]; + /** + * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a comma-separated list. Expand options include: + * + * * `*all` Returns all fields. + * * `*navigable` Returns navigable fields. + * * Any issue field, prefixed with a minus to exclude. + * + * The default is `*navigable`. + * + * Examples: + * + * * `summary,comment` Returns the summary and comments fields only. + * * `-description` Returns all navigable (default) fields except description. + * * `*all,-comment` Returns all fields except comments. + * + * Multiple `fields` parameters can be included in a request. + * + * Note: All navigable fields are returned by default. This differs from [GET issue](#api-rest-api-3-issue-issueIdOrKey-get) where the default is all fields. + */ + fields?: string[]; + /** Reference fields by their key (rather than ID). The default is `false`. */ + fieldsByKeys?: boolean; + /** A [JQL](https://confluence.atlassian.com/x/egORLQ) expression. */ + jql?: string; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** A list of up to 5 issue properties to include in the results. This parameter accepts a comma-separated list. */ + properties?: string[]; + /** + * The index of the first item to return in the page of results (page offset). The base index is `0`. + * @format int32 + */ + startAt?: number; + /** + * Determines how to validate the JQL query and treat the validation results. Supported values: + * + * * `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). + * * `warn` Returns all errors as warnings. + * * `none` No validation is performed. + * * `true` *Deprecated* A legacy synonym for `strict`. + * * `false` *Deprecated* A legacy synonym for `warn`. + * + * The default is `strict`. + * + * Note: If the JQL is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. + */ + validateQuery?: "strict" | "warn" | "none" | "true" | "false"; +} + +/** The result of a JQL search. */ +export interface SearchResults { + /** Expand options that include additional search result details in the response. */ + expand?: string; + /** The list of issues found by the search. */ + issues?: IssueBean[]; + /** + * The maximum number of results that could be on the page. + * @format int32 + */ + maxResults?: number; + /** The ID and name of each field in the search results. */ + names?: Record; + /** The schema describing the field types in the search results. */ + schema?: Record; + /** + * The index of the first item returned on the page. + * @format int32 + */ + startAt?: number; + /** + * The number of results on the page. + * @format int32 + */ + total?: number; + /** Any warnings related to the JQL query. */ + warningMessages?: string[]; +} + +/** Details of an issue level security item. */ +export interface SecurityLevel { + /** The description of the issue level security item. */ + description?: string; + /** The ID of the issue level security item. */ + id?: string; + /** Whether the issue level security item is the default. */ + isDefault?: boolean; + /** The ID of the issue level security scheme. */ + issueSecuritySchemeId?: string; + /** The name of the issue level security item. */ + name?: string; + /** The URL of the issue level security item. */ + self?: string; +} + +/** Details about a security scheme. */ +export interface SecurityScheme { + /** + * The ID of the default security level. + * @format int64 + */ + defaultSecurityLevelId?: number; + /** The description of the issue security scheme. */ + description?: string; + /** + * The ID of the issue security scheme. + * @format int64 + */ + id?: number; + levels?: SecurityLevel[]; + /** The name of the issue security scheme. */ + name?: string; + /** The URL of the issue security scheme. */ + self?: string; +} + +/** List of security schemes. */ +export interface SecuritySchemes { + /** List of security schemes. */ + issueSecuritySchemes?: SecurityScheme[]; +} + +/** Details about the Jira instance. */ +export interface ServerInformation { + /** The base URL of the Jira instance. */ + baseUrl?: string; + /** + * The timestamp when the Jira version was built. + * @format date-time + */ + buildDate?: string; + /** + * The build number of the Jira version. + * @format int32 + */ + buildNumber?: number; + /** The type of server deployment. This is always returned as *Cloud*. */ + deploymentType?: string; + /** Jira instance health check results. Deprecated and no longer returned. */ + healthChecks?: HealthCheckResult[]; + /** The unique identifier of the Jira version. */ + scmInfo?: string; + /** + * The time in Jira when this request was responded to. + * @format date-time + */ + serverTime?: string; + /** The name of the Jira instance. */ + serverTitle?: string; + /** The version of Jira. */ + version?: string; + /** The major, minor, and revision version numbers of the Jira version. */ + versionNumbers?: number[]; +} + +export interface ServiceManagementNavigationInfo { + queueCategory?: string; + /** @format int64 */ + queueId?: number; + queueName?: string; +} + +/** The new default issue priority. */ +export interface SetDefaultPriorityRequest { + /** The ID of the new default issue priority. Must be an existing ID or null. Setting this to null erases the default priority setting. */ + id: string; +} + +/** The new default issue resolution. */ +export interface SetDefaultResolutionRequest { + /** The ID of the new default issue resolution. Must be an existing ID or null. Setting this to null erases the default resolution setting. */ + id: string; +} + +/** Details of a share permission for the filter. */ +export interface SharePermission { + /** The group that the filter is shared with. For a request, specify the `groupId` or `name` property for the group. As a group's name can change, use of `groupId` is recommended. */ + group?: GroupName; + /** + * The unique identifier of the share permission. + * @format int64 + */ + id?: number; + /** + * The project that the filter is shared with. This is similar to the project object returned by [Get project](#api-rest-api-3-project-projectIdOrKey-get) but it contains a subset of the properties, which are: `self`, `id`, `key`, `assigneeType`, `name`, `roles`, `avatarUrls`, `projectType`, `simplified`. + * For a request, specify the `id` for the project. + */ + project?: Project; + /** + * The project role that the filter is shared with. + * For a request, specify the `id` for the role. You must also specify the `project` object and `id` for the project that the role is in. + */ + role?: ProjectRole; + /** + * The type of share permission: + * + * * `user` Shared with a user. + * * `group` Shared with a group. If set in a request, then specify `sharePermission.group` as well. + * * `project` Shared with a project. If set in a request, then specify `sharePermission.project` as well. + * * `projectRole` Share with a project role in a project. This value is not returned in responses. It is used in requests, where it needs to be specify with `projectId` and `projectRoleId`. + * * `global` Shared globally. If set in a request, no other `sharePermission` properties need to be specified. + * * `loggedin` Shared with all logged-in users. Note: This value is set in a request by specifying `authenticated` as the `type`. + * * `project-unknown` Shared with a project that the user does not have access to. Cannot be set in a request. + */ + type: "user" | "group" | "project" | "projectRole" | "global" | "loggedin" | "authenticated" | "project-unknown"; + /** The user account ID that the filter is shared with. For a request, specify the `accountId` property for the user. */ + user?: UserBean; +} + +export interface SharePermissionInputBean { + /** The user account ID that the filter is shared with. For a request, specify the `accountId` property for the user. */ + accountId?: string; + /** The ID of the group, which uniquely identifies the group across all Atlassian products.For example, *952d12c3-5b5b-4d04-bb32-44d383afc4b2*. Cannot be provided with `groupname`. */ + groupId?: string; + /** The name of the group to share the filter with. Set `type` to `group`. Please note that the name of a group is mutable, to reliably identify a group use `groupId`. */ + groupname?: string; + /** The ID of the project to share the filter with. Set `type` to `project`. */ + projectId?: string; + /** The ID of the project role to share the filter with. Set `type` to `projectRole` and the `projectId` for the project that the role is in. */ + projectRoleId?: string; + /** + * The rights for the share permission. + * @format int32 + */ + rights?: number; + /** + * The type of the share permission.Specify the type as follows: + * + * * `user` Share with a user. + * * `group` Share with a group. Specify `groupname` as well. + * * `project` Share with a project. Specify `projectId` as well. + * * `projectRole` Share with a project role in a project. Specify `projectId` and `projectRoleId` as well. + * * `global` Share globally, including anonymous users. If set, this type overrides all existing share permissions and must be deleted before any non-global share permissions is set. + * * `authenticated` Share with all logged-in users. This shows as `loggedin` in the response. If set, this type overrides all existing share permissions and must be deleted before any non-global share permissions is set. + */ + type: "user" | "project" | "group" | "projectRole" | "global" | "authenticated"; +} + +export interface SimpleApplicationPropertyBean { + /** The ID of the application property. */ + id?: string; + /** The new value. */ + value?: string; +} + +export interface SimpleErrorCollection { + /** The list of error messages produced by this operation. For example, "input parameter 'key' must be provided" */ + errorMessages?: string[]; + /** The list of errors by parameter returned by the operation. For example,"projectKey": "Project keys must start with an uppercase letter, followed by one or more uppercase alphanumeric characters." */ + errors?: Record; + /** @format int32 */ + httpStatusCode?: number; +} + +/** Details about the operations available in this version. */ +export interface SimpleLink { + href?: string; + iconClass?: string; + id?: string; + label?: string; + styleClass?: string; + title?: string; + /** @format int32 */ + weight?: number; +} + +export interface SimpleListWrapperApplicationRole { + callback?: ListWrapperCallbackApplicationRole; + items?: ApplicationRole[]; + /** @format int32 */ + "max-results"?: number; + pagingCallback?: ListWrapperCallbackApplicationRole; + /** @format int32 */ + size?: number; +} + +export interface SimpleListWrapperGroupName { + callback?: ListWrapperCallbackGroupName; + items?: GroupName[]; + /** @format int32 */ + "max-results"?: number; + pagingCallback?: ListWrapperCallbackGroupName; + /** @format int32 */ + size?: number; +} + +export interface SimplifiedHierarchyLevel { + /** + * The ID of the level above this one in the hierarchy. This property is deprecated, see [Change notice: Removing hierarchy level IDs from next-gen APIs](https://developer.atlassian.com/cloud/jira/platform/change-notice-removing-hierarchy-level-ids-from-next-gen-apis/). + * @format int64 + */ + aboveLevelId?: number; + /** + * The ID of the level below this one in the hierarchy. This property is deprecated, see [Change notice: Removing hierarchy level IDs from next-gen APIs](https://developer.atlassian.com/cloud/jira/platform/change-notice-removing-hierarchy-level-ids-from-next-gen-apis/). + * @format int64 + */ + belowLevelId?: number; + /** + * The external UUID of the hierarchy level. This property is deprecated, see [Change notice: Removing hierarchy level IDs from next-gen APIs](https://developer.atlassian.com/cloud/jira/platform/change-notice-removing-hierarchy-level-ids-from-next-gen-apis/). + * @format uuid + */ + externalUuid?: string; + /** @format int32 */ + hierarchyLevelNumber?: number; + /** + * The ID of the hierarchy level. This property is deprecated, see [Change notice: Removing hierarchy level IDs from next-gen APIs](https://developer.atlassian.com/cloud/jira/platform/change-notice-removing-hierarchy-level-ids-from-next-gen-apis/). + * @format int64 + */ + id?: number; + /** The issue types available in this hierarchy level. */ + issueTypeIds?: number[]; + /** + * The level of this item in the hierarchy. + * @format int32 + */ + level?: number; + /** The name of this hierarchy level. */ + name?: string; + /** + * The ID of the project configuration. This property is deprecated, see [Change oticen: Removing hierarchy level IDs from next-gen APIs](https://developer.atlassian.com/cloud/jira/platform/change-notice-removing-hierarchy-level-ids-from-next-gen-apis/). + * @format int64 + */ + projectConfigurationId?: number; +} + +export interface SoftwareNavigationInfo { + /** @format int64 */ + boardId?: number; + boardName?: string; + simpleBoard?: boolean; + /** @format int64 */ + totalBoardsInProject?: number; +} + +/** The status of the item. */ +export interface Status { + /** Details of the icon representing the status. If not provided, no status icon displays in Jira. */ + icon?: Icon; + /** Whether the item is resolved. If set to "true", the link to the issue is displayed in a strikethrough font, otherwise the link displays in normal font. */ + resolved?: boolean; + [key: string]: any; +} + +/** A status category. */ +export interface StatusCategory { + /** The name of the color used to represent the status category. */ + colorName?: string; + /** + * The ID of the status category. + * @format int64 + */ + id?: number; + /** The key of the status category. */ + key?: string; + /** The name of the status category. */ + name?: string; + /** The URL of the status category. */ + self?: string; + [key: string]: any; +} + +/** Details of the status being created. */ +export interface StatusCreate { + /** The description of the status. */ + description?: string; + /** + * The name of the status. + * @maxLength 255 + */ + name: string; + /** The category of the status. */ + statusCategory: "TODO" | "IN_PROGRESS" | "DONE"; +} + +/** Details of the statuses being created and their scope. */ +export interface StatusCreateRequest { + /** The scope of the status. */ + scope: StatusScope; + /** Details of the statuses being created. */ + statuses: StatusCreate[]; +} + +/** A status. */ +export interface StatusDetails { + /** The description of the status. */ + description?: string; + /** The URL of the icon used to represent the status. */ + iconUrl?: string; + /** The ID of the status. */ + id?: string; + /** The name of the status. */ + name?: string; + /** The URL of the status. */ + self?: string; + /** The category assigned to the status. */ + statusCategory?: StatusCategory; + [key: string]: any; +} + +/** Details about the mapping from a status to a new status for an issue type. */ +export interface StatusMapping { + /** The ID of the issue type. */ + issueTypeId: string; + /** The ID of the new status. */ + newStatusId: string; + /** The ID of the status. */ + statusId: string; +} + +/** The scope of the status. */ +export interface StatusScope { + /** Project ID details. */ + project?: ProjectId; + /** The scope of the status. `GLOBAL` for company-managed projects and `PROJECT` for team-managed projects. */ + type: "PROJECT" | "GLOBAL"; +} + +/** Details of the status being updated. */ +export interface StatusUpdate { + /** The description of the status. */ + description?: string; + /** The ID of the status. */ + id: string; + /** The name of the status. */ + name: string; + /** The category of the status. */ + statusCategory: "TODO" | "IN_PROGRESS" | "DONE"; +} + +/** The list of statuses that will be updated. */ +export interface StatusUpdateRequest { + /** The list of statuses that will be updated. */ + statuses?: StatusUpdate[]; +} + +export type StringList = object; + +/** An issue suggested for use in the issue picker auto-completion. */ +export interface SuggestedIssue { + /** + * The ID of the issue. + * @format int64 + */ + id?: number; + /** The URL of the issue type's avatar. */ + img?: string; + /** The key of the issue. */ + key?: string; + /** The key of the issue in HTML format. */ + keyHtml?: string; + /** The phrase containing the query string in HTML format, with the string highlighted with HTML bold tags. */ + summary?: string; + /** The phrase containing the query string, as plain text. */ + summaryText?: string; +} + +/** List of system avatars. */ +export interface SystemAvatars { + /** A list of avatar details. */ + system?: Avatar[]; +} + +/** Details about a task. */ +export interface TaskProgressBeanObject { + /** The description of the task. */ + description?: string; + /** + * The execution time of the task, in milliseconds. + * @format int64 + */ + elapsedRuntime: number; + /** + * A timestamp recording when the task was finished. + * @format int64 + */ + finished?: number; + /** The ID of the task. */ + id: string; + /** + * A timestamp recording when the task progress was last updated. + * @format int64 + */ + lastUpdate: number; + /** Information about the progress of the task. */ + message?: string; + /** + * The progress of the task, as a percentage complete. + * @format int64 + */ + progress: number; + /** The result of the task execution. */ + result?: any; + /** + * The URL of the task. + * @format uri + */ + self: string; + /** + * A timestamp recording when the task was started. + * @format int64 + */ + started?: number; + /** The status of the task. */ + status: "ENQUEUED" | "RUNNING" | "COMPLETE" | "FAILED" | "CANCEL_REQUESTED" | "CANCELLED" | "DEAD"; + /** + * A timestamp recording when the task was submitted. + * @format int64 + */ + submitted: number; + /** + * The ID of the user who submitted the task. + * @format int64 + */ + submittedBy: number; +} + +/** Details about a task. */ +export interface TaskProgressBeanRemoveOptionFromIssuesResult { + /** The description of the task. */ + description?: string; + /** + * The execution time of the task, in milliseconds. + * @format int64 + */ + elapsedRuntime: number; + /** + * A timestamp recording when the task was finished. + * @format int64 + */ + finished?: number; + /** The ID of the task. */ + id: string; + /** + * A timestamp recording when the task progress was last updated. + * @format int64 + */ + lastUpdate: number; + /** Information about the progress of the task. */ + message?: string; + /** + * The progress of the task, as a percentage complete. + * @format int64 + */ + progress: number; + /** The result of the task execution. */ + result?: RemoveOptionFromIssuesResult; + /** + * The URL of the task. + * @format uri + */ + self: string; + /** + * A timestamp recording when the task was started. + * @format int64 + */ + started?: number; + /** The status of the task. */ + status: "ENQUEUED" | "RUNNING" | "COMPLETE" | "FAILED" | "CANCEL_REQUESTED" | "CANCELLED" | "DEAD"; + /** + * A timestamp recording when the task was submitted. + * @format int64 + */ + submitted: number; + /** + * The ID of the user who submitted the task. + * @format int64 + */ + submittedBy: number; +} + +/** Details of the time tracking configuration. */ +export interface TimeTrackingConfiguration { + /** The default unit of time applied to logged time. */ + defaultUnit: "minute" | "hour" | "day" | "week"; + /** The format that will appear on an issue's *Time Spent* field. */ + timeFormat: "pretty" | "days" | "hours"; + /** + * The number of days in a working week. + * @format double + */ + workingDaysPerWeek: number; + /** + * The number of hours in a working day. + * @format double + */ + workingHoursPerDay: number; +} + +/** Time tracking details. */ +export interface TimeTrackingDetails { + /** The original estimate of time needed for this issue in readable format. */ + originalEstimate?: string; + /** + * The original estimate of time needed for this issue in seconds. + * @format int64 + */ + originalEstimateSeconds?: number; + /** The remaining estimate of time needed for this issue in readable format. */ + remainingEstimate?: string; + /** + * The remaining estimate of time needed for this issue in seconds. + * @format int64 + */ + remainingEstimateSeconds?: number; + /** Time worked on this issue in readable format. */ + timeSpent?: string; + /** + * Time worked on this issue in seconds. + * @format int64 + */ + timeSpentSeconds?: number; +} + +/** Details about the time tracking provider. */ +export interface TimeTrackingProvider { + /** The key for the time tracking provider. For example, *JIRA*. */ + key: string; + /** The name of the time tracking provider. For example, *JIRA provided time tracking*. */ + name?: string; + /** The URL of the configuration page for the time tracking provider app. For example, *''/example/config/url*. This property is only returned if the `adminPageKey` property is set in the module descriptor of the time tracking provider app. */ + url?: string; +} + +/** Details of a workflow transition. */ +export interface Transition { + /** The description of the transition. */ + description: string; + /** The statuses the transition can start from. */ + from: string[]; + /** The ID of the transition. */ + id: string; + /** The name of the transition. */ + name: string; + /** The properties of the transition. */ + properties?: Record; + /** A collection of transition rules. */ + rules?: WorkflowRules; + /** The details of a transition screen. */ + screen?: TransitionScreenDetails; + /** The status the transition goes to. */ + to: string; + /** The type of the transition. */ + type: "global" | "initial" | "directed"; +} + +/** The details of a transition screen. */ +export interface TransitionScreenDetails { + /** The ID of the screen. */ + id: string; + /** The name of the screen. */ + name?: string; +} + +/** List of issue transitions. */ +export interface Transitions { + /** Expand options that include additional transitions details in the response. */ + expand?: string; + /** List of issue transitions. */ + transitions?: IssueTransition[]; +} + +/** The details of a UI modification's context, which define where to activate the UI modification. */ +export interface UiModificationContextDetails { + /** The ID of the UI modification context. */ + id?: string; + /** Whether a context is available. For example, when a project is deleted the context becomes unavailable. */ + isAvailable?: boolean; + /** The issue type ID of the context. */ + issueTypeId: string; + /** The project ID of the context. */ + projectId: string; + /** The view type of the context. Only `GIC` (Global Issue Create) is supported. */ + viewType: string; +} + +/** The details of a UI modification. */ +export interface UiModificationDetails { + /** List of contexts of the UI modification. The maximum number of contexts is 1000. */ + contexts?: UiModificationContextDetails[]; + /** The data of the UI modification. The maximum size of the data is 50000 characters. */ + data?: string; + /** The description of the UI modification. The maximum length is 255 characters. */ + description?: string; + /** The ID of the UI modification. */ + id: string; + /** The name of the UI modification. The maximum length is 255 characters. */ + name: string; + /** The URL of the UI modification. */ + self: string; +} + +/** Identifiers for a UI modification. */ +export interface UiModificationIdentifiers { + /** The ID of the UI modification. */ + id: string; + /** The URL of the UI modification. */ + self: string; +} + +export interface UnrestrictedUserEmail { + /** The accountId of the user */ + accountId?: string; + /** The email of the user */ + email?: string; + [key: string]: any; +} + +/** Details of a custom field. */ +export interface UpdateCustomFieldDetails { + /** The description of the custom field. The maximum length is 40000 characters. */ + description?: string; + /** The name of the custom field. It doesn't have to be unique. The maximum length is 255 characters. */ + name?: string; + /** + * The searcher that defines the way the field is searched in Jira. It can be set to `null`, otherwise you must specify the valid searcher for the field type, as listed below (abbreviated values shown): + * + * * `cascadingselect`: `cascadingselectsearcher` + * * `datepicker`: `daterange` + * * `datetime`: `datetimerange` + * * `float`: `exactnumber` or `numberrange` + * * `grouppicker`: `grouppickersearcher` + * * `importid`: `exactnumber` or `numberrange` + * * `labels`: `labelsearcher` + * * `multicheckboxes`: `multiselectsearcher` + * * `multigrouppicker`: `multiselectsearcher` + * * `multiselect`: `multiselectsearcher` + * * `multiuserpicker`: `userpickergroupsearcher` + * * `multiversion`: `versionsearcher` + * * `project`: `projectsearcher` + * * `radiobuttons`: `multiselectsearcher` + * * `readonlyfield`: `textsearcher` + * * `select`: `multiselectsearcher` + * * `textarea`: `textsearcher` + * * `textfield`: `textsearcher` + * * `url`: `exacttextsearcher` + * * `userpicker`: `userpickergroupsearcher` + * * `version`: `versionsearcher` + */ + searcherKey?: + | "com.atlassian.jira.plugin.system.customfieldtypes:cascadingselectsearcher" + | "com.atlassian.jira.plugin.system.customfieldtypes:daterange" + | "com.atlassian.jira.plugin.system.customfieldtypes:datetimerange" + | "com.atlassian.jira.plugin.system.customfieldtypes:exactnumber" + | "com.atlassian.jira.plugin.system.customfieldtypes:exacttextsearcher" + | "com.atlassian.jira.plugin.system.customfieldtypes:grouppickersearcher" + | "com.atlassian.jira.plugin.system.customfieldtypes:labelsearcher" + | "com.atlassian.jira.plugin.system.customfieldtypes:multiselectsearcher" + | "com.atlassian.jira.plugin.system.customfieldtypes:numberrange" + | "com.atlassian.jira.plugin.system.customfieldtypes:projectsearcher" + | "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher" + | "com.atlassian.jira.plugin.system.customfieldtypes:userpickergroupsearcher" + | "com.atlassian.jira.plugin.system.customfieldtypes:versionsearcher"; +} + +/** The ID of a screen scheme. */ +export interface UpdateDefaultScreenScheme { + /** The ID of the screen scheme. */ + screenSchemeId: string; +} + +/** The details of the field configuration scheme. */ +export interface UpdateFieldConfigurationSchemeDetails { + /** + * The description of the field configuration scheme. + * @maxLength 1024 + */ + description?: string; + /** + * The name of the field configuration scheme. The name must be unique. + * @maxLength 255 + */ + name: string; +} + +/** Details of a notification scheme. */ +export interface UpdateNotificationSchemeDetails { + /** + * The description of the notification scheme. + * @maxLength 4000 + */ + description?: string; + /** + * The name of the notification scheme. Must be unique. + * @maxLength 255 + */ + name?: string; + [key: string]: any; +} + +/** Details of an issue priority. */ +export interface UpdatePriorityDetails { + /** + * The description of the priority. + * @maxLength 255 + */ + description?: string; + /** + * The URL of an icon for the priority. Accepted protocols are HTTP and HTTPS. Built in icons can also be used. + * @maxLength 255 + */ + iconUrl?: + | "/images/icons/priorities/blocker.png" + | "/images/icons/priorities/critical.png" + | "/images/icons/priorities/high.png" + | "/images/icons/priorities/highest.png" + | "/images/icons/priorities/low.png" + | "/images/icons/priorities/lowest.png" + | "/images/icons/priorities/major.png" + | "/images/icons/priorities/medium.png" + | "/images/icons/priorities/minor.png" + | "/images/icons/priorities/trivial.png"; + /** + * The name of the priority. Must be unique. + * @maxLength 60 + */ + name?: string; + /** The status color of the priority in 3-digit or 6-digit hexadecimal format. */ + statusColor?: string; + [key: string]: any; +} + +/** Details about the project. */ +export interface UpdateProjectDetails { + /** The default assignee when creating issues for this project. */ + assigneeType?: "PROJECT_LEAD" | "UNASSIGNED"; + /** + * An integer value for the project's avatar. + * @format int64 + */ + avatarId?: number; + /** + * The ID of the project's category. A complete list of category IDs is found using the [Get all project categories](#api-rest-api-3-projectCategory-get) operation. To remove the project category from the project, set the value to `-1.` + * @format int64 + */ + categoryId?: number; + /** A brief description of the project. */ + description?: string; + /** + * The ID of the issue security scheme for the project, which enables you to control who can and cannot view issues. Use the [Get issue security schemes](#api-rest-api-3-issuesecurityschemes-get) resource to get all issue security scheme IDs. + * @format int64 + */ + issueSecurityScheme?: number; + /** Project keys must be unique and start with an uppercase letter followed by one or more uppercase alphanumeric characters. The maximum length is 10 characters. */ + key?: string; + /** This parameter is deprecated because of privacy changes. Use `leadAccountId` instead. See the [migration guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. The user name of the project lead. Cannot be provided with `leadAccountId`. */ + lead?: string; + /** + * The account ID of the project lead. Cannot be provided with `lead`. + * @maxLength 128 + */ + leadAccountId?: string; + /** The name of the project. */ + name?: string; + /** + * The ID of the notification scheme for the project. Use the [Get notification schemes](#api-rest-api-3-notificationscheme-get) resource to get a list of notification scheme IDs. + * @format int64 + */ + notificationScheme?: number; + /** + * The ID of the permission scheme for the project. Use the [Get all permission schemes](#api-rest-api-3-permissionscheme-get) resource to see a list of all permission scheme IDs. + * @format int64 + */ + permissionScheme?: number; + /** A link to information about this project, such as project documentation */ + url?: string; +} + +/** Details of an issue resolution. */ +export interface UpdateResolutionDetails { + /** + * The description of the resolution. + * @maxLength 255 + */ + description?: string; + /** + * The name of the resolution. Must be unique. + * @maxLength 60 + */ + name: string; + [key: string]: any; +} + +/** Details of a screen. */ +export interface UpdateScreenDetails { + /** The description of the screen. The maximum length is 255 characters. */ + description?: string; + /** The name of the screen. The name must be unique. The maximum length is 255 characters. */ + name?: string; +} + +/** Details of a screen scheme. */ +export interface UpdateScreenSchemeDetails { + /** The description of the screen scheme. The maximum length is 255 characters. */ + description?: string; + /** The name of the screen scheme. The name must be unique. The maximum length is 255 characters. */ + name?: string; + /** The IDs of the screens for the screen types of the screen scheme. Only screens used in classic projects are accepted. */ + screens?: UpdateScreenTypes; +} + +/** The IDs of the screens for the screen types of the screen scheme. */ +export interface UpdateScreenTypes { + /** The ID of the create screen. To remove the screen association, pass a null. */ + create?: string; + /** The ID of the default screen. When specified, must include a screen ID as a default screen is required. */ + default?: string; + /** The ID of the edit screen. To remove the screen association, pass a null. */ + edit?: string; + /** The ID of the view screen. To remove the screen association, pass a null. */ + view?: string; +} + +/** The details of a UI modification. */ +export interface UpdateUiModificationDetails { + /** List of contexts of the UI modification. The maximum number of contexts is 1000. If provided, replaces all existing contexts. */ + contexts?: UiModificationContextDetails[]; + /** The data of the UI modification. The maximum size of the data is 50000 characters. */ + data?: string; + /** The description of the UI modification. The maximum length is 255 characters. */ + description?: string; + /** The name of the UI modification. The maximum length is 255 characters. */ + name?: string; +} + +export interface UpdateUserToGroupBean { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + * @maxLength 128 + */ + accountId?: string; + /** This property is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + name?: string; + [key: string]: any; +} + +/** A project category. */ +export interface UpdatedProjectCategory { + /** The name of the project category. */ + description?: string; + /** The ID of the project category. */ + id?: string; + /** The description of the project category. */ + name?: string; + /** The URL of the project category. */ + self?: string; +} + +/** + * A user with details as permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions: + * + * * User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, `displayName` provides an indication and other parameters have default values or are blank (for example, email is blank). + * * User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted users. In this case, `accountId` returns *unknown* and all other parameters have fallback values. + * * User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have fallback values. + */ +export interface User { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. Required in requests. + * @maxLength 128 + */ + accountId?: string; + /** + * The user account type. Can take the following values: + * + * * `atlassian` regular Atlassian user account + * * `app` system account used for Connect applications and OAuth to represent external systems + * * `customer` Jira Service Desk account representing an external service desk + */ + accountType?: "atlassian" | "app" | "customer" | "unknown"; + /** Whether the user is active. */ + active?: boolean; + /** The application roles the user is assigned to. */ + applicationRoles?: SimpleListWrapperApplicationRole; + /** The avatars of the user. */ + avatarUrls?: AvatarUrlsBean; + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName?: string; + /** The email address of the user. Depending on the user’s privacy setting, this may be returned as null. */ + emailAddress?: string; + /** Expand options that include additional user details in the response. */ + expand?: string; + /** The groups that the user belongs to. */ + groups?: SimpleListWrapperGroupName; + /** This property is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + key?: string; + /** The locale of the user. Depending on the user’s privacy setting, this may be returned as null. */ + locale?: string; + /** This property is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + name?: string; + /** + * The URL of the user. + * @format uri + */ + self?: string; + /** The time zone specified in the user's profile. Depending on the user’s privacy setting, this may be returned as null. */ + timeZone?: string; +} + +export interface UserBean { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + * @maxLength 128 + */ + accountId?: string; + /** Whether the user is active. */ + active?: boolean; + /** The avatars of the user. */ + avatarUrls?: UserBeanAvatarUrls; + /** The display name of the user. Depending on the user’s privacy setting, this may return an alternative value. */ + displayName?: string; + /** + * This property is deprecated in favor of `accountId` because of privacy changes. See the [migration guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + * The key of the user. + */ + key?: string; + /** + * This property is deprecated in favor of `accountId` because of privacy changes. See the [migration guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + * The username of the user. + */ + name?: string; + /** + * The URL of the user. + * @format uri + */ + self?: string; +} + +export interface UserBeanAvatarUrls { + /** + * The URL of the user's 16x16 pixel avatar. + * @format uri + */ + "16x16"?: string; + /** + * The URL of the user's 24x24 pixel avatar. + * @format uri + */ + "24x24"?: string; + /** + * The URL of the user's 32x32 pixel avatar. + * @format uri + */ + "32x32"?: string; + /** + * The URL of the user's 48x48 pixel avatar. + * @format uri + */ + "48x48"?: string; +} + +/** A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) specified as an Atlassian account ID. */ +export interface UserContextVariable { + /** The account ID of the user. */ + accountId: string; + /** Type of custom context variable. */ + type: string; +} + +/** + * User details permitted by the user's Atlassian Account privacy settings. However, be aware of these exceptions: + * + * * User record deleted from Atlassian: This occurs as the result of a right to be forgotten request. In this case, `displayName` provides an indication and other parameters have default values or are blank (for example, email is blank). + * * User record corrupted: This occurs as a results of events such as a server import and can only happen to deleted users. In this case, `accountId` returns *unknown* and all other parameters have fallback values. + * * User record unavailable: This usually occurs due to an internal service outage. In this case, all parameters have fallback values. + */ +export interface UserDetails { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + * @maxLength 128 + */ + accountId?: string; + /** The type of account represented by this user. This will be one of 'atlassian' (normal users), 'app' (application user) or 'customer' (Jira Service Desk customer user) */ + accountType?: string; + /** Whether the user is active. */ + active?: boolean; + /** The avatars of the user. */ + avatarUrls?: AvatarUrlsBean; + /** The display name of the user. Depending on the user’s privacy settings, this may return an alternative value. */ + displayName?: string; + /** The email address of the user. Depending on the user’s privacy settings, this may be returned as null. */ + emailAddress?: string; + /** This property is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + key?: string; + /** This property is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + name?: string; + /** The URL of the user. */ + self?: string; + /** The time zone specified in the user's profile. Depending on the user’s privacy settings, this may be returned as null. */ + timeZone?: string; +} + +/** Filter for a User Picker (single) custom field. */ +export interface UserFilter { + /** Whether the filter is enabled. */ + enabled: boolean; + /** + * User groups autocomplete suggestion users must belong to. If not provided, the default values are used. A maximum of 10 groups can be provided. + * @uniqueItems true + */ + groups?: string[]; + /** + * Roles that autocomplete suggestion users must belong to. If not provided, the default values are used. A maximum of 10 roles can be provided. + * @uniqueItems true + */ + roleIds?: number[]; +} + +/** List of user account IDs. */ +export interface UserKey { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. Returns *unknown* if the record is deleted and corrupted, for example, as the result of a server import. + * @maxLength 128 + */ + accountId?: string; + /** This property is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + key?: string; +} + +/** A paginated list of users sharing the filter. This includes users that are members of the groups or can browse the projects that the filter is shared with. */ +export interface UserList { + /** + * The index of the last item returned on the page. + * @format int32 + */ + "end-index"?: number; + /** The list of items. */ + items?: User[]; + /** + * The maximum number of results that could be on the page. + * @format int32 + */ + "max-results"?: number; + /** + * The number of items on the page. + * @format int32 + */ + size?: number; + /** + * The index of the first item returned on the page. + * @format int32 + */ + "start-index"?: number; +} + +export interface UserMigrationBean { + accountId?: string; + key?: string; + username?: string; +} + +/** Details of a permission and its availability to a user. */ +export interface UserPermission { + /** Indicate whether the permission key is deprecated. Note that deprecated keys cannot be used in the `permissions parameter of Get my permissions. Deprecated keys are not returned by Get all permissions.` */ + deprecatedKey?: boolean; + /** The description of the permission. */ + description?: string; + /** Whether the permission is available to the user in the queried context. */ + havePermission?: boolean; + /** The ID of the permission. Either `id` or `key` must be specified. Use [Get all permissions](#api-rest-api-3-permissions-get) to get the list of permissions. */ + id?: string; + /** The key of the permission. Either `id` or `key` must be specified. Use [Get all permissions](#api-rest-api-3-permissions-get) to get the list of permissions. */ + key?: string; + /** The name of the permission. */ + name?: string; + /** The type of the permission. */ + type?: "GLOBAL" | "PROJECT"; + [key: string]: any; +} + +/** A user found in a search. */ +export interface UserPickerUser { + /** The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. */ + accountId?: string; + /** + * The avatar URL of the user. + * @format uri + */ + avatarUrl?: string; + /** The display name of the user. Depending on the user’s privacy setting, this may be returned as null. */ + displayName?: string; + /** The display name, email address, and key of the user with the matched query string highlighted with the HTML bold tag. */ + html?: string; + /** This property is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + key?: string; + /** This property is no longer available . See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + name?: string; +} + +/** An operand that is a user-provided value. */ +export interface ValueOperand { + /** Encoded value, which can be used directly in a JQL query. */ + encodedValue?: string; + /** The operand value. */ + value: string; +} + +/** Details about a project version. */ +export interface Version { + /** Indicates that the version is archived. Optional when creating or updating a version. */ + archived?: boolean; + /** The description of the version. Optional when creating or updating a version. */ + description?: string; + /** + * Use [expand](em>#expansion) to include additional information about version in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `operations` Returns the list of operations available for this version. + * * `issuesstatus` Returns the count of issues in this version for each of the status categories *to do*, *in progress*, *done*, and *unmapped*. The *unmapped* property contains a count of issues with a status other than *to do*, *in progress*, and *done*. + * + * Optional for create and update. + */ + expand?: string; + /** The ID of the version. */ + id?: string; + /** If the expand option `issuesstatus` is used, returns the count of issues in this version for each of the status categories *to do*, *in progress*, *done*, and *unmapped*. The *unmapped* property contains a count of issues with a status other than *to do*, *in progress*, and *done*. */ + issuesStatusForFixVersion?: VersionIssuesStatus; + /** + * The URL of the self link to the version to which all unfixed issues are moved when a version is released. Not applicable when creating a version. Optional when updating a version. + * @format uri + */ + moveUnfixedIssuesTo?: string; + /** The unique name of the version. Required when creating a version. Optional when updating a version. The maximum length is 255 characters. */ + name?: string; + /** If the expand option `operations` is used, returns the list of operations available for this version. */ + operations?: SimpleLink[]; + /** Indicates that the version is overdue. */ + overdue?: boolean; + /** Deprecated. Use `projectId`. */ + project?: string; + /** + * The ID of the project to which this version is attached. Required when creating a version. Not applicable when updating a version. + * @format int64 + */ + projectId?: number; + /** + * The release date of the version. Expressed in ISO 8601 format (yyyy-mm-dd). Optional when creating or updating a version. + * @format date + */ + releaseDate?: string; + /** Indicates that the version is released. If the version is released a request to release again is ignored. Not applicable when creating a version. Optional when updating a version. */ + released?: boolean; + /** + * The URL of the version. + * @format uri + */ + self?: string; + /** + * The start date of the version. Expressed in ISO 8601 format (yyyy-mm-dd). Optional when creating or updating a version. + * @format date + */ + startDate?: string; + /** The date on which work on this version is expected to finish, expressed in the instance's *Day/Month/Year Format* date format. */ + userReleaseDate?: string; + /** The date on which work on this version is expected to start, expressed in the instance's *Day/Month/Year Format* date format. */ + userStartDate?: string; +} + +/** Various counts of issues within a version. */ +export interface VersionIssueCounts { + /** List of custom fields using the version. */ + customFieldUsage?: VersionUsageInCustomField[]; + /** + * Count of issues where a version custom field is set to the version. + * @format int64 + */ + issueCountWithCustomFieldsShowingVersion?: number; + /** + * Count of issues where the `affectedVersion` is set to the version. + * @format int64 + */ + issuesAffectedCount?: number; + /** + * Count of issues where the `fixVersion` is set to the version. + * @format int64 + */ + issuesFixedCount?: number; + /** + * The URL of these count details. + * @format uri + */ + self?: string; +} + +/** Counts of the number of issues in various statuses. */ +export interface VersionIssuesStatus { + /** + * Count of issues with status *done*. + * @format int64 + */ + done?: number; + /** + * Count of issues with status *in progress*. + * @format int64 + */ + inProgress?: number; + /** + * Count of issues with status *to do*. + * @format int64 + */ + toDo?: number; + /** + * Count of issues with a status other than *to do*, *in progress*, and *done*. + * @format int64 + */ + unmapped?: number; + [key: string]: any; +} + +export interface VersionMoveBean { + /** + * The URL (self link) of the version after which to place the moved version. Cannot be used with `position`. + * @format uri + */ + after?: string; + /** An absolute position in which to place the moved version. Cannot be used with `after`. */ + position?: "Earlier" | "Later" | "First" | "Last"; +} + +/** Count of a version's unresolved issues. */ +export interface VersionUnresolvedIssuesCount { + /** + * Count of issues. + * @format int64 + */ + issuesCount?: number; + /** + * Count of unresolved issues. + * @format int64 + */ + issuesUnresolvedCount?: number; + /** + * The URL of these count details. + * @format uri + */ + self?: string; +} + +/** List of custom fields using the version. */ +export interface VersionUsageInCustomField { + /** + * The ID of the custom field. + * @format int64 + */ + customFieldId?: number; + /** The name of the custom field. */ + fieldName?: string; + /** + * Count of the issues where the custom field contains the version. + * @format int64 + */ + issueCountWithVersionInCustomField?: number; +} + +/** The group or role to which this item is visible. */ +export interface Visibility { + /** The ID of the group or the name of the role that visibility of this item is restricted to. */ + identifier?: string | null; + /** Whether visibility of this item is restricted to a group or role. */ + type?: "group" | "role"; + /** The name of the group or role that visibility of this item is restricted to. Please note that the name of a group is mutable, to reliably identify a group use `identifier`. */ + value?: string; + [key: string]: any; +} + +/** The details of votes on an issue. */ +export interface Votes { + /** Whether the user making this request has voted on the issue. */ + hasVoted?: boolean; + /** + * The URL of these issue vote details. + * @format uri + */ + self?: string; + /** List of the users who have voted on this issue. An empty list is returned when the calling user doesn't have the *View voters and watchers* project permission. */ + voters?: User[]; + /** + * The number of votes on the issue. + * @format int64 + */ + votes?: number; +} + +export interface WarningCollection { + warnings?: string[]; +} + +/** The details of watchers on an issue. */ +export interface Watchers { + /** Whether the calling user is watching this issue. */ + isWatching?: boolean; + /** The URL of these issue watcher details. */ + self?: string; + /** + * The number of users watching this issue. + * @format int32 + */ + watchCount?: number; + /** Details of the users watching this issue. */ + watchers?: UserDetails[]; +} + +/** A webhook. */ +export interface Webhook { + /** The Jira events that trigger the webhook. */ + events: ( + | "jira:issue_created" + | "jira:issue_updated" + | "jira:issue_deleted" + | "comment_created" + | "comment_updated" + | "comment_deleted" + | "issue_property_set" + | "issue_property_deleted" + )[]; + /** + * The date after which the webhook is no longer sent. Use [Extend webhook life](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-webhooks/#api-rest-api-3-webhook-refresh-put) to extend the date. + * @format int64 + */ + expirationDate?: number; + /** A list of field IDs. When the issue changelog contains any of the fields, the webhook `jira:issue_updated` is sent. If this parameter is not present, the app is notified about all field updates. */ + fieldIdsFilter?: string[]; + /** + * The ID of the webhook. + * @format int64 + */ + id: number; + /** A list of issue property keys. A change of those issue properties triggers the `issue_property_set` or `issue_property_deleted` webhooks. If this parameter is not present, the app is notified about all issue property updates. */ + issuePropertyKeysFilter?: string[]; + /** The JQL filter that specifies which issues the webhook is sent for. */ + jqlFilter: string; +} + +/** A list of webhooks. */ +export interface WebhookDetails { + /** The Jira events that trigger the webhook. */ + events: ( + | "jira:issue_created" + | "jira:issue_updated" + | "jira:issue_deleted" + | "comment_created" + | "comment_updated" + | "comment_deleted" + | "issue_property_set" + | "issue_property_deleted" + )[]; + /** A list of field IDs. When the issue changelog contains any of the fields, the webhook `jira:issue_updated` is sent. If this parameter is not present, the app is notified about all field updates. */ + fieldIdsFilter?: string[]; + /** A list of issue property keys. A change of those issue properties triggers the `issue_property_set` or `issue_property_deleted` webhooks. If this parameter is not present, the app is notified about all issue property updates. */ + issuePropertyKeysFilter?: string[]; + /** + * The JQL filter that specifies which issues the webhook is sent for. Only a subset of JQL can be used. The supported elements are: + * + * * Fields: `issueKey`, `project`, `issuetype`, `status`, `assignee`, `reporter`, `issue.property`, and `cf[id]`. For custom fields (`cf[id]`), only the epic label custom field is supported.". + * * Operators: `=`, `!=`, `IN`, and `NOT IN`. + */ + jqlFilter: string; +} + +/** Details of webhooks to register. */ +export interface WebhookRegistrationDetails { + /** The URL that specifies where to send the webhooks. This URL must use the same base URL as the Connect app. Only a single URL per app is allowed to be registered. */ + url: string; + /** A list of webhooks. */ + webhooks: WebhookDetails[]; +} + +/** The date the refreshed webhooks expire. */ +export interface WebhooksExpirationDate { + /** + * The expiration date of all the refreshed webhooks. + * @format int64 + */ + expirationDate: number; +} + +export interface WorkManagementNavigationInfo { + boardName?: string; +} + +/** Details about a workflow. */ +export interface Workflow { + /** + * The creation date of the workflow. + * @format date-time + */ + created?: string; + /** The description of the workflow. */ + description: string; + /** Whether the workflow has a draft version. */ + hasDraftWorkflow?: boolean; + /** Properties that identify a published workflow. */ + id: PublishedWorkflowId; + /** Whether this is the default workflow. */ + isDefault?: boolean; + /** Operations allowed on a workflow */ + operations?: WorkflowOperations; + /** The projects the workflow is assigned to, through workflow schemes. */ + projects?: ProjectDetails[]; + /** The workflow schemes the workflow is assigned to. */ + schemes?: WorkflowSchemeIdName[]; + /** The statuses of the workflow. */ + statuses?: WorkflowStatus[]; + /** The transitions of the workflow. */ + transitions?: Transition[]; + /** + * The last edited date of the workflow. + * @format date-time + */ + updated?: string; +} + +/** A compound workflow transition rule condition. This object returns `nodeType` as `compound`. */ +export interface WorkflowCompoundCondition { + /** The list of workflow conditions. */ + conditions: WorkflowCondition[]; + nodeType: string; + /** The compound condition operator. */ + operator: "AND" | "OR"; +} + +/** The workflow transition rule conditions tree. */ +export type WorkflowCondition = BaseWorkflowCondition & + ( + | BaseWorkflowConditionNodeTypeMapping<"compound", WorkflowCompoundCondition> + | BaseWorkflowConditionNodeTypeMapping<"simple", WorkflowSimpleCondition> + ); + +/** The classic workflow identifiers. */ +export interface WorkflowIDs { + /** The entity ID of the workflow. */ + entityId?: string; + /** The name of the workflow. */ + name: string; +} + +/** Properties that identify a workflow. */ +export interface WorkflowId { + /** Whether the workflow is in the draft state. */ + draft: boolean; + /** The name of the workflow. */ + name: string; +} + +/** Operations allowed on a workflow */ +export interface WorkflowOperations { + /** Whether the workflow can be deleted. */ + canDelete: boolean; + /** Whether the workflow can be updated. */ + canEdit: boolean; +} + +/** A collection of transition rules. */ +export interface WorkflowRules { + /** The workflow transition rule conditions tree. */ + conditionsTree?: WorkflowCondition; + /** The workflow post functions. */ + postFunctions?: WorkflowTransitionRule[]; + /** The workflow validators. */ + validators?: WorkflowTransitionRule[]; +} + +/** Details of the workflow and its transition rules. */ +export interface WorkflowRulesSearch { + /** + * Use expand to include additional information in the response. This parameter accepts `transition` which, for each rule, returns information about the transition the rule is assigned to. + * @example "transition" + */ + expand?: string; + /** + * The list of workflow rule IDs. + * @maxItems 10 + * @minItems 1 + */ + ruleIds: string[]; + /** + * The workflow ID. + * @format uuid + * @example "a498d711-685d-428d-8c3e-bc03bb450ea7" + */ + workflowEntityId: string; +} + +/** Details of workflow transition rules. */ +export interface WorkflowRulesSearchDetails { + /** List of workflow rule IDs that do not belong to the workflow or can not be found. */ + invalidRules?: string[]; + /** List of valid workflow transition rules. */ + validRules?: WorkflowTransitionRules[]; + /** + * The workflow ID. + * @format uuid + * @example "a498d711-685d-428d-8c3e-bc03bb450ea7" + */ + workflowEntityId?: string; +} + +/** Details about a workflow scheme. */ +export interface WorkflowScheme { + /** The name of the default workflow for the workflow scheme. The default workflow has *All Unassigned Issue Types* assigned to it in Jira. If `defaultWorkflow` is not specified when creating a workflow scheme, it is set to *Jira Workflow (jira)*. */ + defaultWorkflow?: string; + /** The description of the workflow scheme. */ + description?: string; + /** Whether the workflow scheme is a draft or not. */ + draft?: boolean; + /** + * The ID of the workflow scheme. + * @format int64 + */ + id?: number; + /** The issue type to workflow mappings, where each mapping is an issue type ID and workflow name pair. Note that an issue type can only be mapped to one workflow in a workflow scheme. */ + issueTypeMappings?: Record; + /** The issue types available in Jira. */ + issueTypes?: Record; + /** The date-time that the draft workflow scheme was last modified. A modification is a change to the issue type-project mappings only. This property does not apply to non-draft workflows. */ + lastModified?: string; + /** The user that last modified the draft workflow scheme. A modification is a change to the issue type-project mappings only. This property does not apply to non-draft workflows. */ + lastModifiedUser?: User; + /** The name of the workflow scheme. The name must be unique. The maximum length is 255 characters. Required when creating a workflow scheme. */ + name?: string; + /** For draft workflow schemes, this property is the name of the default workflow for the original workflow scheme. The default workflow has *All Unassigned Issue Types* assigned to it in Jira. */ + originalDefaultWorkflow?: string; + /** For draft workflow schemes, this property is the issue type to workflow mappings for the original workflow scheme, where each mapping is an issue type ID and workflow name pair. Note that an issue type can only be mapped to one workflow in a workflow scheme. */ + originalIssueTypeMappings?: Record; + /** @format uri */ + self?: string; + /** + * Whether to create or update a draft workflow scheme when updating an active workflow scheme. An active workflow scheme is a workflow scheme that is used by at least one project. The following examples show how this property works: + * + * * Update an active workflow scheme with `updateDraftIfNeeded` set to `true`: If a draft workflow scheme exists, it is updated. Otherwise, a draft workflow scheme is created. + * * Update an active workflow scheme with `updateDraftIfNeeded` set to `false`: An error is returned, as active workflow schemes cannot be updated. + * * Update an inactive workflow scheme with `updateDraftIfNeeded` set to `true`: The workflow scheme is updated, as inactive workflow schemes do not require drafts to update. + * + * Defaults to `false`. + */ + updateDraftIfNeeded?: boolean; +} + +/** A workflow scheme along with a list of projects that use it. */ +export interface WorkflowSchemeAssociations { + /** The list of projects that use the workflow scheme. */ + projectIds: string[]; + /** The workflow scheme. */ + workflowScheme: WorkflowScheme; +} + +/** The ID and the name of the workflow scheme. */ +export interface WorkflowSchemeIdName { + /** The ID of the workflow scheme. */ + id: string; + /** The name of the workflow scheme. */ + name: string; +} + +/** An associated workflow scheme and project. */ +export interface WorkflowSchemeProjectAssociation { + /** The ID of the project. */ + projectId: string; + /** The ID of the workflow scheme. If the workflow scheme ID is `null`, the operation assigns the default workflow scheme. */ + workflowSchemeId?: string; +} + +/** A workflow transition rule condition. This object returns `nodeType` as `simple`. */ +export interface WorkflowSimpleCondition { + /** EXPERIMENTAL. The configuration of the transition rule. */ + configuration?: object; + nodeType: string; + /** The type of the transition rule. */ + type: string; +} + +/** Details of a workflow status. */ +export interface WorkflowStatus { + /** The ID of the issue status. */ + id: string; + /** The name of the status in the workflow. */ + name: string; + /** Additional properties that modify the behavior of issues in this status. Supports the properties `jira.issue.editable` and `issueEditable` (deprecated) that indicate whether issues are editable. */ + properties?: Record; +} + +/** A workflow transition. */ +export interface WorkflowTransition { + /** + * The transition ID. + * @format int32 + */ + id: number; + /** The transition name. */ + name: string; +} + +/** Details about the server Jira is running on. */ +export interface WorkflowTransitionProperty { + /** The ID of the transition property. */ + id?: string; + /** The key of the transition property. Also known as the name of the transition property. */ + key?: string; + /** The value of the transition property. */ + value: string; + [key: string]: any; +} + +/** A workflow transition rule. */ +export interface WorkflowTransitionRule { + /** EXPERIMENTAL. The configuration of the transition rule. */ + configuration?: any; + /** The type of the transition rule. */ + type: string; +} + +/** A workflow with transition rules. */ +export interface WorkflowTransitionRules { + /** The list of conditions within the workflow. */ + conditions?: ConnectWorkflowTransitionRule[]; + /** The list of post functions within the workflow. */ + postFunctions?: ConnectWorkflowTransitionRule[]; + /** The list of validators within the workflow. */ + validators?: ConnectWorkflowTransitionRule[]; + /** Properties that identify a workflow. */ + workflowId: WorkflowId; +} + +/** Details about a workflow configuration update request. */ +export interface WorkflowTransitionRulesDetails { + /** Properties that identify a workflow. */ + workflowId: WorkflowId; + /** + * The list of connect workflow rule IDs. + * @uniqueItems true + */ + workflowRuleIds: string[]; +} + +/** Details about a workflow configuration update request. */ +export interface WorkflowTransitionRulesUpdate { + /** The list of workflows with transition rules to update. */ + workflows: WorkflowTransitionRules[]; +} + +/** Details of any errors encountered while updating workflow transition rules for a workflow. */ +export interface WorkflowTransitionRulesUpdateErrorDetails { + /** A list of transition rule update errors, indexed by the transition rule ID. Any transition rule that appears here wasn't updated. */ + ruleUpdateErrors: Record; + /** + * The list of errors that specify why the workflow update failed. The workflow was not updated if the list contains any entries. + * @uniqueItems true + */ + updateErrors: string[]; + /** Properties that identify a workflow. */ + workflowId: WorkflowId; +} + +/** Details of any errors encountered while updating workflow transition rules. */ +export interface WorkflowTransitionRulesUpdateErrors { + /** A list of workflows. */ + updateResults: WorkflowTransitionRulesUpdateErrorDetails[]; +} + +/** Details of workflows and their transition rules to delete. */ +export interface WorkflowsWithTransitionRulesDetails { + /** The list of workflows with transition rules to delete. */ + workflows: WorkflowTransitionRulesDetails[]; +} + +/** Details of a worklog. */ +export interface Worklog { + /** Details of the user who created the worklog. */ + author?: UserDetails; + /** A comment about the worklog in [Atlassian Document Format](https://developer.atlassian.com/cloud/jira/platform/apis/document/structure/). Optional when creating or updating a worklog. */ + comment?: any; + /** + * The datetime on which the worklog was created. + * @format date-time + */ + created?: string; + /** The ID of the worklog record. */ + id?: string; + /** The ID of the issue this worklog is for. */ + issueId?: string; + /** Details of properties for the worklog. Optional when creating or updating a worklog. */ + properties?: EntityProperty[]; + /** + * The URL of the worklog item. + * @format uri + */ + self?: string; + /** + * The datetime on which the worklog effort was started. Required when creating a worklog. Optional when updating a worklog. + * @format date-time + */ + started?: string; + /** The time spent working on the issue as days (\#d), hours (\#h), or minutes (\#m or \#). Required when creating a worklog if `timeSpentSeconds` isn't provided. Optional when updating a worklog. Cannot be provided if `timeSpentSecond` is provided. */ + timeSpent?: string; + /** + * The time in seconds spent working on the issue. Required when creating a worklog if `timeSpent` isn't provided. Optional when updating a worklog. Cannot be provided if `timeSpent` is provided. + * @format int64 + */ + timeSpentSeconds?: number; + /** Details of the user who last updated the worklog. */ + updateAuthor?: UserDetails; + /** + * The datetime on which the worklog was last updated. + * @format date-time + */ + updated?: string; + /** Details about any restrictions in the visibility of the worklog. Optional when creating or updating a worklog. */ + visibility?: Visibility; + [key: string]: any; +} + +export interface WorklogIdsRequestBean { + /** + * A list of worklog IDs. + * @uniqueItems true + */ + ids: number[]; +} + +interface BaseCustomContextVariable { + /** Type of custom context variable. */ + type: string; +} + +type BaseCustomContextVariableTypeMapping = { + type: Key; +} & Type; + +type BaseCustomFieldContextDefaultValue = object; + +type BaseCustomFieldContextDefaultValueTypeMapping = { + type: Key; +} & Type; + +/** The workflow transition rule conditions tree. */ +type BaseWorkflowCondition = object; + +type BaseWorkflowConditionNodeTypeMapping = { + nodeType: Key; +} & Type; + +export type QueryParamsType = Record; +export type ResponseFormat = keyof Omit; + +export interface FullRequestParams extends Omit { + /** set parameter to `true` for call `securityWorker` for this request */ + secure?: boolean; + /** request path */ + path: string; + /** content type of request body */ + type?: ContentType; + /** query params */ + query?: QueryParamsType; + /** format of response (i.e. response.json() -> format: "json") */ + format?: ResponseFormat; + /** request body */ + body?: unknown; + /** base url */ + baseUrl?: string; + /** request cancellation token */ + cancelToken?: CancelToken; +} + +export type RequestParams = Omit; + +export interface ApiConfig { + baseUrl?: string; + baseApiParams?: Omit; + securityWorker?: (securityData: SecurityDataType | null) => Promise | RequestParams | void; + customFetch?: typeof fetch; +} + +export interface HttpResponse extends Response { + data: D; + error: E; +} + +type CancelToken = Symbol | string | number; + +export enum ContentType { + Json = "application/json", + FormData = "multipart/form-data", + UrlEncoded = "application/x-www-form-urlencoded", + Text = "text/plain", +} + +export class HttpClient { + public baseUrl: string = "https://your-domain.atlassian.net"; + private securityData: SecurityDataType | null = null; + private securityWorker?: ApiConfig["securityWorker"]; + private abortControllers = new Map(); + private customFetch = (...fetchParams: Parameters) => fetch(...fetchParams); + + private baseApiParams: RequestParams = { + credentials: "same-origin", + headers: {}, + redirect: "follow", + referrerPolicy: "no-referrer", + }; + + constructor(apiConfig: ApiConfig = {}) { + Object.assign(this, apiConfig); + } + + public setSecurityData = (data: SecurityDataType | null) => { + this.securityData = data; + }; + + protected encodeQueryParam(key: string, value: any) { + const encodedKey = encodeURIComponent(key); + return `${encodedKey}=${encodeURIComponent(typeof value === "number" ? value : `${value}`)}`; + } + + protected addQueryParam(query: QueryParamsType, key: string) { + return this.encodeQueryParam(key, query[key]); + } + + protected addArrayQueryParam(query: QueryParamsType, key: string) { + const value = query[key]; + return value.map((v: any) => this.encodeQueryParam(key, v)).join("&"); + } + + protected toQueryString(rawQuery?: QueryParamsType): string { + const query = rawQuery || {}; + const keys = Object.keys(query).filter((key) => "undefined" !== typeof query[key]); + return keys + .map((key) => (Array.isArray(query[key]) ? this.addArrayQueryParam(query, key) : this.addQueryParam(query, key))) + .join("&"); + } + + protected addQueryParams(rawQuery?: QueryParamsType): string { + const queryString = this.toQueryString(rawQuery); + return queryString ? `?${queryString}` : ""; + } + + private contentFormatters: Record any> = { + [ContentType.Json]: (input: any) => + input !== null && (typeof input === "object" || typeof input === "string") ? JSON.stringify(input) : input, + [ContentType.Text]: (input: any) => (input !== null && typeof input !== "string" ? JSON.stringify(input) : input), + [ContentType.FormData]: (input: any) => + Object.keys(input || {}).reduce((formData, key) => { + const property = input[key]; + formData.append( + key, + property instanceof Blob + ? property + : typeof property === "object" && property !== null + ? JSON.stringify(property) + : `${property}`, + ); + return formData; + }, new FormData()), + [ContentType.UrlEncoded]: (input: any) => this.toQueryString(input), + }; + + protected mergeRequestParams(params1: RequestParams, params2?: RequestParams): RequestParams { + return { + ...this.baseApiParams, + ...params1, + ...(params2 || {}), + headers: { + ...(this.baseApiParams.headers || {}), + ...(params1.headers || {}), + ...((params2 && params2.headers) || {}), + }, + }; + } + + protected createAbortSignal = (cancelToken: CancelToken): AbortSignal | undefined => { + if (this.abortControllers.has(cancelToken)) { + const abortController = this.abortControllers.get(cancelToken); + if (abortController) { + return abortController.signal; + } + return void 0; + } + + const abortController = new AbortController(); + this.abortControllers.set(cancelToken, abortController); + return abortController.signal; + }; + + public abortRequest = (cancelToken: CancelToken) => { + const abortController = this.abortControllers.get(cancelToken); + + if (abortController) { + abortController.abort(); + this.abortControllers.delete(cancelToken); + } + }; + + public request = async ({ + body, + secure, + path, + type, + query, + format, + baseUrl, + cancelToken, + ...params + }: FullRequestParams): Promise> => { + const secureParams = + ((typeof secure === "boolean" ? secure : this.baseApiParams.secure) && + this.securityWorker && + (await this.securityWorker(this.securityData))) || + {}; + const requestParams = this.mergeRequestParams(params, secureParams); + const queryString = query && this.toQueryString(query); + const payloadFormatter = this.contentFormatters[type || ContentType.Json]; + const responseFormat = format || requestParams.format; + + return this.customFetch(`${baseUrl || this.baseUrl || ""}${path}${queryString ? `?${queryString}` : ""}`, { + ...requestParams, + headers: { + ...(requestParams.headers || {}), + ...(type && type !== ContentType.FormData ? { "Content-Type": type } : {}), + }, + signal: (cancelToken ? this.createAbortSignal(cancelToken) : requestParams.signal) || null, + body: typeof body === "undefined" || body === null ? null : payloadFormatter(body), + }).then(async (response) => { + const r = response as HttpResponse; + r.data = null as unknown as T; + r.error = null as unknown as E; + + if (!response.ok && response.status < 500) { + throw new hasuraSdk.UnprocessableContent("error: ", { response }); + } + + const data = !responseFormat + ? r + : await response[responseFormat]() + .then((data) => { + if (r.ok) { + r.data = data; + } else { + r.error = data; + } + return r; + }) + .catch((e) => { + r.error = e; + return r; + }); + + if (cancelToken) { + this.abortControllers.delete(cancelToken); + } + + if (!response.ok) throw data; + return data; + }); + }; +} + +/** + * @title The Jira Cloud platform REST API + * @version 1001.0.0-SNAPSHOT + * @license Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html) + * @termsOfService http://atlassian.com/terms/ + * @baseUrl https://your-domain.atlassian.net + * @externalDocs http://www.atlassian.com + * @contact + * + * Jira Cloud platform REST API documentation + */ + +export class Api extends HttpClient { + rest = { + /** + * @description Returns the current announcement banner configuration. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Announcement banner + * @name GetBanner + * @summary Get announcement banner configuration + * @request GET:/rest/api/3/announcementBanner + * @secure + */ + getBanner: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/announcementBanner`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates the announcement banner configuration. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Announcement banner + * @name SetBanner + * @summary Update announcement banner configuration + * @request PUT:/rest/api/3/announcementBanner + * @secure + */ + setBanner: ({ data, params = {} }: { data: AnnouncementBannerConfigurationUpdate; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/announcementBanner`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Updates the value of one or more custom fields on one or more issues. Combinations of custom field and issue should be unique within the request. Custom fields can only be updated by the Forge app that created them. **[Permissions](#permissions) required:** Only the app that created the custom field can update its values with this operation. + * + * @tags Issue custom field values (apps) + * @name UpdateMultipleCustomFieldValues + * @summary Update custom fields + * @request POST:/rest/api/3/app/field/value + * @secure + */ + updateMultipleCustomFieldValues: ({ + data, + query, + params = {}, + }: { + data: MultipleCustomFieldValuesUpdateDetails; + query?: { + /** + * Whether to generate a changelog for this update. + * @default true + */ + generateChangelog?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/app/field/value`, + method: "POST", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of configurations for a custom field created by a [Forge app](https://developer.atlassian.com/platform/forge/). The result can be filtered by one of these criteria: * `id`. * `fieldContextId`. * `issueId`. * `projectKeyOrId` and `issueTypeId`. Otherwise, all configurations are returned. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required for the Forge app that created the custom field. + * + * @tags Issue custom field configuration (apps) + * @name GetCustomFieldConfiguration + * @summary Get custom field configurations + * @request GET:/rest/api/3/app/field/{fieldIdOrKey}/context/configuration + * @secure + */ + getCustomFieldConfiguration: ({ + fieldIdOrKey, + query, + params = {}, + }: { + fieldIdOrKey: string; + query?: { + /** + * The list of configuration IDs. To include multiple configurations, separate IDs with an ampersand: `id=10000&id=10001`. Can't be provided with `fieldContextId`, `issueId`, `projectKeyOrId`, or `issueTypeId`. + * @uniqueItems true + */ + id?: number[]; + /** + * The list of field context IDs. To include multiple field contexts, separate IDs with an ampersand: `fieldContextId=10000&fieldContextId=10001`. Can't be provided with `id`, `issueId`, `projectKeyOrId`, or `issueTypeId`. + * @uniqueItems true + */ + fieldContextId?: number[]; + /** + * The ID of the issue to filter results by. If the issue doesn't exist, an empty list is returned. Can't be provided with `projectKeyOrId`, or `issueTypeId`. + * @format int64 + */ + issueId?: number; + /** The ID or key of the project to filter results by. Must be provided with `issueTypeId`. Can't be provided with `issueId`. */ + projectKeyOrId?: string; + /** The ID of the issue type to filter results by. Must be provided with `projectKeyOrId`. Can't be provided with `issueId`. */ + issueTypeId?: string; + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 100 + */ + maxResults?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/app/field/${fieldIdOrKey}/context/configuration`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Update the configuration for contexts of a custom field created by a [Forge app](https://developer.atlassian.com/platform/forge/). **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required for the Forge app that created the custom field. + * + * @tags Issue custom field configuration (apps) + * @name UpdateCustomFieldConfiguration + * @summary Update custom field configurations + * @request PUT:/rest/api/3/app/field/{fieldIdOrKey}/context/configuration + * @secure + */ + updateCustomFieldConfiguration: ({ + fieldIdOrKey, + data, + params = {}, + }: { + fieldIdOrKey: string; + data: CustomFieldConfigurations; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/app/field/${fieldIdOrKey}/context/configuration`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Updates the value of a custom field on one or more issues. Custom fields can only be updated by the Forge app that created them. **[Permissions](#permissions) required:** Only the app that created the custom field can update its values with this operation. + * + * @tags Issue custom field values (apps) + * @name UpdateCustomFieldValue + * @summary Update custom field value + * @request PUT:/rest/api/3/app/field/{fieldIdOrKey}/value + * @secure + */ + updateCustomFieldValue: ({ + fieldIdOrKey, + data, + query, + params = {}, + }: { + fieldIdOrKey: string; + data: CustomFieldValueUpdateDetails; + query?: { + /** + * Whether to generate a changelog for this update. + * @default true + */ + generateChangelog?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/app/field/${fieldIdOrKey}/value`, + method: "PUT", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns all application properties or an application property. If you specify a value for the `key` parameter, then an application property is returned as an object (not in an array). Otherwise, an array of all editable application properties is returned. See [Set application property](#api-rest-api-3-application-properties-id-put) for descriptions of editable properties. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Jira settings + * @name GetApplicationProperty + * @summary Get application property + * @request GET:/rest/api/3/application-properties + * @secure + */ + getApplicationProperty: ({ + query, + params = {}, + }: { + query?: { + /** The key of the application property. */ + key?: string; + /** The permission level of all items being returned in the list. */ + permissionLevel?: string; + /** When a `key` isn't provided, this filters the list of results by the application property `key` using a regular expression. For example, using `jira.lf.*` will return all application properties with keys that start with *jira.lf.*. */ + keyFilter?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/application-properties`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the application properties that are accessible on the *Advanced Settings* page. To navigate to the *Advanced Settings* page in Jira, choose the Jira icon > **Jira settings** > **System**, **General Configuration** and then click **Advanced Settings** (in the upper right). **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Jira settings + * @name GetAdvancedSettings + * @summary Get advanced settings + * @request GET:/rest/api/3/application-properties/advanced-settings + * @secure + */ + getAdvancedSettings: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/application-properties/advanced-settings`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Changes the value of an application property. For example, you can change the value of the `jira.clone.prefix` from its default value of *CLONE -* to *Clone -* if you prefer sentence case capitalization. Editable properties are described below along with their default values. #### Advanced settings #### The advanced settings below are also accessible in [Jira](https://confluence.atlassian.com/x/vYXKM). | Key | Description | Default value | | -- | -- | -- | | `jira.clone.prefix` | The string of text prefixed to the title of a cloned issue. | `CLONE -` | | `jira.date.picker.java.format` | The date format for the Java (server-side) generated dates. This must be the same as the `jira.date.picker.javascript.format` format setting. | `d/MMM/yy` | | `jira.date.picker.javascript.format` | The date format for the JavaScript (client-side) generated dates. This must be the same as the `jira.date.picker.java.format` format setting. | `%e/%b/%y` | | `jira.date.time.picker.java.format` | The date format for the Java (server-side) generated date times. This must be the same as the `jira.date.time.picker.javascript.format` format setting. | `dd/MMM/yy h:mm a` | | `jira.date.time.picker.javascript.format` | The date format for the JavaScript (client-side) generated date times. This must be the same as the `jira.date.time.picker.java.format` format setting. | `%e/%b/%y %I:%M %p` | | `jira.issue.actions.order` | The default order of actions (such as *Comments* or *Change history*) displayed on the issue view. | `asc` | | `jira.table.cols.subtasks` | The columns to show while viewing subtask issues in a table. For example, a list of subtasks on an issue. | `issuetype, status, assignee, progress` | | `jira.view.issue.links.sort.order` | The sort order of the list of issue links on the issue view. | `type, status, priority` | | `jira.comment.collapsing.minimum.hidden` | The minimum number of comments required for comment collapsing to occur. A value of `0` disables comment collapsing. | `4` | | `jira.newsletter.tip.delay.days` | The number of days before a prompt to sign up to the Jira Insiders newsletter is shown. A value of `-1` disables this feature. | `7` | #### Look and feel #### The settings listed below adjust the [look and feel](https://confluence.atlassian.com/x/VwCLLg). | Key | Description | Default value | | -- | -- | -- | | `jira.lf.date.time` | The [ time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `h:mm a` | | `jira.lf.date.day` | The [ day format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `EEEE h:mm a` | | `jira.lf.date.complete` | The [ date and time format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy h:mm a` | | `jira.lf.date.dmy` | The [ date format](https://docs.oracle.com/javase/6/docs/api/index.html?java/text/SimpleDateFormat.html). | `dd/MMM/yy` | | `jira.date.time.picker.use.iso8061` | When enabled, sets Monday as the first day of the week in the date picker, as specified by the ISO8601 standard. | `false` | | `jira.lf.logo.url` | The URL of the logo image file. | `/images/icon-jira-logo.png` | | `jira.lf.logo.show.application.title` | Controls the visibility of the application title on the sidebar. | `false` | | `jira.lf.favicon.url` | The URL of the favicon. | `/favicon.ico` | | `jira.lf.favicon.hires.url` | The URL of the high-resolution favicon. | `/images/64jira.png` | | `jira.lf.navigation.bgcolour` | The background color of the sidebar. | `#0747A6` | | `jira.lf.navigation.highlightcolour` | The color of the text and logo of the sidebar. | `#DEEBFF` | | `jira.lf.hero.button.base.bg.colour` | The background color of the hero button. | `#3b7fc4` | | `jira.title` | The text for the application title. The application title can also be set in *General settings*. | `Jira` | | `jira.option.globalsharing` | Whether filters and dashboards can be shared with anyone signed into Jira. | `true` | | `xflow.product.suggestions.enabled` | Whether to expose product suggestions for other Atlassian products within Jira. | `true` | #### Other settings #### | Key | Description | Default value | | -- | -- | -- | | `jira.issuenav.criteria.autoupdate` | Whether instant updates to search criteria is active. | `true` | *Note: Be careful when changing [application properties and advanced settings](https://confluence.atlassian.com/x/vYXKM).* **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Jira settings + * @name SetApplicationProperty + * @summary Set application property + * @request PUT:/rest/api/3/application-properties/{id} + * @secure + */ + setApplicationProperty: ({ + id, + data, + params = {}, + }: { + id: string; + data: SimpleApplicationPropertyBean; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/application-properties/${id}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns all application roles. In Jira, application roles are managed using the [Application access configuration](https://confluence.atlassian.com/x/3YxjL) page. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Application roles + * @name GetAllApplicationRoles + * @summary Get all application roles + * @request GET:/rest/api/3/applicationrole + * @secure + */ + getAllApplicationRoles: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/applicationrole`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns an application role. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Application roles + * @name GetApplicationRole + * @summary Get application role + * @request GET:/rest/api/3/applicationrole/{key} + * @secure + */ + getApplicationRole: ({ key, params = {} }: { key: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/applicationrole/${key}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the contents of an attachment. A `Range` header can be set to define a range of bytes within the attachment to download. See the [HTTP Range header standard](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Range) for details. To return a thumbnail of the attachment, use [Get attachment thumbnail](#api-rest-api-3-attachment-thumbnail-id-get). This operation can be accessed anonymously. **[Permissions](#permissions) required:** For the issue containing the attachment: * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue attachments + * @name GetAttachmentContent + * @summary Get attachment content + * @request GET:/rest/api/3/attachment/content/{id} + * @secure + */ + getAttachmentContent: ({ + id, + query, + params = {}, + }: { + id: string; + query?: { + /** + * Whether a redirect is provided for the attachment download. Clients that do not automatically follow redirects can set this to `false` to avoid making multiple requests to download the attachment. + * @default true + */ + redirect?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/attachment/content/${id}`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the attachment settings, that is, whether attachments are enabled and the maximum attachment size allowed. Note that there are also [project permissions](https://confluence.atlassian.com/x/yodKLg) that restrict whether users can create and delete attachments. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. + * + * @tags Issue attachments + * @name GetAttachmentMeta + * @summary Get Jira attachment settings + * @request GET:/rest/api/3/attachment/meta + * @secure + */ + getAttachmentMeta: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/attachment/meta`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the thumbnail of an attachment. To return the attachment contents, use [Get attachment content](#api-rest-api-3-attachment-content-id-get). This operation can be accessed anonymously. **[Permissions](#permissions) required:** For the issue containing the attachment: * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue attachments + * @name GetAttachmentThumbnail + * @summary Get attachment thumbnail + * @request GET:/rest/api/3/attachment/thumbnail/{id} + * @secure + */ + getAttachmentThumbnail: ({ + id, + query, + params = {}, + }: { + id: string; + query?: { + /** + * Whether a redirect is provided for the attachment download. Clients that do not automatically follow redirects can set this to `false` to avoid making multiple requests to download the attachment. + * @default true + */ + redirect?: boolean; + /** + * Whether a default thumbnail is returned when the requested thumbnail is not found. + * @default true + */ + fallbackToDefault?: boolean; + /** + * The maximum width to scale the thumbnail to. + * @format int32 + */ + width?: number; + /** + * The maximum height to scale the thumbnail to. + * @format int32 + */ + height?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/attachment/thumbnail/${id}`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes an attachment from an issue. This operation can be accessed anonymously. **[Permissions](#permissions) required:** For the project holding the issue containing the attachment: * *Delete own attachments* [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment created by the calling user. * *Delete all attachments* [project permission](https://confluence.atlassian.com/x/yodKLg) to delete an attachment created by any user. + * + * @tags Issue attachments + * @name RemoveAttachment + * @summary Delete attachment + * @request DELETE:/rest/api/3/attachment/{id} + * @secure + */ + removeAttachment: ({ id, params = {} }: { id: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/attachment/${id}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Returns the metadata for an attachment. Note that the attachment itself is not returned. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue attachments + * @name GetAttachment + * @summary Get attachment metadata + * @request GET:/rest/api/3/attachment/{id} + * @secure + */ + getAttachment: ({ id, params = {} }: { id: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/attachment/${id}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the metadata for the contents of an attachment, if it is an archive, and metadata for the attachment itself. For example, if the attachment is a ZIP archive, then information about the files in the archive is returned and metadata for the ZIP archive. Currently, only the ZIP archive format is supported. Use this operation to retrieve data that is presented to the user, as this operation returns the metadata for the attachment itself, such as the attachment's ID and name. Otherwise, use [ Get contents metadata for an expanded attachment](#api-rest-api-3-attachment-id-expand-raw-get), which only returns the metadata for the attachment's contents. This operation can be accessed anonymously. **[Permissions](#permissions) required:** For the issue containing the attachment: * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue attachments + * @name ExpandAttachmentForHumans + * @summary Get all metadata for an expanded attachment + * @request GET:/rest/api/3/attachment/{id}/expand/human + * @secure + */ + expandAttachmentForHumans: ({ id, params = {} }: { id: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/attachment/${id}/expand/human`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the metadata for the contents of an attachment, if it is an archive. For example, if the attachment is a ZIP archive, then information about the files in the archive is returned. Currently, only the ZIP archive format is supported. Use this operation if you are processing the data without presenting it to the user, as this operation only returns the metadata for the contents of the attachment. Otherwise, to retrieve data to present to the user, use [ Get all metadata for an expanded attachment](#api-rest-api-3-attachment-id-expand-human-get) which also returns the metadata for the attachment itself, such as the attachment's ID and name. This operation can be accessed anonymously. **[Permissions](#permissions) required:** For the issue containing the attachment: * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue attachments + * @name ExpandAttachmentForMachines + * @summary Get contents metadata for an expanded attachment + * @request GET:/rest/api/3/attachment/{id}/expand/raw + * @secure + */ + expandAttachmentForMachines: ({ id, params = {} }: { id: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/attachment/${id}/expand/raw`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a list of audit records. The list can be filtered to include items: * where each item in `filter` has at least one match in any of these fields: * `summary` * `category` * `eventSource` * `objectItem.name` If the object is a user, account ID is available to filter. * `objectItem.parentName` * `objectItem.typeName` * `changedValues.changedFrom` * `changedValues.changedTo` * `remoteAddress` For example, if `filter` contains *man ed*, an audit record containing `summary": "User added to group"` and `"category": "group management"` is returned. * created on or after a date and time. * created or or before a date and time. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Audit records + * @name GetAuditRecords + * @summary Get audit records + * @request GET:/rest/api/3/auditing/record + * @secure + */ + getAuditRecords: ({ + query, + params = {}, + }: { + query?: { + /** + * The number of records to skip before returning the first result. + * @format int32 + * @default 0 + */ + offset?: number; + /** + * The maximum number of results to return. + * @format int32 + * @default 1000 + */ + limit?: number; + /** The strings to match with audit field content, space separated. */ + filter?: string; + /** + * The date and time on or after which returned audit records must have been created. If `to` is provided `from` must be before `to` or no audit records are returned. + * @format date-time + */ + from?: string; + /** + * The date and time on or before which returned audit results must have been created. If `from` is provided `to` must be after `from` or no audit records are returned. + * @format date-time + */ + to?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/auditing/record`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a list of system avatar details by owner type, where the owner types are issue type, project, or user. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. + * + * @tags Avatars + * @name GetAllSystemAvatars + * @summary Get system avatars by type + * @request GET:/rest/api/3/avatar/{type}/system + * @secure + */ + getAllSystemAvatars: ({ type, params = {} }: { type: "issuetype" | "project" | "user"; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/avatar/${type}/system`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of comments specified by a list of comment IDs. This operation can be accessed anonymously. **[Permissions](#permissions) required:** Comments are returned where the user: * has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the comment. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * + * @tags Issue comments + * @name GetCommentsByIds + * @summary Get comments by IDs + * @request POST:/rest/api/3/comment/list + * @secure + */ + getCommentsByIds: ({ + data, + query, + params = {}, + }: { + data: IssueCommentListRequestBean; + query?: { + /** + * Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `renderedBody` Returns the comment body rendered in HTML. + * * `properties` Returns the comment's properties. + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/comment/list`, + method: "POST", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns the keys of all the properties of a comment. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * + * @tags Issue comment properties + * @name GetCommentPropertyKeys + * @summary Get comment property keys + * @request GET:/rest/api/3/comment/{commentId}/properties + * @secure + */ + getCommentPropertyKeys: ({ commentId, params = {} }: { commentId: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/comment/${commentId}/properties`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes a comment property. **[Permissions](#permissions) required:** either of: * *Edit All Comments* [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from any comment. * *Edit Own Comments* [project permission](https://confluence.atlassian.com/x/yodKLg) to delete a property from a comment created by the user. Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or group. + * + * @tags Issue comment properties + * @name DeleteCommentProperty + * @summary Delete comment property + * @request DELETE:/rest/api/3/comment/{commentId}/properties/{propertyKey} + * @secure + */ + deleteCommentProperty: ({ + commentId, + propertyKey, + params = {}, + }: { + commentId: string; + propertyKey: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/comment/${commentId}/properties/${propertyKey}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Returns the value of a comment property. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * + * @tags Issue comment properties + * @name GetCommentProperty + * @summary Get comment property + * @request GET:/rest/api/3/comment/{commentId}/properties/{propertyKey} + * @secure + */ + getCommentProperty: ({ + commentId, + propertyKey, + params = {}, + }: { + commentId: string; + propertyKey: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/comment/${commentId}/properties/${propertyKey}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates or updates the value of a property for a comment. Use this resource to store custom data against a comment. The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The maximum length is 32768 characters. **[Permissions](#permissions) required:** either of: * *Edit All Comments* [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value of a property on any comment. * *Edit Own Comments* [project permission](https://confluence.atlassian.com/x/yodKLg) to create or update the value of a property on a comment created by the user. Also, when the visibility of a comment is restricted to a role or group the user must be a member of that role or group. + * + * @tags Issue comment properties + * @name SetCommentProperty + * @summary Set comment property + * @request PUT:/rest/api/3/comment/{commentId}/properties/{propertyKey} + * @secure + */ + setCommentProperty: ({ + commentId, + propertyKey, + data, + params = {}, + }: { + commentId: string; + propertyKey: string; + data: any; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/comment/${commentId}/properties/${propertyKey}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Creates a component. Use components to provide containers for issues within a project. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the component is created or *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Project components + * @name CreateComponent + * @summary Create component + * @request POST:/rest/api/3/component + * @secure + */ + createComponent: ({ data, params = {} }: { data: ProjectComponent; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/component`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes a component. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the component or *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Project components + * @name DeleteComponent + * @summary Delete component + * @request DELETE:/rest/api/3/component/{id} + * @secure + */ + deleteComponent: ({ + id, + query, + params = {}, + }: { + id: string; + query?: { + /** The ID of the component to replace the deleted component. If this value is null no replacement is made. */ + moveIssuesTo?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/component/${id}`, + method: "DELETE", + query: query, + secure: true, + ...params, + }), + + /** + * @description Returns a component. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for project containing the component. + * + * @tags Project components + * @name GetComponent + * @summary Get component + * @request GET:/rest/api/3/component/{id} + * @secure + */ + getComponent: ({ id, params = {} }: { id: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/component/${id}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates a component. Any fields included in the request are overwritten. If `leadAccountId` is an empty string ("") the component lead is removed. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the component or *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Project components + * @name UpdateComponent + * @summary Update component + * @request PUT:/rest/api/3/component/{id} + * @secure + */ + updateComponent: ({ id, data, params = {} }: { id: string; data: ProjectComponent; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/component/${id}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns the counts of issues assigned to the component. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. + * + * @tags Project components + * @name GetComponentRelatedIssues + * @summary Get component issues count + * @request GET:/rest/api/3/component/{id}/relatedIssueCounts + * @secure + */ + getComponentRelatedIssues: ({ id, params = {} }: { id: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/component/${id}/relatedIssueCounts`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the [global settings](https://confluence.atlassian.com/x/qYXKM) in Jira. These settings determine whether optional features (for example, subtasks, time tracking, and others) are enabled. If time tracking is enabled, this operation also returns the time tracking configuration. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Jira settings + * @name GetConfiguration + * @summary Get global settings + * @request GET:/rest/api/3/configuration + * @secure + */ + getConfiguration: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/configuration`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the time tracking provider that is currently selected. Note that if time tracking is disabled, then a successful but empty response is returned. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Time tracking + * @name GetSelectedTimeTrackingImplementation + * @summary Get selected time tracking provider + * @request GET:/rest/api/3/configuration/timetracking + * @secure + */ + getSelectedTimeTrackingImplementation: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/configuration/timetracking`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Selects a time tracking provider. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Time tracking + * @name SelectTimeTrackingImplementation + * @summary Select time tracking provider + * @request PUT:/rest/api/3/configuration/timetracking + * @secure + */ + selectTimeTrackingImplementation: ({ data, params = {} }: { data: TimeTrackingProvider; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/configuration/timetracking`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns all time tracking providers. By default, Jira only has one time tracking provider: *JIRA provided time tracking*. However, you can install other time tracking providers via apps from the Atlassian Marketplace. For more information on time tracking providers, see the documentation for the [ Time Tracking Provider](https://developer.atlassian.com/cloud/jira/platform/modules/time-tracking-provider/) module. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Time tracking + * @name GetAvailableTimeTrackingImplementations + * @summary Get all time tracking providers + * @request GET:/rest/api/3/configuration/timetracking/list + * @secure + */ + getAvailableTimeTrackingImplementations: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/configuration/timetracking/list`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the time tracking settings. This includes settings such as the time format, default time unit, and others. For more information, see [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Time tracking + * @name GetSharedTimeTrackingConfiguration + * @summary Get time tracking settings + * @request GET:/rest/api/3/configuration/timetracking/options + * @secure + */ + getSharedTimeTrackingConfiguration: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/configuration/timetracking/options`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Sets the time tracking settings. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Time tracking + * @name SetSharedTimeTrackingConfiguration + * @summary Set time tracking settings + * @request PUT:/rest/api/3/configuration/timetracking/options + * @secure + */ + setSharedTimeTrackingConfiguration: ({ + data, + params = {}, + }: { + data: TimeTrackingConfiguration; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/configuration/timetracking/options`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a custom field option. For example, an option in a select list. Note that this operation **only works for issue field select list options created in Jira or using operations from the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue field select list options created by Connect apps. This operation can be accessed anonymously. **[Permissions](#permissions) required:** The custom field option is returned as follows: * if the user has the *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * if the user has the *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one project the custom field is used in, and the field is visible in at least one layout the user has permission to view. + * + * @tags Issue custom field options + * @name GetCustomFieldOption + * @summary Get custom field option + * @request GET:/rest/api/3/customFieldOption/{id} + * @secure + */ + getCustomFieldOption: ({ id, params = {} }: { id: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/customFieldOption/${id}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a list of dashboards owned by or shared with the user. The list may be filtered to include only favorite or owned dashboards. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. + * + * @tags Dashboards + * @name GetAllDashboards + * @summary Get all dashboards + * @request GET:/rest/api/3/dashboard + * @secure + */ + getAllDashboards: ({ + query, + params = {}, + }: { + query?: { + /** + * The filter applied to the list of dashboards. Valid values are: + * + * * `favourite` Returns dashboards the user has marked as favorite. + * * `my` Returns dashboards owned by the user. + */ + filter?: "my" | "favourite"; + /** + * The index of the first item to return in a page of results (page offset). + * @format int32 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 20 + */ + maxResults?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/dashboard`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates a dashboard. **[Permissions](#permissions) required:** None. + * + * @tags Dashboards + * @name CreateDashboard + * @summary Create dashboard + * @request POST:/rest/api/3/dashboard + * @secure + */ + createDashboard: ({ data, params = {} }: { data: DashboardDetails; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/dashboard`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Gets a list of all available gadgets that can be added to all dashboards. **[Permissions](#permissions) required:** None. + * + * @tags Dashboards + * @name GetAllAvailableDashboardGadgets + * @summary Get available gadgets + * @request GET:/rest/api/3/dashboard/gadgets + * @secure + */ + getAllAvailableDashboardGadgets: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/dashboard/gadgets`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of dashboards. This operation is similar to [Get dashboards](#api-rest-api-3-dashboard-get) except that the results can be refined to include dashboards that have specific attributes. For example, dashboards with a particular name. When multiple attributes are specified only filters matching all attributes are returned. This operation can be accessed anonymously. **[Permissions](#permissions) required:** The following dashboards that match the query parameters are returned: * Dashboards owned by the user. Not returned for anonymous users. * Dashboards shared with a group that the user is a member of. Not returned for anonymous users. * Dashboards shared with a private project that the user can browse. Not returned for anonymous users. * Dashboards shared with a public project. * Dashboards shared with the public. + * + * @tags Dashboards + * @name GetDashboardsPaginated + * @summary Search for dashboards + * @request GET:/rest/api/3/dashboard/search + * @secure + */ + getDashboardsPaginated: ({ + query, + params = {}, + }: { + query?: { + /** String used to perform a case-insensitive partial match with `name`. */ + dashboardName?: string; + /** + * User account ID used to return dashboards with the matching `owner.accountId`. This parameter cannot be used with the `owner` parameter. + * @maxLength 128 + */ + accountId?: string; + /** This parameter is deprecated because of privacy changes. Use `accountId` instead. See the [migration guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. User name used to return dashboards with the matching `owner.name`. This parameter cannot be used with the `accountId` parameter. */ + owner?: string; + /** As a group's name can change, use of `groupId` is recommended. Group name used to return dashboards that are shared with a group that matches `sharePermissions.group.name`. This parameter cannot be used with the `groupId` parameter. */ + groupname?: string; + /** Group ID used to return dashboards that are shared with a group that matches `sharePermissions.group.groupId`. This parameter cannot be used with the `groupname` parameter. */ + groupId?: string; + /** + * Project ID used to returns dashboards that are shared with a project that matches `sharePermissions.project.id`. + * @format int64 + */ + projectId?: number; + /** + * [Order](#ordering) the results by a field: + * + * * `description` Sorts by dashboard description. Note that this sort works independently of whether the expand to display the description field is in use. + * * `favourite_count` Sorts by dashboard popularity. + * * `id` Sorts by dashboard ID. + * * `is_favourite` Sorts by whether the dashboard is marked as a favorite. + * * `name` Sorts by dashboard name. + * * `owner` Sorts by dashboard owner name. + * @default "name" + */ + orderBy?: + | "description" + | "-description" + | "+description" + | "favorite_count" + | "-favorite_count" + | "+favorite_count" + | "id" + | "-id" + | "+id" + | "is_favorite" + | "-is_favorite" + | "+is_favorite" + | "name" + | "-name" + | "+name" + | "owner" + | "-owner" + | "+owner"; + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * The status to filter by. It may be active, archived or deleted. + * @default "active" + */ + status?: "active" | "archived" | "deleted"; + /** + * Use [expand](#expansion) to include additional information about dashboard in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `description` Returns the description of the dashboard. + * * `owner` Returns the owner of the dashboard. + * * `viewUrl` Returns the URL that is used to view the dashboard. + * * `favourite` Returns `isFavourite`, an indicator of whether the user has set the dashboard as a favorite. + * * `favouritedCount` Returns `popularity`, a count of how many users have set this dashboard as a favorite. + * * `sharePermissions` Returns details of the share permissions defined for the dashboard. + * * `editPermissions` Returns details of the edit permissions defined for the dashboard. + * * `isWritable` Returns whether the current user has permission to edit the dashboard. + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/dashboard/search`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a list of dashboard gadgets on a dashboard. This operation returns: * Gadgets from a list of IDs, when `id` is set. * Gadgets with a module key, when `moduleKey` is set. * Gadgets from a list of URIs, when `uri` is set. * All gadgets, when no other parameters are set. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. + * + * @tags Dashboards + * @name GetAllGadgets + * @summary Get gadgets + * @request GET:/rest/api/3/dashboard/{dashboardId}/gadget + * @secure + */ + getAllGadgets: ({ + dashboardId, + query, + params = {}, + }: { + dashboardId: number; + query?: { + /** The list of gadgets module keys. To include multiple module keys, separate module keys with ampersand: `moduleKey=key:one&moduleKey=key:two`. */ + moduleKey?: string[]; + /** The list of gadgets URIs. To include multiple URIs, separate URIs with ampersand: `uri=/rest/example/uri/1&uri=/rest/example/uri/2`. */ + uri?: string[]; + /** The list of gadgets IDs. To include multiple IDs, separate IDs with ampersand: `gadgetId=10000&gadgetId=10001`. */ + gadgetId?: number[]; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/dashboard/${dashboardId}/gadget`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Adds a gadget to a dashboard. **[Permissions](#permissions) required:** None. + * + * @tags Dashboards + * @name AddGadget + * @summary Add gadget to dashboard + * @request POST:/rest/api/3/dashboard/{dashboardId}/gadget + * @secure + */ + addGadget: ({ + dashboardId, + data, + params = {}, + }: { + dashboardId: number; + data: DashboardGadgetSettings; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/dashboard/${dashboardId}/gadget`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Removes a dashboard gadget from a dashboard. When a gadget is removed from a dashboard, other gadgets in the same column are moved up to fill the emptied position. **[Permissions](#permissions) required:** None. + * + * @tags Dashboards + * @name RemoveGadget + * @summary Remove gadget from dashboard + * @request DELETE:/rest/api/3/dashboard/{dashboardId}/gadget/{gadgetId} + * @secure + */ + removeGadget: ({ + dashboardId, + gadgetId, + params = {}, + }: { + dashboardId: number; + gadgetId: number; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/dashboard/${dashboardId}/gadget/${gadgetId}`, + method: "DELETE", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Changes the title, position, and color of the gadget on a dashboard. **[Permissions](#permissions) required:** None. + * + * @tags Dashboards + * @name UpdateGadget + * @summary Update gadget on dashboard + * @request PUT:/rest/api/3/dashboard/{dashboardId}/gadget/{gadgetId} + * @secure + */ + updateGadget: ({ + dashboardId, + gadgetId, + data, + params = {}, + }: { + dashboardId: number; + gadgetId: number; + data: DashboardGadgetUpdateRequest; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/dashboard/${dashboardId}/gadget/${gadgetId}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns the keys of all properties for a dashboard item. This operation can be accessed anonymously. **[Permissions](#permissions) required:** The user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when Jira’s anonymous access is permitted. + * + * @tags Dashboards + * @name GetDashboardItemPropertyKeys + * @summary Get dashboard item property keys + * @request GET:/rest/api/3/dashboard/{dashboardId}/items/{itemId}/properties + * @secure + */ + getDashboardItemPropertyKeys: ({ + dashboardId, + itemId, + params = {}, + }: { + dashboardId: string; + itemId: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/dashboard/${dashboardId}/items/${itemId}/properties`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes a dashboard item property. This operation can be accessed anonymously. **[Permissions](#permissions) required:** The user must be the owner of the dashboard. Note, users with the *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + * + * @tags Dashboards + * @name DeleteDashboardItemProperty + * @summary Delete dashboard item property + * @request DELETE:/rest/api/3/dashboard/{dashboardId}/items/{itemId}/properties/{propertyKey} + * @secure + */ + deleteDashboardItemProperty: ({ + dashboardId, + itemId, + propertyKey, + params = {}, + }: { + dashboardId: string; + itemId: string; + propertyKey: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/dashboard/${dashboardId}/items/${itemId}/properties/${propertyKey}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Returns the key and value of a dashboard item property. A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this resource to store the item's content or configuration details. For more information on working with dashboard items, see [ Building a dashboard item for a JIRA Connect add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) documentation. There is no resource to set or get dashboard items. This operation can be accessed anonymously. **[Permissions](#permissions) required:** The user must be the owner of the dashboard or have the dashboard shared with them. Note, users with the *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. The System dashboard is considered to be shared with all other users, and is accessible to anonymous users when Jira’s anonymous access is permitted. + * + * @tags Dashboards + * @name GetDashboardItemProperty + * @summary Get dashboard item property + * @request GET:/rest/api/3/dashboard/{dashboardId}/items/{itemId}/properties/{propertyKey} + * @secure + */ + getDashboardItemProperty: ({ + dashboardId, + itemId, + propertyKey, + params = {}, + }: { + dashboardId: string; + itemId: string; + propertyKey: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/dashboard/${dashboardId}/items/${itemId}/properties/${propertyKey}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Sets the value of a dashboard item property. Use this resource in apps to store custom data against a dashboard item. A dashboard item enables an app to add user-specific information to a user dashboard. Dashboard items are exposed to users as gadgets that users can add to their dashboards. For more information on how users do this, see [Adding and customizing gadgets](https://confluence.atlassian.com/x/7AeiLQ). When an app creates a dashboard item it registers a callback to receive the dashboard item ID. The callback fires whenever the item is rendered or, where the item is configurable, the user edits the item. The app then uses this resource to store the item's content or configuration details. For more information on working with dashboard items, see [ Building a dashboard item for a JIRA Connect add-on](https://developer.atlassian.com/server/jira/platform/guide-building-a-dashboard-item-for-a-jira-connect-add-on-33746254/) and the [Dashboard Item](https://developer.atlassian.com/cloud/jira/platform/modules/dashboard-item/) documentation. There is no resource to set or get dashboard items. The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The maximum length is 32768 characters. This operation can be accessed anonymously. **[Permissions](#permissions) required:** The user must be the owner of the dashboard. Note, users with the *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. + * + * @tags Dashboards + * @name SetDashboardItemProperty + * @summary Set dashboard item property + * @request PUT:/rest/api/3/dashboard/{dashboardId}/items/{itemId}/properties/{propertyKey} + * @secure + */ + setDashboardItemProperty: ({ + dashboardId, + itemId, + propertyKey, + data, + params = {}, + }: { + dashboardId: string; + itemId: string; + propertyKey: string; + data: any; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/dashboard/${dashboardId}/items/${itemId}/properties/${propertyKey}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes a dashboard. **[Permissions](#permissions) required:** None The dashboard to be deleted must be owned by the user. + * + * @tags Dashboards + * @name DeleteDashboard + * @summary Delete dashboard + * @request DELETE:/rest/api/3/dashboard/{id} + * @secure + */ + deleteDashboard: ({ id, params = {} }: { id: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/dashboard/${id}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Returns a dashboard. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. However, to get a dashboard, the dashboard must be shared with the user or the user must own it. Note, users with the *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) are considered owners of the System dashboard. The System dashboard is considered to be shared with all other users. + * + * @tags Dashboards + * @name GetDashboard + * @summary Get dashboard + * @request GET:/rest/api/3/dashboard/{id} + * @secure + */ + getDashboard: ({ id, params = {} }: { id: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/dashboard/${id}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates a dashboard, replacing all the dashboard details with those provided. **[Permissions](#permissions) required:** None The dashboard to be updated must be owned by the user. + * + * @tags Dashboards + * @name UpdateDashboard + * @summary Update dashboard + * @request PUT:/rest/api/3/dashboard/{id} + * @secure + */ + updateDashboard: ({ id, data, params = {} }: { id: string; data: DashboardDetails; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/dashboard/${id}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Copies a dashboard. Any values provided in the `dashboard` parameter replace those in the copied dashboard. **[Permissions](#permissions) required:** None The dashboard to be copied must be owned by or shared with the user. + * + * @tags Dashboards + * @name CopyDashboard + * @summary Copy dashboard + * @request POST:/rest/api/3/dashboard/{id}/copy + * @secure + */ + copyDashboard: ({ id, data, params = {} }: { id: string; data: DashboardDetails; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/dashboard/${id}/copy`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns all issue events. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issues + * @name GetEvents + * @summary Get events + * @request GET:/rest/api/3/events + * @secure + */ + getEvents: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/events`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Analyses and validates Jira expressions. As an experimental feature, this operation can also attempt to type-check the expressions. Learn more about Jira expressions in the [documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). **[Permissions](#permissions) required**: None. + * + * @tags Jira expressions + * @name AnalyseExpression + * @summary Analyse Jira expression + * @request POST:/rest/api/3/expression/analyse + * @secure + */ + analyseExpression: ({ + data, + query, + params = {}, + }: { + data: JiraExpressionForAnalysis; + query?: { + /** + * The check to perform: + * + * * `syntax` Each expression's syntax is checked to ensure the expression can be parsed. Also, syntactic limits are validated. For example, the expression's length. + * * `type` EXPERIMENTAL. Each expression is type checked and the final type of the expression inferred. Any type errors that would result in the expression failure at runtime are reported. For example, accessing properties that don't exist or passing the wrong number of arguments to functions. Also performs the syntax check. + * * `complexity` EXPERIMENTAL. Determines the formulae for how many [expensive operations](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#expensive-operations) each expression may execute. + * @default "syntax" + */ + check?: "syntax" | "type" | "complexity"; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/expression/analyse`, + method: "POST", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Evaluates a Jira expression and returns its value. This resource can be used to test Jira expressions that you plan to use elsewhere, or to fetch data in a flexible way. Consult the [Jira expressions documentation](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/) for more details. #### Context variables #### The following context variables are available to Jira expressions evaluated by this resource. Their presence depends on various factors; usually you need to manually request them in the context object sent in the payload, but some of them are added automatically under certain conditions. * `user` ([User](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user)): The current user. Always available and equal to `null` if the request is anonymous. * `app` ([App](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#app)): The [Connect app](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) that made the request. Available only for authenticated requests made by Connect Apps (read more here: [Authentication for Connect apps](https://developer.atlassian.com/cloud/jira/platform/security-for-connect-apps/)). * `issue` ([Issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): The current issue. Available only when the issue is provided in the request context object. * `issues` ([List](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#list) of [Issues](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue)): A collection of issues matching a JQL query. Available only when JQL is provided in the request context object. * `project` ([Project](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#project)): The current project. Available only when the project is provided in the request context object. * `sprint` ([Sprint](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#sprint)): The current sprint. Available only when the sprint is provided in the request context object. * `board` ([Board](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#board)): The current board. Available only when the board is provided in the request context object. * `serviceDesk` ([ServiceDesk](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#servicedesk)): The current service desk. Available only when the service desk is provided in the request context object. * `customerRequest` ([CustomerRequest](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#customerrequest)): The current customer request. Available only when the customer request is provided in the request context object. Also, custom context variables can be passed in the request with their types. Those variables can be accessed by key in the Jira expression. These variable types are available for use in a custom context: * `user`: A [user](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#user) specified as an Atlassian account ID. * `issue`: An [issue](https://developer.atlassian.com/cloud/jira/platform/jira-expressions-type-reference#issue) specified by ID or key. All the fields of the issue object are available in the Jira expression. * `json`: A JSON object containing custom content. * `list`: A JSON list of `user`, `issue`, or `json` variable types. This operation can be accessed anonymously. **[Permissions](#permissions) required**: None. However, an expression may return different results for different users depending on their permissions. For example, different users may see different comments on the same issue. Permission to access Jira Software is required to access Jira Software context variables (`board` and `sprint`) or fields (for example, `issue.sprint`). + * + * @tags Jira expressions + * @name EvaluateJiraExpression + * @summary Evaluate Jira expression + * @request POST:/rest/api/3/expression/eval + * @secure + */ + evaluateJiraExpression: ({ + data, + query, + params = {}, + }: { + data: JiraExpressionEvalRequestBean; + query?: { + /** Use [expand](#expansion) to include additional information in the response. This parameter accepts `meta.complexity` that returns information about the expression complexity. For example, the number of expensive operations used by the expression and how close the expression is to reaching the [complexity limit](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions). Useful when designing and debugging your expressions. */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/expression/eval`, + method: "POST", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns system and custom issue fields according to the following rules: * Fields that cannot be added to the issue navigator are always returned. * Fields that cannot be placed on an issue screen are always returned. * Fields that depend on global Jira settings are only returned if the setting is enabled. That is, timetracking fields, subtasks, votes, and watches. * For all other fields, this operation only returns the fields that the user has permission to view (that is, the field is used in at least one project that the user has *Browse Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for.) This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. + * + * @tags Issue fields + * @name GetFields + * @summary Get fields + * @request GET:/rest/api/3/field + * @secure + */ + getFields: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/field`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates a custom field. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue fields + * @name CreateCustomField + * @summary Create custom field + * @request POST:/rest/api/3/field + * @secure + */ + createCustomField: ({ data, params = {} }: { data: CustomFieldDefinitionJsonBean; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/field`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of fields for Classic Jira projects. The list can include: * all fields * specific fields, by defining `id` * fields that contain a string in the field name or description, by defining `query` * specific fields that contain a string in the field name or description, by defining `id` and `query` Only custom fields can be queried, `type` must be set to `custom`. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue fields + * @name GetFieldsPaginated + * @summary Get fields paginated + * @request GET:/rest/api/3/field/search + * @secure + */ + getFieldsPaginated: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** The type of fields to search. */ + type?: ("custom" | "system")[]; + /** + * The IDs of the custom fields to return or, where `query` is specified, filter. + * @uniqueItems true + */ + id?: string[]; + /** String used to perform a case-insensitive partial match with field names or descriptions. */ + query?: string; + /** + * [Order](#ordering) the results by a field: + * + * * `contextsCount` sorts by the number of contexts related to a field + * * `lastUsed` sorts by the date when the value of the field last changed + * * `name` sorts by the field name + * * `screensCount` sorts by the number of screens related to a field + */ + orderBy?: + | "contextsCount" + | "-contextsCount" + | "+contextsCount" + | "lastUsed" + | "-lastUsed" + | "+lastUsed" + | "name" + | "-name" + | "+name" + | "screensCount" + | "-screensCount" + | "+screensCount" + | "projectsCount" + | "-projectsCount" + | "+projectsCount"; + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `key` returns the key for each field + * * `lastUsed` returns the date when the value of the field last changed + * * `screensCount` returns the number of screens related to a field + * * `contextsCount` returns the number of contexts related to a field + * * `isLocked` returns information about whether the field is [locked](https://confluence.atlassian.com/x/ZSN7Og) + * * `searcherKey` returns the searcher key for each custom field + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/search`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of fields in the trash. The list may be restricted to fields whose field name or description partially match a string. Only custom fields can be queried, `type` must be set to `custom`. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue fields + * @name GetTrashedFieldsPaginated + * @summary Get fields in trash paginated + * @request GET:/rest/api/3/field/search/trashed + * @secure + */ + getTrashedFieldsPaginated: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** @uniqueItems true */ + id?: string[]; + /** String used to perform a case-insensitive partial match with field names or descriptions. */ + query?: string; + expand?: + | "name" + | "-name" + | "+name" + | "trashDate" + | "-trashDate" + | "+trashDate" + | "plannedDeletionDate" + | "-plannedDeletionDate" + | "+plannedDeletionDate" + | "projectsCount" + | "-projectsCount" + | "+projectsCount"; + /** + * [Order](#ordering) the results by a field: + * + * * `name` sorts by the field name + * * `trashDate` sorts by the date the field was moved to the trash + * * `plannedDeletionDate` sorts by the planned deletion date + */ + orderBy?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/search/trashed`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates a custom field. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue fields + * @name UpdateCustomField + * @summary Update custom field + * @request PUT:/rest/api/3/field/{fieldId} + * @secure + */ + updateCustomField: ({ + fieldId, + data, + params = {}, + }: { + fieldId: string; + data: UpdateCustomFieldDetails; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldId}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of [ contexts](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html) for a custom field. Contexts can be returned as follows: * With no other parameters set, all contexts. * By defining `id` only, all contexts from the list of IDs. * By defining `isAnyIssueType`, limit the list of contexts returned to either those that apply to all issue types (true) or those that apply to only a subset of issue types (false) * By defining `isGlobalContext`, limit the list of contexts return to either those that apply to all projects (global contexts) (true) or those that apply to only a subset of projects (false). **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue custom field contexts + * @name GetContextsForField + * @summary Get custom field contexts + * @request GET:/rest/api/3/field/{fieldId}/context + * @secure + */ + getContextsForField: ({ + fieldId, + query, + params = {}, + }: { + fieldId: string; + query?: { + /** Whether to return contexts that apply to all issue types. */ + isAnyIssueType?: boolean; + /** Whether to return contexts that apply to all projects. */ + isGlobalContext?: boolean; + /** + * The list of context IDs. To include multiple contexts, separate IDs with ampersand: `contextId=10000&contextId=10001`. + * @uniqueItems true + */ + contextId?: number[]; + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldId}/context`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates a custom field context. If `projectIds` is empty, a global context is created. A global context is one that applies to all project. If `issueTypeIds` is empty, the context applies to all issue types. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue custom field contexts + * @name CreateCustomFieldContext + * @summary Create custom field context + * @request POST:/rest/api/3/field/{fieldId}/context + * @secure + */ + createCustomFieldContext: ({ + fieldId, + data, + params = {}, + }: { + fieldId: string; + data: CreateCustomFieldContext; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldId}/context`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of defaults for a custom field. The results can be filtered by `contextId`, otherwise all values are returned. If no defaults are set for a context, nothing is returned. The returned object depends on type of the custom field: * `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. * `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. * `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio buttons. * `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and checkboxes. * `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. * `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. * `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. * `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. * `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group pickers. * `CustomFieldContextDefaultValueURL` (type `url`) for URLs. * `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. * `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). * `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. * `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. * `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. * `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. * `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. * `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. Forge custom fields [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) are also supported, returning: * `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. * `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection fields. * `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. * `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. * `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. * `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection fields. * `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. * `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. * `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue custom field contexts + * @name GetDefaultValues + * @summary Get custom field contexts default values + * @request GET:/rest/api/3/field/{fieldId}/context/defaultValue + * @secure + */ + getDefaultValues: ({ + fieldId, + query, + params = {}, + }: { + fieldId: string; + query?: { + /** + * The IDs of the contexts. + * @uniqueItems true + */ + contextId?: number[]; + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldId}/context/defaultValue`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Sets default for contexts of a custom field. Default are defined using these objects: * `CustomFieldContextDefaultValueDate` (type `datepicker`) for date fields. * `CustomFieldContextDefaultValueDateTime` (type `datetimepicker`) for date-time fields. * `CustomFieldContextDefaultValueSingleOption` (type `option.single`) for single choice select lists and radio buttons. * `CustomFieldContextDefaultValueMultipleOption` (type `option.multiple`) for multiple choice select lists and checkboxes. * `CustomFieldContextDefaultValueCascadingOption` (type `option.cascading`) for cascading select lists. * `CustomFieldContextSingleUserPickerDefaults` (type `single.user.select`) for single users. * `CustomFieldContextDefaultValueMultiUserPicker` (type `multi.user.select`) for user lists. * `CustomFieldContextDefaultValueSingleGroupPicker` (type `grouppicker.single`) for single choice group pickers. * `CustomFieldContextDefaultValueMultipleGroupPicker` (type `grouppicker.multiple`) for multiple choice group pickers. * `CustomFieldContextDefaultValueURL` (type `url`) for URLs. * `CustomFieldContextDefaultValueProject` (type `project`) for project pickers. * `CustomFieldContextDefaultValueFloat` (type `float`) for floats (floating-point numbers). * `CustomFieldContextDefaultValueLabels` (type `labels`) for labels. * `CustomFieldContextDefaultValueTextField` (type `textfield`) for text fields. * `CustomFieldContextDefaultValueTextArea` (type `textarea`) for text area fields. * `CustomFieldContextDefaultValueReadOnly` (type `readonly`) for read only (text) fields. * `CustomFieldContextDefaultValueMultipleVersion` (type `version.multiple`) for single choice version pickers. * `CustomFieldContextDefaultValueSingleVersion` (type `version.single`) for multiple choice version pickers. Forge custom fields [types](https://developer.atlassian.com/platform/forge/manifest-reference/modules/jira-custom-field-type/#data-types) are also supported, returning: * `CustomFieldContextDefaultValueForgeStringFieldBean` (type `forge.string`) for Forge string fields. * `CustomFieldContextDefaultValueForgeMultiStringFieldBean` (type `forge.string.list`) for Forge string collection fields. * `CustomFieldContextDefaultValueForgeObjectFieldBean` (type `forge.object`) for Forge object fields. * `CustomFieldContextDefaultValueForgeDateTimeFieldBean` (type `forge.datetime`) for Forge date-time fields. * `CustomFieldContextDefaultValueForgeGroupFieldBean` (type `forge.group`) for Forge group fields. * `CustomFieldContextDefaultValueForgeMultiGroupFieldBean` (type `forge.group.list`) for Forge group collection fields. * `CustomFieldContextDefaultValueForgeNumberFieldBean` (type `forge.number`) for Forge number fields. * `CustomFieldContextDefaultValueForgeUserFieldBean` (type `forge.user`) for Forge user fields. * `CustomFieldContextDefaultValueForgeMultiUserFieldBean` (type `forge.user.list`) for Forge user collection fields. Only one type of default object can be included in a request. To remove a default for a context, set the default parameter to `null`. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue custom field contexts + * @name SetDefaultValues + * @summary Set custom field contexts default values + * @request PUT:/rest/api/3/field/{fieldId}/context/defaultValue + * @secure + */ + setDefaultValues: ({ + fieldId, + data, + params = {}, + }: { + fieldId: string; + data: CustomFieldContextDefaultValueUpdate; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldId}/context/defaultValue`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of context to issue type mappings for a custom field. Mappings are returned for all contexts or a list of contexts. Mappings are ordered first by context ID and then by issue type ID. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue custom field contexts + * @name GetIssueTypeMappingsForContexts + * @summary Get issue types for custom field context + * @request GET:/rest/api/3/field/{fieldId}/context/issuetypemapping + * @secure + */ + getIssueTypeMappingsForContexts: ({ + fieldId, + query, + params = {}, + }: { + fieldId: string; + query?: { + /** The ID of the context. To include multiple contexts, provide an ampersand-separated list. For example, `contextId=10001&contextId=10002`. */ + contextId?: number[]; + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldId}/context/issuetypemapping`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of project and issue type mappings and, for each mapping, the ID of a [custom field context](https://confluence.atlassian.com/x/k44fOw) that applies to the project and issue type. If there is no custom field context assigned to the project then, if present, the custom field context that applies to all projects is returned if it also applies to the issue type or all issue types. If a custom field context is not found, the returned custom field context ID is `null`. Duplicate project and issue type mappings cannot be provided in the request. The order of the returned values is the same as provided in the request. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue custom field contexts + * @name GetCustomFieldContextsForProjectsAndIssueTypes + * @summary Get custom field contexts for projects and issue types + * @request POST:/rest/api/3/field/{fieldId}/context/mapping + * @secure + */ + getCustomFieldContextsForProjectsAndIssueTypes: ({ + fieldId, + data, + query, + params = {}, + }: { + fieldId: string; + data: ProjectIssueTypeMappings; + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldId}/context/mapping`, + method: "POST", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of context to project mappings for a custom field. The result can be filtered by `contextId`. Otherwise, all mappings are returned. Invalid IDs are ignored. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue custom field contexts + * @name GetProjectContextMapping + * @summary Get project mappings for custom field context + * @request GET:/rest/api/3/field/{fieldId}/context/projectmapping + * @secure + */ + getProjectContextMapping: ({ + fieldId, + query, + params = {}, + }: { + fieldId: string; + query?: { + /** + * The list of context IDs. To include multiple context, separate IDs with ampersand: `contextId=10000&contextId=10001`. + * @uniqueItems true + */ + contextId?: number[]; + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldId}/context/projectmapping`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes a [ custom field context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue custom field contexts + * @name DeleteCustomFieldContext + * @summary Delete custom field context + * @request DELETE:/rest/api/3/field/{fieldId}/context/{contextId} + * @secure + */ + deleteCustomFieldContext: ({ + fieldId, + contextId, + params = {}, + }: { + fieldId: string; + contextId: number; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldId}/context/${contextId}`, + method: "DELETE", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates a [ custom field context](https://confluence.atlassian.com/adminjiracloud/what-are-custom-field-contexts-991923859.html). **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue custom field contexts + * @name UpdateCustomFieldContext + * @summary Update custom field context + * @request PUT:/rest/api/3/field/{fieldId}/context/{contextId} + * @secure + */ + updateCustomFieldContext: ({ + fieldId, + contextId, + data, + params = {}, + }: { + fieldId: string; + contextId: number; + data: CustomFieldContextUpdateDetails; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldId}/context/${contextId}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Adds issue types to a custom field context, appending the issue types to the issue types list. A custom field context without any issue types applies to all issue types. Adding issue types to such a custom field context would result in it applying to only the listed issue types. If any of the issue types exists in the custom field context, the operation fails and no issue types are added. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue custom field contexts + * @name AddIssueTypesToContext + * @summary Add issue types to context + * @request PUT:/rest/api/3/field/{fieldId}/context/{contextId}/issuetype + * @secure + */ + addIssueTypesToContext: ({ + fieldId, + contextId, + data, + params = {}, + }: { + fieldId: string; + contextId: number; + data: IssueTypeIds; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldId}/context/${contextId}/issuetype`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Removes issue types from a custom field context. A custom field context without any issue types applies to all issue types. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue custom field contexts + * @name RemoveIssueTypesFromContext + * @summary Remove issue types from context + * @request POST:/rest/api/3/field/{fieldId}/context/{contextId}/issuetype/remove + * @secure + */ + removeIssueTypesFromContext: ({ + fieldId, + contextId, + data, + params = {}, + }: { + fieldId: string; + contextId: number; + data: IssueTypeIds; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldId}/context/${contextId}/issuetype/remove`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of all custom field option for a context. Options are returned first then cascading options, in the order they display in Jira. This operation works for custom field options created in Jira or the operations from this resource. **To work with issue field select list options created for Connect apps use the [Issue custom field options (apps)](#api-group-issue-custom-field-options--apps-) operations.** **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue custom field options + * @name GetOptionsForContext + * @summary Get custom field options (context) + * @request GET:/rest/api/3/field/{fieldId}/context/{contextId}/option + * @secure + */ + getOptionsForContext: ({ + fieldId, + contextId, + query, + params = {}, + }: { + fieldId: string; + contextId: number; + query?: { + /** + * The ID of the option. + * @format int64 + */ + optionId?: number; + /** + * Whether only options are returned. + * @default false + */ + onlyOptions?: boolean; + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 100 + */ + maxResults?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldId}/context/${contextId}/option`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates options and, where the custom select field is of the type Select List (cascading), cascading options for a custom select field. The options are added to a context of the field. The maximum number of options that can be created per request is 1000 and each field can have a maximum of 10000 options. This operation works for custom field options created in Jira or the operations from this resource. **To work with issue field select list options created for Connect apps use the [Issue custom field options (apps)](#api-group-issue-custom-field-options--apps-) operations.** **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue custom field options + * @name CreateCustomFieldOption + * @summary Create custom field options (context) + * @request POST:/rest/api/3/field/{fieldId}/context/{contextId}/option + * @secure + */ + createCustomFieldOption: ({ + fieldId, + contextId, + data, + params = {}, + }: { + fieldId: string; + contextId: number; + data: BulkCustomFieldOptionCreateRequest; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldId}/context/${contextId}/option`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Updates the options of a custom field. If any of the options are not found, no options are updated. Options where the values in the request match the current values aren't updated and aren't reported in the response. Note that this operation **only works for issue field select list options created in Jira or using operations from the [Issue custom field options](#api-group-Issue-custom-field-options) resource**, it cannot be used with issue field select list options created by Connect apps. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue custom field options + * @name UpdateCustomFieldOption + * @summary Update custom field options (context) + * @request PUT:/rest/api/3/field/{fieldId}/context/{contextId}/option + * @secure + */ + updateCustomFieldOption: ({ + fieldId, + contextId, + data, + params = {}, + }: { + fieldId: string; + contextId: number; + data: BulkCustomFieldOptionUpdateRequest; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldId}/context/${contextId}/option`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Changes the order of custom field options or cascading options in a context. This operation works for custom field options created in Jira or the operations from this resource. **To work with issue field select list options created for Connect apps use the [Issue custom field options (apps)](#api-group-issue-custom-field-options--apps-) operations.** **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue custom field options + * @name ReorderCustomFieldOptions + * @summary Reorder custom field options (context) + * @request PUT:/rest/api/3/field/{fieldId}/context/{contextId}/option/move + * @secure + */ + reorderCustomFieldOptions: ({ + fieldId, + contextId, + data, + params = {}, + }: { + fieldId: string; + contextId: number; + data: OrderOfCustomFieldOptions; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldId}/context/${contextId}/option/move`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes a custom field option. Options with cascading options cannot be deleted without deleting the cascading options first. This operation works for custom field options created in Jira or the operations from this resource. **To work with issue field select list options created for Connect apps use the [Issue custom field options (apps)](#api-group-issue-custom-field-options--apps-) operations.** **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue custom field options + * @name DeleteCustomFieldOption + * @summary Delete custom field options (context) + * @request DELETE:/rest/api/3/field/{fieldId}/context/{contextId}/option/{optionId} + * @secure + */ + deleteCustomFieldOption: ({ + fieldId, + contextId, + optionId, + params = {}, + }: { + fieldId: string; + contextId: number; + optionId: number; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldId}/context/${contextId}/option/${optionId}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Assigns a custom field context to projects. If any project in the request is assigned to any context of the custom field, the operation fails. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue custom field contexts + * @name AssignProjectsToCustomFieldContext + * @summary Assign custom field context to projects + * @request PUT:/rest/api/3/field/{fieldId}/context/{contextId}/project + * @secure + */ + assignProjectsToCustomFieldContext: ({ + fieldId, + contextId, + data, + params = {}, + }: { + fieldId: string; + contextId: number; + data: ProjectIds; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldId}/context/${contextId}/project`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Removes a custom field context from projects. A custom field context without any projects applies to all projects. Removing all projects from a custom field context would result in it applying to all projects. If any project in the request is not assigned to the context, or the operation would result in two global contexts for the field, the operation fails. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue custom field contexts + * @name RemoveCustomFieldContextFromProjects + * @summary Remove custom field context from projects + * @request POST:/rest/api/3/field/{fieldId}/context/{contextId}/project/remove + * @secure + */ + removeCustomFieldContextFromProjects: ({ + fieldId, + contextId, + data, + params = {}, + }: { + fieldId: string; + contextId: number; + data: ProjectIds; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldId}/context/${contextId}/project/remove`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of the contexts a field is used in. Deprecated, use [ Get custom field contexts](#api-rest-api-3-field-fieldId-context-get). **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue fields + * @name GetContextsForFieldDeprecated + * @summary Get contexts for a field + * @request GET:/rest/api/3/field/{fieldId}/contexts + * @deprecated + * @secure + */ + getContextsForFieldDeprecated: ({ + fieldId, + query, + params = {}, + }: { + fieldId: string; + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 20 + */ + maxResults?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldId}/contexts`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of the screens a field is used in. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Screens + * @name GetScreensForField + * @summary Get screens for a field + * @request GET:/rest/api/3/field/{fieldId}/screens + * @secure + */ + getScreensForField: ({ + fieldId, + query, + params = {}, + }: { + fieldId: string; + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 100 + */ + maxResults?: number; + /** Use [expand](#expansion) to include additional information about screens in the response. This parameter accepts `tab` which returns details about the screen tabs the field is used in. */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldId}/screens`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of all the options of a select list issue field. A select list issue field is a type of [issue field](https://developer.atlassian.com/cloud/jira/platform/modules/issue-field/) that enables a user to select a value from a list of options. Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be used with issue field select list options created in Jira or using operations from the [Issue custom field options](#api-group-Issue-custom-field-options) resource. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required for the app providing the field. + * + * @tags Issue custom field options (apps) + * @name GetAllIssueFieldOptions + * @summary Get all issue field options + * @request GET:/rest/api/3/field/{fieldKey}/option + * @secure + */ + getAllIssueFieldOptions: ({ + fieldKey, + query, + params = {}, + }: { + fieldKey: string; + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldKey}/option`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates an option for a select list issue field. Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be used with issue field select list options created in Jira or using operations from the [Issue custom field options](#api-group-Issue-custom-field-options) resource. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required for the app providing the field. + * + * @tags Issue custom field options (apps) + * @name CreateIssueFieldOption + * @summary Create issue field option + * @request POST:/rest/api/3/field/{fieldKey}/option + * @secure + */ + createIssueFieldOption: ({ + fieldKey, + data, + params = {}, + }: { + fieldKey: string; + data: IssueFieldOptionCreateBean; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldKey}/option`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of options for a select list issue field that can be viewed and selected by the user. Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be used with issue field select list options created in Jira or using operations from the [Issue custom field options](#api-group-Issue-custom-field-options) resource. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Issue custom field options (apps) + * @name GetSelectableIssueFieldOptions + * @summary Get selectable issue field options + * @request GET:/rest/api/3/field/{fieldKey}/option/suggestions/edit + * @secure + */ + getSelectableIssueFieldOptions: ({ + fieldKey, + query, + params = {}, + }: { + fieldKey: string; + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * Filters the results to options that are only available in the specified project. + * @format int64 + */ + projectId?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldKey}/option/suggestions/edit`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of options for a select list issue field that can be viewed by the user. Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be used with issue field select list options created in Jira or using operations from the [Issue custom field options](#api-group-Issue-custom-field-options) resource. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Issue custom field options (apps) + * @name GetVisibleIssueFieldOptions + * @summary Get visible issue field options + * @request GET:/rest/api/3/field/{fieldKey}/option/suggestions/search + * @secure + */ + getVisibleIssueFieldOptions: ({ + fieldKey, + query, + params = {}, + }: { + fieldKey: string; + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + */ + maxResults?: number; + /** + * Filters the results to options that are only available in the specified project. + * @format int64 + */ + projectId?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldKey}/option/suggestions/search`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes an option from a select list issue field. Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be used with issue field select list options created in Jira or using operations from the [Issue custom field options](#api-group-Issue-custom-field-options) resource. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required for the app providing the field. + * + * @tags Issue custom field options (apps) + * @name DeleteIssueFieldOption + * @summary Delete issue field option + * @request DELETE:/rest/api/3/field/{fieldKey}/option/{optionId} + * @secure + */ + deleteIssueFieldOption: ({ + fieldKey, + optionId, + params = {}, + }: { + fieldKey: string; + optionId: number; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldKey}/option/${optionId}`, + method: "DELETE", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns an option from a select list issue field. Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be used with issue field select list options created in Jira or using operations from the [Issue custom field options](#api-group-Issue-custom-field-options) resource. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required for the app providing the field. + * + * @tags Issue custom field options (apps) + * @name GetIssueFieldOption + * @summary Get issue field option + * @request GET:/rest/api/3/field/{fieldKey}/option/{optionId} + * @secure + */ + getIssueFieldOption: ({ + fieldKey, + optionId, + params = {}, + }: { + fieldKey: string; + optionId: number; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldKey}/option/${optionId}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates or creates an option for a select list issue field. This operation requires that the option ID is provided when creating an option, therefore, the option ID needs to be specified as a path and body parameter. The option ID provided in the path and body must be identical. Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be used with issue field select list options created in Jira or using operations from the [Issue custom field options](#api-group-Issue-custom-field-options) resource. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required for the app providing the field. + * + * @tags Issue custom field options (apps) + * @name UpdateIssueFieldOption + * @summary Update issue field option + * @request PUT:/rest/api/3/field/{fieldKey}/option/{optionId} + * @secure + */ + updateIssueFieldOption: ({ + fieldKey, + optionId, + data, + params = {}, + }: { + fieldKey: string; + optionId: number; + data: IssueFieldOption; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldKey}/option/${optionId}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deselects an issue-field select-list option from all issues where it is selected. A different option can be selected to replace the deselected option. The update can also be limited to a smaller set of issues by using a JQL query. Connect and Forge app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) can override the screen security configuration using `overrideScreenSecurity` and `overrideEditableFlag`. This is an [asynchronous operation](#async). The response object contains a link to the long-running task. Note that this operation **only works for issue field select list options added by Connect apps**, it cannot be used with issue field select list options created in Jira or using operations from the [Issue custom field options](#api-group-Issue-custom-field-options) resource. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). Jira permissions are not required for the app providing the field. + * + * @tags Issue custom field options (apps) + * @name ReplaceIssueFieldOption + * @summary Replace issue field option + * @request DELETE:/rest/api/3/field/{fieldKey}/option/{optionId}/issue + * @secure + */ + replaceIssueFieldOption: ({ + fieldKey, + optionId, + query, + params = {}, + }: { + fieldKey: string; + optionId: number; + query?: { + /** + * The ID of the option that will replace the currently selected option. + * @format int64 + */ + replaceWith?: number; + /** A JQL query that specifies the issues to be updated. For example, *project=10000*. */ + jql?: string; + /** + * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect and Forge app users with admin permission. + * @default false + */ + overrideScreenSecurity?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect and Forge app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * @default false + */ + overrideEditableFlag?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/field/${fieldKey}/option/${optionId}/issue`, + method: "DELETE", + query: query, + secure: true, + ...params, + }), + + /** + * @description Deletes a custom field. The custom field is deleted whether it is in the trash or not. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) for more information on trashing and deleting custom fields. This operation is [asynchronous](#async). Follow the `location` link in the response to determine the status of the task and use [Get task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue fields + * @name DeleteCustomField + * @summary Delete custom field + * @request DELETE:/rest/api/3/field/{id} + * @secure + */ + deleteCustomField: ({ id, params = {} }: { id: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/field/${id}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Restores a custom field from trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) for more information on trashing and deleting custom fields. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue fields + * @name RestoreCustomField + * @summary Restore custom field from trash + * @request POST:/rest/api/3/field/{id}/restore + * @secure + */ + restoreCustomField: ({ id, params = {} }: { id: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/field/${id}/restore`, + method: "POST", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Moves a custom field to trash. See [Edit or delete a custom field](https://confluence.atlassian.com/x/Z44fOw) for more information on trashing and deleting custom fields. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue fields + * @name TrashCustomField + * @summary Move custom field to trash + * @request POST:/rest/api/3/field/{id}/trash + * @secure + */ + trashCustomField: ({ id, params = {} }: { id: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/field/${id}/trash`, + method: "POST", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of field configurations. The list can be for all field configurations or a subset determined by any combination of these criteria: * a list of field configuration item IDs. * whether the field configuration is a default. * whether the field configuration name or description contains a query string. Only field configurations used in company-managed (classic) projects are returned. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue field configurations + * @name GetAllFieldConfigurations + * @summary Get all field configurations + * @request GET:/rest/api/3/fieldconfiguration + * @secure + */ + getAllFieldConfigurations: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * The list of field configuration IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + * @uniqueItems true + */ + id?: number[]; + /** + * If *true* returns default field configurations only. + * @default false + */ + isDefault?: boolean; + /** + * The query string used to match against field configuration names and descriptions. + * @default "" + */ + query?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/fieldconfiguration`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates a field configuration. The field configuration is created with the same field properties as the default configuration, with all the fields being optional. This operation can only create configurations for use in company-managed (classic) projects. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue field configurations + * @name CreateFieldConfiguration + * @summary Create field configuration + * @request POST:/rest/api/3/fieldconfiguration + * @secure + */ + createFieldConfiguration: ({ data, params = {} }: { data: FieldConfigurationDetails; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/fieldconfiguration`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes a field configuration. This operation can only delete configurations used in company-managed (classic) projects. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue field configurations + * @name DeleteFieldConfiguration + * @summary Delete field configuration + * @request DELETE:/rest/api/3/fieldconfiguration/{id} + * @secure + */ + deleteFieldConfiguration: ({ id, params = {} }: { id: number; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/fieldconfiguration/${id}`, + method: "DELETE", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates a field configuration. The name and the description provided in the request override the existing values. This operation can only update configurations used in company-managed (classic) projects. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue field configurations + * @name UpdateFieldConfiguration + * @summary Update field configuration + * @request PUT:/rest/api/3/fieldconfiguration/{id} + * @secure + */ + updateFieldConfiguration: ({ + id, + data, + params = {}, + }: { + id: number; + data: FieldConfigurationDetails; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/fieldconfiguration/${id}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of all fields for a configuration. Only the fields from configurations used in company-managed (classic) projects are returned. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue field configurations + * @name GetFieldConfigurationItems + * @summary Get field configuration items + * @request GET:/rest/api/3/fieldconfiguration/{id}/fields + * @secure + */ + getFieldConfigurationItems: ({ + id, + query, + params = {}, + }: { + id: number; + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/fieldconfiguration/${id}/fields`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates fields in a field configuration. The properties of the field configuration fields provided override the existing values. This operation can only update field configurations used in company-managed (classic) projects. The operation can set the renderer for text fields to the default text renderer (`text-renderer`) or wiki style renderer (`wiki-renderer`). However, the renderer cannot be updated for fields using the autocomplete renderer (`autocomplete-renderer`). **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue field configurations + * @name UpdateFieldConfigurationItems + * @summary Update field configuration items + * @request PUT:/rest/api/3/fieldconfiguration/{id}/fields + * @secure + */ + updateFieldConfigurationItems: ({ + id, + data, + params = {}, + }: { + id: number; + data: FieldConfigurationItemsDetails; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/fieldconfiguration/${id}/fields`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of field configuration schemes. Only field configuration schemes used in classic projects are returned. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue field configurations + * @name GetAllFieldConfigurationSchemes + * @summary Get all field configuration schemes + * @request GET:/rest/api/3/fieldconfigurationscheme + * @secure + */ + getAllFieldConfigurationSchemes: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * The list of field configuration scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + * @uniqueItems true + */ + id?: number[]; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/fieldconfigurationscheme`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates a field configuration scheme. This operation can only create field configuration schemes used in company-managed (classic) projects. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue field configurations + * @name CreateFieldConfigurationScheme + * @summary Create field configuration scheme + * @request POST:/rest/api/3/fieldconfigurationscheme + * @secure + */ + createFieldConfigurationScheme: ({ + data, + params = {}, + }: { + data: UpdateFieldConfigurationSchemeDetails; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/fieldconfigurationscheme`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of field configuration issue type items. Only items used in classic projects are returned. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue field configurations + * @name GetFieldConfigurationSchemeMappings + * @summary Get field configuration issue type items + * @request GET:/rest/api/3/fieldconfigurationscheme/mapping + * @secure + */ + getFieldConfigurationSchemeMappings: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * The list of field configuration scheme IDs. To include multiple field configuration schemes separate IDs with ampersand: `fieldConfigurationSchemeId=10000&fieldConfigurationSchemeId=10001`. + * @maxItems 50 + * @minItems 1 + * @uniqueItems true + */ + fieldConfigurationSchemeId?: number[]; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/fieldconfigurationscheme/mapping`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of field configuration schemes and, for each scheme, a list of the projects that use it. The list is sorted by field configuration scheme ID. The first item contains the list of project IDs assigned to the default field configuration scheme. Only field configuration schemes used in classic projects are returned. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue field configurations + * @name GetFieldConfigurationSchemeProjectMapping + * @summary Get field configuration schemes for projects + * @request GET:/rest/api/3/fieldconfigurationscheme/project + * @secure + */ + getFieldConfigurationSchemeProjectMapping: ({ + query, + params = {}, + }: { + query: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * The list of project IDs. To include multiple projects, separate IDs with ampersand: `projectId=10000&projectId=10001`. + * @uniqueItems true + */ + projectId: number[]; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/fieldconfigurationscheme/project`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Assigns a field configuration scheme to a project. If the field configuration scheme ID is `null`, the operation assigns the default field configuration scheme. Field configuration schemes can only be assigned to classic projects. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue field configurations + * @name AssignFieldConfigurationSchemeToProject + * @summary Assign field configuration scheme to project + * @request PUT:/rest/api/3/fieldconfigurationscheme/project + * @secure + */ + assignFieldConfigurationSchemeToProject: ({ + data, + params = {}, + }: { + data: FieldConfigurationSchemeProjectAssociation; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/fieldconfigurationscheme/project`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes a field configuration scheme. This operation can only delete field configuration schemes used in company-managed (classic) projects. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue field configurations + * @name DeleteFieldConfigurationScheme + * @summary Delete field configuration scheme + * @request DELETE:/rest/api/3/fieldconfigurationscheme/{id} + * @secure + */ + deleteFieldConfigurationScheme: ({ id, params = {} }: { id: number; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/fieldconfigurationscheme/${id}`, + method: "DELETE", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates a field configuration scheme. This operation can only update field configuration schemes used in company-managed (classic) projects. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue field configurations + * @name UpdateFieldConfigurationScheme + * @summary Update field configuration scheme + * @request PUT:/rest/api/3/fieldconfigurationscheme/{id} + * @secure + */ + updateFieldConfigurationScheme: ({ + id, + data, + params = {}, + }: { + id: number; + data: UpdateFieldConfigurationSchemeDetails; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/fieldconfigurationscheme/${id}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Assigns issue types to field configurations on field configuration scheme. This operation can only modify field configuration schemes used in company-managed (classic) projects. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue field configurations + * @name SetFieldConfigurationSchemeMapping + * @summary Assign issue types to field configurations + * @request PUT:/rest/api/3/fieldconfigurationscheme/{id}/mapping + * @secure + */ + setFieldConfigurationSchemeMapping: ({ + id, + data, + params = {}, + }: { + id: number; + data: AssociateFieldConfigurationsWithIssueTypesRequest; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/fieldconfigurationscheme/${id}/mapping`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Removes issue types from the field configuration scheme. This operation can only modify field configuration schemes used in company-managed (classic) projects. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue field configurations + * @name RemoveIssueTypesFromGlobalFieldConfigurationScheme + * @summary Remove issue types from field configuration scheme + * @request POST:/rest/api/3/fieldconfigurationscheme/{id}/mapping/delete + * @secure + */ + removeIssueTypesFromGlobalFieldConfigurationScheme: ({ + id, + data, + params = {}, + }: { + id: number; + data: IssueTypeIdsToRemove; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/fieldconfigurationscheme/${id}/mapping/delete`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns all filters. Deprecated, use [ Search for filters](#api-rest-api-3-filter-search-get) that supports search and pagination. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None, however, only the following filters are returned: * filters owned by the user. * filters shared with a group that the user is a member of. * filters shared with a private project that the user has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for. * filters shared with a public project. * filters shared with the public. + * + * @tags Filters + * @name GetFilters + * @summary Get filters + * @request GET:/rest/api/3/filter + * @deprecated + * @secure + */ + getFilters: ({ + query, + params = {}, + }: { + query?: { + /** + * Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/filter`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates a filter. The filter is shared according to the [default share scope](#api-rest-api-3-filter-post). The filter is not selected as a favorite. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Filters + * @name CreateFilter + * @summary Create filter + * @request POST:/rest/api/3/filter + * @secure + */ + createFilter: ({ + data, + query, + params = {}, + }: { + data: Filter; + query?: { + /** + * Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. + */ + expand?: string; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be created. Available to users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * @default false + */ + overrideSharePermissions?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/filter`, + method: "POST", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns the default sharing settings for new filters and dashboards for a user. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Filter sharing + * @name GetDefaultShareScope + * @summary Get default share scope + * @request GET:/rest/api/3/filter/defaultShareScope + * @secure + */ + getDefaultShareScope: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/filter/defaultShareScope`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Sets the default sharing for new filters and dashboards for a user. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Filter sharing + * @name SetDefaultShareScope + * @summary Set default share scope + * @request PUT:/rest/api/3/filter/defaultShareScope + * @secure + */ + setDefaultShareScope: ({ data, params = {} }: { data: DefaultShareScope; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/filter/defaultShareScope`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns the visible favorite filters of the user. This operation can be accessed anonymously. **[Permissions](#permissions) required:** A favorite filter is only visible to the user where the filter is: * owned by the user. * shared with a group that the user is a member of. * shared with a private project that the user has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for. * shared with a public project. * shared with the public. For example, if the user favorites a public filter that is subsequently made private that filter is not returned by this operation. + * + * @tags Filters + * @name GetFavouriteFilters + * @summary Get favorite filters + * @request GET:/rest/api/3/filter/favourite + * @secure + */ + getFavouriteFilters: ({ + query, + params = {}, + }: { + query?: { + /** + * Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/filter/favourite`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the filters owned by the user. If `includeFavourites` is `true`, the user's visible favorite filters are also returned. **[Permissions](#permissions) required:** Permission to access Jira, however, a favorite filters is only visible to the user where the filter is: * owned by the user. * shared with a group that the user is a member of. * shared with a private project that the user has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for. * shared with a public project. * shared with the public. For example, if the user favorites a public filter that is subsequently made private that filter is not returned by this operation. + * + * @tags Filters + * @name GetMyFilters + * @summary Get my filters + * @request GET:/rest/api/3/filter/my + * @secure + */ + getMyFilters: ({ + query, + params = {}, + }: { + query?: { + /** + * Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. + */ + expand?: string; + /** + * Include the user's favorite filters in the response. + * @default false + */ + includeFavourites?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/filter/my`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of filters. Use this operation to get: * specific filters, by defining `id` only. * filters that match all of the specified attributes. For example, all filters for a user with a particular word in their name. When multiple attributes are specified only filters matching all attributes are returned. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None, however, only the following filters that match the query parameters are returned: * filters owned by the user. * filters shared with a group that the user is a member of. * filters shared with a private project that the user has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for. * filters shared with a public project. * filters shared with the public. + * + * @tags Filters + * @name GetFiltersPaginated + * @summary Search for filters + * @request GET:/rest/api/3/filter/search + * @secure + */ + getFiltersPaginated: ({ + query, + params = {}, + }: { + query?: { + /** String used to perform a case-insensitive partial match with `name`. */ + filterName?: string; + /** + * User account ID used to return filters with the matching `owner.accountId`. This parameter cannot be used with `owner`. + * @maxLength 128 + */ + accountId?: string; + /** This parameter is deprecated because of privacy changes. Use `accountId` instead. See the [migration guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. User name used to return filters with the matching `owner.name`. This parameter cannot be used with `accountId`. */ + owner?: string; + /** As a group's name can change, use of `groupId` is recommended to identify a group. Group name used to returns filters that are shared with a group that matches `sharePermissions.group.groupname`. This parameter cannot be used with the `groupId` parameter. */ + groupname?: string; + /** Group ID used to returns filters that are shared with a group that matches `sharePermissions.group.groupId`. This parameter cannot be used with the `groupname` parameter. */ + groupId?: string; + /** + * Project ID used to returns filters that are shared with a project that matches `sharePermissions.project.id`. + * @format int64 + */ + projectId?: number; + /** + * The list of filter IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. Do not exceed 200 filter IDs. + * @uniqueItems true + */ + id?: number[]; + /** + * [Order](#ordering) the results by a field: + * + * * `description` Sorts by filter description. Note that this sorting works independently of whether the expand to display the description field is in use. + * * `favourite_count` Sorts by the count of how many users have this filter as a favorite. + * * `is_favourite` Sorts by whether the filter is marked as a favorite. + * * `id` Sorts by filter ID. + * * `name` Sorts by filter name. + * * `owner` Sorts by the ID of the filter owner. + * * `is_shared` Sorts by whether the filter is shared. + * @default "name" + */ + orderBy?: + | "description" + | "-description" + | "+description" + | "favourite_count" + | "-favourite_count" + | "+favourite_count" + | "id" + | "-id" + | "+id" + | "is_favourite" + | "-is_favourite" + | "+is_favourite" + | "name" + | "-name" + | "+name" + | "owner" + | "-owner" + | "+owner" + | "is_shared" + | "-is_shared" + | "+is_shared"; + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `description` Returns the description of the filter. + * * `favourite` Returns an indicator of whether the user has set the filter as a favorite. + * * `favouritedCount` Returns a count of how many users have set this filter as a favorite. + * * `jql` Returns the JQL query that the filter uses. + * * `owner` Returns the owner of the filter. + * * `searchUrl` Returns a URL to perform the filter's JQL query. + * * `sharePermissions` Returns the share permissions defined for the filter. + * * `editPermissions` Returns the edit permissions defined for the filter. + * * `isWritable` Returns whether the current user has permission to edit the filter. + * * `subscriptions` Returns the users that are subscribed to the filter. + * * `viewUrl` Returns a URL to view the filter. + */ + expand?: string; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be returned. Available to users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * @default false + */ + overrideSharePermissions?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/filter/search`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Delete a filter. **[Permissions](#permissions) required:** Permission to access Jira, however filters can only be deleted by the creator of the filter or a user with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Filters + * @name DeleteFilter + * @summary Delete filter + * @request DELETE:/rest/api/3/filter/{id} + * @secure + */ + deleteFilter: ({ id, params = {} }: { id: number; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/filter/${id}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Returns a filter. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None, however, the filter is only returned where it is: * owned by the user. * shared with a group that the user is a member of. * shared with a private project that the user has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for. * shared with a public project. * shared with the public. + * + * @tags Filters + * @name GetFilter + * @summary Get filter + * @request GET:/rest/api/3/filter/{id} + * @secure + */ + getFilter: ({ + id, + query, + params = {}, + }: { + id: number; + query?: { + /** + * Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. + */ + expand?: string; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be returned. Available to users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * @default false + */ + overrideSharePermissions?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/filter/${id}`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates a filter. Use this operation to update a filter's name, description, JQL, or sharing. **[Permissions](#permissions) required:** Permission to access Jira, however the user must own the filter. + * + * @tags Filters + * @name UpdateFilter + * @summary Update filter + * @request PUT:/rest/api/3/filter/{id} + * @secure + */ + updateFilter: ({ + id, + data, + query, + params = {}, + }: { + id: number; + data: Filter; + query?: { + /** + * Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. + */ + expand?: string; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable the addition of any share permissions to filters. Available to users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * @default false + */ + overrideSharePermissions?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/filter/${id}`, + method: "PUT", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Reset the user's column configuration for the filter to the default. **[Permissions](#permissions) required:** Permission to access Jira, however, columns are only reset for: * filters owned by the user. * filters shared with a group that the user is a member of. * filters shared with a private project that the user has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for. * filters shared with a public project. * filters shared with the public. + * + * @tags Filters + * @name ResetColumns + * @summary Reset columns + * @request DELETE:/rest/api/3/filter/{id}/columns + * @secure + */ + resetColumns: ({ id, params = {} }: { id: number; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/filter/${id}/columns`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Returns the columns configured for a filter. The column configuration is used when the filter's results are viewed in *List View* with the *Columns* set to *Filter*. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None, however, column details are only returned for: * filters owned by the user. * filters shared with a group that the user is a member of. * filters shared with a private project that the user has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for. * filters shared with a public project. * filters shared with the public. + * + * @tags Filters + * @name GetColumns + * @summary Get columns + * @request GET:/rest/api/3/filter/{id}/columns + * @secure + */ + getColumns: ({ id, params = {} }: { id: number; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/filter/${id}/columns`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Sets the columns for a filter. Only navigable fields can be set as columns. Use [Get fields](#api-rest-api-3-field-get) to get the list fields in Jira. A navigable field has `navigable` set to `true`. The parameters for this resource are expressed as HTML form data. For example, in curl: `curl -X PUT -d columns=summary -d columns=description https://your-domain.atlassian.net/rest/api/3/filter/10000/columns` **[Permissions](#permissions) required:** Permission to access Jira, however, columns are only set for: * filters owned by the user. * filters shared with a group that the user is a member of. * filters shared with a private project that the user has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for. * filters shared with a public project. * filters shared with the public. + * + * @tags Filters + * @name SetColumns + * @summary Set columns + * @request PUT:/rest/api/3/filter/{id}/columns + * @secure + */ + setColumns: ({ id, data, params = {} }: { id: number; data: string[]; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/filter/${id}/columns`, + method: "PUT", + body: data, + secure: true, + type: ContentType.FormData, + format: "json", + ...params, + }), + + /** + * @description Removes a filter as a favorite for the user. Note that this operation only removes filters visible to the user from the user's favorites list. For example, if the user favorites a public filter that is subsequently made private (and is therefore no longer visible on their favorites list) they cannot remove it from their favorites list. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Filters + * @name DeleteFavouriteForFilter + * @summary Remove filter as favorite + * @request DELETE:/rest/api/3/filter/{id}/favourite + * @secure + */ + deleteFavouriteForFilter: ({ + id, + query, + params = {}, + }: { + id: number; + query?: { + /** + * Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/filter/${id}/favourite`, + method: "DELETE", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Add a filter as a favorite for the user. **[Permissions](#permissions) required:** Permission to access Jira, however, the user can only favorite: * filters owned by the user. * filters shared with a group that the user is a member of. * filters shared with a private project that the user has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for. * filters shared with a public project. * filters shared with the public. + * + * @tags Filters + * @name SetFavouriteForFilter + * @summary Add filter as favorite + * @request PUT:/rest/api/3/filter/{id}/favourite + * @secure + */ + setFavouriteForFilter: ({ + id, + query, + params = {}, + }: { + id: number; + query?: { + /** + * Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/filter/${id}/favourite`, + method: "PUT", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Changes the owner of the filter. **[Permissions](#permissions) required:** Permission to access Jira. However, the user must own the filter or have the *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Filters + * @name ChangeFilterOwner + * @summary Change filter owner + * @request PUT:/rest/api/3/filter/{id}/owner + * @secure + */ + changeFilterOwner: ({ id, data, params = {} }: { id: number; data: ChangeFilterOwner; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/filter/${id}/owner`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns the share permissions for a filter. A filter can be shared with groups, projects, all logged-in users, or the public. Sharing with all logged-in users or the public is known as a global share permission. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None, however, share permissions are only returned for: * filters owned by the user. * filters shared with a group that the user is a member of. * filters shared with a private project that the user has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for. * filters shared with a public project. * filters shared with the public. + * + * @tags Filter sharing + * @name GetSharePermissions + * @summary Get share permissions + * @request GET:/rest/api/3/filter/{id}/permission + * @secure + */ + getSharePermissions: ({ id, params = {} }: { id: number; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/filter/${id}/permission`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Add a share permissions to a filter. If you add a global share permission (one for all logged-in users or the public) it will overwrite all share permissions for the filter. Be aware that this operation uses different objects for updating share permissions compared to [Update filter](#api-rest-api-3-filter-id-put). **[Permissions](#permissions) required:** *Share dashboards and filters* [global permission](https://confluence.atlassian.com/x/x4dKLg) and the user must own the filter. + * + * @tags Filter sharing + * @name AddSharePermission + * @summary Add share permission + * @request POST:/rest/api/3/filter/{id}/permission + * @secure + */ + addSharePermission: ({ + id, + data, + params = {}, + }: { + id: number; + data: SharePermissionInputBean; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/filter/${id}/permission`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes a share permission from a filter. **[Permissions](#permissions) required:** Permission to access Jira and the user must own the filter. + * + * @tags Filter sharing + * @name DeleteSharePermission + * @summary Delete share permission + * @request DELETE:/rest/api/3/filter/{id}/permission/{permissionId} + * @secure + */ + deleteSharePermission: ({ + id, + permissionId, + params = {}, + }: { + id: number; + permissionId: number; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/filter/${id}/permission/${permissionId}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Returns a share permission for a filter. A filter can be shared with groups, projects, all logged-in users, or the public. Sharing with all logged-in users or the public is known as a global share permission. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None, however, a share permission is only returned for: * filters owned by the user. * filters shared with a group that the user is a member of. * filters shared with a private project that the user has *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for. * filters shared with a public project. * filters shared with the public. + * + * @tags Filter sharing + * @name GetSharePermission + * @summary Get share permission + * @request GET:/rest/api/3/filter/{id}/permission/{permissionId} + * @secure + */ + getSharePermission: ({ + id, + permissionId, + params = {}, + }: { + id: number; + permissionId: number; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/filter/${id}/permission/${permissionId}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes a group. **[Permissions](#permissions) required:** Site administration (that is, member of the *site-admin* strategic [group](https://confluence.atlassian.com/x/24xjL)). + * + * @tags Groups + * @name RemoveGroup + * @summary Remove group + * @request DELETE:/rest/api/3/group + * @secure + */ + removeGroup: ({ + query, + params = {}, + }: { + query?: { + groupname?: string; + /** The ID of the group. This parameter cannot be used with the `groupname` parameter. */ + groupId?: string; + /** + * As a group's name can change, use of `swapGroupId` is recommended to identify a group. + * The group to transfer restrictions to. Only comments and worklogs are transferred. If restrictions are not transferred, comments and worklogs are inaccessible after the deletion. This parameter cannot be used with the `swapGroupId` parameter. + */ + swapGroup?: string; + /** The ID of the group to transfer restrictions to. Only comments and worklogs are transferred. If restrictions are not transferred, comments and worklogs are inaccessible after the deletion. This parameter cannot be used with the `swapGroup` parameter. */ + swapGroupId?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/group`, + method: "DELETE", + query: query, + secure: true, + ...params, + }), + + /** + * @description This operation is deprecated, use [`group/member`](#api-rest-api-3-group-member-get). Returns all users in a group. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Groups + * @name GetGroup + * @summary Get group + * @request GET:/rest/api/3/group + * @deprecated + * @secure + */ + getGroup: ({ + query, + params = {}, + }: { + query?: { + /** + * As a group's name can change, use of `groupId` is recommended to identify a group. + * The name of the group. This parameter cannot be used with the `groupId` parameter. + */ + groupname?: string; + /** The ID of the group. This parameter cannot be used with the `groupName` parameter. */ + groupId?: string; + /** List of fields to expand. */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/group`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates a group. **[Permissions](#permissions) required:** Site administration (that is, member of the *site-admin* [group](https://confluence.atlassian.com/x/24xjL)). + * + * @tags Groups + * @name CreateGroup + * @summary Create group + * @request POST:/rest/api/3/group + * @secure + */ + createGroup: ({ data, params = {} }: { data: AddGroupBean; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/group`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of groups. **[Permissions](#permissions) required:** *Browse users and groups* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Groups + * @name BulkGetGroups + * @summary Bulk get groups + * @request GET:/rest/api/3/group/bulk + * @secure + */ + bulkGetGroups: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * The ID of a group. To specify multiple IDs, pass multiple `groupId` parameters. For example, `groupId=5b10a2844c20165700ede21g&groupId=5b10ac8d82e05b22cc7d4ef5`. + * @uniqueItems true + * @example "3571b9a7-348f-414a-9087-8e1ea03a7df8" + */ + groupId?: string[]; + /** + * The name of a group. To specify multiple names, pass multiple `groupName` parameters. For example, `groupName=administrators&groupName=jira-software-users`. + * @uniqueItems true + */ + groupName?: string[]; + /** The access level of a group. Valid values: 'site-admin', 'admin', 'user'. */ + accessType?: string; + /** The application key of the product user groups to search for. Valid values: 'jira-servicedesk', 'jira-software', 'jira-product-discovery', 'jira-core'. */ + applicationKey?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/group/bulk`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of all users in a group. Note that users are ordered by username, however the username is not returned in the results due to privacy reasons. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Groups + * @name GetUsersFromGroup + * @summary Get users from group + * @request GET:/rest/api/3/group/member + * @secure + */ + getUsersFromGroup: ({ + query, + params = {}, + }: { + query?: { + /** + * As a group's name can change, use of `groupId` is recommended to identify a group. + * The name of the group. This parameter cannot be used with the `groupId` parameter. + */ + groupname?: string; + /** The ID of the group. This parameter cannot be used with the `groupName` parameter. */ + groupId?: string; + /** + * Include inactive users. + * @default false + */ + includeInactiveUsers?: boolean; + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/group/member`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Removes a user from a group. **[Permissions](#permissions) required:** Site administration (that is, member of the *site-admin* [group](https://confluence.atlassian.com/x/24xjL)). + * + * @tags Groups + * @name RemoveUserFromGroup + * @summary Remove user from group + * @request DELETE:/rest/api/3/group/user + * @secure + */ + removeUserFromGroup: ({ + query, + params = {}, + }: { + query: { + /** + * As a group's name can change, use of `groupId` is recommended to identify a group. + * The name of the group. This parameter cannot be used with the `groupId` parameter. + */ + groupname?: string; + /** The ID of the group. This parameter cannot be used with the `groupName` parameter. */ + groupId?: string; + /** This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + username?: string; + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + * @maxLength 128 + * @example "5b10ac8d82e05b22cc7d4ef5" + */ + accountId: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/group/user`, + method: "DELETE", + query: query, + secure: true, + ...params, + }), + + /** + * @description Adds a user to a group. **[Permissions](#permissions) required:** Site administration (that is, member of the *site-admin* [group](https://confluence.atlassian.com/x/24xjL)). + * + * @tags Groups + * @name AddUserToGroup + * @summary Add user to group + * @request POST:/rest/api/3/group/user + * @secure + */ + addUserToGroup: ({ + data, + query, + params = {}, + }: { + data: UpdateUserToGroupBean; + query?: { + /** + * As a group's name can change, use of `groupId` is recommended to identify a group. + * The name of the group. This parameter cannot be used with the `groupId` parameter. + */ + groupname?: string; + /** The ID of the group. This parameter cannot be used with the `groupName` parameter. */ + groupId?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/group/user`, + method: "POST", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a list of groups whose names contain a query string. A list of group names can be provided to exclude groups from the results. The primary use case for this resource is to populate a group picker suggestions list. To this end, the returned object includes the `html` field where the matched query term is highlighted in the group name with the HTML strong tag. Also, the groups list is wrapped in a response object that contains a header for use in the picker, specifically *Showing X of Y matching groups*. The list returns with the groups sorted. If no groups match the list criteria, an empty list is returned. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg). Anonymous calls and calls by users without the required permission return an empty list. *Browse users and groups* [global permission](https://confluence.atlassian.com/x/x4dKLg). Without this permission, calls where query is not an exact match to an existing group will return an empty list. + * + * @tags Groups + * @name FindGroups + * @summary Find groups + * @request GET:/rest/api/3/groups/picker + * @secure + */ + findGroups: ({ + query, + params = {}, + }: { + query?: { + /** This parameter is deprecated, setting it does not affect the results. To find groups containing a particular user, use [Get user groups](#api-rest-api-3-user-groups-get). */ + accountId?: string; + /** + * The string to find in group names. + * @example "query" + */ + query?: string; + /** + * As a group's name can change, use of `excludeGroupIds` is recommended to identify a group. + * A group to exclude from the result. To exclude multiple groups, provide an ampersand-separated list. For example, `exclude=group1&exclude=group2`. This parameter cannot be used with the `excludeGroupIds` parameter. + */ + exclude?: string[]; + /** A group ID to exclude from the result. To exclude multiple groups, provide an ampersand-separated list. For example, `excludeId=group1-id&excludeId=group2-id`. This parameter cannot be used with the `excludeGroups` parameter. */ + excludeId?: string[]; + /** + * The maximum number of groups to return. The maximum number of groups that can be returned is limited by the system property `jira.ajax.autocomplete.limit`. + * @format int32 + */ + maxResults?: number; + /** + * Whether the search for groups should be case insensitive. + * @default false + */ + caseInsensitive?: boolean; + /** This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + userName?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/groups/picker`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a list of users and groups matching a string. The string is used: * for users, to find a case-insensitive match with display name and e-mail address. Note that if a user has hidden their email address in their user profile, partial matches of the email address will not find the user. An exact match is required. * for groups, to find a case-sensitive match with group name. For example, if the string *tin* is used, records with the display name *Tina*, email address *sarah@tinplatetraining.com*, and the group *accounting* would be returned. Optionally, the search can be refined to: * the projects and issue types associated with a custom field, such as a user picker. The search can then be further refined to return only users and groups that have permission to view specific: * projects. * issue types. If multiple projects or issue types are specified, they must be a subset of those enabled for the custom field or no results are returned. For example, if a field is enabled for projects A, B, and C then the search could be limited to projects B and C. However, if the search is limited to projects B and D, nothing is returned. * not return Connect app users and groups. * return groups that have a case-insensitive match with the query. The primary use case for this resource is to populate a picker field suggestion list with users or groups. To this end, the returned object includes an `html` field for each list. This field highlights the matched query term in the item name with the HTML strong tag. Also, each list is wrapped in a response object that contains a header for use in a picker, specifically *Showing X of Y matching groups*. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse users and groups* [global permission](https://confluence.atlassian.com/x/yodKLg). + * + * @tags Group and user picker + * @name FindUsersAndGroups + * @summary Find users and groups + * @request GET:/rest/api/3/groupuserpicker + * @secure + */ + findUsersAndGroups: ({ + query, + params = {}, + }: { + query: { + /** The search string. */ + query: string; + /** + * The maximum number of items to return in each list. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * Whether the user avatar should be returned. If an invalid value is provided, the default value is used. + * @default false + */ + showAvatar?: boolean; + /** The custom field ID of the field this request is for. */ + fieldId?: string; + /** The ID of a project that returned users and groups must have permission to view. To include multiple projects, provide an ampersand-separated list. For example, `projectId=10000&projectId=10001`. This parameter is only used when `fieldId` is present. */ + projectId?: string[]; + /** The ID of an issue type that returned users and groups must have permission to view. To include multiple issue types, provide an ampersand-separated list. For example, `issueTypeId=10000&issueTypeId=10001`. Special values, such as `-1` (all standard issue types) and `-2` (all subtask issue types), are supported. This parameter is only used when `fieldId` is present. */ + issueTypeId?: string[]; + /** + * The size of the avatar to return. If an invalid value is provided, the default value is used. + * @default "xsmall" + */ + avatarSize?: + | "xsmall" + | "xsmall@2x" + | "xsmall@3x" + | "small" + | "small@2x" + | "small@3x" + | "medium" + | "medium@2x" + | "medium@3x" + | "large" + | "large@2x" + | "large@3x" + | "xlarge" + | "xlarge@2x" + | "xlarge@3x" + | "xxlarge" + | "xxlarge@2x" + | "xxlarge@3x" + | "xxxlarge" + | "xxxlarge@2x" + | "xxxlarge@3x"; + /** + * Whether the search for groups should be case insensitive. + * @default false + */ + caseInsensitive?: boolean; + /** + * Whether Connect app users and groups should be excluded from the search results. If an invalid value is provided, the default value is used. + * @default false + */ + excludeConnectAddons?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/groupuserpicker`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns licensing information about the Jira instance. **[Permissions](#permissions) required:** None. + * + * @tags Instance information + * @name GetLicense + * @summary Get license + * @request GET:/rest/api/3/instance/license + * @secure + */ + getLicense: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/instance/license`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates an issue or, where the option to create subtasks is enabled in Jira, a subtask. A transition may be applied, to move the issue or subtask to a workflow step other than the default start step, and issue properties set. The content of the issue or subtask is defined using `update` and `fields`. The fields that can be set in the issue or subtask are determined using the [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get). These are the same fields that appear on the issue's create screen. Note that the `description`, `environment`, and any `textarea` type custom fields (multi-line text fields) take Atlassian Document Format content. Single line custom fields (`textfield`) accept a string and don't handle Atlassian Document Format content. Creating a subtask differs from creating an issue as follows: * `issueType` must be set to a subtask issue type (use [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get) to find subtask issue types). * `parent` must contain the ID or key of the parent issue. In a next-gen project any issue may be made a child providing that the parent and child are members of the same project. **[Permissions](#permissions) required:** *Browse projects* and *Create issues* [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in which the issue or subtask is created. + * + * @tags Issues + * @name CreateIssue + * @summary Create issue + * @request POST:/rest/api/3/issue + * @secure + */ + createIssue: ({ + data, + query, + params = {}, + }: { + data: IssueUpdateDetails; + query?: { + /** + * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown under **Projects** in Jira. When provided, the issue type and request type are added to the user's history for a project. These values are then used to provide defaults on the issue create screen. + * @default false + */ + updateHistory?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue`, + method: "POST", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Creates upto **50** issues and, where the option to create subtasks is enabled in Jira, subtasks. Transitions may be applied, to move the issues or subtasks to a workflow step other than the default start step, and issue properties set. The content of each issue or subtask is defined using `update` and `fields`. The fields that can be set in the issue or subtask are determined using the [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get). These are the same fields that appear on the issues' create screens. Note that the `description`, `environment`, and any `textarea` type custom fields (multi-line text fields) take Atlassian Document Format content. Single line custom fields (`textfield`) accept a string and don't handle Atlassian Document Format content. Creating a subtask differs from creating an issue as follows: * `issueType` must be set to a subtask issue type (use [ Get create issue metadata](#api-rest-api-3-issue-createmeta-get) to find subtask issue types). * `parent` the must contain the ID or key of the parent issue. **[Permissions](#permissions) required:** *Browse projects* and *Create issues* [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project in which each issue or subtask is created. + * + * @tags Issues + * @name CreateIssues + * @summary Bulk create issue + * @request POST:/rest/api/3/issue/bulk + * @secure + */ + createIssues: ({ data, params = {} }: { data: IssuesUpdateBean; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issue/bulk`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns details of projects, issue types within projects, and, when requested, the create screen fields for each issue type for the user. Use the information to populate the requests in [ Create issue](#api-rest-api-3-issue-post) and [Create issues](#api-rest-api-3-issue-bulk-post). The request can be restricted to specific projects or issue types using the query parameters. The response will contain information for the valid projects, issue types, or project and issue type combinations requested. Note that invalid project, issue type, or project and issue type combinations do not generate errors. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Create issues* [project permission](https://confluence.atlassian.com/x/yodKLg) in the requested projects. + * + * @tags Issues + * @name GetCreateIssueMeta + * @summary Get create issue metadata + * @request GET:/rest/api/3/issue/createmeta + * @secure + */ + getCreateIssueMeta: ({ + query, + params = {}, + }: { + query?: { + /** List of project IDs. This parameter accepts a comma-separated list. Multiple project IDs can also be provided using an ampersand-separated list. For example, `projectIds=10000,10001&projectIds=10020,10021`. This parameter may be provided with `projectKeys`. */ + projectIds?: string[]; + /** List of project keys. This parameter accepts a comma-separated list. Multiple project keys can also be provided using an ampersand-separated list. For example, `projectKeys=proj1,proj2&projectKeys=proj3`. This parameter may be provided with `projectIds`. */ + projectKeys?: string[]; + /** List of issue type IDs. This parameter accepts a comma-separated list. Multiple issue type IDs can also be provided using an ampersand-separated list. For example, `issuetypeIds=10000,10001&issuetypeIds=10020,10021`. This parameter may be provided with `issuetypeNames`. */ + issuetypeIds?: string[]; + /** List of issue type names. This parameter accepts a comma-separated list. Multiple issue type names can also be provided using an ampersand-separated list. For example, `issuetypeNames=name1,name2&issuetypeNames=name3`. This parameter may be provided with `issuetypeIds`. */ + issuetypeNames?: string[]; + /** Use [expand](#expansion) to include additional information about issue metadata in the response. This parameter accepts `projects.issuetypes.fields`, which returns information about the fields in the issue creation screen for each issue type. Fields hidden from the screen are not returned. Use the information to populate the `fields` and `update` fields in [Create issue](#api-rest-api-3-issue-post) and [Create issues](#api-rest-api-3-issue-bulk-post). */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/createmeta`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns lists of issues matching a query string. Use this resource to provide auto-completion suggestions when the user is looking for an issue using a word or string. This operation returns two lists: * `History Search` which includes issues from the user's history of created, edited, or viewed issues that contain the string in the `query` parameter. * `Current Search` which includes issues that match the JQL expression in `currentJQL` and contain the string in the `query` parameter. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. + * + * @tags Issue search + * @name GetIssuePickerResource + * @summary Get issue picker suggestions + * @request GET:/rest/api/3/issue/picker + * @secure + */ + getIssuePickerResource: ({ + query, + params = {}, + }: { + query?: { + /** + * A string to match against text fields in the issue such as title, description, or comments. + * @example "query" + */ + query?: string; + /** A JQL query defining a list of issues to search for the query term. Note that `username` and `userkey` cannot be used as search terms for this parameter, due to privacy reasons. Use `accountId` instead. */ + currentJQL?: string; + /** The key of an issue to exclude from search results. For example, the issue the user is viewing when they perform this query. */ + currentIssueKey?: string; + /** The ID of a project that suggested issues must belong to. */ + currentProjectId?: string; + /** Indicate whether to include subtasks in the suggestions list. */ + showSubTasks?: boolean; + /** When `currentIssueKey` is a subtask, whether to include the parent issue in the suggestions if it matches the query. */ + showSubTaskParent?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/picker`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Sets or updates a list of entity property values on issues. A list of up to 10 entity properties can be specified along with up to 10,000 issues on which to set or update that list of entity properties. The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. The maximum length of single issue property value is 32768 characters. This operation can be accessed anonymously. This operation is: * transactional, either all properties are updated in all eligible issues or, when errors occur, no properties are updated. * [asynchronous](#async). Follow the `location` link in the response to determine the status of the task and use [Get task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. **[Permissions](#permissions) required:** * *Browse projects* and *Edit issues* [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project containing the issue. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue properties + * @name BulkSetIssuesPropertiesList + * @summary Bulk set issues properties by list + * @request POST:/rest/api/3/issue/properties + * @secure + */ + bulkSetIssuesPropertiesList: ({ data, params = {} }: { data: IssueEntityProperties; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issue/properties`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + ...params, + }), + + /** + * @description Sets or updates entity property values on issues. Up to 10 entity properties can be specified for each issue and up to 100 issues included in the request. The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON. This operation is: * [asynchronous](#async). Follow the `location` link in the response to determine the status of the task and use [Get task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. * non-transactional. Updating some entities may fail. Such information will available in the task result. **[Permissions](#permissions) required:** * *Browse projects* and *Edit issues* [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project containing the issue. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue properties + * @name BulkSetIssuePropertiesByIssue + * @summary Bulk set issue properties by issue + * @request POST:/rest/api/3/issue/properties/multi + * @secure + */ + bulkSetIssuePropertiesByIssue: ({ + data, + params = {}, + }: { + data: MultiIssueEntityProperties; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/properties/multi`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + ...params, + }), + + /** + * @description Deletes a property value from multiple issues. The issues to be updated can be specified by filter criteria. The criteria the filter used to identify eligible issues are: * `entityIds` Only issues from this list are eligible. * `currentValue` Only issues with the property set to this value are eligible. If both criteria is specified, they are joined with the logical *AND*: only issues that satisfy both criteria are considered eligible. If no filter criteria are specified, all the issues visible to the user and where the user has the EDIT\_ISSUES permission for the issue are considered eligible. This operation is: * transactional, either the property is deleted from all eligible issues or, when errors occur, no properties are deleted. * [asynchronous](#async). Follow the `location` link in the response to determine the status of the task and use [Get task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. **[Permissions](#permissions) required:** * *Browse projects* [ project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing issues. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * *Edit issues* [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. + * + * @tags Issue properties + * @name BulkDeleteIssueProperty + * @summary Bulk delete issue property + * @request DELETE:/rest/api/3/issue/properties/{propertyKey} + * @secure + */ + bulkDeleteIssueProperty: ({ + propertyKey, + data, + params = {}, + }: { + propertyKey: string; + data: IssueFilterForBulkPropertyDelete; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/properties/${propertyKey}`, + method: "DELETE", + body: data, + secure: true, + type: ContentType.Json, + ...params, + }), + + /** + * @description Sets a property value on multiple issues. The value set can be a constant or determined by a [Jira expression](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/). Expressions must be computable with constant complexity when applied to a set of issues. Expressions must also comply with the [restrictions](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions) that apply to all Jira expressions. The issues to be updated can be specified by a filter. The filter identifies issues eligible for update using these criteria: * `entityIds` Only issues from this list are eligible. * `currentValue` Only issues with the property set to this value are eligible. * `hasProperty`: * If *true*, only issues with the property are eligible. * If *false*, only issues without the property are eligible. If more than one criteria is specified, they are joined with the logical *AND*: only issues that satisfy all criteria are eligible. If an invalid combination of criteria is provided, an error is returned. For example, specifying a `currentValue` and `hasProperty` as *false* would not match any issues (because without the property the property cannot have a value). The filter is optional. Without the filter all the issues visible to the user and where the user has the EDIT\_ISSUES permission for the issue are considered eligible. This operation is: * transactional, either all eligible issues are updated or, when errors occur, none are updated. * [asynchronous](#async). Follow the `location` link in the response to determine the status of the task and use [Get task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for each project containing issues. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * *Edit issues* [project permission](https://confluence.atlassian.com/x/yodKLg) for each issue. + * + * @tags Issue properties + * @name BulkSetIssueProperty + * @summary Bulk set issue property + * @request PUT:/rest/api/3/issue/properties/{propertyKey} + * @secure + */ + bulkSetIssueProperty: ({ + propertyKey, + data, + params = {}, + }: { + propertyKey: string; + data: BulkIssuePropertyUpdateRequest; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/properties/${propertyKey}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + ...params, + }), + + /** + * @description Returns, for the user, details of the watched status of issues from a list. If an issue ID is invalid, the returned watched status is `false`. This operation requires the **Allow users to watch issues** option to be *ON*. This option is set in General configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for details. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue watchers + * @name GetIsWatchingIssueBulk + * @summary Get is watching issue bulk + * @request POST:/rest/api/3/issue/watching + * @secure + */ + getIsWatchingIssueBulk: ({ data, params = {} }: { data: IssueList; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issue/watching`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes an issue. An issue cannot be deleted if it has one or more subtasks. To delete an issue with subtasks, set `deleteSubtasks`. This causes the issue's subtasks to be deleted with the issue. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* and *Delete issues* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the issue. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issues + * @name DeleteIssue + * @summary Delete issue + * @request DELETE:/rest/api/3/issue/{issueIdOrKey} + * @secure + */ + deleteIssue: ({ + issueIdOrKey, + query, + params = {}, + }: { + issueIdOrKey: string; + query?: { + /** + * Whether the issue's subtasks are deleted when the issue is deleted. + * @default "false" + */ + deleteSubtasks?: "true" | "false"; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}`, + method: "DELETE", + query: query, + secure: true, + ...params, + }), + + /** + * @description Returns the details for an issue. The issue is identified by its ID or key, however, if the identifier doesn't match an issue, a case-insensitive search and check for moved issues is performed. If a matching issue is found its details are returned, a 302 or other redirect is **not** returned. The issue key returned in the response is the key of the issue found. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issues + * @name GetIssue + * @summary Get issue + * @request GET:/rest/api/3/issue/{issueIdOrKey} + * @secure + */ + getIssue: ({ + issueIdOrKey, + query, + params = {}, + }: { + issueIdOrKey: string; + query?: { + /** + * A list of fields to return for the issue. This parameter accepts a comma-separated list. Use it to retrieve a subset of fields. Allowed values: + * + * * `*all` Returns all fields. + * * `*navigable` Returns navigable fields. + * * Any issue field, prefixed with a minus to exclude. + * + * Examples: + * + * * `summary,comment` Returns only the summary and comments fields. + * * `-description` Returns all (default) fields except description. + * * `*navigable,-comment` Returns all navigable fields except comment. + * + * This parameter may be specified multiple times. For example, `fields=field1,field2& fields=field3`. + * + * Note: All fields are returned by default. This differs from [Search for issues using JQL (GET)](#api-rest-api-3-search-get) and [Search for issues using JQL (POST)](#api-rest-api-3-search-post) where the default is all navigable fields. + */ + fields?: string[]; + /** + * Whether fields in `fields` are referenced by keys rather than IDs. This parameter is useful where fields have been added by a connect app and a field's key may differ from its ID. + * @default false + */ + fieldsByKeys?: boolean; + /** + * Use [expand](#expansion) to include additional information about the issues in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `renderedFields` Returns field values rendered in HTML format. + * * `names` Returns the display name of each field. + * * `schema` Returns the schema describing a field type. + * * `transitions` Returns all possible transitions for the issue. + * * `editmeta` Returns information about how each field can be edited. + * * `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * * `versionedRepresentations` Returns a JSON array for each version of a field's value, with the highest number representing the most recent version. Note: When included in the request, the `fields` parameter is ignored. + */ + expand?: string; + /** + * A list of issue properties to return for the issue. This parameter accepts a comma-separated list. Allowed values: + * + * * `*all` Returns all issue properties. + * * Any issue property key, prefixed with a minus to exclude. + * + * Examples: + * + * * `*all` Returns all properties. + * * `*all,-prop1` Returns all properties except `prop1`. + * * `prop1,prop2` Returns `prop1` and `prop2` properties. + * + * This parameter may be specified multiple times. For example, `properties=prop1,prop2& properties=prop3`. + */ + properties?: string[]; + /** + * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown under **Projects** in Jira. This also populates the [JQL issues search](#api-rest-api-3-search-get) `lastViewed` field. + * @default false + */ + updateHistory?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Edits an issue. A transition may be applied and issue properties updated as part of the edit. The edits to the issue's fields are defined using `update` and `fields`. The fields that can be edited are determined using [ Get edit issue metadata](#api-rest-api-3-issue-issueIdOrKey-editmeta-get). The parent field may be set by key or ID. For standard issue types, the parent may be removed by setting `update.parent.set.none` to *true*. Note that the `description`, `environment`, and any `textarea` type custom fields (multi-line text fields) take Atlassian Document Format content. Single line custom fields (`textfield`) accept a string and don't handle Atlassian Document Format content. Connect apps having an app user with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg), can override the screen security configuration using `overrideScreenSecurity` and `overrideEditableFlag`. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* and *Edit issues* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issues + * @name EditIssue + * @summary Edit issue + * @request PUT:/rest/api/3/issue/{issueIdOrKey} + * @secure + */ + editIssue: ({ + issueIdOrKey, + data, + query, + params = {}, + }: { + issueIdOrKey: string; + data: IssueUpdateDetails; + query?: { + /** + * Whether a notification email about the issue update is sent to all watchers. To disable the notification, administer Jira or administer project permissions are required. If the user doesn't have the necessary permission the request is ignored. + * @default true + */ + notifyUsers?: boolean; + /** + * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * @default false + */ + overrideScreenSecurity?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * @default false + */ + overrideEditableFlag?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}`, + method: "PUT", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Assigns an issue to a user. Use this operation when the calling user does not have the *Edit Issues* permission but has the *Assign issue* permission for the project that the issue is in. If `name` or `accountId` is set to: * `"-1"`, the issue is assigned to the default assignee for the project. * `null`, the issue is set to unassigned. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse Projects* and *Assign Issues* [ project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issues + * @name AssignIssue + * @summary Assign issue + * @request PUT:/rest/api/3/issue/{issueIdOrKey}/assignee + * @secure + */ + assignIssue: ({ issueIdOrKey, data, params = {} }: { issueIdOrKey: string; data: User; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/assignee`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Adds one or more attachments to an issue. Attachments are posted as multipart/form-data ([RFC 1867](https://www.ietf.org/rfc/rfc1867.txt)). Note that: * The request must have a `X-Atlassian-Token: no-check` header, if not it is blocked. See [Special headers](#special-request-headers) for more information. * The name of the multipart/form-data parameter that contains the attachments must be `file`. The following examples upload a file called *myfile.txt* to the issue *TEST-123*: #### curl #### curl --location --request POST 'https://your-domain.atlassian.net/rest/api/3/issue/TEST-123/attachments' -u 'email@example.com:' -H 'X-Atlassian-Token: no-check' --form 'file=@"myfile.txt"' #### Node.js #### // This code sample uses the 'node-fetch' and 'form-data' libraries: // https://www.npmjs.com/package/node-fetch // https://www.npmjs.com/package/form-data const fetch = require('node-fetch'); const FormData = require('form-data'); const fs = require('fs'); const filePath = 'myfile.txt'; const form = new FormData(); const stats = fs.statSync(filePath); const fileSizeInBytes = stats.size; const fileStream = fs.createReadStream(filePath); form.append('file', fileStream, {knownLength: fileSizeInBytes}); fetch('https://your-domain.atlassian.net/rest/api/3/issue/TEST-123/attachments', { method: 'POST', body: form, headers: { 'Authorization': `Basic ${Buffer.from( 'email@example.com:' ).toString('base64')}`, 'Accept': 'application/json', 'X-Atlassian-Token': 'no-check' } }) .then(response => { console.log( `Response: ${response.status} ${response.statusText}` ); return response.text(); }) .then(text => console.log(text)) .catch(err => console.error(err)); #### Java #### // This code sample uses the 'Unirest' library: // http://unirest.io/java.html HttpResponse response = Unirest.post("https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}/attachments") .basicAuth("email@example.com", "") .header("Accept", "application/json") .header("X-Atlassian-Token", "no-check") .field("file", new File("myfile.txt")) .asJson(); System.out.println(response.getBody()); #### Python #### # This code sample uses the 'requests' library: # http://docs.python-requests.org import requests from requests.auth import HTTPBasicAuth import json url = "https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}/attachments" auth = HTTPBasicAuth("email@example.com", "") headers = { "Accept": "application/json", "X-Atlassian-Token": "no-check" } response = requests.request( "POST", url, headers = headers, auth = auth, files = { "file": ("myfile.txt", open("myfile.txt","rb"), "application-type") } ) print(json.dumps(json.loads(response.text), sort_keys=True, indent=4, separators=(",", ": "))) #### PHP #### // This code sample uses the 'Unirest' library: // http://unirest.io/php.html Unirest\Request::auth('email@example.com', ''); $headers = array( 'Accept' => 'application/json', 'X-Atlassian-Token' => 'no-check' ); $parameters = array( 'file' => File::add('myfile.txt') ); $response = Unirest\Request::post( 'https://your-domain.atlassian.net/rest/api/2/issue/{issueIdOrKey}/attachments', $headers, $parameters ); var_dump($response) #### Forge #### // This sample uses Atlassian Forge and the `form-data` library. // https://developer.atlassian.com/platform/forge/ // https://www.npmjs.com/package/form-data import api from "@forge/api"; import FormData from "form-data"; const form = new FormData(); form.append('file', fileStream, {knownLength: fileSizeInBytes}); const response = await api.asApp().requestJira('/rest/api/2/issue/{issueIdOrKey}/attachments', { method: 'POST', body: form, headers: { 'Accept': 'application/json', 'X-Atlassian-Token': 'no-check' } }); console.log(`Response: ${response.status} ${response.statusText}`); console.log(await response.json()); Tip: Use a client library. Many client libraries have classes for handling multipart POST operations. For example, in Java, the Apache HTTP Components library provides a [MultiPartEntity](http://hc.apache.org/httpcomponents-client-ga/httpmime/apidocs/org/apache/http/entity/mime/MultipartEntity.html) class for multipart POST operations. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse Projects* and *Create attachments* [ project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue attachments + * @name AddAttachment + * @summary Add attachment + * @request POST:/rest/api/3/issue/{issueIdOrKey}/attachments + * @secure + */ + addAttachment: ({ + issueIdOrKey, + data, + params = {}, + }: { + issueIdOrKey: string; + data: File; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/attachments`, + method: "POST", + body: data, + secure: true, + type: ContentType.FormData, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of all changelogs for an issue sorted by date, starting from the oldest. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issues + * @name GetChangeLogs + * @summary Get changelogs + * @request GET:/rest/api/3/issue/{issueIdOrKey}/changelog + * @secure + */ + getChangeLogs: ({ + issueIdOrKey, + query, + params = {}, + }: { + issueIdOrKey: string; + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int32 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 100 + */ + maxResults?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/changelog`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns changelogs for an issue specified by a list of changelog IDs. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issues + * @name GetChangeLogsByIds + * @summary Get changelogs by IDs + * @request POST:/rest/api/3/issue/{issueIdOrKey}/changelog/list + * @secure + */ + getChangeLogsByIds: ({ + issueIdOrKey, + data, + params = {}, + }: { + issueIdOrKey: string; + data: IssueChangelogIds; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/changelog/list`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns all comments for an issue. This operation can be accessed anonymously. **[Permissions](#permissions) required:** Comments are included in the response where the user has: * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the comment. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * If the comment has visibility restrictions, belongs to the group or has the role visibility is role visibility is restricted to. + * + * @tags Issue comments + * @name GetComments + * @summary Get comments + * @request GET:/rest/api/3/issue/{issueIdOrKey}/comment + * @secure + */ + getComments: ({ + issueIdOrKey, + query, + params = {}, + }: { + issueIdOrKey: string; + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 5000 + */ + maxResults?: number; + /** [Order](#ordering) the results by a field. Accepts *created* to sort comments by their created date. */ + orderBy?: "created" | "-created" | "+created"; + /** Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/comment`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Adds a comment to an issue. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* and *Add comments* [ project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue containing the comment is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue comments + * @name AddComment + * @summary Add comment + * @request POST:/rest/api/3/issue/{issueIdOrKey}/comment + * @secure + */ + addComment: ({ + issueIdOrKey, + data, + query, + params = {}, + }: { + issueIdOrKey: string; + data: Comment; + query?: { + /** Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/comment`, + method: "POST", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes a comment. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue containing the comment is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * *Delete all comments*[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any comment or *Delete own comments* to delete comment created by the user, * If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted to. + * + * @tags Issue comments + * @name DeleteComment + * @summary Delete comment + * @request DELETE:/rest/api/3/issue/{issueIdOrKey}/comment/{id} + * @secure + */ + deleteComment: ({ issueIdOrKey, id, params = {} }: { issueIdOrKey: string; id: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/comment/${id}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Returns a comment. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the comment. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted to. + * + * @tags Issue comments + * @name GetComment + * @summary Get comment + * @request GET:/rest/api/3/issue/{issueIdOrKey}/comment/{id} + * @secure + */ + getComment: ({ + issueIdOrKey, + id, + query, + params = {}, + }: { + issueIdOrKey: string; + id: string; + query?: { + /** Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/comment/${id}`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates a comment. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue containing the comment is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * *Edit all comments*[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any comment or *Edit own comments* to update comment created by the user. * If the comment has visibility restrictions, the user belongs to the group or has the role visibility is restricted to. + * + * @tags Issue comments + * @name UpdateComment + * @summary Update comment + * @request PUT:/rest/api/3/issue/{issueIdOrKey}/comment/{id} + * @secure + */ + updateComment: ({ + issueIdOrKey, + id, + data, + query, + params = {}, + }: { + issueIdOrKey: string; + id: string; + data: Comment; + query?: { + /** + * Whether users are notified when a comment is updated. + * @default true + */ + notifyUsers?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with the *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * @default false + */ + overrideEditableFlag?: boolean; + /** Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/comment/${id}`, + method: "PUT", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns the edit screen fields for an issue that are visible to and editable by the user. Use the information to populate the requests in [Edit issue](#api-rest-api-3-issue-issueIdOrKey-put). This endpoint will check for these conditions: 1. Field is available on a field screen - through screen, screen scheme, issue type screen scheme, and issue type scheme configuration. `overrideScreenSecurity=true` skips this condition. 2. Field is visible in the [field configuration](https://support.atlassian.com/jira-cloud-administration/docs/change-a-field-configuration/). `overrideScreenSecurity=true` skips this condition. 3. Field is shown on the issue: each field has different conditions here. For example: Attachment field only shows if attachments are enabled. Assignee only shows if user has permissions to assign the issue. 4. If a field is custom then it must have valid custom field context, applicable for its project and issue type. All system fields are assumed to have context in all projects and all issue types. 5. Issue has a project, issue type, and status defined. 6. Issue is assigned to a valid workflow, and the current status has assigned a workflow step. `overrideEditableFlag=true` skips this condition. 7. The current workflow step is editable. This is true by default, but [can be disabled by setting](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) the `jira.issue.editable` property to `false`. `overrideEditableFlag=true` skips this condition. 8. User has [Edit issues permission](https://support.atlassian.com/jira-cloud-administration/docs/permissions-for-company-managed-projects/). 9. Workflow permissions allow editing a field. This is true by default but [can be modified](https://support.atlassian.com/jira-cloud-administration/docs/use-workflow-properties/) using `jira.permission.*` workflow properties. Fields hidden using [Issue layout settings page](https://support.atlassian.com/jira-software-cloud/docs/configure-field-layout-in-the-issue-view/) remain editable. Connect apps having an app user with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg), and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg), can return additional details using: * `overrideScreenSecurity` When this flag is `true`, then this endpoint skips checking if fields are available through screens, and field configuration (conditions 1. and 2. from the list above). * `overrideEditableFlag` When this flag is `true`, then this endpoint skips checking if workflow is present and if the current step is editable (conditions 6. and 7. from the list above). This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. Note: For any fields to be editable the user must have the *Edit issues* [project permission](https://confluence.atlassian.com/x/yodKLg) for the issue. + * + * @tags Issues + * @name GetEditIssueMeta + * @summary Get edit issue metadata + * @request GET:/rest/api/3/issue/{issueIdOrKey}/editmeta + * @secure + */ + getEditIssueMeta: ({ + issueIdOrKey, + query, + params = {}, + }: { + issueIdOrKey: string; + query?: { + /** + * Whether hidden fields are returned. Available to Connect app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * @default false + */ + overrideScreenSecurity?: boolean; + /** + * Whether non-editable fields are returned. Available to Connect app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * @default false + */ + overrideEditableFlag?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/editmeta`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates an email notification for an issue and adds it to the mail queue. **[Permissions](#permissions) required:** * *Browse Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issues + * @name Notify + * @summary Send notification for issue + * @request POST:/rest/api/3/issue/{issueIdOrKey}/notify + * @secure + */ + notify: ({ + issueIdOrKey, + data, + params = {}, + }: { + issueIdOrKey: string; + data: Notification; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/notify`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns the URLs and keys of an issue's properties. This operation can be accessed anonymously. **[Permissions](#permissions) required:** Property details are only returned where the user has: * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the issue. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue properties + * @name GetIssuePropertyKeys + * @summary Get issue property keys + * @request GET:/rest/api/3/issue/{issueIdOrKey}/properties + * @secure + */ + getIssuePropertyKeys: ({ issueIdOrKey, params = {} }: { issueIdOrKey: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/properties`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes an issue's property. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* and *Edit issues* [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project containing the issue. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue properties + * @name DeleteIssueProperty + * @summary Delete issue property + * @request DELETE:/rest/api/3/issue/{issueIdOrKey}/properties/{propertyKey} + * @secure + */ + deleteIssueProperty: ({ + issueIdOrKey, + propertyKey, + params = {}, + }: { + issueIdOrKey: string; + propertyKey: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/properties/${propertyKey}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Returns the key and value of an issue's property. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the issue. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue properties + * @name GetIssueProperty + * @summary Get issue property + * @request GET:/rest/api/3/issue/{issueIdOrKey}/properties/{propertyKey} + * @secure + */ + getIssueProperty: ({ + issueIdOrKey, + propertyKey, + params = {}, + }: { + issueIdOrKey: string; + propertyKey: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/properties/${propertyKey}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Sets the value of an issue's property. Use this resource to store custom data against an issue. The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The maximum length is 32768 characters. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* and *Edit issues* [project permissions](https://confluence.atlassian.com/x/yodKLg) for the project containing the issue. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue properties + * @name SetIssueProperty + * @summary Set issue property + * @request PUT:/rest/api/3/issue/{issueIdOrKey}/properties/{propertyKey} + * @secure + */ + setIssueProperty: ({ + issueIdOrKey, + propertyKey, + data, + params = {}, + }: { + issueIdOrKey: string; + propertyKey: string; + data: any; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/properties/${propertyKey}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes the remote issue link from the issue using the link's global ID. Where the global ID includes reserved URL characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* and *Link issues* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is implemented, issue-level security permission to view the issue. + * + * @tags Issue remote links + * @name DeleteRemoteIssueLinkByGlobalId + * @summary Delete remote issue link by global ID + * @request DELETE:/rest/api/3/issue/{issueIdOrKey}/remotelink + * @secure + */ + deleteRemoteIssueLinkByGlobalId: ({ + issueIdOrKey, + query, + params = {}, + }: { + issueIdOrKey: string; + query: { + /** + * The global ID of a remote issue link. + * @example "system=http://www.mycompany.com/support&id=1" + */ + globalId: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/remotelink`, + method: "DELETE", + query: query, + secure: true, + ...params, + }), + + /** + * @description Returns the remote issue links for an issue. When a remote issue link global ID is provided the record with that global ID is returned, otherwise all remote issue links are returned. Where a global ID includes reserved URL characters these must be escaped in the request. For example, pass `system=http://www.mycompany.com/support&id=1` as `system%3Dhttp%3A%2F%2Fwww.mycompany.com%2Fsupport%26id%3D1`. This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue remote links + * @name GetRemoteIssueLinks + * @summary Get remote issue links + * @request GET:/rest/api/3/issue/{issueIdOrKey}/remotelink + * @secure + */ + getRemoteIssueLinks: ({ + issueIdOrKey, + query, + params = {}, + }: { + issueIdOrKey: string; + query?: { + /** The global ID of the remote issue link. */ + globalId?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/remotelink`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates or updates a remote issue link for an issue. If a `globalId` is provided and a remote issue link with that global ID is found it is updated. Any fields without values in the request are set to null. Otherwise, the remote issue link is created. This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* and *Link issues* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue remote links + * @name CreateOrUpdateRemoteIssueLink + * @summary Create or update remote issue link + * @request POST:/rest/api/3/issue/{issueIdOrKey}/remotelink + * @secure + */ + createOrUpdateRemoteIssueLink: ({ + issueIdOrKey, + data, + params = {}, + }: { + issueIdOrKey: string; + data: RemoteIssueLinkRequest; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/remotelink`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes a remote issue link from an issue. This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects*, *Edit issues*, and *Link issues* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue remote links + * @name DeleteRemoteIssueLinkById + * @summary Delete remote issue link by ID + * @request DELETE:/rest/api/3/issue/{issueIdOrKey}/remotelink/{linkId} + * @secure + */ + deleteRemoteIssueLinkById: ({ + issueIdOrKey, + linkId, + params = {}, + }: { + issueIdOrKey: string; + linkId: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/remotelink/${linkId}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Returns a remote issue link for an issue. This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue remote links + * @name GetRemoteIssueLinkById + * @summary Get remote issue link by ID + * @request GET:/rest/api/3/issue/{issueIdOrKey}/remotelink/{linkId} + * @secure + */ + getRemoteIssueLinkById: ({ + issueIdOrKey, + linkId, + params = {}, + }: { + issueIdOrKey: string; + linkId: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/remotelink/${linkId}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates a remote issue link for an issue. Note: Fields without values in the request are set to null. This operation requires [issue linking to be active](https://confluence.atlassian.com/x/yoXKM). This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* and *Link issues* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue remote links + * @name UpdateRemoteIssueLink + * @summary Update remote issue link by ID + * @request PUT:/rest/api/3/issue/{issueIdOrKey}/remotelink/{linkId} + * @secure + */ + updateRemoteIssueLink: ({ + issueIdOrKey, + linkId, + data, + params = {}, + }: { + issueIdOrKey: string; + linkId: string; + data: RemoteIssueLinkRequest; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/remotelink/${linkId}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns either all transitions or a transition that can be performed by the user on an issue, based on the issue's status. Note, if a request is made for a transition that does not exist or cannot be performed on the issue, given its status, the response will return any empty transitions list. This operation can be accessed anonymously. **[Permissions](#permissions) required: A list or transition is returned only when the user has:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. However, if the user does not have the *Transition issues* [ project permission](https://confluence.atlassian.com/x/yodKLg) the response will not list any transitions. + * + * @tags Issues + * @name GetTransitions + * @summary Get transitions + * @request GET:/rest/api/3/issue/{issueIdOrKey}/transitions + * @secure + */ + getTransitions: ({ + issueIdOrKey, + query, + params = {}, + }: { + issueIdOrKey: string; + query?: { + /** Use [expand](#expansion) to include additional information about transitions in the response. This parameter accepts `transitions.fields`, which returns information about the fields in the transition screen for each transition. Fields hidden from the screen are not returned. Use this information to populate the `fields` and `update` fields in [Transition issue](#api-rest-api-3-issue-issueIdOrKey-transitions-post). */ + expand?: string; + /** The ID of the transition. */ + transitionId?: string; + /** + * Whether transitions with the condition *Hide From User Condition* are included in the response. + * @default false + */ + skipRemoteOnlyCondition?: boolean; + /** + * Whether details of transitions that fail a condition are included in the response + * @default false + */ + includeUnavailableTransitions?: boolean; + /** + * Whether the transitions are sorted by ops-bar sequence value first then category order (Todo, In Progress, Done) or only by ops-bar sequence value. + * @default false + */ + sortByOpsBarAndStatus?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/transitions`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Performs an issue transition and, if the transition has a screen, updates the fields from the transition screen. sortByCategory To update the fields on the transition screen, specify the fields in the `fields` or `update` parameters in the request body. Get details about the fields using [ Get transitions](#api-rest-api-3-issue-issueIdOrKey-transitions-get) with the `transitions.fields` expand. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* and *Transition issues* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issues + * @name DoTransition + * @summary Transition issue + * @request POST:/rest/api/3/issue/{issueIdOrKey}/transitions + * @secure + */ + doTransition: ({ + issueIdOrKey, + data, + params = {}, + }: { + issueIdOrKey: string; + data: IssueUpdateDetails; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/transitions`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes a user's vote from an issue. This is the equivalent of the user clicking *Unvote* on an issue in Jira. This operation requires the **Allow users to vote on issues** option to be *ON*. This option is set in General configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for details. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue votes + * @name RemoveVote + * @summary Delete vote + * @request DELETE:/rest/api/3/issue/{issueIdOrKey}/votes + * @secure + */ + removeVote: ({ issueIdOrKey, params = {} }: { issueIdOrKey: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/votes`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Returns details about the votes on an issue. This operation requires the **Allow users to vote on issues** option to be *ON*. This option is set in General configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for details. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is ini * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. Note that users with the necessary permissions for this operation but without the *View voters and watchers* project permissions are not returned details in the `voters` field. + * + * @tags Issue votes + * @name GetVotes + * @summary Get votes + * @request GET:/rest/api/3/issue/{issueIdOrKey}/votes + * @secure + */ + getVotes: ({ issueIdOrKey, params = {} }: { issueIdOrKey: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/votes`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Adds the user's vote to an issue. This is the equivalent of the user clicking *Vote* on an issue in Jira. This operation requires the **Allow users to vote on issues** option to be *ON*. This option is set in General configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for details. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue votes + * @name AddVote + * @summary Add vote + * @request POST:/rest/api/3/issue/{issueIdOrKey}/votes + * @secure + */ + addVote: ({ issueIdOrKey, params = {} }: { issueIdOrKey: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/votes`, + method: "POST", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes a user as a watcher of an issue. This operation requires the **Allow users to watch issues** option to be *ON*. This option is set in General configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for details. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * To remove users other than themselves from the watchlist, *Manage watcher list* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + * + * @tags Issue watchers + * @name RemoveWatcher + * @summary Delete watcher + * @request DELETE:/rest/api/3/issue/{issueIdOrKey}/watchers + * @secure + */ + removeWatcher: ({ + issueIdOrKey, + query, + params = {}, + }: { + issueIdOrKey: string; + query?: { + /** This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + username?: string; + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. Required. + * @maxLength 128 + * @example "5b10ac8d82e05b22cc7d4ef5" + */ + accountId?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/watchers`, + method: "DELETE", + query: query, + secure: true, + ...params, + }), + + /** + * @description Returns the watchers for an issue. This operation requires the **Allow users to watch issues** option to be *ON*. This option is set in General configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for details. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is ini * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * To see details of users on the watchlist other than themselves, *View voters and watchers* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + * + * @tags Issue watchers + * @name GetIssueWatchers + * @summary Get issue watchers + * @request GET:/rest/api/3/issue/{issueIdOrKey}/watchers + * @secure + */ + getIssueWatchers: ({ issueIdOrKey, params = {} }: { issueIdOrKey: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/watchers`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Adds a user as a watcher of an issue by passing the account ID of the user. For example, `"5b10ac8d82e05b22cc7d4ef5"`. If no user is specified the calling user is added. This operation requires the **Allow users to watch issues** option to be *ON*. This option is set in General configuration for Jira. See [Configuring Jira application options](https://confluence.atlassian.com/x/uYXKM) for details. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * To add users other than themselves to the watchlist, *Manage watcher list* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. + * + * @tags Issue watchers + * @name AddWatcher + * @summary Add watcher + * @request POST:/rest/api/3/issue/{issueIdOrKey}/watchers + * @secure + */ + addWatcher: ({ issueIdOrKey, data, params = {} }: { issueIdOrKey: string; data: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/watchers`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns worklogs for an issue, starting from the oldest worklog or from the worklog started on or after a date and time. Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). This operation can be accessed anonymously. **[Permissions](#permissions) required:** Workloads are only returned where the user has: * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * + * @tags Issue worklogs + * @name GetIssueWorklog + * @summary Get issue worklogs + * @request GET:/rest/api/3/issue/{issueIdOrKey}/worklog + * @secure + */ + getIssueWorklog: ({ + issueIdOrKey, + query, + params = {}, + }: { + issueIdOrKey: string; + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 5000 + */ + maxResults?: number; + /** + * The worklog start date and time, as a UNIX timestamp in milliseconds, after which worklogs are returned. + * @format int64 + */ + startedAfter?: number; + /** + * The worklog start date and time, as a UNIX timestamp in milliseconds, before which worklogs are returned. + * @format int64 + */ + startedBefore?: number; + /** + * Use [expand](#expansion) to include additional information about worklogs in the response. This parameter accepts`properties`, which returns worklog properties. + * @default "" + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/worklog`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Adds a worklog to an issue. Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* and *Work on issues* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue worklogs + * @name AddWorklog + * @summary Add worklog + * @request POST:/rest/api/3/issue/{issueIdOrKey}/worklog + * @secure + */ + addWorklog: ({ + issueIdOrKey, + data, + query, + params = {}, + }: { + issueIdOrKey: string; + data: Worklog; + query?: { + /** + * Whether users watching the issue are notified by email. + * @default true + */ + notifyUsers?: boolean; + /** + * Defines how to update the issue's time estimate, the options are: + * + * * `new` Sets the estimate to a specific value, defined in `newEstimate`. + * * `leave` Leaves the estimate unchanged. + * * `manual` Reduces the estimate by amount specified in `reduceBy`. + * * `auto` Reduces the estimate by the value of `timeSpent` in the worklog. + * @default "auto" + */ + adjustEstimate?: "new" | "leave" | "manual" | "auto"; + /** The value to set as the issue's remaining time estimate, as days (\#d), hours (\#h), or minutes (\#m or \#). For example, *2d*. Required when `adjustEstimate` is `new`. */ + newEstimate?: string; + /** The amount to reduce the issue's remaining estimate by, as days (\#d), hours (\#h), or minutes (\#m). For example, *2d*. Required when `adjustEstimate` is `manual`. */ + reduceBy?: string; + /** + * Use [expand](#expansion) to include additional information about work logs in the response. This parameter accepts `properties`, which returns worklog properties. + * @default "" + */ + expand?: string; + /** + * Whether the worklog entry should be added to the issue even if the issue is not editable, because jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. + * @default false + */ + overrideEditableFlag?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/worklog`, + method: "POST", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes a worklog from an issue. Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * *Delete all worklogs*[ project permission](https://confluence.atlassian.com/x/yodKLg) to delete any worklog or *Delete own worklogs* to delete worklogs created by the user, * If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * + * @tags Issue worklogs + * @name DeleteWorklog + * @summary Delete worklog + * @request DELETE:/rest/api/3/issue/{issueIdOrKey}/worklog/{id} + * @secure + */ + deleteWorklog: ({ + issueIdOrKey, + id, + query, + params = {}, + }: { + issueIdOrKey: string; + id: string; + query?: { + /** + * Whether users watching the issue are notified by email. + * @default true + */ + notifyUsers?: boolean; + /** + * Defines how to update the issue's time estimate, the options are: + * + * * `new` Sets the estimate to a specific value, defined in `newEstimate`. + * * `leave` Leaves the estimate unchanged. + * * `manual` Increases the estimate by amount specified in `increaseBy`. + * * `auto` Reduces the estimate by the value of `timeSpent` in the worklog. + * @default "auto" + */ + adjustEstimate?: "new" | "leave" | "manual" | "auto"; + /** The value to set as the issue's remaining time estimate, as days (\#d), hours (\#h), or minutes (\#m or \#). For example, *2d*. Required when `adjustEstimate` is `new`. */ + newEstimate?: string; + /** The amount to increase the issue's remaining estimate by, as days (\#d), hours (\#h), or minutes (\#m or \#). For example, *2d*. Required when `adjustEstimate` is `manual`. */ + increaseBy?: string; + /** + * Whether the work log entry should be added to the issue even if the issue is not editable, because jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with admin permission can use this flag. + * @default false + */ + overrideEditableFlag?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/worklog/${id}`, + method: "DELETE", + query: query, + secure: true, + ...params, + }), + + /** + * @description Returns a worklog. Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * + * @tags Issue worklogs + * @name GetWorklog + * @summary Get worklog + * @request GET:/rest/api/3/issue/{issueIdOrKey}/worklog/{id} + * @secure + */ + getWorklog: ({ + issueIdOrKey, + id, + query, + params = {}, + }: { + issueIdOrKey: string; + id: string; + query?: { + /** + * Use [expand](#expansion) to include additional information about work logs in the response. This parameter accepts + * + * `properties`, which returns worklog properties. + * @default "" + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/worklog/${id}`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates a worklog. Time tracking must be enabled in Jira, otherwise this operation returns an error. For more information, see [Configuring time tracking](https://confluence.atlassian.com/x/qoXKM). This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * *Edit all worklogs*[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or *Edit own worklogs* to update worklogs created by the user. * If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * + * @tags Issue worklogs + * @name UpdateWorklog + * @summary Update worklog + * @request PUT:/rest/api/3/issue/{issueIdOrKey}/worklog/{id} + * @secure + */ + updateWorklog: ({ + issueIdOrKey, + id, + data, + query, + params = {}, + }: { + issueIdOrKey: string; + id: string; + data: Worklog; + query?: { + /** + * Whether users watching the issue are notified by email. + * @default true + */ + notifyUsers?: boolean; + /** + * Defines how to update the issue's time estimate, the options are: + * + * * `new` Sets the estimate to a specific value, defined in `newEstimate`. + * * `leave` Leaves the estimate unchanged. + * * `auto` Updates the estimate by the difference between the original and updated value of `timeSpent` or `timeSpentSeconds`. + * @default "auto" + */ + adjustEstimate?: "new" | "leave" | "manual" | "auto"; + /** The value to set as the issue's remaining time estimate, as days (\#d), hours (\#h), or minutes (\#m or \#). For example, *2d*. Required when `adjustEstimate` is `new`. */ + newEstimate?: string; + /** + * Use [expand](#expansion) to include additional information about worklogs in the response. This parameter accepts `properties`, which returns worklog properties. + * @default "" + */ + expand?: string; + /** + * Whether the worklog should be added to the issue even if the issue is not editable. For example, because the issue is closed. Connect and Forge app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. + * @default false + */ + overrideEditableFlag?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/worklog/${id}`, + method: "PUT", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns the keys of all properties for a worklog. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * + * @tags Issue worklog properties + * @name GetWorklogPropertyKeys + * @summary Get worklog property keys + * @request GET:/rest/api/3/issue/{issueIdOrKey}/worklog/{worklogId}/properties + * @secure + */ + getWorklogPropertyKeys: ({ + issueIdOrKey, + worklogId, + params = {}, + }: { + issueIdOrKey: string; + worklogId: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/worklog/${worklogId}/properties`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes a worklog property. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * + * @tags Issue worklog properties + * @name DeleteWorklogProperty + * @summary Delete worklog property + * @request DELETE:/rest/api/3/issue/{issueIdOrKey}/worklog/{worklogId}/properties/{propertyKey} + * @secure + */ + deleteWorklogProperty: ({ + issueIdOrKey, + worklogId, + propertyKey, + params = {}, + }: { + issueIdOrKey: string; + worklogId: string; + propertyKey: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/worklog/${worklogId}/properties/${propertyKey}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Returns the value of a worklog property. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * + * @tags Issue worklog properties + * @name GetWorklogProperty + * @summary Get worklog property + * @request GET:/rest/api/3/issue/{issueIdOrKey}/worklog/{worklogId}/properties/{propertyKey} + * @secure + */ + getWorklogProperty: ({ + issueIdOrKey, + worklogId, + propertyKey, + params = {}, + }: { + issueIdOrKey: string; + worklogId: string; + propertyKey: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/worklog/${worklogId}/properties/${propertyKey}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Sets the value of a worklog property. Use this operation to store custom data against the worklog. The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The maximum length is 32768 characters. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * *Edit all worklogs*[ project permission](https://confluence.atlassian.com/x/yodKLg) to update any worklog or *Edit own worklogs* to update worklogs created by the user. * If the worklog has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * + * @tags Issue worklog properties + * @name SetWorklogProperty + * @summary Set worklog property + * @request PUT:/rest/api/3/issue/{issueIdOrKey}/worklog/{worklogId}/properties/{propertyKey} + * @secure + */ + setWorklogProperty: ({ + issueIdOrKey, + worklogId, + propertyKey, + data, + params = {}, + }: { + issueIdOrKey: string; + worklogId: string; + propertyKey: string; + data: any; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issue/${issueIdOrKey}/worklog/${worklogId}/properties/${propertyKey}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Creates a link between two issues. Use this operation to indicate a relationship between two issues and optionally add a comment to the from (outward) issue. To use this resource the site must have [Issue Linking](https://confluence.atlassian.com/x/yoXKM) enabled. This resource returns nothing on the creation of an issue link. To obtain the ID of the issue link, use `https://your-domain.atlassian.net/rest/api/3/issue/[linked issue key]?fields=issuelinks`. If the link request duplicates a link, the response indicates that the issue link was created. If the request included a comment, the comment is added. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse project* [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the issues to be linked, * *Link issues* [project permission](https://confluence.atlassian.com/x/yodKLg) on the project containing the from (outward) issue, * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. * If the comment has visibility restrictions, belongs to the group or has the role visibility is restricted to. + * + * @tags Issue links + * @name LinkIssues + * @summary Create issue link + * @request POST:/rest/api/3/issueLink + * @secure + */ + linkIssues: ({ data, params = {} }: { data: LinkIssueRequestJsonBean; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issueLink`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes an issue link. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * Browse project [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the issues in the link. * *Link issues* [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one of the projects containing issues in the link. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the issues. + * + * @tags Issue links + * @name DeleteIssueLink + * @summary Delete issue link + * @request DELETE:/rest/api/3/issueLink/{linkId} + * @secure + */ + deleteIssueLink: ({ linkId, params = {} }: { linkId: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issueLink/${linkId}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Returns an issue link. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Browse project* [project permission](https://confluence.atlassian.com/x/yodKLg) for all the projects containing the linked issues. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, permission to view both of the issues. + * + * @tags Issue links + * @name GetIssueLink + * @summary Get issue link + * @request GET:/rest/api/3/issueLink/{linkId} + * @secure + */ + getIssueLink: ({ linkId, params = {} }: { linkId: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issueLink/${linkId}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a list of all issue link types. To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. + * + * @tags Issue link types + * @name GetIssueLinkTypes + * @summary Get issue link types + * @request GET:/rest/api/3/issueLinkType + * @secure + */ + getIssueLinkTypes: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issueLinkType`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates an issue link type. Use this operation to create descriptions of the reasons why issues are linked. The issue link type consists of a name and descriptions for a link's inward and outward relationships. To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue link types + * @name CreateIssueLinkType + * @summary Create issue link type + * @request POST:/rest/api/3/issueLinkType + * @secure + */ + createIssueLinkType: ({ data, params = {} }: { data: IssueLinkType; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issueLinkType`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes an issue link type. To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue link types + * @name DeleteIssueLinkType + * @summary Delete issue link type + * @request DELETE:/rest/api/3/issueLinkType/{issueLinkTypeId} + * @secure + */ + deleteIssueLinkType: ({ issueLinkTypeId, params = {} }: { issueLinkTypeId: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issueLinkType/${issueLinkTypeId}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Returns an issue link type. To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for a project in the site. + * + * @tags Issue link types + * @name GetIssueLinkType + * @summary Get issue link type + * @request GET:/rest/api/3/issueLinkType/{issueLinkTypeId} + * @secure + */ + getIssueLinkType: ({ issueLinkTypeId, params = {} }: { issueLinkTypeId: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issueLinkType/${issueLinkTypeId}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates an issue link type. To use this operation, the site must have [issue linking](https://confluence.atlassian.com/x/yoXKM) enabled. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue link types + * @name UpdateIssueLinkType + * @summary Update issue link type + * @request PUT:/rest/api/3/issueLinkType/{issueLinkTypeId} + * @secure + */ + updateIssueLinkType: ({ + issueLinkTypeId, + data, + params = {}, + }: { + issueLinkTypeId: string; + data: IssueLinkType; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issueLinkType/${issueLinkTypeId}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns all [issue security schemes](https://confluence.atlassian.com/x/J4lKLg). **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue security schemes + * @name GetIssueSecuritySchemes + * @summary Get issue security schemes + * @request GET:/rest/api/3/issuesecurityschemes + * @secure + */ + getIssueSecuritySchemes: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issuesecurityschemes`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns an issue security scheme along with its security levels. **[Permissions](#permissions) required:** * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for a project that uses the requested issue security scheme. + * + * @tags Issue security schemes + * @name GetIssueSecurityScheme + * @summary Get issue security scheme + * @request GET:/rest/api/3/issuesecurityschemes/{id} + * @secure + */ + getIssueSecurityScheme: ({ id, params = {} }: { id: number; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issuesecurityschemes/${id}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns issue security level members. Only issue security level members in context of classic projects are returned. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue security level + * @name GetIssueSecurityLevelMembers + * @summary Get issue security level members + * @request GET:/rest/api/3/issuesecurityschemes/{issueSecuritySchemeId}/members + * @secure + */ + getIssueSecurityLevelMembers: ({ + issueSecuritySchemeId, + query, + params = {}, + }: { + issueSecuritySchemeId: number; + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * The list of issue security level IDs. To include multiple issue security levels separate IDs with ampersand: `issueSecurityLevelId=10000&issueSecurityLevelId=10001`. + * @uniqueItems true + */ + issueSecurityLevelId?: number[]; + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `all` Returns all expandable information. + * * `field` Returns information about the custom field granted the permission. + * * `group` Returns information about the group that is granted the permission. + * * `projectRole` Returns information about the project role granted the permission. + * * `user` Returns information about the user who is granted the permission. + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuesecurityschemes/${issueSecuritySchemeId}/members`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns all issue types. This operation can be accessed anonymously. **[Permissions](#permissions) required:** Issue types are only returned as follows: * if the user has the *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg), all issue types are returned. * if the user has the *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, the issue types associated with the projects the user has permission to browse are returned. + * + * @tags Issue types + * @name GetIssueAllTypes + * @summary Get all issue types for user + * @request GET:/rest/api/3/issuetype + * @secure + */ + getIssueAllTypes: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issuetype`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates an issue type and adds it to the default issue type scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue types + * @name CreateIssueType + * @summary Create issue type + * @request POST:/rest/api/3/issuetype + * @secure + */ + createIssueType: ({ data, params = {} }: { data: IssueTypeCreateBean; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issuetype`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns issue types for a project. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) in the relevant project or *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue types + * @name GetIssueTypesForProject + * @summary Get issue types for project + * @request GET:/rest/api/3/issuetype/project + * @secure + */ + getIssueTypesForProject: ({ + query, + params = {}, + }: { + query: { + /** + * The ID of the project. + * @format int64 + */ + projectId: number; + /** + * The level of the issue type to filter by. Use: + * + * * `-1` for Subtask. + * * `0` for Base. + * * `1` for Epic. + * @format int32 + */ + level?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetype/project`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes the issue type. If the issue type is in use, all uses are updated with the alternative issue type (`alternativeIssueTypeId`). A list of alternative issue types are obtained from the [Get alternative issue types](#api-rest-api-3-issuetype-id-alternatives-get) resource. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue types + * @name DeleteIssueType + * @summary Delete issue type + * @request DELETE:/rest/api/3/issuetype/{id} + * @secure + */ + deleteIssueType: ({ + id, + query, + params = {}, + }: { + id: string; + query?: { + /** The ID of the replacement issue type. */ + alternativeIssueTypeId?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetype/${id}`, + method: "DELETE", + query: query, + secure: true, + ...params, + }), + + /** + * @description Returns an issue type. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) in a project the issue type is associated with or *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue types + * @name GetIssueType + * @summary Get issue type + * @request GET:/rest/api/3/issuetype/{id} + * @secure + */ + getIssueType: ({ id, params = {} }: { id: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issuetype/${id}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates the issue type. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue types + * @name UpdateIssueType + * @summary Update issue type + * @request PUT:/rest/api/3/issuetype/{id} + * @secure + */ + updateIssueType: ({ id, data, params = {} }: { id: string; data: IssueTypeUpdateBean; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issuetype/${id}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a list of issue types that can be used to replace the issue type. The alternative issue types are those assigned to the same workflow scheme, field configuration scheme, and screen scheme. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. + * + * @tags Issue types + * @name GetAlternativeIssueTypes + * @summary Get alternative issue types + * @request GET:/rest/api/3/issuetype/{id}/alternatives + * @secure + */ + getAlternativeIssueTypes: ({ id, params = {} }: { id: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issuetype/${id}/alternatives`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Loads an avatar for the issue type. Specify the avatar's local file location in the body of the request. Also, include the following headers: * `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special Headers](#special-request-headers). * `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. For example: `curl --request POST \ --user email@example.com: \ --header 'X-Atlassian-Token: no-check' \ --header 'Content-Type: image/< image_type>' \ --data-binary "<@/path/to/file/with/your/avatar>" \ --url 'https://your-domain.atlassian.net/rest/api/3/issuetype/{issueTypeId}'This` The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of the image. The length of the square's sides is set to the smaller of the height or width of the image. The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. After creating the avatar, use [ Update issue type](#api-rest-api-3-issuetype-id-put) to set it as the issue type's displayed avatar. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue types + * @name CreateIssueTypeAvatar + * @summary Load issue type avatar + * @request POST:/rest/api/3/issuetype/{id}/avatar2 + * @secure + */ + createIssueTypeAvatar: ({ + id, + query, + data, + params = {}, + }: { + id: string; + query: { + /** + * The X coordinate of the top-left corner of the crop region. + * @format int32 + * @default 0 + */ + x?: number; + /** + * The Y coordinate of the top-left corner of the crop region. + * @format int32 + * @default 0 + */ + y?: number; + /** + * The length of each side of the crop region. + * @format int32 + */ + size: number; + }; + data: any; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetype/${id}/avatar2`, + method: "POST", + query: query, + body: data, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns all the [issue type property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) keys of the issue type. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the property keys of any issue type. * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) to get the property keys of any issue types associated with the projects the user has permission to browse. + * + * @tags Issue type properties + * @name GetIssueTypePropertyKeys + * @summary Get issue type property keys + * @request GET:/rest/api/3/issuetype/{issueTypeId}/properties + * @secure + */ + getIssueTypePropertyKeys: ({ issueTypeId, params = {} }: { issueTypeId: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issuetype/${issueTypeId}/properties`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes the [issue type property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue type properties + * @name DeleteIssueTypeProperty + * @summary Delete issue type property + * @request DELETE:/rest/api/3/issuetype/{issueTypeId}/properties/{propertyKey} + * @secure + */ + deleteIssueTypeProperty: ({ + issueTypeId, + propertyKey, + params = {}, + }: { + issueTypeId: string; + propertyKey: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetype/${issueTypeId}/properties/${propertyKey}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Returns the key and value of the [issue type property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) to get the details of any issue type. * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) to get the details of any issue types associated with the projects the user has permission to browse. + * + * @tags Issue type properties + * @name GetIssueTypeProperty + * @summary Get issue type property + * @request GET:/rest/api/3/issuetype/{issueTypeId}/properties/{propertyKey} + * @secure + */ + getIssueTypeProperty: ({ + issueTypeId, + propertyKey, + params = {}, + }: { + issueTypeId: string; + propertyKey: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetype/${issueTypeId}/properties/${propertyKey}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates or updates the value of the [issue type property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). Use this resource to store and update data against an issue type. The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The maximum length is 32768 characters. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue type properties + * @name SetIssueTypeProperty + * @summary Set issue type property + * @request PUT:/rest/api/3/issuetype/{issueTypeId}/properties/{propertyKey} + * @secure + */ + setIssueTypeProperty: ({ + issueTypeId, + propertyKey, + data, + params = {}, + }: { + issueTypeId: string; + propertyKey: string; + data: any; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetype/${issueTypeId}/properties/${propertyKey}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of issue type schemes. Only issue type schemes used in classic projects are returned. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue type schemes + * @name GetAllIssueTypeSchemes + * @summary Get all issue type schemes + * @request GET:/rest/api/3/issuetypescheme + * @secure + */ + getAllIssueTypeSchemes: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * The list of issue type schemes IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + * @uniqueItems true + */ + id?: number[]; + /** + * [Order](#ordering) the results by a field: + * + * * `name` Sorts by issue type scheme name. + * * `id` Sorts by issue type scheme ID. + * @default "id" + */ + orderBy?: "name" | "-name" | "+name" | "id" | "-id" | "+id"; + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `projects` For each issue type schemes, returns information about the projects the issue type scheme is assigned to. + * * `issueTypes` For each issue type schemes, returns information about the issueTypes the issue type scheme have. + * @default "" + */ + expand?: string; + /** + * String used to perform a case-insensitive partial match with issue type scheme name. + * @default "" + */ + queryString?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetypescheme`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates an issue type scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue type schemes + * @name CreateIssueTypeScheme + * @summary Create issue type scheme + * @request POST:/rest/api/3/issuetypescheme + * @secure + */ + createIssueTypeScheme: ({ data, params = {} }: { data: IssueTypeSchemeDetails; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/issuetypescheme`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of issue type scheme items. Only issue type scheme items used in classic projects are returned. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue type schemes + * @name GetIssueTypeSchemesMapping + * @summary Get issue type scheme items + * @request GET:/rest/api/3/issuetypescheme/mapping + * @secure + */ + getIssueTypeSchemesMapping: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * The list of issue type scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, `issueTypeSchemeId=10000&issueTypeSchemeId=10001`. + * @uniqueItems true + */ + issueTypeSchemeId?: number[]; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetypescheme/mapping`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of issue type schemes and, for each issue type scheme, a list of the projects that use it. Only issue type schemes used in classic projects are returned. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue type schemes + * @name GetIssueTypeSchemeForProjects + * @summary Get issue type schemes for projects + * @request GET:/rest/api/3/issuetypescheme/project + * @secure + */ + getIssueTypeSchemeForProjects: ({ + query, + params = {}, + }: { + query: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * The list of project IDs. To include multiple project IDs, provide an ampersand-separated list. For example, `projectId=10000&projectId=10001`. + * @uniqueItems true + */ + projectId: number[]; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetypescheme/project`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Assigns an issue type scheme to a project. If any issues in the project are assigned issue types not present in the new scheme, the operation will fail. To complete the assignment those issues must be updated to use issue types in the new scheme. Issue type schemes can only be assigned to classic projects. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue type schemes + * @name AssignIssueTypeSchemeToProject + * @summary Assign issue type scheme to project + * @request PUT:/rest/api/3/issuetypescheme/project + * @secure + */ + assignIssueTypeSchemeToProject: ({ + data, + params = {}, + }: { + data: IssueTypeSchemeProjectAssociation; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetypescheme/project`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes an issue type scheme. Only issue type schemes used in classic projects can be deleted. Any projects assigned to the scheme are reassigned to the default issue type scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue type schemes + * @name DeleteIssueTypeScheme + * @summary Delete issue type scheme + * @request DELETE:/rest/api/3/issuetypescheme/{issueTypeSchemeId} + * @secure + */ + deleteIssueTypeScheme: ({ + issueTypeSchemeId, + params = {}, + }: { + issueTypeSchemeId: number; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetypescheme/${issueTypeSchemeId}`, + method: "DELETE", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates an issue type scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue type schemes + * @name UpdateIssueTypeScheme + * @summary Update issue type scheme + * @request PUT:/rest/api/3/issuetypescheme/{issueTypeSchemeId} + * @secure + */ + updateIssueTypeScheme: ({ + issueTypeSchemeId, + data, + params = {}, + }: { + issueTypeSchemeId: number; + data: IssueTypeSchemeUpdateDetails; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetypescheme/${issueTypeSchemeId}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Adds issue types to an issue type scheme. The added issue types are appended to the issue types list. If any of the issue types exist in the issue type scheme, the operation fails and no issue types are added. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue type schemes + * @name AddIssueTypesToIssueTypeScheme + * @summary Add issue types to issue type scheme + * @request PUT:/rest/api/3/issuetypescheme/{issueTypeSchemeId}/issuetype + * @secure + */ + addIssueTypesToIssueTypeScheme: ({ + issueTypeSchemeId, + data, + params = {}, + }: { + issueTypeSchemeId: number; + data: IssueTypeIds; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetypescheme/${issueTypeSchemeId}/issuetype`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Changes the order of issue types in an issue type scheme. The request body parameters must meet the following requirements: * all of the issue types must belong to the issue type scheme. * either `after` or `position` must be provided. * the issue type in `after` must not be in the issue type list. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue type schemes + * @name ReorderIssueTypesInIssueTypeScheme + * @summary Change order of issue types + * @request PUT:/rest/api/3/issuetypescheme/{issueTypeSchemeId}/issuetype/move + * @secure + */ + reorderIssueTypesInIssueTypeScheme: ({ + issueTypeSchemeId, + data, + params = {}, + }: { + issueTypeSchemeId: number; + data: OrderOfIssueTypes; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetypescheme/${issueTypeSchemeId}/issuetype/move`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Removes an issue type from an issue type scheme. This operation cannot remove: * any issue type used by issues. * any issue types from the default issue type scheme. * the last standard issue type from an issue type scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue type schemes + * @name RemoveIssueTypeFromIssueTypeScheme + * @summary Remove issue type from issue type scheme + * @request DELETE:/rest/api/3/issuetypescheme/{issueTypeSchemeId}/issuetype/{issueTypeId} + * @secure + */ + removeIssueTypeFromIssueTypeScheme: ({ + issueTypeSchemeId, + issueTypeId, + params = {}, + }: { + issueTypeSchemeId: number; + issueTypeId: number; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetypescheme/${issueTypeSchemeId}/issuetype/${issueTypeId}`, + method: "DELETE", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of issue type screen schemes. Only issue type screen schemes used in classic projects are returned. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue type screen schemes + * @name GetIssueTypeScreenSchemes + * @summary Get issue type screen schemes + * @request GET:/rest/api/3/issuetypescreenscheme + * @secure + */ + getIssueTypeScreenSchemes: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * The list of issue type screen scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + * @uniqueItems true + */ + id?: number[]; + /** + * String used to perform a case-insensitive partial match with issue type screen scheme name. + * @default "" + */ + queryString?: string; + /** + * [Order](#ordering) the results by a field: + * + * * `name` Sorts by issue type screen scheme name. + * * `id` Sorts by issue type screen scheme ID. + * @default "id" + */ + orderBy?: "name" | "-name" | "+name" | "id" | "-id" | "+id"; + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts `projects` that, for each issue type screen schemes, returns information about the projects the issue type screen scheme is assigned to. + * @default "" + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetypescreenscheme`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates an issue type screen scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue type screen schemes + * @name CreateIssueTypeScreenScheme + * @summary Create issue type screen scheme + * @request POST:/rest/api/3/issuetypescreenscheme + * @secure + */ + createIssueTypeScreenScheme: ({ + data, + params = {}, + }: { + data: IssueTypeScreenSchemeDetails; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetypescreenscheme`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of issue type screen scheme items. Only issue type screen schemes used in classic projects are returned. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue type screen schemes + * @name GetIssueTypeScreenSchemeMappings + * @summary Get issue type screen scheme items + * @request GET:/rest/api/3/issuetypescreenscheme/mapping + * @secure + */ + getIssueTypeScreenSchemeMappings: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * The list of issue type screen scheme IDs. To include multiple issue type screen schemes, separate IDs with ampersand: `issueTypeScreenSchemeId=10000&issueTypeScreenSchemeId=10001`. + * @uniqueItems true + */ + issueTypeScreenSchemeId?: number[]; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetypescreenscheme/mapping`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of issue type screen schemes and, for each issue type screen scheme, a list of the projects that use it. Only issue type screen schemes used in classic projects are returned. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue type screen schemes + * @name GetIssueTypeScreenSchemeProjectAssociations + * @summary Get issue type screen schemes for projects + * @request GET:/rest/api/3/issuetypescreenscheme/project + * @secure + */ + getIssueTypeScreenSchemeProjectAssociations: ({ + query, + params = {}, + }: { + query: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * The list of project IDs. To include multiple projects, separate IDs with ampersand: `projectId=10000&projectId=10001`. + * @uniqueItems true + */ + projectId: number[]; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetypescreenscheme/project`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Assigns an issue type screen scheme to a project. Issue type screen schemes can only be assigned to classic projects. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue type screen schemes + * @name AssignIssueTypeScreenSchemeToProject + * @summary Assign issue type screen scheme to project + * @request PUT:/rest/api/3/issuetypescreenscheme/project + * @secure + */ + assignIssueTypeScreenSchemeToProject: ({ + data, + params = {}, + }: { + data: IssueTypeScreenSchemeProjectAssociation; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetypescreenscheme/project`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes an issue type screen scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue type screen schemes + * @name DeleteIssueTypeScreenScheme + * @summary Delete issue type screen scheme + * @request DELETE:/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId} + * @secure + */ + deleteIssueTypeScreenScheme: ({ + issueTypeScreenSchemeId, + params = {}, + }: { + issueTypeScreenSchemeId: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetypescreenscheme/${issueTypeScreenSchemeId}`, + method: "DELETE", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates an issue type screen scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue type screen schemes + * @name UpdateIssueTypeScreenScheme + * @summary Update issue type screen scheme + * @request PUT:/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId} + * @secure + */ + updateIssueTypeScreenScheme: ({ + issueTypeScreenSchemeId, + data, + params = {}, + }: { + issueTypeScreenSchemeId: string; + data: IssueTypeScreenSchemeUpdateDetails; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetypescreenscheme/${issueTypeScreenSchemeId}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Appends issue type to screen scheme mappings to an issue type screen scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue type screen schemes + * @name AppendMappingsForIssueTypeScreenScheme + * @summary Append mappings to issue type screen scheme + * @request PUT:/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId}/mapping + * @secure + */ + appendMappingsForIssueTypeScreenScheme: ({ + issueTypeScreenSchemeId, + data, + params = {}, + }: { + issueTypeScreenSchemeId: string; + data: IssueTypeScreenSchemeMappingDetails; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetypescreenscheme/${issueTypeScreenSchemeId}/mapping`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Updates the default screen scheme of an issue type screen scheme. The default screen scheme is used for all unmapped issue types. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue type screen schemes + * @name UpdateDefaultScreenScheme + * @summary Update issue type screen scheme default screen scheme + * @request PUT:/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId}/mapping/default + * @secure + */ + updateDefaultScreenScheme: ({ + issueTypeScreenSchemeId, + data, + params = {}, + }: { + issueTypeScreenSchemeId: string; + data: UpdateDefaultScreenScheme; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetypescreenscheme/${issueTypeScreenSchemeId}/mapping/default`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Removes issue type to screen scheme mappings from an issue type screen scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue type screen schemes + * @name RemoveMappingsFromIssueTypeScreenScheme + * @summary Remove mappings from issue type screen scheme + * @request POST:/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId}/mapping/remove + * @secure + */ + removeMappingsFromIssueTypeScreenScheme: ({ + issueTypeScreenSchemeId, + data, + params = {}, + }: { + issueTypeScreenSchemeId: string; + data: IssueTypeIds; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetypescreenscheme/${issueTypeScreenSchemeId}/mapping/remove`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of projects associated with an issue type screen scheme. Only company-managed projects associated with an issue type screen scheme are returned. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue type screen schemes + * @name GetProjectsForIssueTypeScreenScheme + * @summary Get issue type screen scheme projects + * @request GET:/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId}/project + * @secure + */ + getProjectsForIssueTypeScreenScheme: ({ + issueTypeScreenSchemeId, + query, + params = {}, + }: { + issueTypeScreenSchemeId: number; + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** @default "" */ + query?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/issuetypescreenscheme/${issueTypeScreenSchemeId}/project`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns reference data for JQL searches. This is a downloadable version of the documentation provided in [Advanced searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of JQL-reserved words. Use this information to assist with the programmatic creation of JQL queries or the validation of queries built in a custom query builder. To filter visible field details by project or collapse non-unique fields by field type then [Get field reference data (POST)](#api-rest-api-3-jql-autocompletedata-post) can be used. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. + * + * @tags JQL + * @name GetAutoComplete + * @summary Get field reference data (GET) + * @request GET:/rest/api/3/jql/autocompletedata + * @secure + */ + getAutoComplete: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/jql/autocompletedata`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns reference data for JQL searches. This is a downloadable version of the documentation provided in [Advanced searching - fields reference](https://confluence.atlassian.com/x/gwORLQ) and [Advanced searching - functions reference](https://confluence.atlassian.com/x/hgORLQ), along with a list of JQL-reserved words. Use this information to assist with the programmatic creation of JQL queries or the validation of queries built in a custom query builder. This operation can filter the custom fields returned by project. Invalid project IDs in `projectIds` are ignored. System fields are always returned. It can also return the collapsed field for custom fields. Collapsed fields enable searches to be performed across all fields with the same name and of the same field type. For example, the collapsed field `Component - Component[Dropdown]` enables dropdown fields `Component - cf[10061]` and `Component - cf[10062]` to be searched simultaneously. **[Permissions](#permissions) required:** None. + * + * @tags JQL + * @name GetAutoCompletePost + * @summary Get field reference data (POST) + * @request POST:/rest/api/3/jql/autocompletedata + * @secure + */ + getAutoCompletePost: ({ data, params = {} }: { data: SearchAutoCompleteFilter; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/jql/autocompletedata`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns the JQL search auto complete suggestions for a field. Suggestions can be obtained by providing: * `fieldName` to get a list of all values for the field. * `fieldName` and `fieldValue` to get a list of values containing the text in `fieldValue`. * `fieldName` and `predicateName` to get a list of all predicate values for the field. * `fieldName`, `predicateName`, and `predicateValue` to get a list of predicate values containing the text in `predicateValue`. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. + * + * @tags JQL + * @name GetFieldAutoCompleteForQueryString + * @summary Get field auto complete suggestions + * @request GET:/rest/api/3/jql/autocompletedata/suggestions + * @secure + */ + getFieldAutoCompleteForQueryString: ({ + query, + params = {}, + }: { + query?: { + /** + * The name of the field. + * @example "reporter" + */ + fieldName?: string; + /** The partial field item name entered by the user. */ + fieldValue?: string; + /** The name of the [ CHANGED operator predicate](https://confluence.atlassian.com/x/hQORLQ#Advancedsearching-operatorsreference-CHANGEDCHANGED) for which the suggestions are generated. The valid predicate operators are *by*, *from*, and *to*. */ + predicateName?: string; + /** The partial predicate item name entered by the user. */ + predicateValue?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/jql/autocompletedata/suggestions`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * No description + * + * @name GetPrecomputations + * @summary Get precomputation + * @request GET:/rest/api/3/jql/function/computation + * @secure + */ + getPrecomputations: ({ + query, + params = {}, + }: { + query?: { + functionKey?: string[]; + /** + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * @format int32 + * @default 5000 + */ + maxResults?: number; + orderBy?: string; + filter?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/jql/function/computation`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * No description + * + * @name UpdatePrecomputations + * @summary Update precomputations + * @request POST:/rest/api/3/jql/function/computation + * @secure + */ + updatePrecomputations: ({ + data, + params = {}, + }: { + data: JqlFunctionPrecomputationUpdateRequestBean; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/jql/function/computation`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Checks whether one or more issues would be returned by one or more JQL queries. **[Permissions](#permissions) required:** None, however, issues are only matched against JQL queries where the user has: * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that the issue is in. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue search + * @name MatchIssues + * @summary Check issues against JQL + * @request POST:/rest/api/3/jql/match + * @secure + */ + matchIssues: ({ data, params = {} }: { data: IssuesAndJQLQueries; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/jql/match`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Parses and validates JQL queries. Validation is performed in context of the current user. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. + * + * @tags JQL + * @name ParseJqlQueries + * @summary Parse JQL query + * @request POST:/rest/api/3/jql/parse + * @secure + */ + parseJqlQueries: ({ + data, + query, + params = {}, + }: { + data: JqlQueriesToParse; + query?: { + /** + * How to validate the JQL query and treat the validation results. Validation options include: + * + * * `strict` Returns all errors. If validation fails, the query structure is not returned. + * * `warn` Returns all errors. If validation fails but the JQL query is correctly formed, the query structure is returned. + * * `none` No validation is performed. If JQL query is correctly formed, the query structure is returned. + * @default "strict" + */ + validation?: "strict" | "warn" | "none"; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/jql/parse`, + method: "POST", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Converts one or more JQL queries with user identifiers (username or user key) to equivalent JQL queries with account IDs. You may wish to use this operation if your system stores JQL queries and you want to make them GDPR-compliant. For more information about GDPR-related changes, see the [migration guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/). **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags JQL + * @name MigrateQueries + * @summary Convert user identifiers to account IDs in JQL queries + * @request POST:/rest/api/3/jql/pdcleaner + * @secure + */ + migrateQueries: ({ data, params = {} }: { data: JQLPersonalDataMigrationRequest; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/jql/pdcleaner`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Sanitizes one or more JQL queries by converting readable details into IDs where a user doesn't have permission to view the entity. For example, if the query contains the clause *project = 'Secret project'*, and a user does not have browse permission for the project "Secret project", the sanitized query replaces the clause with *project = 12345"* (where 12345 is the ID of the project). If a user has the required permission, the clause is not sanitized. If the account ID is null, sanitizing is performed for an anonymous user. Note that sanitization doesn't make the queries GDPR-compliant, because it doesn't remove user identifiers (username or user key). If you need to make queries GDPR-compliant, use [Convert user identifiers to account IDs in JQL queries](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-jql/#api-rest-api-3-jql-sanitize-post). Before sanitization each JQL query is parsed. The queries are returned in the same order that they were passed. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags JQL + * @name SanitiseJqlQueries + * @summary Sanitize JQL queries + * @request POST:/rest/api/3/jql/sanitize + * @secure + */ + sanitiseJqlQueries: ({ data, params = {} }: { data: JqlQueriesToSanitize; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/jql/sanitize`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of labels. + * + * @tags Labels + * @name GetAllLabels + * @summary Get all labels + * @request GET:/rest/api/3/label + * @secure + */ + getAllLabels: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 1000 + */ + maxResults?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/label`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the total approximate user account across all jira licenced application keys. Please note this information is cached with a 7-day lifecycle and could be stale at the time of call. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags License metrics + * @name GetApproximateLicenseCount + * @summary Get approximate license count + * @request GET:/rest/api/3/license/approximateLicenseCount + * @secure + */ + getApproximateLicenseCount: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/license/approximateLicenseCount`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the total approximate user account for a specific `jira licence application key`. Please note this information is cached with a 7-day lifecycle and could be stale at the time of call. #### Application Key #### An application key represents a specific version of Jira. See \{@link ApplicationKey\} for details **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags License metrics + * @name GetApproximateApplicationLicenseCount + * @summary Get approximate application license count + * @request GET:/rest/api/3/license/approximateLicenseCount/product/{applicationKey} + * @secure + */ + getApproximateApplicationLicenseCount: ({ + applicationKey, + params = {}, + }: { + applicationKey: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/license/approximateLicenseCount/product/${applicationKey}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a list of permissions indicating which permissions the user has. Details of the user's permissions can be obtained in a global, project, issue or comment context. The user is reported as having a project permission: * in the global context, if the user has the project permission in any project. * for a project, where the project permission is determined using issue data, if the user meets the permission's criteria for any issue in the project. Otherwise, if the user has the project permission in the project. * for an issue, where a project permission is determined using issue data, if the user has the permission in the issue. Otherwise, if the user has the project permission in the project containing the issue. * for a comment, where the user has both the permission to browse the comment and the project permission for the comment's parent issue. Only the BROWSE\_PROJECTS permission is supported. If a `commentId` is provided whose `permissions` does not equal BROWSE\_PROJECTS, a 400 error will be returned. This means that users may be shown as having an issue permission (such as EDIT\_ISSUES) in the global context or a project context but may not have the permission for any or all issues. For example, if Reporters have the EDIT\_ISSUES permission a user would be shown as having this permission in the global context or the context of a project, because any user can be a reporter. However, if they are not the user who reported the issue queried they would not have EDIT\_ISSUES permission for that issue. Global permissions are unaffected by context. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. + * + * @tags Permissions + * @name GetMyPermissions + * @summary Get my permissions + * @request GET:/rest/api/3/mypermissions + * @secure + */ + getMyPermissions: ({ + query, + params = {}, + }: { + query?: { + /** The key of project. Ignored if `projectId` is provided. */ + projectKey?: string; + /** The ID of project. */ + projectId?: string; + /** The key of the issue. Ignored if `issueId` is provided. */ + issueKey?: string; + /** The ID of the issue. */ + issueId?: string; + /** + * A list of permission keys. (Required) This parameter accepts a comma-separated list. To get the list of available permissions, use [Get all permissions](#api-rest-api-3-permissions-get). + * @example "BROWSE_PROJECTS,EDIT_ISSUES" + */ + permissions?: string; + projectUuid?: string; + projectConfigurationUuid?: string; + /** The ID of the comment. */ + commentId?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/mypermissions`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes a preference of the user, which restores the default value of system defined settings. Note that these keys are deprecated: * *jira.user.locale* The locale of the user. By default, not set. The user takes the instance locale. * *jira.user.timezone* The time zone of the user. By default, not set. The user takes the instance timezone. Use [ Update a user profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) from the user management REST API to manage timezone and locale instead. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Myself + * @name RemovePreference + * @summary Delete preference + * @request DELETE:/rest/api/3/mypreferences + * @secure + */ + removePreference: ({ + query, + params = {}, + }: { + query: { + /** The key of the preference. */ + key: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/mypreferences`, + method: "DELETE", + query: query, + secure: true, + ...params, + }), + + /** + * @description Returns the value of a preference of the current user. Note that these keys are deprecated: * *jira.user.locale* The locale of the user. By default this is not set and the user takes the locale of the instance. * *jira.user.timezone* The time zone of the user. By default this is not set and the user takes the timezone of the instance. Use [ Update a user profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) from the user management REST API to manage timezone and locale instead. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Myself + * @name GetPreference + * @summary Get preference + * @request GET:/rest/api/3/mypreferences + * @secure + */ + getPreference: ({ + query, + params = {}, + }: { + query: { + /** The key of the preference. */ + key: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/mypreferences`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates a preference for the user or updates a preference's value by sending a plain text string. For example, `false`. An arbitrary preference can be created with the value containing up to 255 characters. In addition, the following keys define system preferences that can be set or created: * *user.notifications.mimetype* The mime type used in notifications sent to the user. Defaults to `html`. * *user.notify.own.changes* Whether the user gets notified of their own changes. Defaults to `false`. * *user.default.share.private* Whether new [ filters](https://confluence.atlassian.com/x/eQiiLQ) are set to private. Defaults to `true`. * *user.keyboard.shortcuts.disabled* Whether keyboard shortcuts are disabled. Defaults to `false`. * *user.autowatch.disabled* Whether the user automatically watches issues they create or add a comment to. By default, not set: the user takes the instance autowatch setting. Note that these keys are deprecated: * *jira.user.locale* The locale of the user. By default, not set. The user takes the instance locale. * *jira.user.timezone* The time zone of the user. By default, not set. The user takes the instance timezone. Use [ Update a user profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) from the user management REST API to manage timezone and locale instead. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Myself + * @name SetPreference + * @summary Set preference + * @request PUT:/rest/api/3/mypreferences + * @secure + */ + setPreference: ({ + query, + data, + params = {}, + }: { + query: { + /** The key of the preference. The maximum length is 255 characters. */ + key: string; + }; + data: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/mypreferences`, + method: "PUT", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deprecated, use [ Update a user profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) from the user management REST API instead. Deletes the locale of the user, which restores the default setting. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Myself + * @name DeleteLocale + * @summary Delete locale + * @request DELETE:/rest/api/3/mypreferences/locale + * @deprecated + * @secure + */ + deleteLocale: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/mypreferences/locale`, + method: "DELETE", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the locale for the user. If the user has no language preference set (which is the default setting) or this resource is accessed anonymous, the browser locale detected by Jira is returned. Jira detects the browser locale using the *Accept-Language* header in the request. However, if this doesn't match a locale available Jira, the site default locale is returned. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. + * + * @tags Myself + * @name GetLocale + * @summary Get locale + * @request GET:/rest/api/3/mypreferences/locale + * @secure + */ + getLocale: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/mypreferences/locale`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deprecated, use [ Update a user profile](https://developer.atlassian.com/cloud/admin/user-management/rest/#api-users-account-id-manage-profile-patch) from the user management REST API instead. Sets the locale of the user. The locale must be one supported by the instance of Jira. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Myself + * @name SetLocale + * @summary Set locale + * @request PUT:/rest/api/3/mypreferences/locale + * @deprecated + * @secure + */ + setLocale: ({ data, params = {} }: { data: Locale; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/mypreferences/locale`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns details for the current user. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Myself + * @name GetCurrentUser + * @summary Get current user + * @request GET:/rest/api/3/myself + * @secure + */ + getCurrentUser: ({ + query, + params = {}, + }: { + query?: { + /** + * Use [expand](#expansion) to include additional information about user in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `groups` Returns all groups, including nested groups, the user belongs to. + * * `applicationRoles` Returns the application roles the user is assigned to. + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/myself`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of [notification schemes](https://confluence.atlassian.com/x/8YdKLg) ordered by the display name. *Note that you should allow for events without recipients to appear in responses.* **[Permissions](#permissions) required:** Permission to access Jira, however, the user must have permission to administer at least one project associated with a notification scheme for it to be returned. + * + * @tags Issue notification schemes + * @name GetNotificationSchemes + * @summary Get notification schemes paginated + * @request GET:/rest/api/3/notificationscheme + * @secure + */ + getNotificationSchemes: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @default "0" + */ + startAt?: string; + /** + * The maximum number of items to return per page. + * @default "50" + */ + maxResults?: string; + /** + * The list of notification schemes IDs to be filtered by + * @uniqueItems true + */ + id?: string[]; + /** + * The list of projects IDs to be filtered by + * @uniqueItems true + */ + projectId?: string[]; + /** + * When set to true, returns only the default notification scheme. If you provide project IDs not associated with the default, returns an empty page. The default value is false. + * @default false + */ + onlyDefault?: boolean; + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `all` Returns all expandable information + * * `field` Returns information about any custom fields assigned to receive an event + * * `group` Returns information about any groups assigned to receive an event + * * `notificationSchemeEvents` Returns a list of event associations. This list is returned for all expandable information + * * `projectRole` Returns information about any project roles assigned to receive an event + * * `user` Returns information about any users assigned to receive an event + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/notificationscheme`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates a notification scheme with notifications. You can create up to 1000 notifications per request. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue notification schemes + * @name CreateNotificationScheme + * @summary Create notification scheme + * @request POST:/rest/api/3/notificationscheme + * @secure + */ + createNotificationScheme: ({ + data, + params = {}, + }: { + data: CreateNotificationSchemeDetails; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/notificationscheme`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) mapping of project that have notification scheme assigned. You can provide either one or multiple notification scheme IDs or project IDs to filter by. If you don't provide any, this will return a list of all mappings. Note that only company-managed (classic) projects are supported. This is because team-managed projects don't have a concept of a default notification scheme. The mappings are ordered by projectId. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Issue notification schemes + * @name GetNotificationSchemeToProjectMappings + * @summary Get projects using notification schemes paginated + * @request GET:/rest/api/3/notificationscheme/project + * @secure + */ + getNotificationSchemeToProjectMappings: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @default "0" + */ + startAt?: string; + /** + * The maximum number of items to return per page. + * @default "50" + */ + maxResults?: string; + /** + * The list of notifications scheme IDs to be filtered out + * @uniqueItems true + */ + notificationSchemeId?: string[]; + /** + * The list of project IDs to be filtered out + * @uniqueItems true + */ + projectId?: string[]; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/notificationscheme/project`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a [notification scheme](https://confluence.atlassian.com/x/8YdKLg), including the list of events and the recipients who will receive notifications for those events. **[Permissions](#permissions) required:** Permission to access Jira, however, the user must have permission to administer at least one project associated with the notification scheme. + * + * @tags Issue notification schemes + * @name GetNotificationScheme + * @summary Get notification scheme + * @request GET:/rest/api/3/notificationscheme/{id} + * @secure + */ + getNotificationScheme: ({ + id, + query, + params = {}, + }: { + id: number; + query?: { + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `all` Returns all expandable information + * * `field` Returns information about any custom fields assigned to receive an event + * * `group` Returns information about any groups assigned to receive an event + * * `notificationSchemeEvents` Returns a list of event associations. This list is returned for all expandable information + * * `projectRole` Returns information about any project roles assigned to receive an event + * * `user` Returns information about any users assigned to receive an event + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/notificationscheme/${id}`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates a notification scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue notification schemes + * @name UpdateNotificationScheme + * @summary Update notification scheme + * @request PUT:/rest/api/3/notificationscheme/{id} + * @secure + */ + updateNotificationScheme: ({ + id, + data, + params = {}, + }: { + id: string; + data: UpdateNotificationSchemeDetails; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/notificationscheme/${id}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Adds notifications to a notification scheme. You can add up to 1000 notifications per request. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue notification schemes + * @name AddNotifications + * @summary Add notifications to notification scheme + * @request PUT:/rest/api/3/notificationscheme/{id}/notification + * @secure + */ + addNotifications: ({ + id, + data, + params = {}, + }: { + id: string; + data: AddNotificationsDetails; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/notificationscheme/${id}/notification`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes a notification scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue notification schemes + * @name DeleteNotificationScheme + * @summary Delete notification scheme + * @request DELETE:/rest/api/3/notificationscheme/{notificationSchemeId} + * @secure + */ + deleteNotificationScheme: ({ + notificationSchemeId, + params = {}, + }: { + notificationSchemeId: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/notificationscheme/${notificationSchemeId}`, + method: "DELETE", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Removes a notification from a notification scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue notification schemes + * @name RemoveNotificationFromNotificationScheme + * @summary Remove notification from notification scheme + * @request DELETE:/rest/api/3/notificationscheme/{notificationSchemeId}/notification/{notificationId} + * @secure + */ + removeNotificationFromNotificationScheme: ({ + notificationSchemeId, + notificationId, + params = {}, + }: { + notificationSchemeId: string; + notificationId: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/notificationscheme/${notificationSchemeId}/notification/${notificationId}`, + method: "DELETE", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns all permissions, including: * global permissions. * project permissions. * global permissions added by plugins. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Permissions + * @name GetAllPermissions + * @summary Get all permissions + * @request GET:/rest/api/3/permissions + * @secure + */ + getAllPermissions: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/permissions`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns: * for a list of global permissions, the global permissions granted to a user. * for a list of project permissions and lists of projects and issues, for each project permission a list of the projects and issues a user can access or manipulate. If no account ID is provided, the operation returns details for the logged in user. Note that: * Invalid project and issue IDs are ignored. * A maximum of 1000 projects and 1000 issues can be checked. * Null values in `globalPermissions`, `projectPermissions`, `projectPermissions.projects`, and `projectPermissions.issues` are ignored. * Empty strings in `projectPermissions.permissions` are ignored. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) to check the permissions for other users, otherwise none. However, Connect apps can make a call from the app server to the product to obtain permission details for any user, without admin permission. This Connect app ability doesn't apply to calls made using AP.request() in a browser. + * + * @tags Permissions + * @name GetBulkPermissions + * @summary Get bulk permissions + * @request POST:/rest/api/3/permissions/check + * @secure + */ + getBulkPermissions: ({ data, params = {} }: { data: BulkPermissionsRequestBean; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/permissions/check`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns all the projects where the user is granted a list of project permissions. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. + * + * @tags Permissions + * @name GetPermittedProjects + * @summary Get permitted projects + * @request POST:/rest/api/3/permissions/project + * @secure + */ + getPermittedProjects: ({ data, params = {} }: { data: PermissionsKeysBean; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/permissions/project`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns all permission schemes. ### About permission schemes and grants ### A permission scheme is a collection of permission grants. A permission grant consists of a `holder` and a `permission`. #### Holder object #### The `holder` object contains information about the user or group being granted the permission. For example, the *Administer projects* permission is granted to a group named *Teams in space administrators*. In this case, the type is `"type": "group"`, and the parameter is the group name, `"parameter": "Teams in space administrators"` and the value is group ID, `"value": "ca85fac0-d974-40ca-a615-7af99c48d24f"`. The `holder` object is defined by the following properties: * `type` Identifies the user or group (see the list of types below). * `parameter` As a group's name can change, use of `value` is recommended. The value of this property depends on the `type`. For example, if the `type` is a group, then you need to specify the group name. * `value` The value of this property depends on the `type`. If the `type` is a group, then you need to specify the group ID. For other `type` it has the same value as `parameter` The following `types` are available. The expected values for `parameter` and `value` are given in parentheses (some types may not have a `parameter` or `value`): * `anyone` Grant for anonymous users. * `applicationRole` Grant for users with access to the specified application (application name, application name). See [Update product access settings](https://confluence.atlassian.com/x/3YxjL) for more information. * `assignee` Grant for the user currently assigned to an issue. * `group` Grant for the specified group (`parameter` : group name, `value` : group ID). * `groupCustomField` Grant for a user in the group selected in the specified custom field (`parameter` : custom field ID, `value` : custom field ID). * `projectLead` Grant for a project lead. * `projectRole` Grant for the specified project role (`parameter` :project role ID, `value` : project role ID). * `reporter` Grant for the user who reported the issue. * `sd.customer.portal.only` Jira Service Desk only. Grants customers permission to access the customer portal but not Jira. See [Customizing Jira Service Desk permissions](https://confluence.atlassian.com/x/24dKLg) for more information. * `user` Grant for the specified user (`parameter` : user ID - historically this was the userkey but that is deprecated and the account ID should be used, `value` : user ID). * `userCustomField` Grant for a user selected in the specified custom field (`parameter` : custom field ID, `value` : custom field ID). #### Built-in permissions #### The [built-in Jira permissions](https://confluence.atlassian.com/x/yodKLg) are listed below. Apps can also define custom permissions. See the [project permission](https://developer.atlassian.com/cloud/jira/platform/modules/project-permission/) and [global permission](https://developer.atlassian.com/cloud/jira/platform/modules/global-permission/) module documentation for more information. **Project permissions** * `ADMINISTER_PROJECTS` * `BROWSE_PROJECTS` * `MANAGE_SPRINTS_PERMISSION` (Jira Software only) * `SERVICEDESK_AGENT` (Jira Service Desk only) * `VIEW_DEV_TOOLS` (Jira Software only) * `VIEW_READONLY_WORKFLOW` **Issue permissions** * `ASSIGNABLE_USER` * `ASSIGN_ISSUES` * `CLOSE_ISSUES` * `CREATE_ISSUES` * `DELETE_ISSUES` * `EDIT_ISSUES` * `LINK_ISSUES` * `MODIFY_REPORTER` * `MOVE_ISSUES` * `RESOLVE_ISSUES` * `SCHEDULE_ISSUES` * `SET_ISSUE_SECURITY` * `TRANSITION_ISSUES` **Voters and watchers permissions** * `MANAGE_WATCHERS` * `VIEW_VOTERS_AND_WATCHERS` **Comments permissions** * `ADD_COMMENTS` * `DELETE_ALL_COMMENTS` * `DELETE_OWN_COMMENTS` * `EDIT_ALL_COMMENTS` * `EDIT_OWN_COMMENTS` **Attachments permissions** * `CREATE_ATTACHMENTS` * `DELETE_ALL_ATTACHMENTS` * `DELETE_OWN_ATTACHMENTS` **Time tracking permissions** * `DELETE_ALL_WORKLOGS` * `DELETE_OWN_WORKLOGS` * `EDIT_ALL_WORKLOGS` * `EDIT_OWN_WORKLOGS` * `WORK_ON_ISSUES` **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Permission schemes + * @name GetAllPermissionSchemes + * @summary Get all permission schemes + * @request GET:/rest/api/3/permissionscheme + * @secure + */ + getAllPermissionSchemes: ({ + query, + params = {}, + }: { + query?: { + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are included when you specify any value. Expand options include: + * + * * `all` Returns all expandable information. + * * `field` Returns information about the custom field granted the permission. + * * `group` Returns information about the group that is granted the permission. + * * `permissions` Returns all permission grants for each permission scheme. + * * `projectRole` Returns information about the project role granted the permission. + * * `user` Returns information about the user who is granted the permission. + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/permissionscheme`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates a new permission scheme. You can create a permission scheme with or without defining a set of permission grants. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Permission schemes + * @name CreatePermissionScheme + * @summary Create permission scheme + * @request POST:/rest/api/3/permissionscheme + * @secure + */ + createPermissionScheme: ({ + data, + query, + params = {}, + }: { + data: PermissionScheme; + query?: { + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are always included when you specify any value. Expand options include: + * + * * `all` Returns all expandable information. + * * `field` Returns information about the custom field granted the permission. + * * `group` Returns information about the group that is granted the permission. + * * `permissions` Returns all permission grants for each permission scheme. + * * `projectRole` Returns information about the project role granted the permission. + * * `user` Returns information about the user who is granted the permission. + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/permissionscheme`, + method: "POST", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes a permission scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Permission schemes + * @name DeletePermissionScheme + * @summary Delete permission scheme + * @request DELETE:/rest/api/3/permissionscheme/{schemeId} + * @secure + */ + deletePermissionScheme: ({ schemeId, params = {} }: { schemeId: number; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/permissionscheme/${schemeId}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Returns a permission scheme. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Permission schemes + * @name GetPermissionScheme + * @summary Get permission scheme + * @request GET:/rest/api/3/permissionscheme/{schemeId} + * @secure + */ + getPermissionScheme: ({ + schemeId, + query, + params = {}, + }: { + schemeId: number; + query?: { + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are included when you specify any value. Expand options include: + * + * * `all` Returns all expandable information. + * * `field` Returns information about the custom field granted the permission. + * * `group` Returns information about the group that is granted the permission. + * * `permissions` Returns all permission grants for each permission scheme. + * * `projectRole` Returns information about the project role granted the permission. + * * `user` Returns information about the user who is granted the permission. + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/permissionscheme/${schemeId}`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates a permission scheme. Below are some important things to note when using this resource: * If a permissions list is present in the request, then it is set in the permission scheme, overwriting *all existing* grants. * If you want to update only the name and description, then do not send a permissions list in the request. * Sending an empty list will remove all permission grants from the permission scheme. If you want to add or delete a permission grant instead of updating the whole list, see [Create permission grant](#api-rest-api-3-permissionscheme-schemeId-permission-post) or [Delete permission scheme entity](#api-rest-api-3-permissionscheme-schemeId-permission-permissionId-delete). See [About permission schemes and grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more details. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Permission schemes + * @name UpdatePermissionScheme + * @summary Update permission scheme + * @request PUT:/rest/api/3/permissionscheme/{schemeId} + * @secure + */ + updatePermissionScheme: ({ + schemeId, + data, + query, + params = {}, + }: { + schemeId: number; + data: PermissionScheme; + query?: { + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are always included when you specify any value. Expand options include: + * + * * `all` Returns all expandable information. + * * `field` Returns information about the custom field granted the permission. + * * `group` Returns information about the group that is granted the permission. + * * `permissions` Returns all permission grants for each permission scheme. + * * `projectRole` Returns information about the project role granted the permission. + * * `user` Returns information about the user who is granted the permission. + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/permissionscheme/${schemeId}`, + method: "PUT", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns all permission grants for a permission scheme. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Permission schemes + * @name GetPermissionSchemeGrants + * @summary Get permission scheme grants + * @request GET:/rest/api/3/permissionscheme/{schemeId}/permission + * @secure + */ + getPermissionSchemeGrants: ({ + schemeId, + query, + params = {}, + }: { + schemeId: number; + query?: { + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are always included when you specify any value. Expand options include: + * + * * `permissions` Returns all permission grants for each permission scheme. + * * `user` Returns information about the user who is granted the permission. + * * `group` Returns information about the group that is granted the permission. + * * `projectRole` Returns information about the project role granted the permission. + * * `field` Returns information about the custom field granted the permission. + * * `all` Returns all expandable information. + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/permissionscheme/${schemeId}/permission`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates a permission grant in a permission scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Permission schemes + * @name CreatePermissionGrant + * @summary Create permission grant + * @request POST:/rest/api/3/permissionscheme/{schemeId}/permission + * @secure + */ + createPermissionGrant: ({ + schemeId, + data, + query, + params = {}, + }: { + schemeId: number; + data: PermissionGrant; + query?: { + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are always included when you specify any value. Expand options include: + * + * * `permissions` Returns all permission grants for each permission scheme. + * * `user` Returns information about the user who is granted the permission. + * * `group` Returns information about the group that is granted the permission. + * * `projectRole` Returns information about the project role granted the permission. + * * `field` Returns information about the custom field granted the permission. + * * `all` Returns all expandable information. + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/permissionscheme/${schemeId}/permission`, + method: "POST", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes a permission grant from a permission scheme. See [About permission schemes and grants](../api-group-permission-schemes/#about-permission-schemes-and-grants) for more details. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Permission schemes + * @name DeletePermissionSchemeEntity + * @summary Delete permission scheme grant + * @request DELETE:/rest/api/3/permissionscheme/{schemeId}/permission/{permissionId} + * @secure + */ + deletePermissionSchemeEntity: ({ + schemeId, + permissionId, + params = {}, + }: { + schemeId: number; + permissionId: number; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/permissionscheme/${schemeId}/permission/${permissionId}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Returns a permission grant. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Permission schemes + * @name GetPermissionSchemeGrant + * @summary Get permission scheme grant + * @request GET:/rest/api/3/permissionscheme/{schemeId}/permission/{permissionId} + * @secure + */ + getPermissionSchemeGrant: ({ + schemeId, + permissionId, + query, + params = {}, + }: { + schemeId: number; + permissionId: number; + query?: { + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are always included when you specify any value. Expand options include: + * + * * `all` Returns all expandable information. + * * `field` Returns information about the custom field granted the permission. + * * `group` Returns information about the group that is granted the permission. + * * `permissions` Returns all permission grants for each permission scheme. + * * `projectRole` Returns information about the project role granted the permission. + * * `user` Returns information about the user who is granted the permission. + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/permissionscheme/${schemeId}/permission/${permissionId}`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the list of all issue priorities. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Issue priorities + * @name GetPriorities + * @summary Get priorities + * @request GET:/rest/api/3/priority + * @deprecated + * @secure + */ + getPriorities: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/priority`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates an issue priority. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue priorities + * @name CreatePriority + * @summary Create priority + * @request POST:/rest/api/3/priority + * @secure + */ + createPriority: ({ data, params = {} }: { data: CreatePriorityDetails; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/priority`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Sets default issue priority. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue priorities + * @name SetDefaultPriority + * @summary Set default priority + * @request PUT:/rest/api/3/priority/default + * @secure + */ + setDefaultPriority: ({ data, params = {} }: { data: SetDefaultPriorityRequest; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/priority/default`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Changes the order of issue priorities. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue priorities + * @name MovePriorities + * @summary Move priorities + * @request PUT:/rest/api/3/priority/move + * @secure + */ + movePriorities: ({ data, params = {} }: { data: ReorderIssuePriorities; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/priority/move`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of priorities. The list can contain all priorities or a subset determined by any combination of these criteria: * a list of priority IDs. Any invalid priority IDs are ignored. * whether the field configuration is a default. This returns priorities from company-managed (classic) projects only, as there is no concept of default priorities in team-managed projects. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Issue priorities + * @name SearchPriorities + * @summary Search priorities + * @request GET:/rest/api/3/priority/search + * @secure + */ + searchPriorities: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @default "0" + */ + startAt?: string; + /** + * The maximum number of items to return per page. + * @default "50" + */ + maxResults?: string; + /** The list of priority IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=2&id=3`. */ + id?: string[]; + /** + * Whether only the default priority is returned. + * @default false + */ + onlyDefault?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/priority/search`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes an issue priority. This operation is [asynchronous](#async). Follow the `location` link in the response to determine the status of the task and use [Get task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue priorities + * @name DeletePriority + * @summary Delete priority + * @request DELETE:/rest/api/3/priority/{id} + * @secure + */ + deletePriority: ({ + id, + query, + params = {}, + }: { + id: string; + query: { + /** The ID of the issue priority that will replace the currently selected resolution. */ + replaceWith: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/priority/${id}`, + method: "DELETE", + query: query, + secure: true, + ...params, + }), + + /** + * @description Returns an issue priority. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Issue priorities + * @name GetPriority + * @summary Get priority + * @request GET:/rest/api/3/priority/{id} + * @secure + */ + getPriority: ({ id, params = {} }: { id: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/priority/${id}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates an issue priority. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue priorities + * @name UpdatePriority + * @summary Update priority + * @request PUT:/rest/api/3/priority/{id} + * @secure + */ + updatePriority: ({ id, data, params = {} }: { id: string; data: UpdatePriorityDetails; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/priority/${id}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns all projects visible to the user. Deprecated, use [ Get projects paginated](#api-rest-api-3-project-search-get) that supports search and pagination. This operation can be accessed anonymously. **[Permissions](#permissions) required:** Projects are returned only where the user has *Browse Projects* or *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * + * @tags Projects + * @name GetAllProjects + * @summary Get all projects + * @request GET:/rest/api/3/project + * @deprecated + * @secure + */ + getAllProjects: ({ + query, + params = {}, + }: { + query?: { + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expanded options include: + * + * * `description` Returns the project description. + * * `issueTypes` Returns all issue types associated with the project. + * * `lead` Returns information about the project lead. + * * `projectKeys` Returns all project keys associated with the project. + */ + expand?: string; + /** + * Returns the user's most recently accessed projects. You may specify the number of results to return up to a maximum of 20. If access is anonymous, then the recently accessed projects are based on the current HTTP session. + * @format int32 + */ + recent?: number; + /** A list of project properties to return for the project. This parameter accepts a comma-separated list. */ + properties?: string[]; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates a project based on a project type template, as shown in the following table: | Project Type Key | Project Template Key | |--|--| | `business` | `com.atlassian.jira-core-project-templates:jira-core-simplified-content-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-document-approval`, `com.atlassian.jira-core-project-templates:jira-core-simplified-lead-tracking`, `com.atlassian.jira-core-project-templates:jira-core-simplified-process-control`, `com.atlassian.jira-core-project-templates:jira-core-simplified-procurement`, `com.atlassian.jira-core-project-templates:jira-core-simplified-project-management`, `com.atlassian.jira-core-project-templates:jira-core-simplified-recruitment`, `com.atlassian.jira-core-project-templates:jira-core-simplified-task-tracking` | | `service_desk` | `com.atlassian.servicedesk:simplified-it-service-management`, `com.atlassian.servicedesk:simplified-general-service-desk-it`, `com.atlassian.servicedesk:simplified-general-service-desk-business`, `com.atlassian.servicedesk:simplified-internal-service-desk`, `com.atlassian.servicedesk:simplified-external-service-desk`, `com.atlassian.servicedesk:simplified-hr-service-desk`, `com.atlassian.servicedesk:simplified-facilities-service-desk`, `com.atlassian.servicedesk:simplified-legal-service-desk`, `com.atlassian.servicedesk:simplified-analytics-service-desk`, `com.atlassian.servicedesk:simplified-marketing-service-desk`, `com.atlassian.servicedesk:simplified-finance-service-desk` | | `software` | `com.pyxis.greenhopper.jira:gh-simplified-agility-kanban`, `com.pyxis.greenhopper.jira:gh-simplified-agility-scrum`, `com.pyxis.greenhopper.jira:gh-simplified-basic`, `com.pyxis.greenhopper.jira:gh-simplified-kanban-classic`, `com.pyxis.greenhopper.jira:gh-simplified-scrum-classic` | The project types are available according to the installed Jira features as follows: * Jira Core, the default, enables `business` projects. * Jira Service Management enables `service_desk` projects. * Jira Software enables `software` projects. To determine which features are installed, go to **Jira settings** > **Apps** > **Manage apps** and review the System Apps list. To add Jira Software or Jira Service Management into a JIRA instance, use **Jira settings** > **Apps** > **Finding new apps**. For more information, see [ Managing add-ons](https://confluence.atlassian.com/x/S31NLg). **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Projects + * @name CreateProject + * @summary Create project + * @request POST:/rest/api/3/project + * @secure + */ + createProject: ({ data, params = {} }: { data: CreateProjectDetails; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/project`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a list of up to 20 projects recently viewed by the user that are still visible to the user. This operation can be accessed anonymously. **[Permissions](#permissions) required:** Projects are returned only where the user has one of: * *Browse Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. * *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Projects + * @name GetRecent + * @summary Get recent projects + * @request GET:/rest/api/3/project/recent + * @secure + */ + getRecent: ({ + query, + params = {}, + }: { + query?: { + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expanded options include: + * + * * `description` Returns the project description. + * * `projectKeys` Returns all project keys associated with a project. + * * `lead` Returns information about the project lead. + * * `issueTypes` Returns all issue types associated with the project. + * * `url` Returns the URL associated with the project. + * * `permissions` Returns the permissions associated with the project. + * * `insight` EXPERIMENTAL. Returns the insight details of total issue count and last issue update time for the project. + * * `*` Returns the project with all available expand options. + */ + expand?: string; + /** EXPERIMENTAL. A list of project properties to return for the project. This parameter accepts a comma-separated list. Invalid property names are ignored. */ + properties?: StringList[]; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/recent`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of projects visible to the user. This operation can be accessed anonymously. **[Permissions](#permissions) required:** Projects are returned only where the user has one of: * *Browse Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. * *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Projects + * @name SearchProjects + * @summary Get projects paginated + * @request GET:/rest/api/3/project/search + * @secure + */ + searchProjects: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * [Order](#ordering) the results by a field. + * + * * `category` Sorts by project category. A complete list of category IDs is found using [Get all project categories](#api-rest-api-3-projectCategory-get). + * * `issueCount` Sorts by the total number of issues in each project. + * * `key` Sorts by project key. + * * `lastIssueUpdatedTime` Sorts by the last issue update time. + * * `name` Sorts by project name. + * * `owner` Sorts by project lead. + * * `archivedDate` EXPERIMENTAL. Sorts by project archived date. + * * `deletedDate` EXPERIMENTAL. Sorts by project deleted date. + * @default "key" + */ + orderBy?: + | "category" + | "-category" + | "+category" + | "key" + | "-key" + | "+key" + | "name" + | "-name" + | "+name" + | "owner" + | "-owner" + | "+owner" + | "issueCount" + | "-issueCount" + | "+issueCount" + | "lastIssueUpdatedDate" + | "-lastIssueUpdatedDate" + | "+lastIssueUpdatedDate" + | "archivedDate" + | "+archivedDate" + | "-archivedDate" + | "deletedDate" + | "+deletedDate" + | "-deletedDate"; + /** + * The project IDs to filter the results by. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. Up to 50 project IDs can be provided. + * @uniqueItems true + */ + id?: number[]; + /** + * The project keys to filter the results by. To include multiple keys, provide an ampersand-separated list. For example, `keys=PA&keys=PB`. Up to 50 project keys can be provided. + * @uniqueItems true + */ + keys?: string[]; + /** Filter the results using a literal string. Projects with a matching `key` or `name` are returned (case insensitive). */ + query?: string; + /** Orders results by the [project type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes). This parameter accepts a comma-separated list. Valid values are `business`, `service_desk`, and `software`. */ + typeKey?: string; + /** + * The ID of the project's category. A complete list of category IDs is found using the [Get all project categories](#api-rest-api-3-projectCategory-get) operation. + * @format int64 + */ + categoryId?: number; + /** + * Filter results by projects for which the user can: + * + * * `view` the project, meaning that they have one of the following permissions: + * + * * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * * *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * * `browse` the project, meaning that they have the *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * * `edit` the project, meaning that they have one of the following permissions: + * + * * *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * @default "view" + */ + action?: "view" | "browse" | "edit"; + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expanded options include: + * + * * `description` Returns the project description. + * * `projectKeys` Returns all project keys associated with a project. + * * `lead` Returns information about the project lead. + * * `issueTypes` Returns all issue types associated with the project. + * * `url` Returns the URL associated with the project. + * * `insight` EXPERIMENTAL. Returns the insight details of total issue count and last issue update time for the project. + */ + expand?: string; + /** + * EXPERIMENTAL. Filter results by project status: + * + * * `live` Search live projects. + * * `archived` Search archived projects. + * * `deleted` Search deleted projects, those in the recycle bin. + */ + status?: ("live" | "archived" | "deleted")[]; + /** EXPERIMENTAL. A list of project properties to return for the project. This parameter accepts a comma-separated list. */ + properties?: StringList[]; + /** EXPERIMENTAL. A query string used to search properties. The query string cannot be specified using a JSON object. For example, to search for the value of `nested` from `{"something":{"nested":1,"other":2}}` use `[thepropertykey].something.nested=1`. Note that the propertyQuery key is enclosed in square brackets to enable searching where the propertyQuery key includes dot (.) or equals (=) characters. Note that `thepropertykey` is only returned when included in `properties`. */ + propertyQuery?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/search`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns all [project types](https://confluence.atlassian.com/x/Var1Nw), whether or not the instance has a valid license for each type. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. + * + * @tags Project types + * @name GetAllProjectTypes + * @summary Get all project types + * @request GET:/rest/api/3/project/type + * @secure + */ + getAllProjectTypes: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/project/type`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns all [project types](https://confluence.atlassian.com/x/Var1Nw) with a valid license. + * + * @tags Project types + * @name GetAllAccessibleProjectTypes + * @summary Get licensed project types + * @request GET:/rest/api/3/project/type/accessible + * @secure + */ + getAllAccessibleProjectTypes: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/project/type/accessible`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a [project type](https://confluence.atlassian.com/x/Var1Nw). This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. + * + * @tags Project types + * @name GetProjectTypeByKey + * @summary Get project type by key + * @request GET:/rest/api/3/project/type/{projectTypeKey} + * @secure + */ + getProjectTypeByKey: ({ + projectTypeKey, + params = {}, + }: { + projectTypeKey: "software" | "service_desk" | "business" | "product_discovery"; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/type/${projectTypeKey}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a [project type](https://confluence.atlassian.com/x/Var1Nw) if it is accessible to the user. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Project types + * @name GetAccessibleProjectTypeByKey + * @summary Get accessible project type by key + * @request GET:/rest/api/3/project/type/{projectTypeKey}/accessible + * @secure + */ + getAccessibleProjectTypeByKey: ({ + projectTypeKey, + params = {}, + }: { + projectTypeKey: "software" | "service_desk" | "business" | "product_discovery"; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/type/${projectTypeKey}/accessible`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes a project. You can't delete a project if it's archived. To delete an archived project, restore the project and then delete it. To restore a project, use the Jira UI. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Projects + * @name DeleteProject + * @summary Delete project + * @request DELETE:/rest/api/3/project/{projectIdOrKey} + * @secure + */ + deleteProject: ({ + projectIdOrKey, + query, + params = {}, + }: { + projectIdOrKey: string; + query?: { + /** + * Whether this project is placed in the Jira recycle bin where it will be available for restoration. + * @default false + */ + enableUndo?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}`, + method: "DELETE", + query: query, + secure: true, + ...params, + }), + + /** + * @description Returns the [project details](https://confluence.atlassian.com/x/ahLpNw) for a project. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * + * @tags Projects + * @name GetProject + * @summary Get project + * @request GET:/rest/api/3/project/{projectIdOrKey} + * @secure + */ + getProject: ({ + projectIdOrKey, + query, + params = {}, + }: { + projectIdOrKey: string; + query?: { + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Note that the project description, issue types, and project lead are included in all responses by default. Expand options include: + * + * * `description` The project description. + * * `issueTypes` The issue types associated with the project. + * * `lead` The project lead. + * * `projectKeys` All project keys associated with the project. + * * `issueTypeHierarchy` The project issue type hierarchy. + */ + expand?: string; + /** A list of project properties to return for the project. This parameter accepts a comma-separated list. */ + properties?: string[]; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates the [project details](https://confluence.atlassian.com/x/ahLpNw) of a project. All parameters are optional in the body of the request. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Projects + * @name UpdateProject + * @summary Update project + * @request PUT:/rest/api/3/project/{projectIdOrKey} + * @secure + */ + updateProject: ({ + projectIdOrKey, + data, + query, + params = {}, + }: { + projectIdOrKey: string; + data: UpdateProjectDetails; + query?: { + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Note that the project description, issue types, and project lead are included in all responses by default. Expand options include: + * + * * `description` The project description. + * * `issueTypes` The issue types associated with the project. + * * `lead` The project lead. + * * `projectKeys` All project keys associated with the project. + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}`, + method: "PUT", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Archives a project. You can't delete a project if it's archived. To delete an archived project, restore the project and then delete it. To restore a project, use the Jira UI. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Projects + * @name ArchiveProject + * @summary Archive project + * @request POST:/rest/api/3/project/{projectIdOrKey}/archive + * @secure + */ + archiveProject: ({ projectIdOrKey, params = {} }: { projectIdOrKey: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/archive`, + method: "POST", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Sets the avatar displayed for a project. Use [Load project avatar](#api-rest-api-3-project-projectIdOrKey-avatar2-post) to store avatars against the project, before using this operation to set the displayed avatar. **[Permissions](#permissions) required:** *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg). + * + * @tags Project avatars + * @name UpdateProjectAvatar + * @summary Set project avatar + * @request PUT:/rest/api/3/project/{projectIdOrKey}/avatar + * @secure + */ + updateProjectAvatar: ({ + projectIdOrKey, + data, + params = {}, + }: { + projectIdOrKey: string; + data: Avatar; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/avatar`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes a custom avatar from a project. Note that system avatars cannot be deleted. **[Permissions](#permissions) required:** *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg). + * + * @tags Project avatars + * @name DeleteProjectAvatar + * @summary Delete project avatar + * @request DELETE:/rest/api/3/project/{projectIdOrKey}/avatar/{id} + * @secure + */ + deleteProjectAvatar: ({ + projectIdOrKey, + id, + params = {}, + }: { + projectIdOrKey: string; + id: number; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/avatar/${id}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Loads an avatar for a project. Specify the avatar's local file location in the body of the request. Also, include the following headers: * `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special Headers](#special-request-headers). * `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. For example: `curl --request POST ` `--user email@example.com: ` `--header 'X-Atlassian-Token: no-check' ` `--header 'Content-Type: image/< image_type>' ` `--data-binary "<@/path/to/file/with/your/avatar>" ` `--url 'https://your-domain.atlassian.net/rest/api/3/project/{projectIdOrKey}/avatar2'` The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of the image. The length of the square's sides is set to the smaller of the height or width of the image. The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. After creating the avatar use [Set project avatar](#api-rest-api-3-project-projectIdOrKey-avatar-put) to set it as the project's displayed avatar. **[Permissions](#permissions) required:** *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg). + * + * @tags Project avatars + * @name CreateProjectAvatar + * @summary Load project avatar + * @request POST:/rest/api/3/project/{projectIdOrKey}/avatar2 + * @secure + */ + createProjectAvatar: ({ + projectIdOrKey, + data, + query, + params = {}, + }: { + projectIdOrKey: string; + data: any; + query?: { + /** + * The X coordinate of the top-left corner of the crop region. + * @format int32 + * @default 0 + */ + x?: number; + /** + * The Y coordinate of the top-left corner of the crop region. + * @format int32 + * @default 0 + */ + y?: number; + /** + * The length of each side of the crop region. + * @format int32 + */ + size?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/avatar2`, + method: "POST", + query: query, + body: data, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns all project avatars, grouped by system and custom avatars. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * + * @tags Project avatars + * @name GetAllProjectAvatars + * @summary Get all project avatars + * @request GET:/rest/api/3/project/{projectIdOrKey}/avatars + * @secure + */ + getAllProjectAvatars: ({ projectIdOrKey, params = {} }: { projectIdOrKey: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/avatars`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of all components in a project. See the [Get project components](#api-rest-api-3-project-projectIdOrKey-components-get) resource if you want to get a full list of versions without pagination. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * + * @tags Project components + * @name GetProjectComponentsPaginated + * @summary Get project components paginated + * @request GET:/rest/api/3/project/{projectIdOrKey}/component + * @secure + */ + getProjectComponentsPaginated: ({ + projectIdOrKey, + query, + params = {}, + }: { + projectIdOrKey: string; + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * [Order](#ordering) the results by a field: + * + * * `description` Sorts by the component description. + * * `issueCount` Sorts by the count of issues associated with the component. + * * `lead` Sorts by the user key of the component's project lead. + * * `name` Sorts by component name. + */ + orderBy?: + | "description" + | "-description" + | "+description" + | "issueCount" + | "-issueCount" + | "+issueCount" + | "lead" + | "-lead" + | "+lead" + | "name" + | "-name" + | "+name"; + /** Filter the results using a literal string. Components with a matching `name` or `description` are returned (case insensitive). */ + query?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/component`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns all components in a project. See the [Get project components paginated](#api-rest-api-3-project-projectIdOrKey-component-get) resource if you want to get a full list of components with pagination. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * + * @tags Project components + * @name GetProjectComponents + * @summary Get project components + * @request GET:/rest/api/3/project/{projectIdOrKey}/components + * @secure + */ + getProjectComponents: ({ projectIdOrKey, params = {} }: { projectIdOrKey: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/components`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes a project asynchronously. This operation is: * transactional, that is, if part of the delete fails the project is not deleted. * [asynchronous](#async). Follow the `location` link in the response to determine the status of the task and use [Get task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Projects + * @name DeleteProjectAsynchronously + * @summary Delete project asynchronously + * @request POST:/rest/api/3/project/{projectIdOrKey}/delete + * @secure + */ + deleteProjectAsynchronously: ({ + projectIdOrKey, + params = {}, + }: { + projectIdOrKey: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/delete`, + method: "POST", + secure: true, + ...params, + }), + + /** + * @description Returns the list of features for a project. + * + * @tags Project features + * @name GetFeaturesForProject + * @summary Get project features + * @request GET:/rest/api/3/project/{projectIdOrKey}/features + * @secure + */ + getFeaturesForProject: ({ projectIdOrKey, params = {} }: { projectIdOrKey: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/features`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Sets the state of a project feature. + * + * @tags Project features + * @name ToggleFeatureForProject + * @summary Set project feature state + * @request PUT:/rest/api/3/project/{projectIdOrKey}/features/{featureKey} + * @secure + */ + toggleFeatureForProject: ({ + projectIdOrKey, + featureKey, + data, + params = {}, + }: { + projectIdOrKey: string; + featureKey: string; + data: ProjectFeatureState; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/features/${featureKey}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns all [project property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) keys for the project. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * + * @tags Project properties + * @name GetProjectPropertyKeys + * @summary Get project property keys + * @request GET:/rest/api/3/project/{projectIdOrKey}/properties + * @secure + */ + getProjectPropertyKeys: ({ projectIdOrKey, params = {} }: { projectIdOrKey: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/properties`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes the [property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties) from a project. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) or *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the property. + * + * @tags Project properties + * @name DeleteProjectProperty + * @summary Delete project property + * @request DELETE:/rest/api/3/project/{projectIdOrKey}/properties/{propertyKey} + * @secure + */ + deleteProjectProperty: ({ + projectIdOrKey, + propertyKey, + params = {}, + }: { + projectIdOrKey: string; + propertyKey: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/properties/${propertyKey}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Returns the value of a [project property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the property. + * + * @tags Project properties + * @name GetProjectProperty + * @summary Get project property + * @request GET:/rest/api/3/project/{projectIdOrKey}/properties/{propertyKey} + * @secure + */ + getProjectProperty: ({ + projectIdOrKey, + propertyKey, + params = {}, + }: { + projectIdOrKey: string; + propertyKey: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/properties/${propertyKey}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Sets the value of the [project property](https://developer.atlassian.com/cloud/jira/platform/storing-data-without-a-database/#a-id-jira-entity-properties-a-jira-entity-properties). You can use project properties to store custom data against the project. The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The maximum length is 32768 characters. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) or *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project in which the property is created. + * + * @tags Project properties + * @name SetProjectProperty + * @summary Set project property + * @request PUT:/rest/api/3/project/{projectIdOrKey}/properties/{propertyKey} + * @secure + */ + setProjectProperty: ({ + projectIdOrKey, + propertyKey, + data, + params = {}, + }: { + projectIdOrKey: string; + propertyKey: string; + data: any; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/properties/${propertyKey}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Restores a project that has been archived or placed in the Jira recycle bin. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Projects + * @name Restore + * @summary Restore deleted or archived project + * @request POST:/rest/api/3/project/{projectIdOrKey}/restore + * @secure + */ + restore: ({ projectIdOrKey, params = {} }: { projectIdOrKey: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/restore`, + method: "POST", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a list of [project roles](https://confluence.atlassian.com/x/3odKLg) for the project returning the name and self URL for each role. Note that all project roles are shared with all projects in Jira Cloud. See [Get all project roles](#api-rest-api-3-role-get) for more information. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for any project on the site or *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Project roles + * @name GetProjectRoles + * @summary Get project roles for project + * @request GET:/rest/api/3/project/{projectIdOrKey}/role + * @secure + */ + getProjectRoles: ({ projectIdOrKey, params = {} }: { projectIdOrKey: string; params?: RequestParams }) => + this.request, void>({ + path: `/rest/api/3/project/${projectIdOrKey}/role`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes actors from a project role for the project. To remove default actors from the project role, use [Delete default actors from project role](#api-rest-api-3-role-id-actors-delete). This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Project role actors + * @name DeleteActor + * @summary Delete actors from project role + * @request DELETE:/rest/api/3/project/{projectIdOrKey}/role/{id} + * @secure + */ + deleteActor: ({ + projectIdOrKey, + id, + query, + params = {}, + }: { + projectIdOrKey: string; + id: number; + query?: { + /** + * The user account ID of the user to remove from the project role. + * @example "5b10ac8d82e05b22cc7d4ef5" + */ + user?: string; + /** The name of the group to remove from the project role. This parameter cannot be used with the `groupId` parameter. As a group's name can change, use of `groupId` is recommended. */ + group?: string; + /** The ID of the group to remove from the project role. This parameter cannot be used with the `group` parameter. */ + groupId?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/role/${id}`, + method: "DELETE", + query: query, + secure: true, + ...params, + }), + + /** + * @description Returns a project role's details and actors associated with the project. The list of actors is sorted by display name. To check whether a user belongs to a role based on their group memberships, use [Get user](#api-rest-api-3-user-get) with the `groups` expand parameter selected. Then check whether the user keys and groups match with the actors returned for the project. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Project roles + * @name GetProjectRole + * @summary Get project role for project + * @request GET:/rest/api/3/project/{projectIdOrKey}/role/{id} + * @secure + */ + getProjectRole: ({ + projectIdOrKey, + id, + query, + params = {}, + }: { + projectIdOrKey: string; + id: number; + query?: { + /** + * Exclude inactive users. + * @default false + */ + excludeInactiveUsers?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/role/${id}`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Adds actors to a project role for the project. To replace all actors for the project, use [Set actors for project role](#api-rest-api-3-project-projectIdOrKey-role-id-put). This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Project role actors + * @name AddActorUsers + * @summary Add actors to project role + * @request POST:/rest/api/3/project/{projectIdOrKey}/role/{id} + * @secure + */ + addActorUsers: ({ + projectIdOrKey, + id, + data, + params = {}, + }: { + projectIdOrKey: string; + id: number; + data: ActorsMap; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/role/${id}`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Sets the actors for a project role for a project, replacing all existing actors. To add actors to the project without overwriting the existing list, use [Add actors to project role](#api-rest-api-3-project-projectIdOrKey-role-id-post). **[Permissions](#permissions) required:** *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project or *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Project role actors + * @name SetActors + * @summary Set actors for project role + * @request PUT:/rest/api/3/project/{projectIdOrKey}/role/{id} + * @secure + */ + setActors: ({ + projectIdOrKey, + id, + data, + params = {}, + }: { + projectIdOrKey: string; + id: number; + data: ProjectRoleActorsUpdateBean; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/role/${id}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns all [project roles](https://confluence.atlassian.com/x/3odKLg) and the details for each role. Note that the list of project roles is common to all projects. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) or *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * + * @tags Project roles + * @name GetProjectRoleDetails + * @summary Get project role details + * @request GET:/rest/api/3/project/{projectIdOrKey}/roledetails + * @secure + */ + getProjectRoleDetails: ({ + projectIdOrKey, + query, + params = {}, + }: { + projectIdOrKey: string; + query?: { + /** + * Whether the roles should be filtered to include only those the user is assigned to. + * @default false + */ + currentMember?: boolean; + /** @default false */ + excludeConnectAddons?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/roledetails`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the valid statuses for a project. The statuses are grouped by issue type, as each project has a set of valid issue types and each issue type has a set of valid statuses. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * + * @tags Projects + * @name GetAllStatuses + * @summary Get all statuses for project + * @request GET:/rest/api/3/project/{projectIdOrKey}/statuses + * @secure + */ + getAllStatuses: ({ projectIdOrKey, params = {} }: { projectIdOrKey: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/statuses`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deprecated, this feature is no longer supported and no alternatives are available, see [Convert project to a different template or type](https://confluence.atlassian.com/x/yEKeOQ). Updates a [project type](https://confluence.atlassian.com/x/GwiiLQ). The project type can be updated for classic projects only, project type cannot be updated for next-gen projects. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Projects + * @name UpdateProjectType + * @summary Update project type + * @request PUT:/rest/api/3/project/{projectIdOrKey}/type/{newProjectTypeKey} + * @deprecated + * @secure + */ + updateProjectType: ({ + projectIdOrKey, + newProjectTypeKey, + params = {}, + }: { + projectIdOrKey: string; + newProjectTypeKey: "software" | "service_desk" | "business"; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/type/${newProjectTypeKey}`, + method: "PUT", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of all versions in a project. See the [Get project versions](#api-rest-api-3-project-projectIdOrKey-versions-get) resource if you want to get a full list of versions without pagination. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * + * @tags Project versions + * @name GetProjectVersionsPaginated + * @summary Get project versions paginated + * @request GET:/rest/api/3/project/{projectIdOrKey}/version + * @secure + */ + getProjectVersionsPaginated: ({ + projectIdOrKey, + query, + params = {}, + }: { + projectIdOrKey: string; + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * [Order](#ordering) the results by a field: + * + * * `description` Sorts by version description. + * * `name` Sorts by version name. + * * `releaseDate` Sorts by release date, starting with the oldest date. Versions with no release date are listed last. + * * `sequence` Sorts by the order of appearance in the user interface. + * * `startDate` Sorts by start date, starting with the oldest date. Versions with no start date are listed last. + */ + orderBy?: + | "description" + | "-description" + | "+description" + | "name" + | "-name" + | "+name" + | "releaseDate" + | "-releaseDate" + | "+releaseDate" + | "sequence" + | "-sequence" + | "+sequence" + | "startDate" + | "-startDate" + | "+startDate"; + /** Filter the results using a literal string. Versions with matching `name` or `description` are returned (case insensitive). */ + query?: string; + /** A list of status values used to filter the results by version status. This parameter accepts a comma-separated list. The status values are `released`, `unreleased`, and `archived`. */ + status?: string; + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `issuesstatus` Returns the number of issues in each status category for each version. + * * `operations` Returns actions that can be performed on the specified version. + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/version`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns all versions in a project. The response is not paginated. Use [Get project versions paginated](#api-rest-api-3-project-projectIdOrKey-version-get) if you want to get the versions in a project with pagination. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * + * @tags Project versions + * @name GetProjectVersions + * @summary Get project versions + * @request GET:/rest/api/3/project/{projectIdOrKey}/versions + * @secure + */ + getProjectVersions: ({ + projectIdOrKey, + query, + params = {}, + }: { + projectIdOrKey: string; + query?: { + /** Use [expand](#expansion) to include additional information in the response. This parameter accepts `operations`, which returns actions that can be performed on the version. */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectIdOrKey}/versions`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). **[Permissions](#permissions) required:** *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * + * @tags Project email + * @name GetProjectEmail + * @summary Get project's sender email + * @request GET:/rest/api/3/project/{projectId}/email + * @secure + */ + getProjectEmail: ({ projectId, params = {} }: { projectId: number; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/project/${projectId}/email`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Sets the [project's sender email address](https://confluence.atlassian.com/x/dolKLg). If `emailAddress` is an empty string, the default email address is restored. **[Permissions](#permissions) required:** *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * + * @tags Project email + * @name UpdateProjectEmail + * @summary Set project's sender email + * @request PUT:/rest/api/3/project/{projectId}/email + * @secure + */ + updateProjectEmail: ({ + projectId, + data, + params = {}, + }: { + projectId: number; + data: ProjectEmailAddress; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectId}/email`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Get the issue type hierarchy for a next-gen project. The issue type hierarchy for a project consists of: * *Epic* at level 1 (optional). * One or more issue types at level 0 such as *Story*, *Task*, or *Bug*. Where the issue type *Epic* is defined, these issue types are used to break down the content of an epic. * *Subtask* at level -1 (optional). This issue type enables level 0 issue types to be broken down into components. Issues based on a level -1 issue type must have a parent issue. **[Permissions](#permissions) required:** *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * + * @tags Projects + * @name GetHierarchy + * @summary Get project issue type hierarchy + * @request GET:/rest/api/3/project/{projectId}/hierarchy + * @deprecated + * @secure + */ + getHierarchy: ({ projectId, params = {} }: { projectId: number; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/project/${projectId}/hierarchy`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the [issue security scheme](https://confluence.atlassian.com/x/J4lKLg) associated with the project. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) or the *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg). + * + * @tags Project permission schemes + * @name GetProjectIssueSecurityScheme + * @summary Get project issue security scheme + * @request GET:/rest/api/3/project/{projectKeyOrId}/issuesecuritylevelscheme + * @secure + */ + getProjectIssueSecurityScheme: ({ + projectKeyOrId, + params = {}, + }: { + projectKeyOrId: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectKeyOrId}/issuesecuritylevelscheme`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Gets a [notification scheme](https://confluence.atlassian.com/x/8YdKLg) associated with the project. Deprecated, use [Get notification schemes paginated](#api-rest-api-3-notificationscheme-get) supporting search and pagination. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) or *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg). + * + * @tags Projects + * @name GetNotificationSchemeForProject + * @summary Get project notification scheme + * @request GET:/rest/api/3/project/{projectKeyOrId}/notificationscheme + * @deprecated + * @secure + */ + getNotificationSchemeForProject: ({ + projectKeyOrId, + query, + params = {}, + }: { + projectKeyOrId: string; + query?: { + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `all` Returns all expandable information + * * `field` Returns information about any custom fields assigned to receive an event + * * `group` Returns information about any groups assigned to receive an event + * * `notificationSchemeEvents` Returns a list of event associations. This list is returned for all expandable information + * * `projectRole` Returns information about any project roles assigned to receive an event + * * `user` Returns information about any users assigned to receive an event + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectKeyOrId}/notificationscheme`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Gets the [permission scheme](https://confluence.atlassian.com/x/yodKLg) associated with the project. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) or *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg). + * + * @tags Project permission schemes + * @name GetAssignedPermissionScheme + * @summary Get assigned permission scheme + * @request GET:/rest/api/3/project/{projectKeyOrId}/permissionscheme + * @secure + */ + getAssignedPermissionScheme: ({ + projectKeyOrId, + query, + params = {}, + }: { + projectKeyOrId: string; + query?: { + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are included when you specify any value. Expand options include: + * + * * `all` Returns all expandable information. + * * `field` Returns information about the custom field granted the permission. + * * `group` Returns information about the group that is granted the permission. + * * `permissions` Returns all permission grants for each permission scheme. + * * `projectRole` Returns information about the project role granted the permission. + * * `user` Returns information about the user who is granted the permission. + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectKeyOrId}/permissionscheme`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Assigns a permission scheme with a project. See [Managing project permissions](https://confluence.atlassian.com/x/yodKLg) for more information about permission schemes. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) + * + * @tags Project permission schemes + * @name AssignPermissionScheme + * @summary Assign permission scheme + * @request PUT:/rest/api/3/project/{projectKeyOrId}/permissionscheme + * @secure + */ + assignPermissionScheme: ({ + projectKeyOrId, + data, + query, + params = {}, + }: { + projectKeyOrId: string; + data: IdBean; + query?: { + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are included when you specify any value. Expand options include: + * + * * `all` Returns all expandable information. + * * `field` Returns information about the custom field granted the permission. + * * `group` Returns information about the group that is granted the permission. + * * `permissions` Returns all permission grants for each permission scheme. + * * `projectRole` Returns information about the project role granted the permission. + * * `user` Returns information about the user who is granted the permission. + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectKeyOrId}/permissionscheme`, + method: "PUT", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns all [issue security](https://confluence.atlassian.com/x/J4lKLg) levels for the project that the user has access to. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse projects* [global permission](https://confluence.atlassian.com/x/x4dKLg) for the project, however, issue security levels are only returned for authenticated user with *Set Issue Security* [global permission](https://confluence.atlassian.com/x/x4dKLg) for the project. + * + * @tags Project permission schemes + * @name GetSecurityLevelsForProject + * @summary Get project issue security levels + * @request GET:/rest/api/3/project/{projectKeyOrId}/securitylevel + * @secure + */ + getSecurityLevelsForProject: ({ + projectKeyOrId, + params = {}, + }: { + projectKeyOrId: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/project/${projectKeyOrId}/securitylevel`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns all project categories. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Project categories + * @name GetAllProjectCategories + * @summary Get all project categories + * @request GET:/rest/api/3/projectCategory + * @secure + */ + getAllProjectCategories: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/projectCategory`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates a project category. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Project categories + * @name CreateProjectCategory + * @summary Create project category + * @request POST:/rest/api/3/projectCategory + * @secure + */ + createProjectCategory: ({ data, params = {} }: { data: ProjectCategory; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/projectCategory`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes a project category. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Project categories + * @name RemoveProjectCategory + * @summary Delete project category + * @request DELETE:/rest/api/3/projectCategory/{id} + * @secure + */ + removeProjectCategory: ({ id, params = {} }: { id: number; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/projectCategory/${id}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Returns a project category. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Project categories + * @name GetProjectCategoryById + * @summary Get project category by ID + * @request GET:/rest/api/3/projectCategory/{id} + * @secure + */ + getProjectCategoryById: ({ id, params = {} }: { id: number; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/projectCategory/${id}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates a project category. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Project categories + * @name UpdateProjectCategory + * @summary Update project category + * @request PUT:/rest/api/3/projectCategory/{id} + * @secure + */ + updateProjectCategory: ({ id, data, params = {} }: { id: number; data: ProjectCategory; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/projectCategory/${id}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Validates a project key by confirming the key is a valid string and not in use. **[Permissions](#permissions) required:** None. + * + * @tags Project key and name validation + * @name ValidateProjectKey + * @summary Validate project key + * @request GET:/rest/api/3/projectvalidate/key + * @secure + */ + validateProjectKey: ({ + query, + params = {}, + }: { + query?: { + /** + * The project key. + * @example "HSP" + */ + key?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/projectvalidate/key`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Validates a project key and, if the key is invalid or in use, generates a valid random string for the project key. **[Permissions](#permissions) required:** None. + * + * @tags Project key and name validation + * @name GetValidProjectKey + * @summary Get valid project key + * @request GET:/rest/api/3/projectvalidate/validProjectKey + * @secure + */ + getValidProjectKey: ({ + query, + params = {}, + }: { + query?: { + /** + * The project key. + * @example "HSP" + */ + key?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/projectvalidate/validProjectKey`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Checks that a project name isn't in use. If the name isn't in use, the passed string is returned. If the name is in use, this operation attempts to generate a valid project name based on the one supplied, usually by adding a sequence number. If a valid project name cannot be generated, a 404 response is returned. **[Permissions](#permissions) required:** None. + * + * @tags Project key and name validation + * @name GetValidProjectName + * @summary Get valid project name + * @request GET:/rest/api/3/projectvalidate/validProjectName + * @secure + */ + getValidProjectName: ({ + query, + params = {}, + }: { + query: { + /** The project name. */ + name: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/projectvalidate/validProjectName`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a list of all issue resolution values. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Issue resolutions + * @name GetResolutions + * @summary Get resolutions + * @request GET:/rest/api/3/resolution + * @deprecated + * @secure + */ + getResolutions: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/resolution`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates an issue resolution. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue resolutions + * @name CreateResolution + * @summary Create resolution + * @request POST:/rest/api/3/resolution + * @secure + */ + createResolution: ({ data, params = {} }: { data: CreateResolutionDetails; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/resolution`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Sets default issue resolution. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue resolutions + * @name SetDefaultResolution + * @summary Set default resolution + * @request PUT:/rest/api/3/resolution/default + * @secure + */ + setDefaultResolution: ({ data, params = {} }: { data: SetDefaultResolutionRequest; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/resolution/default`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Changes the order of issue resolutions. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue resolutions + * @name MoveResolutions + * @summary Move resolutions + * @request PUT:/rest/api/3/resolution/move + * @secure + */ + moveResolutions: ({ data, params = {} }: { data: ReorderIssueResolutionsRequest; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/resolution/move`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of resolutions. The list can contain all resolutions or a subset determined by any combination of these criteria: * a list of resolutions IDs. * whether the field configuration is a default. This returns resolutions from company-managed (classic) projects only, as there is no concept of default resolutions in team-managed projects. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Issue resolutions + * @name SearchResolutions + * @summary Search resolutions + * @request GET:/rest/api/3/resolution/search + * @secure + */ + searchResolutions: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @default "0" + */ + startAt?: string; + /** + * The maximum number of items to return per page. + * @default "50" + */ + maxResults?: string; + /** The list of resolutions IDs to be filtered out */ + id?: string[]; + /** + * When set to true, return default only, when IDs provided, if none of them is default, return empty page. Default value is false + * @default false + */ + onlyDefault?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/resolution/search`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes an issue resolution. This operation is [asynchronous](#async). Follow the `location` link in the response to determine the status of the task and use [Get task](#api-rest-api-3-task-taskId-get) to obtain subsequent updates. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue resolutions + * @name DeleteResolution + * @summary Delete resolution + * @request DELETE:/rest/api/3/resolution/{id} + * @secure + */ + deleteResolution: ({ + id, + query, + params = {}, + }: { + id: string; + query: { + /** The ID of the issue resolution that will replace the currently selected resolution. */ + replaceWith: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/resolution/${id}`, + method: "DELETE", + query: query, + secure: true, + ...params, + }), + + /** + * @description Returns an issue resolution value. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Issue resolutions + * @name GetResolution + * @summary Get resolution + * @request GET:/rest/api/3/resolution/{id} + * @secure + */ + getResolution: ({ id, params = {} }: { id: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/resolution/${id}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates an issue resolution. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue resolutions + * @name UpdateResolution + * @summary Update resolution + * @request PUT:/rest/api/3/resolution/{id} + * @secure + */ + updateResolution: ({ + id, + data, + params = {}, + }: { + id: string; + data: UpdateResolutionDetails; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/resolution/${id}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Gets a list of all project roles, complete with project role details and default actors. ### About project roles ### [Project roles](https://confluence.atlassian.com/x/3odKLg) are a flexible way to to associate users and groups with projects. In Jira Cloud, the list of project roles is shared globally with all projects, but each project can have a different set of actors associated with it (unlike groups, which have the same membership throughout all Jira applications). Project roles are used in [permission schemes](#api-rest-api-3-permissionscheme-get), [email notification schemes](#api-rest-api-3-notificationscheme-get), [issue security levels](#api-rest-api-3-issuesecurityschemes-get), [comment visibility](#api-rest-api-3-comment-list-post), and workflow conditions. #### Members and actors #### In the Jira REST API, a member of a project role is called an *actor*. An *actor* is a group or user associated with a project role. Actors may be set as [default members](https://confluence.atlassian.com/x/3odKLg#Managingprojectroles-Specifying'defaultmembers'foraprojectrole) of the project role or set at the project level: * Default actors: Users and groups that are assigned to the project role for all newly created projects. The default actors can be removed at the project level later if desired. * Actors: Users and groups that are associated with a project role for a project, which may differ from the default actors. This enables you to assign a user to different roles in different projects. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Project roles + * @name GetAllProjectRoles + * @summary Get all project roles + * @request GET:/rest/api/3/role + * @secure + */ + getAllProjectRoles: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/role`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates a new project role with no [default actors](#api-rest-api-3-resolution-get). You can use the [Add default actors to project role](#api-rest-api-3-role-id-actors-post) operation to add default actors to the project role after creating it. *Note that although a new project role is available to all projects upon creation, any default actors that are associated with the project role are not added to projects that existed prior to the role being created.*< **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Project roles + * @name CreateProjectRole + * @summary Create project role + * @request POST:/rest/api/3/role + * @secure + */ + createProjectRole: ({ data, params = {} }: { data: CreateUpdateRoleRequestBean; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/role`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes a project role. You must specify a replacement project role if you wish to delete a project role that is in use. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Project roles + * @name DeleteProjectRole + * @summary Delete project role + * @request DELETE:/rest/api/3/role/{id} + * @secure + */ + deleteProjectRole: ({ + id, + query, + params = {}, + }: { + id: number; + query?: { + /** + * The ID of the project role that will replace the one being deleted. + * @format int64 + */ + swap?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/role/${id}`, + method: "DELETE", + query: query, + secure: true, + ...params, + }), + + /** + * @description Gets the project role details and the default actors associated with the role. The list of default actors is sorted by display name. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Project roles + * @name GetProjectRoleById + * @summary Get project role by ID + * @request GET:/rest/api/3/role/{id} + * @secure + */ + getProjectRoleById: ({ id, params = {} }: { id: number; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/role/${id}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates either the project role's name or its description. You cannot update both the name and description at the same time using this operation. If you send a request with a name and a description only the name is updated. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Project roles + * @name PartialUpdateProjectRole + * @summary Partial update project role + * @request POST:/rest/api/3/role/{id} + * @secure + */ + partialUpdateProjectRole: ({ + id, + data, + params = {}, + }: { + id: number; + data: CreateUpdateRoleRequestBean; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/role/${id}`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Updates the project role's name and description. You must include both a name and a description in the request. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Project roles + * @name FullyUpdateProjectRole + * @summary Fully update project role + * @request PUT:/rest/api/3/role/{id} + * @secure + */ + fullyUpdateProjectRole: ({ + id, + data, + params = {}, + }: { + id: number; + data: CreateUpdateRoleRequestBean; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/role/${id}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes the [default actors](#api-rest-api-3-resolution-get) from a project role. You may delete a group or user, but you cannot delete a group and a user in the same request. Changing a project role's default actors does not affect project role members for projects already created. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Project role actors + * @name DeleteProjectRoleActorsFromRole + * @summary Delete default actors from project role + * @request DELETE:/rest/api/3/role/{id}/actors + * @secure + */ + deleteProjectRoleActorsFromRole: ({ + id, + query, + params = {}, + }: { + id: number; + query?: { + /** + * The user account ID of the user to remove as a default actor. + * @example "5b10ac8d82e05b22cc7d4ef5" + */ + user?: string; + /** The group ID of the group to be removed as a default actor. This parameter cannot be used with the `group` parameter. */ + groupId?: string; + /** The group name of the group to be removed as a default actor.This parameter cannot be used with the `groupId` parameter. As a group's name can change, use of `groupId` is recommended. */ + group?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/role/${id}/actors`, + method: "DELETE", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the [default actors](#api-rest-api-3-resolution-get) for the project role. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Project role actors + * @name GetProjectRoleActorsForRole + * @summary Get default actors for project role + * @request GET:/rest/api/3/role/{id}/actors + * @secure + */ + getProjectRoleActorsForRole: ({ id, params = {} }: { id: number; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/role/${id}/actors`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Adds [default actors](#api-rest-api-3-resolution-get) to a role. You may add groups or users, but you cannot add groups and users in the same request. Changing a project role's default actors does not affect project role members for projects already created. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Project role actors + * @name AddProjectRoleActorsToRole + * @summary Add default actors to project role + * @request POST:/rest/api/3/role/{id}/actors + * @secure + */ + addProjectRoleActorsToRole: ({ + id, + data, + params = {}, + }: { + id: number; + data: ActorInputBean; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/role/${id}/actors`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of all screens or those specified by one or more screen IDs. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Screens + * @name GetScreens + * @summary Get screens + * @request GET:/rest/api/3/screens + * @secure + */ + getScreens: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 100 + */ + maxResults?: number; + /** + * The list of screen IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + * @uniqueItems true + */ + id?: number[]; + /** + * String used to perform a case-insensitive partial match with screen name. + * @default "" + */ + queryString?: string; + /** + * The scope filter string. To filter by multiple scope, provide an ampersand-separated list. For example, `scope=GLOBAL&scope=PROJECT`. + * @uniqueItems true + */ + scope?: ("GLOBAL" | "TEMPLATE" | "PROJECT")[]; + /** + * [Order](#ordering) the results by a field: + * + * * `id` Sorts by screen ID. + * * `name` Sorts by screen name. + */ + orderBy?: "name" | "-name" | "+name" | "id" | "-id" | "+id"; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/screens`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates a screen with a default field tab. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Screens + * @name CreateScreen + * @summary Create screen + * @request POST:/rest/api/3/screens + * @secure + */ + createScreen: ({ data, params = {} }: { data: ScreenDetails; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/screens`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Adds a field to the default tab of the default screen. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Screens + * @name AddFieldToDefaultScreen + * @summary Add field to default screen + * @request POST:/rest/api/3/screens/addToDefault/{fieldId} + * @secure + */ + addFieldToDefaultScreen: ({ fieldId, params = {} }: { fieldId: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/screens/addToDefault/${fieldId}`, + method: "POST", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes a screen. A screen cannot be deleted if it is used in a screen scheme, workflow, or workflow draft. Only screens used in classic projects can be deleted. + * + * @tags Screens + * @name DeleteScreen + * @summary Delete screen + * @request DELETE:/rest/api/3/screens/{screenId} + * @secure + */ + deleteScreen: ({ screenId, params = {} }: { screenId: number; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/screens/${screenId}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Updates a screen. Only screens used in classic projects can be updated. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Screens + * @name UpdateScreen + * @summary Update screen + * @request PUT:/rest/api/3/screens/{screenId} + * @secure + */ + updateScreen: ({ + screenId, + data, + params = {}, + }: { + screenId: number; + data: UpdateScreenDetails; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/screens/${screenId}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns the fields that can be added to a tab on a screen. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Screens + * @name GetAvailableScreenFields + * @summary Get available screen fields + * @request GET:/rest/api/3/screens/{screenId}/availableFields + * @secure + */ + getAvailableScreenFields: ({ screenId, params = {} }: { screenId: number; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/screens/${screenId}/availableFields`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the list of tabs for a screen. **[Permissions](#permissions) required:** * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen Scheme. + * + * @tags Screen tabs + * @name GetAllScreenTabs + * @summary Get all screen tabs + * @request GET:/rest/api/3/screens/{screenId}/tabs + * @secure + */ + getAllScreenTabs: ({ + screenId, + query, + params = {}, + }: { + screenId: number; + query?: { + /** The key of the project. */ + projectKey?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/screens/${screenId}/tabs`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates a tab for a screen. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Screen tabs + * @name AddScreenTab + * @summary Create screen tab + * @request POST:/rest/api/3/screens/{screenId}/tabs + * @secure + */ + addScreenTab: ({ + screenId, + data, + params = {}, + }: { + screenId: number; + data: ScreenableTab; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/screens/${screenId}/tabs`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes a screen tab. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Screen tabs + * @name DeleteScreenTab + * @summary Delete screen tab + * @request DELETE:/rest/api/3/screens/{screenId}/tabs/{tabId} + * @secure + */ + deleteScreenTab: ({ screenId, tabId, params = {} }: { screenId: number; tabId: number; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/screens/${screenId}/tabs/${tabId}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Updates the name of a screen tab. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Screen tabs + * @name RenameScreenTab + * @summary Update screen tab + * @request PUT:/rest/api/3/screens/{screenId}/tabs/{tabId} + * @secure + */ + renameScreenTab: ({ + screenId, + tabId, + data, + params = {}, + }: { + screenId: number; + tabId: number; + data: ScreenableTab; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/screens/${screenId}/tabs/${tabId}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns all fields for a screen tab. **[Permissions](#permissions) required:** * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg) when the project key is specified, providing that the screen is associated with the project through a Screen Scheme and Issue Type Screen Scheme. + * + * @tags Screen tab fields + * @name GetAllScreenTabFields + * @summary Get all screen tab fields + * @request GET:/rest/api/3/screens/{screenId}/tabs/{tabId}/fields + * @secure + */ + getAllScreenTabFields: ({ + screenId, + tabId, + query, + params = {}, + }: { + screenId: number; + tabId: number; + query?: { + /** The key of the project. */ + projectKey?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/screens/${screenId}/tabs/${tabId}/fields`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Adds a field to a screen tab. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Screen tab fields + * @name AddScreenTabField + * @summary Add screen tab field + * @request POST:/rest/api/3/screens/{screenId}/tabs/{tabId}/fields + * @secure + */ + addScreenTabField: ({ + screenId, + tabId, + data, + params = {}, + }: { + screenId: number; + tabId: number; + data: AddFieldBean; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/screens/${screenId}/tabs/${tabId}/fields`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Removes a field from a screen tab. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Screen tab fields + * @name RemoveScreenTabField + * @summary Remove screen tab field + * @request DELETE:/rest/api/3/screens/{screenId}/tabs/{tabId}/fields/{id} + * @secure + */ + removeScreenTabField: ({ + screenId, + tabId, + id, + params = {}, + }: { + screenId: number; + tabId: number; + id: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/screens/${screenId}/tabs/${tabId}/fields/${id}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Moves a screen tab field. If `after` and `position` are provided in the request, `position` is ignored. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Screen tab fields + * @name MoveScreenTabField + * @summary Move screen tab field + * @request POST:/rest/api/3/screens/{screenId}/tabs/{tabId}/fields/{id}/move + * @secure + */ + moveScreenTabField: ({ + screenId, + tabId, + id, + data, + params = {}, + }: { + screenId: number; + tabId: number; + id: string; + data: MoveFieldBean; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/screens/${screenId}/tabs/${tabId}/fields/${id}/move`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Moves a screen tab. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Screen tabs + * @name MoveScreenTab + * @summary Move screen tab + * @request POST:/rest/api/3/screens/{screenId}/tabs/{tabId}/move/{pos} + * @secure + */ + moveScreenTab: ({ + screenId, + tabId, + pos, + params = {}, + }: { + screenId: number; + tabId: number; + pos: number; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/screens/${screenId}/tabs/${tabId}/move/${pos}`, + method: "POST", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of screen schemes. Only screen schemes used in classic projects are returned. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Screen schemes + * @name GetScreenSchemes + * @summary Get screen schemes + * @request GET:/rest/api/3/screenscheme + * @secure + */ + getScreenSchemes: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 25 + */ + maxResults?: number; + /** + * The list of screen scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + * @uniqueItems true + */ + id?: number[]; + /** + * Use [expand](#expansion) include additional information in the response. This parameter accepts `issueTypeScreenSchemes` that, for each screen schemes, returns information about the issue type screen scheme the screen scheme is assigned to. + * @default "" + */ + expand?: string; + /** + * String used to perform a case-insensitive partial match with screen scheme name. + * @default "" + */ + queryString?: string; + /** + * [Order](#ordering) the results by a field: + * + * * `id` Sorts by screen scheme ID. + * * `name` Sorts by screen scheme name. + */ + orderBy?: "name" | "-name" | "+name" | "id" | "-id" | "+id"; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/screenscheme`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates a screen scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Screen schemes + * @name CreateScreenScheme + * @summary Create screen scheme + * @request POST:/rest/api/3/screenscheme + * @secure + */ + createScreenScheme: ({ data, params = {} }: { data: ScreenSchemeDetails; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/screenscheme`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes a screen scheme. A screen scheme cannot be deleted if it is used in an issue type screen scheme. Only screens schemes used in classic projects can be deleted. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Screen schemes + * @name DeleteScreenScheme + * @summary Delete screen scheme + * @request DELETE:/rest/api/3/screenscheme/{screenSchemeId} + * @secure + */ + deleteScreenScheme: ({ screenSchemeId, params = {} }: { screenSchemeId: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/screenscheme/${screenSchemeId}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Updates a screen scheme. Only screen schemes used in classic projects can be updated. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Screen schemes + * @name UpdateScreenScheme + * @summary Update screen scheme + * @request PUT:/rest/api/3/screenscheme/{screenSchemeId} + * @secure + */ + updateScreenScheme: ({ + screenSchemeId, + data, + params = {}, + }: { + screenSchemeId: string; + data: UpdateScreenSchemeDetails; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/screenscheme/${screenSchemeId}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). If the JQL query expression is too large to be encoded as a query parameter, use the [POST](#api-rest-api-3-search-post) version of this resource. This operation can be accessed anonymously. **[Permissions](#permissions) required:** Issues are included in the response where the user has: * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the issue. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue search + * @name SearchForIssuesUsingJql + * @summary Search for issues using JQL (GET) + * @request GET:/rest/api/3/search + * @secure + */ + searchForIssuesUsingJql: ({ + query, + params = {}, + }: { + query?: { + /** + * The [JQL](https://confluence.atlassian.com/x/egORLQ) that defines the search. Note: + * + * * If no JQL expression is provided, all issues are returned. + * * `username` and `userkey` cannot be used as search terms due to privacy reasons. Use `accountId` instead. + * * If a user has hidden their email address in their user profile, partial matches of the email address will not find the user. An exact match is required. + * @example "project = HSP" + */ + jql?: string; + /** + * The index of the first item to return in a page of results (page offset). + * @format int32 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. To manage page size, Jira may return fewer items per page where a large number of fields are requested. The greatest number of items returned per page is achieved when requesting `id` or `key` only. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * Determines how to validate the JQL query and treat the validation results. Supported values are: + * + * * `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). + * * `warn` Returns all errors as warnings. + * * `none` No validation is performed. + * * `true` *Deprecated* A legacy synonym for `strict`. + * * `false` *Deprecated* A legacy synonym for `warn`. + * + * Note: If the JQL is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. + * @default "strict" + */ + validateQuery?: "strict" | "warn" | "none" | "true" | "false"; + /** + * A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a comma-separated list. Expand options include: + * + * * `*all` Returns all fields. + * * `*navigable` Returns navigable fields. + * * Any issue field, prefixed with a minus to exclude. + * + * Examples: + * + * * `summary,comment` Returns only the summary and comments fields. + * * `-description` Returns all navigable (default) fields except description. + * * `*all,-comment` Returns all fields except comments. + * + * This parameter may be specified multiple times. For example, `fields=field1,field2&fields=field3`. + * + * Note: All navigable fields are returned by default. This differs from [GET issue](#api-rest-api-3-issue-issueIdOrKey-get) where the default is all fields. + */ + fields?: string[]; + /** + * Use [expand](#expansion) to include additional information about issues in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `renderedFields` Returns field values rendered in HTML format. + * * `names` Returns the display name of each field. + * * `schema` Returns the schema describing a field type. + * * `transitions` Returns all possible transitions for the issue. + * * `operations` Returns all possible operations for the issue. + * * `editmeta` Returns information about how each field can be edited. + * * `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * * `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each version of a field's value, with the highest numbered item representing the most recent version. + */ + expand?: string; + /** A list of issue property keys for issue properties to include in the results. This parameter accepts a comma-separated list. Multiple properties can also be provided using an ampersand separated list. For example, `properties=prop1,prop2&properties=prop3`. A maximum of 5 issue property keys can be specified. */ + properties?: string[]; + /** + * Reference fields by their key (rather than ID). + * @default false + */ + fieldsByKeys?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/search`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Searches for issues using [JQL](https://confluence.atlassian.com/x/egORLQ). There is a [GET](#api-rest-api-3-search-get) version of this resource that can be used for smaller JQL query expressions. This operation can be accessed anonymously. **[Permissions](#permissions) required:** Issues are included in the response where the user has: * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the issue. * If [issue-level security](https://confluence.atlassian.com/x/J4lKLg) is configured, issue-level security permission to view the issue. + * + * @tags Issue search + * @name SearchForIssuesUsingJqlPost + * @summary Search for issues using JQL (POST) + * @request POST:/rest/api/3/search + * @secure + */ + searchForIssuesUsingJqlPost: ({ data, params = {} }: { data: SearchRequestBean; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/search`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns details of an issue security level. Use [Get issue security scheme](#api-rest-api-3-issuesecurityschemes-id-get) to obtain the IDs of issue security levels associated with the issue security scheme. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. + * + * @tags Issue security level + * @name GetIssueSecurityLevel + * @summary Get issue security level + * @request GET:/rest/api/3/securitylevel/{id} + * @secure + */ + getIssueSecurityLevel: ({ id, params = {} }: { id: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/securitylevel/${id}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns information about the Jira instance. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. + * + * @tags Server info + * @name GetServerInfo + * @summary Get Jira instance info + * @request GET:/rest/api/3/serverInfo + * @secure + */ + getServerInfo: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/serverInfo`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the default issue navigator columns. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue navigator settings + * @name GetIssueNavigatorDefaultColumns + * @summary Get issue navigator default columns + * @request GET:/rest/api/3/settings/columns + * @secure + */ + getIssueNavigatorDefaultColumns: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/settings/columns`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Sets the default issue navigator columns. The `columns` parameter accepts a navigable field value and is expressed as HTML form data. To specify multiple columns, pass multiple `columns` parameters. For example, in curl: `curl -X PUT -d columns=summary -d columns=description https://your-domain.atlassian.net/rest/api/3/settings/columns` If no column details are sent, then all default columns are removed. A navigable field is one that can be used as a column on the issue navigator. Find details of navigable issue columns using [Get fields](#api-rest-api-3-field-get). **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Issue navigator settings + * @name SetIssueNavigatorDefaultColumns + * @summary Set issue navigator default columns + * @request PUT:/rest/api/3/settings/columns + * @secure + */ + setIssueNavigatorDefaultColumns: ({ data, params = {} }: { data: string[]; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/settings/columns`, + method: "PUT", + body: data, + secure: true, + type: ContentType.FormData, + format: "json", + ...params, + }), + + /** + * @description Returns a list of all statuses associated with active workflows. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. + * + * @tags Workflow statuses + * @name GetStatuses + * @summary Get all statuses + * @request GET:/rest/api/3/status + * @secure + */ + getStatuses: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/status`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a status. The status must be associated with an active workflow to be returned. If a name is used on more than one status, only the status found first is returned. Therefore, identifying the status by its ID may be preferable. This operation can be accessed anonymously. [Permissions](#permissions) required: None. + * + * @tags Workflow statuses + * @name GetStatus + * @summary Get status + * @request GET:/rest/api/3/status/{idOrName} + * @secure + */ + getStatus: ({ idOrName, params = {} }: { idOrName: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/status/${idOrName}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a list of all status categories. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Workflow status categories + * @name GetStatusCategories + * @summary Get all status categories + * @request GET:/rest/api/3/statuscategory + * @secure + */ + getStatusCategories: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/api/3/statuscategory`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a status category. Status categories provided a mechanism for categorizing [statuses](#api-rest-api-3-status-idOrName-get). **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Workflow status categories + * @name GetStatusCategory + * @summary Get status category + * @request GET:/rest/api/3/statuscategory/{idOrKey} + * @secure + */ + getStatusCategory: ({ idOrKey, params = {} }: { idOrKey: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/statuscategory/${idOrKey}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes statuses by ID. **[Permissions](#permissions) required:** * *Administer projects* [project permission.](https://confluence.atlassian.com/x/yodKLg) * *Administer Jira* [project permission.](https://confluence.atlassian.com/x/yodKLg) + * + * @tags Status + * @name DeleteStatusesById + * @summary Bulk delete Statuses + * @request DELETE:/rest/api/3/statuses + * @secure + */ + deleteStatusesById: ({ + query, + params = {}, + }: { + query?: { + /** + * The list of status IDs. To include multiple IDs, provide an ampersand-separated list. For example, id=10000&id=10001. + * + * Min items `1`, Max items `50` + */ + id?: string[]; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/statuses`, + method: "DELETE", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a list of the statuses specified by one or more status IDs. **[Permissions](#permissions) required:** * *Administer projects* [project permission.](https://confluence.atlassian.com/x/yodKLg) * *Administer Jira* [project permission.](https://confluence.atlassian.com/x/yodKLg) + * + * @tags Status + * @name GetStatusesById + * @summary Bulk get statuses + * @request GET:/rest/api/3/statuses + * @secure + */ + getStatusesById: ({ + query, + params = {}, + }: { + query?: { + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `usages` Returns the project and issue types that use the status in their workflow. + */ + expand?: string; + /** + * The list of status IDs. To include multiple IDs, provide an ampersand-separated list. For example, id=10000&id=10001. + * + * Min items `1`, Max items `50` + */ + id?: string[]; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/statuses`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates statuses for a global or project scope. **[Permissions](#permissions) required:** * *Administer projects* [project permission.](https://confluence.atlassian.com/x/yodKLg) * *Administer Jira* [project permission.](https://confluence.atlassian.com/x/yodKLg) + * + * @tags Status + * @name CreateStatuses + * @summary Bulk create statuses + * @request POST:/rest/api/3/statuses + * @secure + */ + createStatuses: ({ data, params = {} }: { data: StatusCreateRequest; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/statuses`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Updates statuses by ID. **[Permissions](#permissions) required:** * *Administer projects* [project permission.](https://confluence.atlassian.com/x/yodKLg) * *Administer Jira* [project permission.](https://confluence.atlassian.com/x/yodKLg) + * + * @tags Status + * @name UpdateStatuses + * @summary Bulk update statuses + * @request PUT:/rest/api/3/statuses + * @secure + */ + updateStatuses: ({ data, params = {} }: { data: StatusUpdateRequest; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/statuses`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](https://developer.atlassian.com/cloud/jira/platform/rest/v3/intro/#pagination) list of statuses that match a search on name or project. **[Permissions](#permissions) required:** * *Administer projects* [project permission.](https://confluence.atlassian.com/x/yodKLg) * *Administer Jira* [project permission.](https://confluence.atlassian.com/x/yodKLg) + * + * @tags Status + * @name Search + * @summary Search statuses paginated + * @request GET:/rest/api/3/statuses/search + * @secure + */ + search: ({ + query, + params = {}, + }: { + query?: { + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `usages` Returns the project and issue types that use the status in their workflow. + */ + expand?: string; + /** The project the status is part of or null for global statuses. */ + projectId?: string; + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 200 + */ + maxResults?: number; + /** + * Term to match status names against or null to search for all statuses in the search scope. + * @maxLength 255 + */ + searchString?: string; + /** Category of the status to filter by. The supported values are: `TODO`, `IN_PROGRESS`, and `DONE`. */ + statusCategory?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/statuses/search`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the status of a [long-running asynchronous task](#async). When a task has finished, this operation returns the JSON blob applicable to the task. See the documentation of the operation that created the task for details. Task details are not permanently retained. As of September 2019, details are retained for 14 days although this period may change without notice. **[Permissions](#permissions) required:** either of: * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * Creator of the task. + * + * @tags Tasks + * @name GetTask + * @summary Get task + * @request GET:/rest/api/3/task/{taskId} + * @secure + */ + getTask: ({ taskId, params = {} }: { taskId: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/task/${taskId}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Cancels a task. **[Permissions](#permissions) required:** either of: * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). * Creator of the task. + * + * @tags Tasks + * @name CancelTask + * @summary Cancel task + * @request POST:/rest/api/3/task/{taskId}/cancel + * @secure + */ + cancelTask: ({ taskId, params = {} }: { taskId: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/task/${taskId}/cancel`, + method: "POST", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Gets UI modifications. UI modifications can only be retrieved by Forge apps. **[Permissions](#permissions) required:** None. + * + * @tags UI modifications (apps) + * @name GetUiModifications + * @summary Get UI modifications + * @request GET:/rest/api/3/uiModifications + * @secure + */ + getUiModifications: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * Use expand to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `data` Returns UI modification data. + * * `contexts` Returns UI modification contexts. + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/uiModifications`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates a UI modification. UI modification can only be created by Forge apps. Each app can define up to 100 UI modifications. Each UI modification can define up to 1000 contexts. **[Permissions](#permissions) required:** * *None* if the UI modification is created without contexts. * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the UI modification is created with contexts. + * + * @tags UI modifications (apps) + * @name CreateUiModification + * @summary Create UI modification + * @request POST:/rest/api/3/uiModifications + * @secure + */ + createUiModification: ({ data, params = {} }: { data: CreateUiModificationDetails; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/uiModifications`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes a UI modification. All the contexts that belong to the UI modification are deleted too. UI modification can only be deleted by Forge apps. **[Permissions](#permissions) required:** None. + * + * @tags UI modifications (apps) + * @name DeleteUiModification + * @summary Delete UI modification + * @request DELETE:/rest/api/3/uiModifications/{uiModificationId} + * @secure + */ + deleteUiModification: ({ uiModificationId, params = {} }: { uiModificationId: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/uiModifications/${uiModificationId}`, + method: "DELETE", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates a UI modification. UI modification can only be updated by Forge apps. Each UI modification can define up to 1000 contexts. **[Permissions](#permissions) required:** * *None* if the UI modification is created without contexts. * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for one or more projects, if the UI modification is created with contexts. + * + * @tags UI modifications (apps) + * @name UpdateUiModification + * @summary Update UI modification + * @request PUT:/rest/api/3/uiModifications/{uiModificationId} + * @secure + */ + updateUiModification: ({ + uiModificationId, + data, + params = {}, + }: { + uiModificationId: string; + data: UpdateUiModificationDetails; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/uiModifications/${uiModificationId}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns the system and custom avatars for a project or issue type. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * for custom project avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project the avatar belongs to. * for custom issue type avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one project the issue type is used in. * for system avatars, none. + * + * @tags Avatars + * @name GetAvatars + * @summary Get avatars + * @request GET:/rest/api/3/universal_avatar/type/{type}/owner/{entityId} + * @secure + */ + getAvatars: ({ + type, + entityId, + params = {}, + }: { + type: "project" | "issuetype"; + entityId: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/universal_avatar/type/${type}/owner/${entityId}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Loads a custom avatar for a project or issue type. Specify the avatar's local file location in the body of the request. Also, include the following headers: * `X-Atlassian-Token: no-check` To prevent XSRF protection blocking the request, for more information see [Special Headers](#special-request-headers). * `Content-Type: image/image type` Valid image types are JPEG, GIF, or PNG. For example: `curl --request POST ` `--user email@example.com: ` `--header 'X-Atlassian-Token: no-check' ` `--header 'Content-Type: image/< image_type>' ` `--data-binary "<@/path/to/file/with/your/avatar>" ` `--url 'https://your-domain.atlassian.net/rest/api/3/universal_avatar/type/{type}/owner/{entityId}'` The avatar is cropped to a square. If no crop parameters are specified, the square originates at the top left of the image. The length of the square's sides is set to the smaller of the height or width of the image. The cropped image is then used to create avatars of 16x16, 24x24, 32x32, and 48x48 in size. After creating the avatar use: * [Update issue type](#api-rest-api-3-issuetype-id-put) to set it as the issue type's displayed avatar. * [Set project avatar](#api-rest-api-3-project-projectIdOrKey-avatar-put) to set it as the project's displayed avatar. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Avatars + * @name StoreAvatar + * @summary Load avatar + * @request POST:/rest/api/3/universal_avatar/type/{type}/owner/{entityId} + * @secure + */ + storeAvatar: ({ + type, + entityId, + query, + data, + params = {}, + }: { + type: "project" | "issuetype"; + entityId: string; + query: { + /** + * The X coordinate of the top-left corner of the crop region. + * @format int32 + * @default 0 + */ + x?: number; + /** + * The Y coordinate of the top-left corner of the crop region. + * @format int32 + * @default 0 + */ + y?: number; + /** + * The length of each side of the crop region. + * @format int32 + */ + size: number; + }; + data: any; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/universal_avatar/type/${type}/owner/${entityId}`, + method: "POST", + query: query, + body: data, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes an avatar from a project or issue type. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Avatars + * @name DeleteAvatar + * @summary Delete avatar + * @request DELETE:/rest/api/3/universal_avatar/type/{type}/owner/{owningObjectId}/avatar/{id} + * @secure + */ + deleteAvatar: ({ + type, + owningObjectId, + id, + params = {}, + }: { + type: "project" | "issuetype"; + owningObjectId: string; + id: number; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/universal_avatar/type/${type}/owner/${owningObjectId}/avatar/${id}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Returns the default project or issue type avatar image. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. + * + * @tags Avatars + * @name GetAvatarImageByType + * @summary Get avatar image by type + * @request GET:/rest/api/3/universal_avatar/view/type/{type} + * @secure + */ + getAvatarImageByType: ({ + type, + query, + params = {}, + }: { + type: "issuetype" | "project"; + query?: { + /** The size of the avatar image. If not provided the default size is returned. */ + size?: "xsmall" | "small" | "medium" | "large" | "xlarge"; + /** The format to return the avatar image in. If not provided the original content format is returned. */ + format?: "png" | "svg"; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/universal_avatar/view/type/${type}`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a project or issue type avatar image by ID. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * For system avatars, none. * For custom project avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project the avatar belongs to. * For custom issue type avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one project the issue type is used in. + * + * @tags Avatars + * @name GetAvatarImageById + * @summary Get avatar image by ID + * @request GET:/rest/api/3/universal_avatar/view/type/{type}/avatar/{id} + * @secure + */ + getAvatarImageById: ({ + type, + id, + query, + params = {}, + }: { + type: "issuetype" | "project"; + id: number; + query?: { + /** The size of the avatar image. If not provided the default size is returned. */ + size?: "xsmall" | "small" | "medium" | "large" | "xlarge"; + /** The format to return the avatar image in. If not provided the original content format is returned. */ + format?: "png" | "svg"; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/universal_avatar/view/type/${type}/avatar/${id}`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the avatar image for a project or issue type. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * For system avatars, none. * For custom project avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project the avatar belongs to. * For custom issue type avatars, *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for at least one project the issue type is used in. + * + * @tags Avatars + * @name GetAvatarImageByOwner + * @summary Get avatar image by owner + * @request GET:/rest/api/3/universal_avatar/view/type/{type}/owner/{entityId} + * @secure + */ + getAvatarImageByOwner: ({ + type, + entityId, + query, + params = {}, + }: { + type: "issuetype" | "project"; + entityId: string; + query?: { + /** The size of the avatar image. If not provided the default size is returned. */ + size?: "xsmall" | "small" | "medium" | "large" | "xlarge"; + /** The format to return the avatar image in. If not provided the original content format is returned. */ + format?: "png" | "svg"; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/universal_avatar/view/type/${type}/owner/${entityId}`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes a user. If the operation completes successfully then the user is removed from Jira's user base. This operation does not delete the user's Atlassian account. **[Permissions](#permissions) required:** Site administration (that is, membership of the *site-admin* [group](https://confluence.atlassian.com/x/24xjL)). + * + * @tags Users + * @name RemoveUser + * @summary Delete user + * @request DELETE:/rest/api/3/user + * @secure + */ + removeUser: ({ + query, + params = {}, + }: { + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + * @maxLength 128 + * @example "5b10ac8d82e05b22cc7d4ef5" + */ + accountId: string; + /** This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + username?: string; + /** This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + key?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/user`, + method: "DELETE", + query: query, + secure: true, + ...params, + }), + + /** + * @description Returns a user. Privacy controls are applied to the response based on the user's preferences. This could mean, for example, that the user's email address is hidden. See the [Profile visibility overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. **[Permissions](#permissions) required:** *Browse users and groups* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Users + * @name GetUser + * @summary Get user + * @request GET:/rest/api/3/user + * @secure + */ + getUser: ({ + query, + params = {}, + }: { + query?: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. Required. + * @maxLength 128 + * @example "5b10ac8d82e05b22cc7d4ef5" + */ + accountId?: string; + /** This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide) for details. */ + username?: string; + /** This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide) for details. */ + key?: string; + /** + * Use [expand](#expansion) to include additional information about users in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `groups` includes all groups and nested groups to which the user belongs. + * * `applicationRoles` includes details of all the applications to which the user has access. + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/user`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates a user. This resource is retained for legacy compatibility. As soon as a more suitable alternative is available this resource will be deprecated. If the user exists and has access to Jira, the operation returns a 201 status. If the user exists but does not have access to Jira, the operation returns a 400 status. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Users + * @name CreateUser + * @summary Create user + * @request POST:/rest/api/3/user + * @secure + */ + createUser: ({ data, params = {} }: { data: NewUserDetails; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/user`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a list of users who can be assigned issues in one or more projects. The list may be restricted to users whose attributes match a string. This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and then returns only the users from that range that can be assigned issues in the projects. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users who can be assigned issues in the projects, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your code. Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that the user's email address is hidden. See the [Profile visibility overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. This operation can be accessed anonymously. **[Permissions](#permissions) required:** None. + * + * @tags User search + * @name FindBulkAssignableUsers + * @summary Find users assignable to projects + * @request GET:/rest/api/3/user/assignable/multiProjectSearch + * @secure + */ + findBulkAssignableUsers: ({ + query, + params = {}, + }: { + query: { + /** + * A query string that is matched against user attributes, such as `displayName` and `emailAddress`, to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. Required, unless `accountId` is specified. + * @example "query" + */ + query?: string; + /** This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + username?: string; + /** + * A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. + * @maxLength 128 + */ + accountId?: string; + /** A list of project keys (case sensitive). This parameter accepts a comma-separated list. */ + projectKeys: string; + /** + * The index of the first item to return in a page of results (page offset). + * @format int32 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/user/assignable/multiProjectSearch`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a list of users that can be assigned to an issue. Use this operation to find the list of users who can be assigned to: * a new issue, by providing the `projectKeyOrId`. * an updated issue, by providing the `issueKey`. * to an issue during a transition (workflow action), by providing the `issueKey` and the transition id in `actionDescriptorId`. You can obtain the IDs of an issue's valid transitions using the `transitions` option in the `expand` parameter of [ Get issue](#api-rest-api-3-issue-issueIdOrKey-get). In all these cases, you can pass an account ID to determine if a user can be assigned to an issue. The user is returned in the response if they can be assigned to the issue or issue transition. This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and then returns only the users from that range that can be assigned the issue. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users who can be assigned the issue, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your code. Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that the user's email address is hidden. See the [Profile visibility overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags User search + * @name FindAssignableUsers + * @summary Find users assignable to issues + * @request GET:/rest/api/3/user/assignable/search + * @secure + */ + findAssignableUsers: ({ + query, + params = {}, + }: { + query?: { + /** + * A query string that is matched against user attributes, such as `displayName`, and `emailAddress`, to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. Required, unless `username` or `accountId` is specified. + * @example "query" + */ + query?: string; + /** The sessionId of this request. SessionId is the same until the assignee is set. */ + sessionId?: string; + /** This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + username?: string; + /** + * A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. + * @maxLength 128 + */ + accountId?: string; + /** The project ID or project key (case sensitive). Required, unless `issueKey` is specified. */ + project?: string; + /** The key of the issue. Required, unless `project` is specified. */ + issueKey?: string; + /** + * The index of the first item to return in a page of results (page offset). + * @format int32 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return. This operation may return less than the maximum number of items even if more are available. The operation fetches users up to the maximum and then, from the fetched users, returns only the users that can be assigned to the issue. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * The ID of the transition. + * @format int32 + */ + actionDescriptorId?: number; + /** @default false */ + recommend?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/user/assignable/search`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of the users specified by one or more account IDs. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Users + * @name BulkGetUsers + * @summary Bulk get users + * @request GET:/rest/api/3/user/bulk + * @secure + */ + bulkGetUsers: ({ + query, + params = {}, + }: { + query: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 10 + */ + maxResults?: number; + /** This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + username?: string[]; + /** This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + key?: string[]; + /** + * The account ID of a user. To specify multiple users, pass multiple `accountId` parameters. For example, `accountId=5b10a2844c20165700ede21g&accountId=5b10ac8d82e05b22cc7d4ef5`. + * @maxLength 128 + * @example "5b10ac8d82e05b22cc7d4ef5" + */ + accountId: string[]; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/user/bulk`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the account IDs for the users specified in the `key` or `username` parameters. Note that multiple `key` or `username` parameters can be specified. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Users + * @name BulkGetUsersMigration + * @summary Get account IDs for users + * @request GET:/rest/api/3/user/bulk/migration + * @secure + */ + bulkGetUsersMigration: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 10 + */ + maxResults?: number; + /** Username of a user. To specify multiple users, pass multiple copies of this parameter. For example, `username=fred&username=barney`. Required if `key` isn't provided. Cannot be provided if `key` is present. */ + username?: string[]; + /** Key of a user. To specify multiple users, pass multiple copies of this parameter. For example, `key=fred&key=barney`. Required if `username` isn't provided. Cannot be provided if `username` is present. */ + key?: string[]; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/user/bulk/migration`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Resets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user to the system default. If `accountId` is not passed, the calling user's default columns are reset. **[Permissions](#permissions) required:** * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. * Permission to access Jira, to set the calling user's columns. + * + * @tags Users + * @name ResetUserColumns + * @summary Reset user default columns + * @request DELETE:/rest/api/3/user/columns + * @secure + */ + resetUserColumns: ({ + query, + params = {}, + }: { + query?: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + * @maxLength 128 + * @example "5b10ac8d82e05b22cc7d4ef5" + */ + accountId?: string; + /** This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + username?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/user/columns`, + method: "DELETE", + query: query, + secure: true, + ...params, + }), + + /** + * @description Returns the default [issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If `accountId` is not passed in the request, the calling user's details are returned. **[Permissions](#permissions) required:** * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLgl), to get the column details for any user. * Permission to access Jira, to get the calling user's column details. + * + * @tags Users + * @name GetUserDefaultColumns + * @summary Get user default columns + * @request GET:/rest/api/3/user/columns + * @secure + */ + getUserDefaultColumns: ({ + query, + params = {}, + }: { + query?: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + * @maxLength 128 + * @example "5b10ac8d82e05b22cc7d4ef5" + */ + accountId?: string; + /** This parameter is no longer available See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + username?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/user/columns`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Sets the default [ issue table columns](https://confluence.atlassian.com/x/XYdKLg) for the user. If an account ID is not passed, the calling user's default columns are set. If no column details are sent, then all default columns are removed. The parameters for this resource are expressed as HTML form data. For example, in curl: `curl -X PUT -d columns=summary -d columns=description https://your-domain.atlassian.net/rest/api/3/user/columns?accountId=5b10ac8d82e05b22cc7d4ef5'` **[Permissions](#permissions) required:** * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg), to set the columns on any user. * Permission to access Jira, to set the calling user's columns. + * + * @tags Users + * @name SetUserColumns + * @summary Set user default columns + * @request PUT:/rest/api/3/user/columns + * @secure + */ + setUserColumns: ({ + data, + query, + params = {}, + }: { + data: string[]; + query?: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + * @maxLength 128 + * @example "5b10ac8d82e05b22cc7d4ef5" + */ + accountId?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/user/columns`, + method: "PUT", + query: query, + body: data, + secure: true, + type: ContentType.FormData, + format: "json", + ...params, + }), + + /** + * @description Returns a user's email address. This API is only available to apps approved by Atlassian, according to these [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + * + * @tags Users + * @name GetUserEmail + * @summary Get user email + * @request GET:/rest/api/3/user/email + * @secure + */ + getUserEmail: ({ + query, + params = {}, + }: { + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, `5b10ac8d82e05b22cc7d4ef5`. + * @maxLength 128 + */ + accountId: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/user/email`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a user's email address. This API is only available to apps approved by Atlassian, according to these [guidelines](https://community.developer.atlassian.com/t/guidelines-for-requesting-access-to-email-address/27603). + * + * @tags Users + * @name GetUserEmailBulk + * @summary Get user email bulk + * @request GET:/rest/api/3/user/email/bulk + * @secure + */ + getUserEmailBulk: ({ + query, + params = {}, + }: { + query: { + /** + * The account IDs of the users for which emails are required. An `accountId` is an identifier that uniquely identifies the user across all Atlassian products. For example, `5b10ac8d82e05b22cc7d4ef5`. Note, this should be treated as an opaque identifier (that is, do not assume any structure in the value). + * @maxLength 128 + */ + accountId: string[]; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/user/email/bulk`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the groups to which a user belongs. **[Permissions](#permissions) required:** *Browse users and groups* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Users + * @name GetUserGroups + * @summary Get user groups + * @request GET:/rest/api/3/user/groups + * @secure + */ + getUserGroups: ({ + query, + params = {}, + }: { + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + * @maxLength 128 + * @example "5b10ac8d82e05b22cc7d4ef5" + */ + accountId: string; + /** This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + username?: string; + /** This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + key?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/user/groups`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a list of users who fulfill these criteria: * their user attributes match a search string. * they have a set of permissions for a project or issue. If no search string is provided, a list of all users with the permissions is returned. This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and then returns only the users from that range that match the search string and have permission for the project or issue. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users who match the search string and have permission for the project or issue, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your code. Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that the user's email address is hidden. See the [Profile visibility overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. This operation can be accessed anonymously. **[Permissions](#permissions) required:** * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg), to get users for any project. * *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for a project, to get users for that project. + * + * @tags User search + * @name FindUsersWithAllPermissions + * @summary Find users with permissions + * @request GET:/rest/api/3/user/permission/search + * @secure + */ + findUsersWithAllPermissions: ({ + query, + params = {}, + }: { + query: { + /** + * A query string that is matched against user attributes, such as `displayName` and `emailAddress`, to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. Required, unless `accountId` is specified. + * @example "query" + */ + query?: string; + /** This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + username?: string; + /** + * A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. + * @maxLength 128 + */ + accountId?: string; + /** + * A comma separated list of permissions. Permissions can be specified as any: + * + * * permission returned by [Get all permissions](#api-rest-api-3-permissions-get). + * * custom project permission added by Connect apps. + * * (deprecated) one of the following: + * + * * ASSIGNABLE\_USER + * * ASSIGN\_ISSUE + * * ATTACHMENT\_DELETE\_ALL + * * ATTACHMENT\_DELETE\_OWN + * * BROWSE + * * CLOSE\_ISSUE + * * COMMENT\_DELETE\_ALL + * * COMMENT\_DELETE\_OWN + * * COMMENT\_EDIT\_ALL + * * COMMENT\_EDIT\_OWN + * * COMMENT\_ISSUE + * * CREATE\_ATTACHMENT + * * CREATE\_ISSUE + * * DELETE\_ISSUE + * * EDIT\_ISSUE + * * LINK\_ISSUE + * * MANAGE\_WATCHER\_LIST + * * MODIFY\_REPORTER + * * MOVE\_ISSUE + * * PROJECT\_ADMIN + * * RESOLVE\_ISSUE + * * SCHEDULE\_ISSUE + * * SET\_ISSUE\_SECURITY + * * TRANSITION\_ISSUE + * * VIEW\_VERSION\_CONTROL + * * VIEW\_VOTERS\_AND\_WATCHERS + * * VIEW\_WORKFLOW\_READONLY + * * WORKLOG\_DELETE\_ALL + * * WORKLOG\_DELETE\_OWN + * * WORKLOG\_EDIT\_ALL + * * WORKLOG\_EDIT\_OWN + * * WORK\_ISSUE + */ + permissions: string; + /** The issue key for the issue. */ + issueKey?: string; + /** The project key for the project (case sensitive). */ + projectKey?: string; + /** + * The index of the first item to return in a page of results (page offset). + * @format int32 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/user/permission/search`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a list of users whose attributes match the query term. The returned object includes the `html` field where the matched query term is highlighted with the HTML strong tag. A list of account IDs can be provided to exclude users from the results. This operation takes the users in the range defined by `maxResults`, up to the thousandth user, and then returns only the users from that range that match the query term. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users who match the query term, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your code. Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that the user's email address is hidden. See the [Profile visibility overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse users and groups* [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by users without the required permission return search results for an exact name match only. + * + * @tags User search + * @name FindUsersForPicker + * @summary Find users for picker + * @request GET:/rest/api/3/user/picker + * @secure + */ + findUsersForPicker: ({ + query, + params = {}, + }: { + query: { + /** A query string that is matched against user attributes, such as `displayName`, and `emailAddress`, to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. */ + query: string; + /** + * The maximum number of items to return. The total number of matched users is returned in `total`. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * Include the URI to the user's avatar. + * @default false + */ + showAvatar?: boolean; + /** This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + exclude?: string[]; + /** A list of account IDs to exclude from the search results. This parameter accepts a comma-separated list. Multiple account IDs can also be provided using an ampersand-separated list. For example, `excludeAccountIds=5b10a2844c20165700ede21g,5b10a0effa615349cb016cd8&excludeAccountIds=5b10ac8d82e05b22cc7d4ef5`. Cannot be provided with `exclude`. */ + excludeAccountIds?: string[]; + avatarSize?: string; + /** @default false */ + excludeConnectUsers?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/user/picker`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the keys of all properties for a user. Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and maintained in Jira. **[Permissions](#permissions) required:** * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg), to access the property keys on any user. * Access to Jira, to access the calling user's property keys. + * + * @tags User properties + * @name GetUserPropertyKeys + * @summary Get user property keys + * @request GET:/rest/api/3/user/properties + * @secure + */ + getUserPropertyKeys: ({ + query, + params = {}, + }: { + query?: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + * @maxLength 128 + * @example "5b10ac8d82e05b22cc7d4ef5" + */ + accountId?: string; + /** This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + userKey?: string; + /** This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + username?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/user/properties`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes a property from a user. Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and maintained in Jira. **[Permissions](#permissions) required:** * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg), to delete a property from any user. * Access to Jira, to delete a property from the calling user's record. + * + * @tags User properties + * @name DeleteUserProperty + * @summary Delete user property + * @request DELETE:/rest/api/3/user/properties/{propertyKey} + * @secure + */ + deleteUserProperty: ({ + propertyKey, + query, + params = {}, + }: { + propertyKey: string; + query?: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + * @maxLength 128 + * @example "5b10ac8d82e05b22cc7d4ef5" + */ + accountId?: string; + /** This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + userKey?: string; + /** This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + username?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/user/properties/${propertyKey}`, + method: "DELETE", + query: query, + secure: true, + ...params, + }), + + /** + * @description Returns the value of a user's property. If no property key is provided [Get user property keys](#api-rest-api-3-user-properties-get) is called. Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and maintained in Jira. **[Permissions](#permissions) required:** * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg), to get a property from any user. * Access to Jira, to get a property from the calling user's record. + * + * @tags User properties + * @name GetUserProperty + * @summary Get user property + * @request GET:/rest/api/3/user/properties/{propertyKey} + * @secure + */ + getUserProperty: ({ + propertyKey, + query, + params = {}, + }: { + propertyKey: string; + query?: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + * @maxLength 128 + * @example "5b10ac8d82e05b22cc7d4ef5" + */ + accountId?: string; + /** This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + userKey?: string; + /** This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + username?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/user/properties/${propertyKey}`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Sets the value of a user's property. Use this resource to store custom data against a user. Note: This operation does not access the [user properties](https://confluence.atlassian.com/x/8YxjL) created and maintained in Jira. **[Permissions](#permissions) required:** * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg), to set a property on any user. * Access to Jira, to set a property on the calling user's record. + * + * @tags User properties + * @name SetUserProperty + * @summary Set user property + * @request PUT:/rest/api/3/user/properties/{propertyKey} + * @secure + */ + setUserProperty: ({ + propertyKey, + data, + query, + params = {}, + }: { + propertyKey: string; + data: any; + query?: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + * @maxLength 128 + * @example "5b10ac8d82e05b22cc7d4ef5" + */ + accountId?: string; + /** This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + userKey?: string; + /** This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + username?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/user/properties/${propertyKey}`, + method: "PUT", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a list of users that match the search string and property. This operation first applies a filter to match the search string and property, and then takes the filtered users in the range defined by `startAt` and `maxResults`, up to the thousandth user. To get all the users who match the search string and property, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your code. This operation can be accessed anonymously. Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that the user's email address is hidden. See the [Profile visibility overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. **[Permissions](#permissions) required:** *Browse users and groups* [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls or calls by users without the required permission return empty search results. + * + * @tags User search + * @name FindUsers + * @summary Find users + * @request GET:/rest/api/3/user/search + * @secure + */ + findUsers: ({ + query, + params = {}, + }: { + query?: { + /** + * A query string that is matched against user attributes ( `displayName`, and `emailAddress`) to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. Required, unless `accountId` or `property` is specified. + * @example "query" + */ + query?: string; + username?: string; + /** + * A query string that is matched exactly against a user `accountId`. Required, unless `query` or `property` is specified. + * @maxLength 128 + */ + accountId?: string; + /** + * The index of the first item to return in a page of filtered results (page offset). + * @format int32 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** A query string used to search properties. Property keys are specified by path, so property keys containing dot (.) or equals (=) characters cannot be used. The query string cannot be specified using a JSON object. Example: To search for the value of `nested` from `{"something":{"nested":1,"other":2}}` use `thepropertykey.something.nested=1`. Required, unless `accountId` or `query` is specified. */ + property?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/user/search`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Finds users with a structured query and returns a [paginated](#pagination) list of user details. This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and then returns only the users from that range that match the structured query. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your code. **[Permissions](#permissions) required:** *Browse users and groups* [global permission](https://confluence.atlassian.com/x/x4dKLg). The query statements are: * `is assignee of PROJ` Returns the users that are assignees of at least one issue in project *PROJ*. * `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues *PROJ-1* or *PROJ-2*. * `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues *PROJ-1* or *PROJ-2*. * `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues *PROJ-1* or *PROJ-2*. * `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues *PROJ-1* or *PROJ-2*. * `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues *PROJ-1* or *PROJ-2*. * `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues *PROJ-1* or *PROJ-2*. * `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. The list of issues can be extended as needed, as in *(PROJ-1, PROJ-2, ... PROJ-n)*. Statements can be combined using the `AND` and `OR` operators to form more complex queries. For example: `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` + * + * @tags User search + * @name FindUsersByQuery + * @summary Find users by query + * @request GET:/rest/api/3/user/search/query + * @secure + */ + findUsersByQuery: ({ + query, + params = {}, + }: { + query: { + /** The search query. */ + query: string; + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 100 + */ + maxResults?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/user/search/query`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Finds users with a structured query and returns a [paginated](#pagination) list of user keys. This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and then returns only the users from that range that match the structured query. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users who match the structured query, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your code. **[Permissions](#permissions) required:** *Browse users and groups* [global permission](https://confluence.atlassian.com/x/x4dKLg). The query statements are: * `is assignee of PROJ` Returns the users that are assignees of at least one issue in project *PROJ*. * `is assignee of (PROJ-1, PROJ-2)` Returns users that are assignees on the issues *PROJ-1* or *PROJ-2*. * `is reporter of (PROJ-1, PROJ-2)` Returns users that are reporters on the issues *PROJ-1* or *PROJ-2*. * `is watcher of (PROJ-1, PROJ-2)` Returns users that are watchers on the issues *PROJ-1* or *PROJ-2*. * `is voter of (PROJ-1, PROJ-2)` Returns users that are voters on the issues *PROJ-1* or *PROJ-2*. * `is commenter of (PROJ-1, PROJ-2)` Returns users that have posted a comment on the issues *PROJ-1* or *PROJ-2*. * `is transitioner of (PROJ-1, PROJ-2)` Returns users that have performed a transition on issues *PROJ-1* or *PROJ-2*. * `[propertyKey].entity.property.path is "property value"` Returns users with the entity property value. The list of issues can be extended as needed, as in *(PROJ-1, PROJ-2, ... PROJ-n)*. Statements can be combined using the `AND` and `OR` operators to form more complex queries. For example: `is assignee of PROJ AND [propertyKey].entity.property.path is "property value"` + * + * @tags User search + * @name FindUserKeysByQuery + * @summary Find user keys by query + * @request GET:/rest/api/3/user/search/query/key + * @secure + */ + findUserKeysByQuery: ({ + query, + params = {}, + }: { + query: { + /** The search query. */ + query: string; + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 100 + */ + maxResults?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/user/search/query/key`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a list of users who fulfill these criteria: * their user attributes match a search string. * they have permission to browse issues. Use this resource to find users who can browse: * an issue, by providing the `issueKey`. * any issue in a project, by providing the `projectKey`. This operation takes the users in the range defined by `startAt` and `maxResults`, up to the thousandth user, and then returns only the users from that range that match the search string and have permission to browse issues. This means the operation usually returns fewer users than specified in `maxResults`. To get all the users who match the search string and have permission to browse issues, use [Get all users](#api-rest-api-3-users-search-get) and filter the records in your code. Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that the user's email address is hidden. See the [Profile visibility overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse users and groups* [global permission](https://confluence.atlassian.com/x/x4dKLg). Anonymous calls and calls by users without the required permission return empty search results. + * + * @tags User search + * @name FindUsersWithBrowsePermission + * @summary Find users with browse permission + * @request GET:/rest/api/3/user/viewissue/search + * @secure + */ + findUsersWithBrowsePermission: ({ + query, + params = {}, + }: { + query?: { + /** + * A query string that is matched against user attributes, such as `displayName` and `emailAddress`, to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. Required, unless `accountId` is specified. + * @example "query" + */ + query?: string; + /** This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. */ + username?: string; + /** + * A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. + * @maxLength 128 + */ + accountId?: string; + /** The issue key for the issue. Required, unless `projectKey` is specified. */ + issueKey?: string; + /** The project key for the project (case sensitive). Required, unless `issueKey` is specified. */ + projectKey?: string; + /** + * The index of the first item to return in a page of results (page offset). + * @format int32 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/user/viewissue/search`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a list of all users, including active users, inactive users and previously deleted users that have an Atlassian account. Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that the user's email address is hidden. See the [Profile visibility overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. **[Permissions](#permissions) required:** *Browse users and groups* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Users + * @name GetAllUsersDefault + * @summary Get all users default + * @request GET:/rest/api/3/users + * @secure + */ + getAllUsersDefault: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return. + * @format int32 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return. + * @format int32 + * @default 50 + */ + maxResults?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/users`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a list of all users, including active users, inactive users and previously deleted users that have an Atlassian account. Privacy controls are applied to the response based on the users' preferences. This could mean, for example, that the user's email address is hidden. See the [Profile visibility overview](https://developer.atlassian.com/cloud/jira/platform/profile-visibility/) for more details. **[Permissions](#permissions) required:** *Browse users and groups* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Users + * @name GetAllUsers + * @summary Get all users + * @request GET:/rest/api/3/users/search + * @secure + */ + getAllUsers: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return. + * @format int32 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return. + * @format int32 + * @default 50 + */ + maxResults?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/users/search`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates a project version. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) or *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project the version is added to. + * + * @tags Project versions + * @name CreateVersion + * @summary Create version + * @request POST:/rest/api/3/version + * @secure + */ + createVersion: ({ data, params = {} }: { data: Version; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/version`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes a project version. Deprecated, use [ Delete and replace version](#api-rest-api-3-version-id-removeAndSwap-post) that supports swapping version values in custom fields, in addition to the swapping for `fixVersion` and `affectedVersion` provided in this resource. Alternative versions can be provided to update issues that use the deleted version in `fixVersion` or `affectedVersion`. If alternatives are not provided, occurrences of `fixVersion` and `affectedVersion` that contain the deleted version are cleared. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) or *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. + * + * @tags Project versions + * @name DeleteVersion + * @summary Delete version + * @request DELETE:/rest/api/3/version/{id} + * @deprecated + * @secure + */ + deleteVersion: ({ + id, + query, + params = {}, + }: { + id: string; + query?: { + /** The ID of the version to update `fixVersion` to when the field contains the deleted version. The replacement version must be in the same project as the version being deleted and cannot be the version being deleted. */ + moveFixIssuesTo?: string; + /** The ID of the version to update `affectedVersion` to when the field contains the deleted version. The replacement version must be in the same project as the version being deleted and cannot be the version being deleted. */ + moveAffectedIssuesTo?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/version/${id}`, + method: "DELETE", + query: query, + secure: true, + ...params, + }), + + /** + * @description Returns a project version. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project containing the version. + * + * @tags Project versions + * @name GetVersion + * @summary Get version + * @request GET:/rest/api/3/version/{id} + * @secure + */ + getVersion: ({ + id, + query, + params = {}, + }: { + id: string; + query?: { + /** + * Use [expand](#expansion) to include additional information about version in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `operations` Returns the list of operations available for this version. + * * `issuesstatus` Returns the count of issues in this version for each of the status categories *to do*, *in progress*, *done*, and *unmapped*. The *unmapped* property represents the number of issues with a status other than *to do*, *in progress*, and *done*. + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/version/${id}`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates a project version. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) or *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. + * + * @tags Project versions + * @name UpdateVersion + * @summary Update version + * @request PUT:/rest/api/3/version/{id} + * @secure + */ + updateVersion: ({ id, data, params = {} }: { id: string; data: Version; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/version/${id}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Merges two project versions. The merge is completed by deleting the version specified in `id` and replacing any occurrences of its ID in `fixVersion` with the version ID specified in `moveIssuesTo`. Consider using [ Delete and replace version](#api-rest-api-3-version-id-removeAndSwap-post) instead. This resource supports swapping version values in `fixVersion`, `affectedVersion`, and custom fields. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) or *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. + * + * @tags Project versions + * @name MergeVersions + * @summary Merge versions + * @request PUT:/rest/api/3/version/{id}/mergeto/{moveIssuesTo} + * @secure + */ + mergeVersions: ({ id, moveIssuesTo, params = {} }: { id: string; moveIssuesTo: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/version/${id}/mergeto/${moveIssuesTo}`, + method: "PUT", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Modifies the version's sequence within the project, which affects the display order of the versions in Jira. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse projects* project permission for the project that contains the version. + * + * @tags Project versions + * @name MoveVersion + * @summary Move version + * @request POST:/rest/api/3/version/{id}/move + * @secure + */ + moveVersion: ({ id, data, params = {} }: { id: string; data: VersionMoveBean; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/version/${id}/move`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns the following counts for a version: * Number of issues where the `fixVersion` is set to the version. * Number of issues where the `affectedVersion` is set to the version. * Number of issues where a version custom field is set to the version. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse projects* project permission for the project that contains the version. + * + * @tags Project versions + * @name GetVersionRelatedIssues + * @summary Get version's related issues count + * @request GET:/rest/api/3/version/{id}/relatedIssueCounts + * @secure + */ + getVersionRelatedIssues: ({ id, params = {} }: { id: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/version/${id}/relatedIssueCounts`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes a project version. Alternative versions can be provided to update issues that use the deleted version in `fixVersion`, `affectedVersion`, or any version picker custom fields. If alternatives are not provided, occurrences of `fixVersion`, `affectedVersion`, and any version picker custom field, that contain the deleted version, are cleared. Any replacement version must be in the same project as the version being deleted and cannot be the version being deleted. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) or *Administer Projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project that contains the version. + * + * @tags Project versions + * @name DeleteAndReplaceVersion + * @summary Delete and replace version + * @request POST:/rest/api/3/version/{id}/removeAndSwap + * @secure + */ + deleteAndReplaceVersion: ({ + id, + data, + params = {}, + }: { + id: string; + data: DeleteAndReplaceVersionBean; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/version/${id}/removeAndSwap`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns counts of the issues and unresolved issues for the project version. This operation can be accessed anonymously. **[Permissions](#permissions) required:** *Browse projects* project permission for the project that contains the version. + * + * @tags Project versions + * @name GetVersionUnresolvedIssues + * @summary Get version's unresolved issues count + * @request GET:/rest/api/3/version/{id}/unresolvedIssueCount + * @secure + */ + getVersionUnresolvedIssues: ({ id, params = {} }: { id: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/version/${id}/unresolvedIssueCount`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Removes webhooks by ID. Only webhooks registered by the calling app are removed. If webhooks created by other apps are specified, they are ignored. **[Permissions](#permissions) required:** Only [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + * + * @tags Webhooks + * @name DeleteWebhookById + * @summary Delete webhooks by ID + * @request DELETE:/rest/api/3/webhook + * @secure + */ + deleteWebhookById: ({ data, params = {} }: { data: ContainerForWebhookIDs; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/webhook`, + method: "DELETE", + body: data, + secure: true, + type: ContentType.Json, + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of the webhooks registered by the calling app. **[Permissions](#permissions) required:** Only [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + * + * @tags Webhooks + * @name GetDynamicWebhooksForApp + * @summary Get dynamic webhooks for app + * @request GET:/rest/api/3/webhook + * @secure + */ + getDynamicWebhooksForApp: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 100 + */ + maxResults?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/webhook`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Registers webhooks. **NOTE:** for non-public OAuth apps, webhooks are delivered only if there is a match between the app owner and the user who registered a dynamic webhook. **[Permissions](#permissions) required:** Only [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + * + * @tags Webhooks + * @name RegisterDynamicWebhooks + * @summary Register dynamic webhooks + * @request POST:/rest/api/3/webhook + * @secure + */ + registerDynamicWebhooks: ({ data, params = {} }: { data: WebhookRegistrationDetails; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/webhook`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns webhooks that have recently failed to be delivered to the requesting app after the maximum number of retries. After 72 hours the failure may no longer be returned by this operation. The oldest failure is returned first. This method uses a cursor-based pagination. To request the next page use the failure time of the last webhook on the list as the `failedAfter` value or use the URL provided in `next`. **[Permissions](#permissions) required:** Only [Connect apps](https://developer.atlassian.com/cloud/jira/platform/index/#connect-apps) can use this operation. + * + * @tags Webhooks + * @name GetFailedWebhooks + * @summary Get failed webhooks + * @request GET:/rest/api/3/webhook/failed + * @secure + */ + getFailedWebhooks: ({ + query, + params = {}, + }: { + query?: { + /** + * The maximum number of webhooks to return per page. If obeying the maxResults directive would result in records with the same failure time being split across pages, the directive is ignored and all records with the same failure time included on the page. + * @format int32 + */ + maxResults?: number; + /** + * The time after which any webhook failure must have occurred for the record to be returned, expressed as milliseconds since the UNIX epoch. + * @format int64 + */ + after?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/webhook/failed`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Extends the life of webhook. Webhooks registered through the REST API expire after 30 days. Call this operation to keep them alive. Unrecognized webhook IDs (those that are not found or belong to other apps) are ignored. **[Permissions](#permissions) required:** Only [Connect](https://developer.atlassian.com/cloud/jira/platform/#connect-apps) and [OAuth 2.0](https://developer.atlassian.com/cloud/jira/platform/oauth-2-3lo-apps) apps can use this operation. + * + * @tags Webhooks + * @name RefreshWebhooks + * @summary Extend webhook life + * @request PUT:/rest/api/3/webhook/refresh + * @secure + */ + refreshWebhooks: ({ data, params = {} }: { data: ContainerForWebhookIDs; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/webhook/refresh`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns all workflows in Jira or a workflow. Deprecated, use [Get workflows paginated](#api-rest-api-3-workflow-search-get). If the `workflowName` parameter is specified, the workflow is returned as an object (not in an array). Otherwise, an array of workflow objects is returned. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflows + * @name GetAllWorkflows + * @summary Get all workflows + * @request GET:/rest/api/3/workflow + * @deprecated + * @secure + */ + getAllWorkflows: ({ + query, + params = {}, + }: { + query?: { + /** The name of the workflow to be returned. Only one workflow can be specified. */ + workflowName?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflow`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates a workflow. You can define transition rules using the shapes detailed in the following sections. If no transitional rules are specified the default system transition rules are used. #### Conditions #### Conditions enable workflow rules that govern whether a transition can execute. ##### Always false condition ##### A condition that always fails. { "type": "AlwaysFalseCondition" } ##### Block transition until approval ##### A condition that blocks issue transition if there is a pending approval. { "type": "BlockInProgressApprovalCondition" } ##### Compare number custom field condition ##### A condition that allows transition if a comparison between a number custom field and a value is true. { "type": "CompareNumberCFCondition", "configuration": { "comparator": "=", "fieldId": "customfield_10029", "fieldValue": 2 } } * `comparator` One of the supported comparator: `=`, `>`, and `<`. * `fieldId` The custom numeric field ID. Allowed field types: * `com.atlassian.jira.plugin.system.customfieldtypes:float` * `com.pyxis.greenhopper.jira:jsw-story-points` * `fieldValue` The value for comparison. ##### Hide from user condition ##### A condition that hides a transition from users. The transition can only be triggered from a workflow function or REST API operation. { "type": "RemoteOnlyCondition" } ##### Only assignee condition ##### A condition that allows only the assignee to execute a transition. { "type": "AllowOnlyAssignee" } ##### Only Bamboo notifications workflow condition ##### A condition that makes the transition available only to Bamboo build notifications. { "type": "OnlyBambooNotificationsCondition" } ##### Only reporter condition ##### A condition that allows only the reporter to execute a transition. { "type": "AllowOnlyReporter" } ##### Permission condition ##### A condition that allows only users with a permission to execute a transition. { "type": "PermissionCondition", "configuration": { "permissionKey": "BROWSE_PROJECTS" } } * `permissionKey` The permission required to perform the transition. Allowed values: [built-in](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-permission-schemes/#built-in-permissions) or app defined permissions. ##### Previous status condition ##### A condition that allows a transition based on whether an issue has or has not transitioned through a status. { "type": "PreviousStatusCondition", "configuration": { "ignoreLoopTransitions": true, "includeCurrentStatus": true, "mostRecentStatusOnly": true, "reverseCondition": true, "previousStatus": { "id": "5" } } } By default this condition allows the transition if the status, as defined by its ID in the `previousStatus` object, matches any previous issue status, unless: * `ignoreLoopTransitions` is `true`, then loop transitions (from and to the same status) are ignored. * `includeCurrentStatus` is `true`, then the current issue status is also checked. * `mostRecentStatusOnly` is `true`, then only the issue's preceding status (the one immediately before the current status) is checked. * `reverseCondition` is `true`, then the status must not be present. ##### Separation of duties condition ##### A condition that prevents a user to perform the transition, if the user has already performed a transition on the issue. { "type": "SeparationOfDutiesCondition", "configuration": { "fromStatus": { "id": "5" }, "toStatus": { "id": "6" } } } * `fromStatus` OPTIONAL. An object containing the ID of the source status of the transition that is blocked. If omitted any transition to `toStatus` is blocked. * `toStatus` An object containing the ID of the target status of the transition that is blocked. ##### Subtask blocking condition ##### A condition that blocks transition on a parent issue if any of its subtasks are in any of one or more statuses. { "type": "SubTaskBlockingCondition", "configuration": { "statuses": [ { "id": "1" }, { "id": "3" } ] } } * `statuses` A list of objects containing status IDs. ##### User is in any group condition ##### A condition that allows users belonging to any group from a list of groups to execute a transition. { "type": "UserInAnyGroupCondition", "configuration": { "groups": [ "administrators", "atlassian-addons-admin" ] } } * `groups` A list of group names. ##### User is in any project role condition ##### A condition that allows only users with at least one project roles from a list of project roles to execute a transition. { "type": "InAnyProjectRoleCondition", "configuration": { "projectRoles": [ { "id": "10002" }, { "id": "10003" }, { "id": "10012" }, { "id": "10013" } ] } } * `projectRoles` A list of objects containing project role IDs. ##### User is in custom field condition ##### A condition that allows only users listed in a given custom field to execute the transition. { "type": "UserIsInCustomFieldCondition", "configuration": { "allowUserInField": false, "fieldId": "customfield_10010" } } * `allowUserInField` If `true` only a user who is listed in `fieldId` can perform the transition, otherwise, only a user who is not listed in `fieldId` can perform the transition. * `fieldId` The ID of the field containing the list of users. ##### User is in group condition ##### A condition that allows users belonging to a group to execute a transition. { "type": "UserInGroupCondition", "configuration": { "group": "administrators" } } * `group` The name of the group. ##### User is in group custom field condition ##### A condition that allows users belonging to a group specified in a custom field to execute a transition. { "type": "InGroupCFCondition", "configuration": { "fieldId": "customfield_10012" } } * `fieldId` The ID of the field. Allowed field types: * `com.atlassian.jira.plugin.system.customfieldtypes:multigrouppicker` * `com.atlassian.jira.plugin.system.customfieldtypes:grouppicker` * `com.atlassian.jira.plugin.system.customfieldtypes:select` * `com.atlassian.jira.plugin.system.customfieldtypes:multiselect` * `com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons` * `com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes` * `com.pyxis.greenhopper.jira:gh-epic-status` ##### User is in project role condition ##### A condition that allows users with a project role to execute a transition. { "type": "InProjectRoleCondition", "configuration": { "projectRole": { "id": "10002" } } } * `projectRole` An object containing the ID of a project role. ##### Value field condition ##### A conditions that allows a transition to execute if the value of a field is equal to a constant value or simply set. { "type": "ValueFieldCondition", "configuration": { "fieldId": "assignee", "fieldValue": "qm:6e1ecee6-8e64-4db6-8c85-916bb3275f51:54b56885-2bd2-4381-8239-78263442520f", "comparisonType": "NUMBER", "comparator": "=" } } * `fieldId` The ID of a field used in the comparison. * `fieldValue` The expected value of the field. * `comparisonType` The type of the comparison. Allowed values: `STRING`, `NUMBER`, `DATE`, `DATE_WITHOUT_TIME`, or `OPTIONID`. * `comparator` One of the supported comparator: `>`, `>=`, `=`, `<=`, `<`, `!=`. **Notes:** * If you choose the comparison type `STRING`, only `=` and `!=` are valid options. * You may leave `fieldValue` empty when comparison type is `!=` to indicate that a value is required in the field. * For date fields without time format values as `yyyy-MM-dd`, and for those with time as `yyyy-MM-dd HH:mm`. For example, for July 16 2021 use `2021-07-16`, for 8:05 AM use `2021-07-16 08:05`, and for 4 PM: `2021-07-16 16:00`. #### Validators #### Validators check that any input made to the transition is valid before the transition is performed. ##### Date field validator ##### A validator that compares two dates. { "type": "DateFieldValidator", "configuration": { "comparator": ">", "date1": "updated", "date2": "created", "expression": "1d", "includeTime": true } } * `comparator` One of the supported comparator: `>`, `>=`, `=`, `<=`, `<`, or `!=`. * `date1` The date field to validate. Allowed field types: * `com.atlassian.jira.plugin.system.customfieldtypes:datepicker` * `com.atlassian.jira.plugin.system.customfieldtypes:datetime` * `com.atlassian.jpo:jpo-custom-field-baseline-end` * `com.atlassian.jpo:jpo-custom-field-baseline-start` * `duedate` * `created` * `updated` * `resolutiondate` * `date2` The second date field. Required, if `expression` is not passed. Allowed field types: * `com.atlassian.jira.plugin.system.customfieldtypes:datepicker` * `com.atlassian.jira.plugin.system.customfieldtypes:datetime` * `com.atlassian.jpo:jpo-custom-field-baseline-end` * `com.atlassian.jpo:jpo-custom-field-baseline-start` * `duedate` * `created` * `updated` * `resolutiondate` * `expression` An expression specifying an offset. Required, if `date2` is not passed. Offsets are built with a number, with `-` as prefix for the past, and one of these time units: `d` for day, `w` for week, `m` for month, or `y` for year. For example, -2d means two days into the past and 1w means one week into the future. The `now` keyword enables a comparison with the current date. * `includeTime` If `true`, then the time part of the data is included for the comparison. If the field doesn't have a time part, 00:00:00 is used. ##### Windows date validator ##### A validator that checks that a date falls on or after a reference date and before or on the reference date plus a number of days. { "type": "WindowsDateValidator", "configuration": { "date1": "customfield_10009", "date2": "created", "windowsDays": 5 } } * `date1` The date field to validate. Allowed field types: * `com.atlassian.jira.plugin.system.customfieldtypes:datepicker` * `com.atlassian.jira.plugin.system.customfieldtypes:datetime` * `com.atlassian.jpo:jpo-custom-field-baseline-end` * `com.atlassian.jpo:jpo-custom-field-baseline-start` * `duedate` * `created` * `updated` * `resolutiondate` * `date2` The reference date. Allowed field types: * `com.atlassian.jira.plugin.system.customfieldtypes:datepicker` * `com.atlassian.jira.plugin.system.customfieldtypes:datetime` * `com.atlassian.jpo:jpo-custom-field-baseline-end` * `com.atlassian.jpo:jpo-custom-field-baseline-start` * `duedate` * `created` * `updated` * `resolutiondate` * `windowsDays` A positive integer indicating a number of days. ##### Field required validator ##### A validator that checks fields are not empty. By default, if a field is not included in the current context it's ignored and not validated. { "type": "FieldRequiredValidator", "configuration": { "ignoreContext": true, "errorMessage": "Hey", "fieldIds": [ "versions", "customfield_10037", "customfield_10003" ] } } * `ignoreContext` If `true`, then the context is ignored and all the fields are validated. * `errorMessage` OPTIONAL. The error message displayed when one or more fields are empty. A default error message is shown if an error message is not provided. * `fieldIds` The list of fields to validate. ##### Field changed validator ##### A validator that checks that a field value is changed. However, this validation can be ignored for users from a list of groups. { "type": "FieldChangedValidator", "configuration": { "fieldId": "comment", "errorMessage": "Hey", "exemptedGroups": [ "administrators", "atlassian-addons-admin" ] } } * `fieldId` The ID of a field. * `errorMessage` OPTIONAL. The error message displayed if the field is not changed. A default error message is shown if the error message is not provided. * `exemptedGroups` OPTIONAL. The list of groups. ##### Field has single value validator ##### A validator that checks that a multi-select field has only one value. Optionally, the validation can ignore values copied from subtasks. { "type": "FieldHasSingleValueValidator", "configuration": { "fieldId": "attachment, "excludeSubtasks": true } } * `fieldId` The ID of a field. * `excludeSubtasks` If `true`, then values copied from subtasks are ignored. ##### Parent status validator ##### A validator that checks the status of the parent issue of a subtask. Ìf the issue is not a subtask, no validation is performed. { "type": "ParentStatusValidator", "configuration": { "parentStatuses": [ { "id":"1" }, { "id":"2" } ] } } * `parentStatus` The list of required parent issue statuses. ##### Permission validator ##### A validator that checks the user has a permission. { "type": "PermissionValidator", "configuration": { "permissionKey": "ADMINISTER_PROJECTS" } } * `permissionKey` The permission required to perform the transition. Allowed values: [built-in](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-permission-schemes/#built-in-permissions) or app defined permissions. ##### Previous status validator ##### A validator that checks if the issue has held a status. { "type": "PreviousStatusValidator", "configuration": { "mostRecentStatusOnly": false, "previousStatus": { "id": "15" } } } * `mostRecentStatusOnly` If `true`, then only the issue's preceding status (the one immediately before the current status) is checked. * `previousStatus` An object containing the ID of an issue status. ##### Regular expression validator ##### A validator that checks the content of a field against a regular expression. { "type": "RegexpFieldValidator", "configuration": { "regExp": "[0-9]", "fieldId": "customfield_10029" } } * `regExp`A regular expression. * `fieldId` The ID of a field. Allowed field types: * `com.atlassian.jira.plugin.system.customfieldtypes:select` * `com.atlassian.jira.plugin.system.customfieldtypes:multiselect` * `com.atlassian.jira.plugin.system.customfieldtypes:radiobuttons` * `com.atlassian.jira.plugin.system.customfieldtypes:multicheckboxes` * `com.atlassian.jira.plugin.system.customfieldtypes:textarea` * `com.atlassian.jira.plugin.system.customfieldtypes:textfield` * `com.atlassian.jira.plugin.system.customfieldtypes:url` * `com.atlassian.jira.plugin.system.customfieldtypes:float` * `com.pyxis.greenhopper.jira:jsw-story-points` * `com.pyxis.greenhopper.jira:gh-epic-status` * `description` * `summary` ##### User permission validator ##### A validator that checks if a user has a permission. Obsolete. You may encounter this validator when getting transition rules and can pass it when updating or creating rules, for example, when you want to duplicate the rules from a workflow on a new workflow. { "type": "UserPermissionValidator", "configuration": { "permissionKey": "BROWSE_PROJECTS", "nullAllowed": false, "username": "TestUser" } } * `permissionKey` The permission to be validated. Allowed values: [built-in](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-permission-schemes/#built-in-permissions) or app defined permissions. * `nullAllowed` If `true`, allows the transition when `username` is empty. * `username` The username to validate against the `permissionKey`. #### Post functions #### Post functions carry out any additional processing required after a Jira workflow transition is executed. ##### Fire issue event function ##### A post function that fires an event that is processed by the listeners. { "type": "FireIssueEventFunction", "configuration": { "event": { "id":"1" } } } **Note:** If provided, this post function overrides the default `FireIssueEventFunction`. Can be included once in a transition. * `event` An object containing the ID of the issue event. ##### Update issue status ##### A post function that sets issue status to the linked status of the destination workflow status. { "type": "UpdateIssueStatusFunction" } **Note:** This post function is a default function in global and directed transitions. It can only be added to the initial transition and can only be added once. ##### Create comment ##### A post function that adds a comment entered during the transition to an issue. { "type": "CreateCommentFunction" } **Note:** This post function is a default function in global and directed transitions. It can only be added to the initial transition and can only be added once. ##### Store issue ##### A post function that stores updates to an issue. { "type": "IssueStoreFunction" } **Note:** This post function can only be added to the initial transition and can only be added once. ##### Assign to current user function ##### A post function that assigns the issue to the current user if the current user has the `ASSIGNABLE_USER` permission. { "type": "AssignToCurrentUserFunction" } **Note:** This post function can be included once in a transition. ##### Assign to lead function ##### A post function that assigns the issue to the project or component lead developer. { "type": "AssignToLeadFunction" } **Note:** This post function can be included once in a transition. ##### Assign to reporter function ##### A post function that assigns the issue to the reporter. { "type": "AssignToReporterFunction" } **Note:** This post function can be included once in a transition. ##### Clear field value function ##### A post function that clears the value from a field. { "type": "ClearFieldValuePostFunction", "configuration": { "fieldId": "assignee" } } * `fieldId` The ID of the field. ##### Copy value from other field function ##### A post function that copies the value of one field to another, either within an issue or from parent to subtask. { "type": "CopyValueFromOtherFieldPostFunction", "configuration": { "sourceFieldId": "assignee", "destinationFieldId": "creator", "copyType": "same" } } * `sourceFieldId` The ID of the source field. * `destinationFieldId` The ID of the destination field. * `copyType` Use `same` to copy the value from a field inside the issue, or `parent` to copy the value from the parent issue. ##### Create Crucible review workflow function ##### A post function that creates a Crucible review for all unreviewed code for the issue. { "type": "CreateCrucibleReviewWorkflowFunction" } **Note:** This post function can be included once in a transition. ##### Set issue security level based on user's project role function ##### A post function that sets the issue's security level if the current user has a project role. { "type": "SetIssueSecurityFromRoleFunction", "configuration": { "projectRole": { "id":"10002" }, "issueSecurityLevel": { "id":"10000" } } } * `projectRole` An object containing the ID of the project role. * `issueSecurityLevel` OPTIONAL. The object containing the ID of the security level. If not passed, then the security level is set to `none`. ##### Trigger a webhook function ##### A post function that triggers a webhook. { "type": "TriggerWebhookFunction", "configuration": { "webhook": { "id": "1" } } } * `webhook` An object containing the ID of the webhook listener to trigger. ##### Update issue custom field function ##### A post function that updates the content of an issue custom field. { "type": "UpdateIssueCustomFieldPostFunction", "configuration": { "mode": "append", "fieldId": "customfield_10003", "fieldValue": "yikes" } } * `mode` Use `replace` to override the field content with `fieldValue` or `append` to add `fieldValue` to the end of the field content. * `fieldId` The ID of the field. * `fieldValue` The update content. ##### Update issue field function ##### A post function that updates a simple issue field. { "type": "UpdateIssueFieldFunction", "configuration": { "fieldId": "assignee", "fieldValue": "5f0c277e70b8a90025a00776" } } * `fieldId` The ID of the field. Allowed field types: * `assignee` * `description` * `environment` * `priority` * `resolution` * `summary` * `timeoriginalestimate` * `timeestimate` * `timespent` * `fieldValue` The update value. * If the `fieldId` is `assignee`, the `fieldValue` should be one of these values: * an account ID. * `automatic`. * a blank string, which sets the value to `unassigned`. #### Connect rules #### Connect rules are conditions, validators, and post functions of a transition that are registered by Connect apps. To create a rule registered by the app, the app must be enabled and the rule's module must exist. { "type": "appKey__moduleKey", "configuration": { "value":"{\"isValid\":\"true\"}" } } * `type` A Connect rule key in a form of `appKey__moduleKey`. * `value` The stringified JSON configuration of a Connect rule. #### Forge rules #### Forge transition rules are not yet supported. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflows + * @name CreateWorkflow + * @summary Create workflow + * @request POST:/rest/api/3/workflow + * @secure + */ + createWorkflow: ({ data, params = {} }: { data: CreateWorkflowDetails; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/workflow`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of workflows with transition rules. The workflows can be filtered to return only those containing workflow transition rules: * of one or more transition rule types, such as [workflow post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/). * matching one or more transition rule keys. Only workflows containing transition rules created by the calling Connect app are returned. Due to server-side optimizations, workflows with an empty list of rules may be returned; these workflows can be ignored. **[Permissions](#permissions) required:** Only Connect apps can use this operation. + * + * @tags Workflow transition rules + * @name GetWorkflowTransitionRuleConfigurations + * @summary Get workflow transition rule configurations + * @request GET:/rest/api/3/workflow/rule/config + * @secure + */ + getWorkflowTransitionRuleConfigurations: ({ + query, + params = {}, + }: { + query: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @max 50 + * @default 10 + */ + maxResults?: number; + /** + * The types of the transition rules to return. + * @uniqueItems true + */ + types: ("postfunction" | "condition" | "validator")[]; + /** + * The transition rule class keys, as defined in the Connect app descriptor, of the transition rules to return. + * @uniqueItems true + */ + keys?: string[]; + /** + * EXPERIMENTAL: The list of workflow names to filter by. + * @maxLength 50 + * @uniqueItems true + */ + workflowNames?: string[]; + /** + * EXPERIMENTAL: The list of `tags` to filter by. + * @maxLength 20 + * @uniqueItems true + */ + withTags?: string[]; + /** EXPERIMENTAL: Whether draft or published workflows are returned. If not provided, both workflow types are returned. */ + draft?: boolean; + /** Use [expand](#expansion) to include additional information in the response. This parameter accepts `transition`, which, for each rule, returns information about the transition the rule is assigned to. */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflow/rule/config`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates configuration of workflow transition rules. The following rule types are supported: * [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) * [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) * [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) Only rules created by the calling Connect app can be updated. To assist with app migration, this operation can be used to: * Disable a rule. * Add a `tag`. Use this to filter rules in the [Get workflow transition rule configurations](https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-workflow-transition-rules/#api-rest-api-3-workflow-rule-config-get). Rules are enabled if the `disabled` parameter is not provided. **[Permissions](#permissions) required:** Only Connect apps can use this operation. + * + * @tags Workflow transition rules + * @name UpdateWorkflowTransitionRuleConfigurations + * @summary Update workflow transition rule configurations + * @request PUT:/rest/api/3/workflow/rule/config + * @secure + */ + updateWorkflowTransitionRuleConfigurations: ({ + data, + params = {}, + }: { + data: WorkflowTransitionRulesUpdate; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflow/rule/config`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes workflow transition rules from one or more workflows. These rule types are supported: * [post functions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-post-function/) * [conditions](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-condition/) * [validators](https://developer.atlassian.com/cloud/jira/platform/modules/workflow-validator/) Only rules created by the calling Connect app can be deleted. **[Permissions](#permissions) required:** Only Connect apps can use this operation. + * + * @tags Workflow transition rules + * @name DeleteWorkflowTransitionRuleConfigurations + * @summary Delete workflow transition rule configurations + * @request PUT:/rest/api/3/workflow/rule/config/delete + * @secure + */ + deleteWorkflowTransitionRuleConfigurations: ({ + data, + params = {}, + }: { + data: WorkflowsWithTransitionRulesDetails; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflow/rule/config/delete`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of published classic workflows. When workflow names are specified, details of those workflows are returned. Otherwise, all published classic workflows are returned. This operation does not return next-gen workflows. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflows + * @name GetWorkflowsPaginated + * @summary Get workflows paginated + * @request GET:/rest/api/3/workflow/search + * @secure + */ + getWorkflowsPaginated: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + /** + * The name of a workflow to return. To include multiple workflows, provide an ampersand-separated list. For example, `workflowName=name1&workflowName=name2`. + * @uniqueItems true + */ + workflowName?: string[]; + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + * + * * `transitions` For each workflow, returns information about the transitions inside the workflow. + * * `transitions.rules` For each workflow transition, returns information about its rules. Transitions are included automatically if this expand is requested. + * * `transitions.properties` For each workflow transition, returns information about its properties. Transitions are included automatically if this expand is requested. + * * `statuses` For each workflow, returns information about the statuses inside the workflow. + * * `statuses.properties` For each workflow status, returns information about its properties. Statuses are included automatically if this expand is requested. + * * `default` For each workflow, returns information about whether this is the default workflow. + * * `schemes` For each workflow, returns information about the workflow schemes the workflow is assigned to. + * * `projects` For each workflow, returns information about the projects the workflow is assigned to, through workflow schemes. + * * `hasDraftWorkflow` For each workflow, returns information about whether the workflow has a draft version. + * * `operations` For each workflow, returns information about the actions that can be undertaken on the workflow. + */ + expand?: string; + /** String used to perform a case-insensitive partial match with workflow name. */ + queryString?: string; + /** + * [Order](#ordering) the results by a field: + * + * * `name` Sorts by workflow name. + * * `created` Sorts by create time. + * * `updated` Sorts by update time. + */ + orderBy?: + | "name" + | "-name" + | "+name" + | "created" + | "-created" + | "+created" + | "updated" + | "+updated" + | "-updated"; + /** Filters active and inactive workflows. */ + isActive?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflow/search`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes a property from a workflow transition. Transition properties are used to change the behavior of a transition. For more information, see [Transition properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow transition properties + * @name DeleteWorkflowTransitionProperty + * @summary Delete workflow transition property + * @request DELETE:/rest/api/3/workflow/transitions/{transitionId}/properties + * @secure + */ + deleteWorkflowTransitionProperty: ({ + transitionId, + query, + params = {}, + }: { + transitionId: number; + query: { + /** The name of the transition property to delete, also known as the name of the property. */ + key: string; + /** The name of the workflow that the transition belongs to. */ + workflowName: string; + /** The workflow status. Set to `live` for inactive workflows or `draft` for draft workflows. Active workflows cannot be edited. */ + workflowMode?: "live" | "draft"; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflow/transitions/${transitionId}/properties`, + method: "DELETE", + query: query, + secure: true, + ...params, + }), + + /** + * @description Returns the properties on a workflow transition. Transition properties are used to change the behavior of a transition. For more information, see [Transition properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow transition properties + * @name GetWorkflowTransitionProperties + * @summary Get workflow transition properties + * @request GET:/rest/api/3/workflow/transitions/{transitionId}/properties + * @secure + */ + getWorkflowTransitionProperties: ({ + transitionId, + query, + params = {}, + }: { + transitionId: number; + query: { + /** + * Some properties with keys that have the *jira.* prefix are reserved, which means they are not editable. To include these properties in the results, set this parameter to *true*. + * @default false + */ + includeReservedKeys?: boolean; + /** The key of the property being returned, also known as the name of the property. If this parameter is not specified, all properties on the transition are returned. */ + key?: string; + /** The name of the workflow that the transition belongs to. */ + workflowName: string; + /** + * The workflow status. Set to *live* for active and inactive workflows, or *draft* for draft workflows. + * @default "live" + */ + workflowMode?: "live" | "draft"; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflow/transitions/${transitionId}/properties`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Adds a property to a workflow transition. Transition properties are used to change the behavior of a transition. For more information, see [Transition properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow transition properties + * @name CreateWorkflowTransitionProperty + * @summary Create workflow transition property + * @request POST:/rest/api/3/workflow/transitions/{transitionId}/properties + * @secure + */ + createWorkflowTransitionProperty: ({ + transitionId, + query, + data, + params = {}, + }: { + transitionId: number; + query: { + /** The key of the property being added, also known as the name of the property. Set this to the same value as the `key` defined in the request body. */ + key: string; + /** The name of the workflow that the transition belongs to. */ + workflowName: string; + /** + * The workflow status. Set to *live* for inactive workflows or *draft* for draft workflows. Active workflows cannot be edited. + * @default "live" + */ + workflowMode?: "live" | "draft"; + }; + data: WorkflowTransitionProperty; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflow/transitions/${transitionId}/properties`, + method: "POST", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Updates a workflow transition by changing the property value. Trying to update a property that does not exist results in a new property being added to the transition. Transition properties are used to change the behavior of a transition. For more information, see [Transition properties](https://confluence.atlassian.com/x/zIhKLg#Advancedworkflowconfiguration-transitionproperties) and [Workflow properties](https://confluence.atlassian.com/x/JYlKLg). **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow transition properties + * @name UpdateWorkflowTransitionProperty + * @summary Update workflow transition property + * @request PUT:/rest/api/3/workflow/transitions/{transitionId}/properties + * @secure + */ + updateWorkflowTransitionProperty: ({ + transitionId, + query, + data, + params = {}, + }: { + transitionId: number; + query: { + /** The key of the property being updated, also known as the name of the property. Set this to the same value as the `key` defined in the request body. */ + key: string; + /** The name of the workflow that the transition belongs to. */ + workflowName: string; + /** The workflow status. Set to `live` for inactive workflows or `draft` for draft workflows. Active workflows cannot be edited. */ + workflowMode?: "live" | "draft"; + }; + data: WorkflowTransitionProperty; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflow/transitions/${transitionId}/properties`, + method: "PUT", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes a workflow. The workflow cannot be deleted if it is: * an active workflow. * a system workflow. * associated with any workflow scheme. * associated with any draft workflow scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflows + * @name DeleteInactiveWorkflow + * @summary Delete inactive workflow + * @request DELETE:/rest/api/3/workflow/{entityId} + * @secure + */ + deleteInactiveWorkflow: ({ entityId, params = {} }: { entityId: string; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/workflow/${entityId}`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Returns a [paginated](#pagination) list of all workflow schemes, not including draft workflow schemes. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow schemes + * @name GetAllWorkflowSchemes + * @summary Get all workflow schemes + * @request GET:/rest/api/3/workflowscheme + * @secure + */ + getAllWorkflowSchemes: ({ + query, + params = {}, + }: { + query?: { + /** + * The index of the first item to return in a page of results (page offset). + * @format int64 + * @default 0 + */ + startAt?: number; + /** + * The maximum number of items to return per page. + * @format int32 + * @default 50 + */ + maxResults?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflowscheme`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Creates a workflow scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow schemes + * @name CreateWorkflowScheme + * @summary Create workflow scheme + * @request POST:/rest/api/3/workflowscheme + * @secure + */ + createWorkflowScheme: ({ data, params = {} }: { data: WorkflowScheme; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/workflowscheme`, + method: "POST", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a list of the workflow schemes associated with a list of projects. Each returned workflow scheme includes a list of the requested projects associated with it. Any team-managed or non-existent projects in the request are ignored and no errors are returned. If the project is associated with the `Default Workflow Scheme` no ID is returned. This is because the way the `Default Workflow Scheme` is stored means it has no ID. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow scheme project associations + * @name GetWorkflowSchemeProjectAssociations + * @summary Get workflow scheme project associations + * @request GET:/rest/api/3/workflowscheme/project + * @secure + */ + getWorkflowSchemeProjectAssociations: ({ + query, + params = {}, + }: { + query: { + /** + * The ID of a project to return the workflow schemes for. To include multiple projects, provide an ampersand-Jim: oneseparated list. For example, `projectId=10000&projectId=10001`. + * @maxItems 100 + * @minItems 1 + * @uniqueItems true + */ + projectId: number[]; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflowscheme/project`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Assigns a workflow scheme to a project. This operation is performed only when there are no issues in the project. Workflow schemes can only be assigned to classic projects. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow scheme project associations + * @name AssignSchemeToProject + * @summary Assign workflow scheme to project + * @request PUT:/rest/api/3/workflowscheme/project + * @secure + */ + assignSchemeToProject: ({ + data, + params = {}, + }: { + data: WorkflowSchemeProjectAssociation; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflowscheme/project`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes a workflow scheme. Note that a workflow scheme cannot be deleted if it is active (that is, being used by at least one project). **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow schemes + * @name DeleteWorkflowScheme + * @summary Delete workflow scheme + * @request DELETE:/rest/api/3/workflowscheme/{id} + * @secure + */ + deleteWorkflowScheme: ({ id, params = {} }: { id: number; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}`, + method: "DELETE", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns a workflow scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow schemes + * @name GetWorkflowScheme + * @summary Get workflow scheme + * @request GET:/rest/api/3/workflowscheme/{id} + * @secure + */ + getWorkflowScheme: ({ + id, + query, + params = {}, + }: { + id: number; + query?: { + /** + * Returns the workflow scheme's draft rather than scheme itself, if set to true. If the workflow scheme does not have a draft, then the workflow scheme is returned. + * @default false + */ + returnDraftIfExists?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates a workflow scheme, including the name, default workflow, issue type to project mappings, and more. If the workflow scheme is active (that is, being used by at least one project), then a draft workflow scheme is created or updated instead, provided that `updateDraftIfNeeded` is set to `true`. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow schemes + * @name UpdateWorkflowScheme + * @summary Update workflow scheme + * @request PUT:/rest/api/3/workflowscheme/{id} + * @secure + */ + updateWorkflowScheme: ({ id, data, params = {} }: { id: number; data: WorkflowScheme; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Create a draft workflow scheme from an active workflow scheme, by copying the active workflow scheme. Note that an active workflow scheme can only have one draft workflow scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow scheme drafts + * @name CreateWorkflowSchemeDraftFromParent + * @summary Create draft workflow scheme + * @request POST:/rest/api/3/workflowscheme/{id}/createdraft + * @secure + */ + createWorkflowSchemeDraftFromParent: ({ id, params = {} }: { id: number; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}/createdraft`, + method: "POST", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Resets the default workflow for a workflow scheme. That is, the default workflow is set to Jira's system workflow (the *jira* workflow). Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to `true` and a draft workflow scheme is created or updated with the default workflow reset. The draft workflow scheme can be published in Jira. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow schemes + * @name DeleteDefaultWorkflow + * @summary Delete default workflow + * @request DELETE:/rest/api/3/workflowscheme/{id}/default + * @secure + */ + deleteDefaultWorkflow: ({ + id, + query, + params = {}, + }: { + id: number; + query?: { + /** Set to true to create or update the draft of a workflow scheme and delete the mapping from the draft, when the workflow scheme cannot be edited. Defaults to `false`. */ + updateDraftIfNeeded?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}/default`, + method: "DELETE", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the default workflow for a workflow scheme. The default workflow is the workflow that is assigned any issue types that have not been mapped to any other workflow. The default workflow has *All Unassigned Issue Types* listed in its issue types for the workflow scheme in Jira. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow schemes + * @name GetDefaultWorkflow + * @summary Get default workflow + * @request GET:/rest/api/3/workflowscheme/{id}/default + * @secure + */ + getDefaultWorkflow: ({ + id, + query, + params = {}, + }: { + id: number; + query?: { + /** + * Set to `true` to return the default workflow for the workflow scheme's draft rather than scheme itself. If the workflow scheme does not have a draft, then the default workflow for the workflow scheme is returned. + * @default false + */ + returnDraftIfExists?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}/default`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Sets the default workflow for a workflow scheme. Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to `true` in the request object and a draft workflow scheme is created or updated with the new default workflow. The draft workflow scheme can be published in Jira. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow schemes + * @name UpdateDefaultWorkflow + * @summary Update default workflow + * @request PUT:/rest/api/3/workflowscheme/{id}/default + * @secure + */ + updateDefaultWorkflow: ({ id, data, params = {} }: { id: number; data: DefaultWorkflow; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}/default`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes a draft workflow scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow scheme drafts + * @name DeleteWorkflowSchemeDraft + * @summary Delete draft workflow scheme + * @request DELETE:/rest/api/3/workflowscheme/{id}/draft + * @secure + */ + deleteWorkflowSchemeDraft: ({ id, params = {} }: { id: number; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}/draft`, + method: "DELETE", + secure: true, + ...params, + }), + + /** + * @description Returns the draft workflow scheme for an active workflow scheme. Draft workflow schemes allow changes to be made to the active workflow schemes: When an active workflow scheme is updated, a draft copy is created. The draft is modified, then the changes in the draft are copied back to the active workflow scheme. See [Configuring workflow schemes](https://confluence.atlassian.com/x/tohKLg) for more information. Note that: * Only active workflow schemes can have draft workflow schemes. * An active workflow scheme can only have one draft workflow scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow scheme drafts + * @name GetWorkflowSchemeDraft + * @summary Get draft workflow scheme + * @request GET:/rest/api/3/workflowscheme/{id}/draft + * @secure + */ + getWorkflowSchemeDraft: ({ id, params = {} }: { id: number; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}/draft`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Updates a draft workflow scheme. If a draft workflow scheme does not exist for the active workflow scheme, then a draft is created. Note that an active workflow scheme can only have one draft workflow scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow scheme drafts + * @name UpdateWorkflowSchemeDraft + * @summary Update draft workflow scheme + * @request PUT:/rest/api/3/workflowscheme/{id}/draft + * @secure + */ + updateWorkflowSchemeDraft: ({ + id, + data, + params = {}, + }: { + id: number; + data: WorkflowScheme; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}/draft`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Resets the default workflow for a workflow scheme's draft. That is, the default workflow is set to Jira's system workflow (the *jira* workflow). **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow scheme drafts + * @name DeleteDraftDefaultWorkflow + * @summary Delete draft default workflow + * @request DELETE:/rest/api/3/workflowscheme/{id}/draft/default + * @secure + */ + deleteDraftDefaultWorkflow: ({ id, params = {} }: { id: number; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}/draft/default`, + method: "DELETE", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the default workflow for a workflow scheme's draft. The default workflow is the workflow that is assigned any issue types that have not been mapped to any other workflow. The default workflow has *All Unassigned Issue Types* listed in its issue types for the workflow scheme in Jira. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow scheme drafts + * @name GetDraftDefaultWorkflow + * @summary Get draft default workflow + * @request GET:/rest/api/3/workflowscheme/{id}/draft/default + * @secure + */ + getDraftDefaultWorkflow: ({ id, params = {} }: { id: number; params?: RequestParams }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}/draft/default`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Sets the default workflow for a workflow scheme's draft. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow scheme drafts + * @name UpdateDraftDefaultWorkflow + * @summary Update draft default workflow + * @request PUT:/rest/api/3/workflowscheme/{id}/draft/default + * @secure + */ + updateDraftDefaultWorkflow: ({ + id, + data, + params = {}, + }: { + id: number; + data: DefaultWorkflow; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}/draft/default`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes the issue type-workflow mapping for an issue type in a workflow scheme's draft. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow scheme drafts + * @name DeleteWorkflowSchemeDraftIssueType + * @summary Delete workflow for issue type in draft workflow scheme + * @request DELETE:/rest/api/3/workflowscheme/{id}/draft/issuetype/{issueType} + * @secure + */ + deleteWorkflowSchemeDraftIssueType: ({ + id, + issueType, + params = {}, + }: { + id: number; + issueType: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}/draft/issuetype/${issueType}`, + method: "DELETE", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the issue type-workflow mapping for an issue type in a workflow scheme's draft. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow scheme drafts + * @name GetWorkflowSchemeDraftIssueType + * @summary Get workflow for issue type in draft workflow scheme + * @request GET:/rest/api/3/workflowscheme/{id}/draft/issuetype/{issueType} + * @secure + */ + getWorkflowSchemeDraftIssueType: ({ + id, + issueType, + params = {}, + }: { + id: number; + issueType: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}/draft/issuetype/${issueType}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Sets the workflow for an issue type in a workflow scheme's draft. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow scheme drafts + * @name SetWorkflowSchemeDraftIssueType + * @summary Set workflow for issue type in draft workflow scheme + * @request PUT:/rest/api/3/workflowscheme/{id}/draft/issuetype/{issueType} + * @secure + */ + setWorkflowSchemeDraftIssueType: ({ + id, + issueType, + data, + params = {}, + }: { + id: number; + issueType: string; + data: IssueTypeWorkflowMapping; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}/draft/issuetype/${issueType}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Publishes a draft workflow scheme. Where the draft workflow includes new workflow statuses for an issue type, mappings are provided to update issues with the original workflow status to the new workflow status. This operation is [asynchronous](#async). Follow the `location` link in the response to determine the status of the task and use [Get task](#api-rest-api-3-task-taskId-get) to obtain updates. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow scheme drafts + * @name PublishDraftWorkflowScheme + * @summary Publish draft workflow scheme + * @request POST:/rest/api/3/workflowscheme/{id}/draft/publish + * @secure + */ + publishDraftWorkflowScheme: ({ + id, + data, + query, + params = {}, + }: { + id: number; + data: PublishDraftWorkflowScheme; + query?: { + /** + * Whether the request only performs a validation. + * @default false + */ + validateOnly?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}/draft/publish`, + method: "POST", + query: query, + body: data, + secure: true, + type: ContentType.Json, + ...params, + }), + + /** + * @description Deletes the workflow-issue type mapping for a workflow in a workflow scheme's draft. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow scheme drafts + * @name DeleteDraftWorkflowMapping + * @summary Delete issue types for workflow in draft workflow scheme + * @request DELETE:/rest/api/3/workflowscheme/{id}/draft/workflow + * @secure + */ + deleteDraftWorkflowMapping: ({ + id, + query, + params = {}, + }: { + id: number; + query: { + /** The name of the workflow. */ + workflowName: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}/draft/workflow`, + method: "DELETE", + query: query, + secure: true, + ...params, + }), + + /** + * @description Returns the workflow-issue type mappings for a workflow scheme's draft. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow scheme drafts + * @name GetDraftWorkflow + * @summary Get issue types for workflows in draft workflow scheme + * @request GET:/rest/api/3/workflowscheme/{id}/draft/workflow + * @secure + */ + getDraftWorkflow: ({ + id, + query, + params = {}, + }: { + id: number; + query?: { + /** The name of a workflow in the scheme. Limits the results to the workflow-issue type mapping for the specified workflow. */ + workflowName?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}/draft/workflow`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Sets the issue types for a workflow in a workflow scheme's draft. The workflow can also be set as the default workflow for the draft workflow scheme. Unmapped issues types are mapped to the default workflow. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow scheme drafts + * @name UpdateDraftWorkflowMapping + * @summary Set issue types for workflow in workflow scheme + * @request PUT:/rest/api/3/workflowscheme/{id}/draft/workflow + * @secure + */ + updateDraftWorkflowMapping: ({ + id, + query, + data, + params = {}, + }: { + id: number; + query: { + /** The name of the workflow. */ + workflowName: string; + }; + data: IssueTypesWorkflowMapping; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}/draft/workflow`, + method: "PUT", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes the issue type-workflow mapping for an issue type in a workflow scheme. Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to `true` and a draft workflow scheme is created or updated with the issue type-workflow mapping deleted. The draft workflow scheme can be published in Jira. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow schemes + * @name DeleteWorkflowSchemeIssueType + * @summary Delete workflow for issue type in workflow scheme + * @request DELETE:/rest/api/3/workflowscheme/{id}/issuetype/{issueType} + * @secure + */ + deleteWorkflowSchemeIssueType: ({ + id, + issueType, + query, + params = {}, + }: { + id: number; + issueType: string; + query?: { + /** Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the workflow scheme cannot be edited. Defaults to `false`. */ + updateDraftIfNeeded?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}/issuetype/${issueType}`, + method: "DELETE", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns the issue type-workflow mapping for an issue type in a workflow scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow schemes + * @name GetWorkflowSchemeIssueType + * @summary Get workflow for issue type in workflow scheme + * @request GET:/rest/api/3/workflowscheme/{id}/issuetype/{issueType} + * @secure + */ + getWorkflowSchemeIssueType: ({ + id, + issueType, + query, + params = {}, + }: { + id: number; + issueType: string; + query?: { + /** + * Returns the mapping from the workflow scheme's draft rather than the workflow scheme, if set to true. If no draft exists, the mapping from the workflow scheme is returned. + * @default false + */ + returnDraftIfExists?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}/issuetype/${issueType}`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Sets the workflow for an issue type in a workflow scheme. Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to `true` in the request body and a draft workflow scheme is created or updated with the new issue type-workflow mapping. The draft workflow scheme can be published in Jira. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow schemes + * @name SetWorkflowSchemeIssueType + * @summary Set workflow for issue type in workflow scheme + * @request PUT:/rest/api/3/workflowscheme/{id}/issuetype/{issueType} + * @secure + */ + setWorkflowSchemeIssueType: ({ + id, + issueType, + data, + params = {}, + }: { + id: number; + issueType: string; + data: IssueTypeWorkflowMapping; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}/issuetype/${issueType}`, + method: "PUT", + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Deletes the workflow-issue type mapping for a workflow in a workflow scheme. Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to `true` and a draft workflow scheme is created or updated with the workflow-issue type mapping deleted. The draft workflow scheme can be published in Jira. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow schemes + * @name DeleteWorkflowMapping + * @summary Delete issue types for workflow in workflow scheme + * @request DELETE:/rest/api/3/workflowscheme/{id}/workflow + * @secure + */ + deleteWorkflowMapping: ({ + id, + query, + params = {}, + }: { + id: number; + query: { + /** The name of the workflow. */ + workflowName: string; + /** Set to true to create or update the draft of a workflow scheme and delete the mapping from the draft, when the workflow scheme cannot be edited. Defaults to `false`. */ + updateDraftIfNeeded?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}/workflow`, + method: "DELETE", + query: query, + secure: true, + ...params, + }), + + /** + * @description Returns the workflow-issue type mappings for a workflow scheme. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow schemes + * @name GetWorkflow + * @summary Get issue types for workflows in workflow scheme + * @request GET:/rest/api/3/workflowscheme/{id}/workflow + * @secure + */ + getWorkflow: ({ + id, + query, + params = {}, + }: { + id: number; + query?: { + /** The name of a workflow in the scheme. Limits the results to the workflow-issue type mapping for the specified workflow. */ + workflowName?: string; + /** + * Returns the mapping from the workflow scheme's draft rather than the workflow scheme, if set to true. If no draft exists, the mapping from the workflow scheme is returned. + * @default false + */ + returnDraftIfExists?: boolean; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}/workflow`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Sets the issue types for a workflow in a workflow scheme. The workflow can also be set as the default workflow for the workflow scheme. Unmapped issues types are mapped to the default workflow. Note that active workflow schemes cannot be edited. If the workflow scheme is active, set `updateDraftIfNeeded` to `true` in the request body and a draft workflow scheme is created or updated with the new workflow-issue types mappings. The draft workflow scheme can be published in Jira. **[Permissions](#permissions) required:** *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * + * @tags Workflow schemes + * @name UpdateWorkflowMapping + * @summary Set issue types for workflow in workflow scheme + * @request PUT:/rest/api/3/workflowscheme/{id}/workflow + * @secure + */ + updateWorkflowMapping: ({ + id, + query, + data, + params = {}, + }: { + id: number; + query: { + /** The name of the workflow. */ + workflowName: string; + }; + data: IssueTypesWorkflowMapping; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/workflowscheme/${id}/workflow`, + method: "PUT", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a list of IDs and delete timestamps for worklogs deleted after a date and time. This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set to true on the last page of worklogs. This resource does not return worklogs deleted during the minute preceding the request. **[Permissions](#permissions) required:** Permission to access Jira. + * + * @tags Issue worklogs + * @name GetIdsOfWorklogsDeletedSince + * @summary Get IDs of deleted worklogs + * @request GET:/rest/api/3/worklog/deleted + * @secure + */ + getIdsOfWorklogsDeletedSince: ({ + query, + params = {}, + }: { + query?: { + /** + * The date and time, as a UNIX timestamp in milliseconds, after which deleted worklogs are returned. + * @format int64 + * @default 0 + */ + since?: number; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/worklog/deleted`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Returns worklog details for a list of worklog IDs. The returned list of worklogs is limited to 1000 items. **[Permissions](#permissions) required:** Permission to access Jira, however, worklogs are only returned where either of the following is true: * the worklog is set as *Viewable by All Users*. * the user is a member of a project role or group with permission to view the worklog. + * + * @tags Issue worklogs + * @name GetWorklogsForIds + * @summary Get worklogs + * @request POST:/rest/api/3/worklog/list + * @secure + */ + getWorklogsForIds: ({ + data, + query, + params = {}, + }: { + data: WorklogIdsRequestBean; + query?: { + /** + * Use [expand](#expansion) to include additional information about worklogs in the response. This parameter accepts `properties` that returns the properties of each worklog. + * @default "" + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/worklog/list`, + method: "POST", + query: query, + body: data, + secure: true, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Returns a list of IDs and update timestamps for worklogs updated after a date and time. This resource is paginated, with a limit of 1000 worklogs per page. Each page lists worklogs from oldest to youngest. If the number of items in the date range exceeds 1000, `until` indicates the timestamp of the youngest item on the page. Also, `nextPage` provides the URL for the next page of worklogs. The `lastPage` parameter is set to true on the last page of worklogs. This resource does not return worklogs updated during the minute preceding the request. **[Permissions](#permissions) required:** Permission to access Jira, however, worklogs are only returned where either of the following is true: * the worklog is set as *Viewable by All Users*. * the user is a member of a project role or group with permission to view the worklog. + * + * @tags Issue worklogs + * @name GetIdsOfWorklogsModifiedSince + * @summary Get IDs of updated worklogs + * @request GET:/rest/api/3/worklog/updated + * @secure + */ + getIdsOfWorklogsModifiedSince: ({ + query, + params = {}, + }: { + query?: { + /** + * The date and time, as a UNIX timestamp in milliseconds, after which updated worklogs are returned. + * @format int64 + * @default 0 + */ + since?: number; + /** + * Use [expand](#expansion) to include additional information about worklogs in the response. This parameter accepts `properties` that returns the properties of each worklog. + * @default "" + */ + expand?: string; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/api/3/worklog/updated`, + method: "GET", + query: query, + secure: true, + format: "json", + ...params, + }), + + /** + * @description Gets all the properties of an app. **[Permissions](#permissions) required:** Only a Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the Marketplace can access properties of Connect apps they were [migrated from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). + * + * @tags App properties + * @name AddonPropertiesResourceGetAddonPropertiesGet + * @summary Get app properties + * @request GET:/rest/atlassian-connect/1/addons/{addonKey}/properties + * @secure + */ + addonPropertiesResourceGetAddonPropertiesGet: ({ + addonKey, + params = {}, + }: { + addonKey: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/atlassian-connect/1/addons/${addonKey}/properties`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Deletes an app's property. **[Permissions](#permissions) required:** Only a Connect app whose key matches `addonKey` can make this request. + * + * @tags App properties + * @name AddonPropertiesResourceDeleteAddonPropertyDelete + * @summary Delete app property + * @request DELETE:/rest/atlassian-connect/1/addons/{addonKey}/properties/{propertyKey} + */ + addonPropertiesResourceDeleteAddonPropertyDelete: ({ + addonKey, + propertyKey, + params = {}, + }: { + addonKey: string; + propertyKey: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/atlassian-connect/1/addons/${addonKey}/properties/${propertyKey}`, + method: "DELETE", + ...params, + }), + + /** + * @description Returns the key and value of an app's property. **[Permissions](#permissions) required:** Only a Connect app whose key matches `addonKey` can make this request. Additionally, Forge apps published on the Marketplace can access properties of Connect apps they were [migrated from](https://developer.atlassian.com/platform/forge/build-a-connect-on-forge-app/). + * + * @tags App properties + * @name AddonPropertiesResourceGetAddonPropertyGet + * @summary Get app property + * @request GET:/rest/atlassian-connect/1/addons/{addonKey}/properties/{propertyKey} + * @secure + */ + addonPropertiesResourceGetAddonPropertyGet: ({ + addonKey, + propertyKey, + params = {}, + }: { + addonKey: string; + propertyKey: string; + params?: RequestParams; + }) => + this.request({ + path: `/rest/atlassian-connect/1/addons/${addonKey}/properties/${propertyKey}`, + method: "GET", + secure: true, + format: "json", + ...params, + }), + + /** + * @description Sets the value of an app's property. Use this resource to store custom data for your app. The value of the request body must be a [valid](http://tools.ietf.org/html/rfc4627), non-empty JSON blob. The maximum length is 32768 characters. **[Permissions](#permissions) required:** Only a Connect app whose key matches `addonKey` can make this request. + * + * @tags App properties + * @name AddonPropertiesResourcePutAddonPropertyPut + * @summary Set app property + * @request PUT:/rest/atlassian-connect/1/addons/{addonKey}/properties/{propertyKey} + */ + addonPropertiesResourcePutAddonPropertyPut: ({ + addonKey, + propertyKey, + data, + params = {}, + }: { + addonKey: string; + propertyKey: string; + data: any; + params?: RequestParams; + }) => + this.request({ + path: `/rest/atlassian-connect/1/addons/${addonKey}/properties/${propertyKey}`, + method: "PUT", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Remove all or a list of modules registered by the calling app. **[Permissions](#permissions) required:** Only Connect apps can make this request. + * + * @tags Dynamic modules + * @name DynamicModulesResourceRemoveModulesDelete + * @summary Remove modules + * @request DELETE:/rest/atlassian-connect/1/app/module/dynamic + */ + dynamicModulesResourceRemoveModulesDelete: ({ + query, + params = {}, + }: { + query?: { + /** + * The key of the module to remove. To include multiple module keys, provide multiple copies of this parameter. + * For example, `moduleKey=dynamic-attachment-entity-property&moduleKey=dynamic-select-field`. + * Nonexistent keys are ignored. + */ + moduleKey?: string[]; + }; + params?: RequestParams; + }) => + this.request({ + path: `/rest/atlassian-connect/1/app/module/dynamic`, + method: "DELETE", + query: query, + ...params, + }), + + /** + * @description Returns all modules registered dynamically by the calling app. **[Permissions](#permissions) required:** Only Connect apps can make this request. + * + * @tags Dynamic modules + * @name DynamicModulesResourceGetModulesGet + * @summary Get modules + * @request GET:/rest/atlassian-connect/1/app/module/dynamic + */ + dynamicModulesResourceGetModulesGet: ({ params = {} }: { params?: RequestParams }) => + this.request({ + path: `/rest/atlassian-connect/1/app/module/dynamic`, + method: "GET", + format: "json", + ...params, + }), + + /** + * @description Registers a list of modules. **[Permissions](#permissions) required:** Only Connect apps can make this request. + * + * @tags Dynamic modules + * @name DynamicModulesResourceRegisterModulesPost + * @summary Register modules + * @request POST:/rest/atlassian-connect/1/app/module/dynamic + */ + dynamicModulesResourceRegisterModulesPost: ({ + data, + params = {}, + }: { + data: ConnectModules; + params?: RequestParams; + }) => + this.request({ + path: `/rest/atlassian-connect/1/app/module/dynamic`, + method: "POST", + body: data, + type: ContentType.Json, + ...params, + }), + + /** + * @description Updates the value of a custom field added by Connect apps on one or more issues. The values of up to 200 custom fields can be updated. **[Permissions](#permissions) required:** Only Connect apps can make this request. + * + * @tags App migration + * @name AppIssueFieldValueUpdateResourceUpdateIssueFieldsPut + * @summary Bulk update custom field value + * @request PUT:/rest/atlassian-connect/1/migration/field + */ + appIssueFieldValueUpdateResourceUpdateIssueFieldsPut: ({ + data, + params = {}, + }: { + data: ConnectCustomFieldValues; + params?: RequestParams; + }) => + this.request({ + path: `/rest/atlassian-connect/1/migration/field`, + method: "PUT", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + + /** + * @description Updates the values of multiple entity properties for an object, up to 50 updates per request. This operation is for use by Connect apps during app migration. + * + * @tags App migration + * @name MigrationResourceUpdateEntityPropertiesValuePut + * @summary Bulk update entity properties + * @request PUT:/rest/atlassian-connect/1/migration/properties/{entityType} + */ + migrationResourceUpdateEntityPropertiesValuePut: ({ + entityType, + data, + params = {}, + }: { + entityType: + | "IssueProperty" + | "CommentProperty" + | "DashboardItemProperty" + | "IssueTypeProperty" + | "ProjectProperty" + | "UserProperty" + | "WorklogProperty" + | "BoardProperty" + | "SprintProperty"; + data: EntityPropertyDetails[]; + params?: RequestParams; + }) => + this.request({ + path: `/rest/atlassian-connect/1/migration/properties/${entityType}`, + method: "PUT", + body: data, + type: ContentType.Json, + ...params, + }), + + /** + * @description Returns configurations for workflow transition rules migrated from server to cloud and owned by the calling Connect app. + * + * @tags App migration + * @name MigrationResourceWorkflowRuleSearchPost + * @summary Get workflow transition rule configurations + * @request POST:/rest/atlassian-connect/1/migration/workflow/rule/search + */ + migrationResourceWorkflowRuleSearchPost: ({ + data, + params = {}, + }: { + data: WorkflowRulesSearch; + params?: RequestParams; + }) => + this.request({ + path: `/rest/atlassian-connect/1/migration/workflow/rule/search`, + method: "POST", + body: data, + type: ContentType.Json, + format: "json", + ...params, + }), + }; +} diff --git a/src/app/parser/typescript/test-data/cleanup-tests/atlassian-jira/golden-file b/src/app/parser/typescript/test-data/cleanup-tests/atlassian-jira/golden-file new file mode 100644 index 0000000..e781def --- /dev/null +++ b/src/app/parser/typescript/test-data/cleanup-tests/atlassian-jira/golden-file @@ -0,0 +1,15829 @@ +import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; +import { + ActorInputBean, + ActorsMap, + AddFieldBean, + AddGroupBean, + AddNotificationsDetails, + AnnouncementBannerConfiguration, + AnnouncementBannerConfigurationUpdate, + Api, + ApplicationProperty, + ApplicationRole, + AssociateFieldConfigurationsWithIssueTypesRequest, + Attachment, + AttachmentArchiveImpl, + AttachmentArchiveMetadataReadable, + AttachmentMetadata, + AttachmentSettings, + AuditRecords, + AutoCompleteSuggestions, + AvailableDashboardGadgetsResponse, + Avatar, + Avatars, + BulkCustomFieldOptionCreateRequest, + BulkCustomFieldOptionUpdateRequest, + BulkIssueIsWatching, + BulkIssuePropertyUpdateRequest, + BulkPermissionGrants, + BulkPermissionsRequestBean, + ChangeFilterOwner, + ChangedWorklogs, + ColumnItem, + Comment, + ComponentIssuesCount, + Configuration, + ConnectCustomFieldValues, + ConnectModule, + ConnectModules, + ContainerForProjectFeatures, + ContainerForRegisteredWebhooks, + ContainerForWebhookIDs, + ContainerOfWorkflowSchemeAssociations, + ConvertedJQLQueries, + CreateCustomFieldContext, + CreateNotificationSchemeDetails, + CreatePriorityDetails, + CreateProjectDetails, + CreateResolutionDetails, + CreateUiModificationDetails, + CreateUpdateRoleRequestBean, + CreateWorkflowDetails, + CreatedIssue, + CreatedIssues, + CustomFieldConfigurations, + CustomFieldContextDefaultValueUpdate, + CustomFieldContextUpdateDetails, + CustomFieldCreatedContextOptionsList, + CustomFieldDefinitionJsonBean, + CustomFieldOption, + CustomFieldUpdatedContextOptionsList, + CustomFieldValueUpdateDetails, + Dashboard, + DashboardDetails, + DashboardGadget, + DashboardGadgetResponse, + DashboardGadgetSettings, + DashboardGadgetUpdateRequest, + DefaultShareScope, + DefaultWorkflow, + DeleteAndReplaceVersionBean, + DeprecatedWorkflow, + EntityProperty, + EntityPropertyDetails, + ErrorCollection, + FailedWebhooks, + FieldConfiguration, + FieldConfigurationDetails, + FieldConfigurationItemsDetails, + FieldConfigurationScheme, + FieldConfigurationSchemeProjectAssociation, + FieldDetails, + Filter, + FoundGroups, + FoundUsers, + FoundUsersAndGroups, + Group, + GroupName, + IdBean, + IssueBean, + IssueChangelogIds, + IssueCommentListRequestBean, + IssueCreateMetadata, + IssueEntityProperties, + IssueEvent, + IssueFieldOption, + IssueFieldOptionCreateBean, + IssueFilterForBulkPropertyDelete, + IssueLink, + IssueLinkType, + IssueLinkTypes, + IssueList, + IssueMatches, + IssuePickerSuggestions, + IssueTypeCreateBean, + IssueTypeDetails, + IssueTypeIds, + IssueTypeIdsToRemove, + IssueTypeSchemeDetails, + IssueTypeSchemeID, + IssueTypeSchemeProjectAssociation, + IssueTypeSchemeUpdateDetails, + IssueTypeScreenSchemeDetails, + IssueTypeScreenSchemeId, + IssueTypeScreenSchemeMappingDetails, + IssueTypeScreenSchemeProjectAssociation, + IssueTypeScreenSchemeUpdateDetails, + IssueTypeUpdateBean, + IssueTypeWithStatus, + IssueTypeWorkflowMapping, + IssueTypesWorkflowMapping, + IssueUpdateDetails, + IssueUpdateMetadata, + IssuesAndJQLQueries, + IssuesUpdateBean, + JQLPersonalDataMigrationRequest, + JQLReferenceData, + JiraExpressionEvalRequestBean, + JiraExpressionForAnalysis, + JiraExpressionResult, + JiraExpressionsAnalysis, + JiraStatus, + JqlFunctionPrecomputationUpdateRequestBean, + JqlQueriesToParse, + JqlQueriesToSanitize, + License, + LicenseMetric, + LinkIssueRequestJsonBean, + Locale, + MoveFieldBean, + MultiIssueEntityProperties, + MultipleCustomFieldValuesUpdateDetails, + NewUserDetails, + Notification, + NotificationScheme, + NotificationSchemeId, + OperationMessage, + OrderOfCustomFieldOptions, + OrderOfIssueTypes, + PageBeanChangelog, + PageBeanComment, + PageBeanComponentWithIssueCount, + PageBeanContext, + PageBeanContextForProjectAndIssueType, + PageBeanContextualConfiguration, + PageBeanCustomFieldContext, + PageBeanCustomFieldContextDefaultValue, + PageBeanCustomFieldContextOption, + PageBeanCustomFieldContextProjectMapping, + PageBeanDashboard, + PageBeanField, + PageBeanFieldConfigurationDetails, + PageBeanFieldConfigurationIssueTypeItem, + PageBeanFieldConfigurationItem, + PageBeanFieldConfigurationScheme, + PageBeanFieldConfigurationSchemeProjects, + PageBeanFilterDetails, + PageBeanGroupDetails, + PageBeanIssueFieldOption, + PageBeanIssueSecurityLevelMember, + PageBeanIssueTypeScheme, + PageBeanIssueTypeSchemeMapping, + PageBeanIssueTypeSchemeProjects, + PageBeanIssueTypeScreenScheme, + PageBeanIssueTypeScreenSchemeItem, + PageBeanIssueTypeScreenSchemesProjects, + PageBeanIssueTypeToContextMapping, + PageBeanJqlFunctionPrecomputationBean, + PageBeanNotificationScheme, + PageBeanNotificationSchemeAndProjectMappingJsonBean, + PageBeanPriority, + PageBeanProject, + PageBeanProjectDetails, + PageBeanResolutionJsonBean, + PageBeanScreen, + PageBeanScreenScheme, + PageBeanScreenWithTab, + PageBeanString, + PageBeanUiModificationDetails, + PageBeanUser, + PageBeanUserDetails, + PageBeanUserKey, + PageBeanVersion, + PageBeanWebhook, + PageBeanWorkflow, + PageBeanWorkflowScheme, + PageBeanWorkflowTransitionRules, + PageOfChangelogs, + PageOfComments, + PageOfDashboards, + PageOfStatuses, + PageOfWorklogs, + ParsedJqlQueries, + PermissionGrant, + PermissionGrants, + PermissionScheme, + PermissionSchemes, + Permissions, + PermissionsKeysBean, + PermittedProjects, + Priority, + PriorityId, + Project, + ProjectAvatars, + ProjectCategory, + ProjectComponent, + ProjectEmailAddress, + ProjectFeatureState, + ProjectIdentifiers, + ProjectIds, + ProjectIssueSecurityLevels, + ProjectIssueTypeHierarchy, + ProjectIssueTypeMappings, + ProjectRole, + ProjectRoleActorsUpdateBean, + ProjectRoleDetails, + ProjectType, + PropertyKeys, + PublishDraftWorkflowScheme, + RemoteIssueLink, + RemoteIssueLinkIdentifies, + RemoteIssueLinkRequest, + ReorderIssuePriorities, + ReorderIssueResolutionsRequest, + Resolution, + ResolutionId, + SanitizedJqlQueries, + Screen, + ScreenDetails, + ScreenSchemeDetails, + ScreenSchemeId, + ScreenableField, + ScreenableTab, + SearchAutoCompleteFilter, + SearchRequestBean, + SearchResults, + SecurityLevel, + SecurityScheme, + SecuritySchemes, + ServerInformation, + SetDefaultPriorityRequest, + SetDefaultResolutionRequest, + SharePermission, + SharePermissionInputBean, + SimpleApplicationPropertyBean, + StatusCategory, + StatusCreateRequest, + StatusDetails, + StatusUpdateRequest, + StringList, + SystemAvatars, + TaskProgressBeanObject, + TimeTrackingConfiguration, + TimeTrackingProvider, + Transitions, + UiModificationIdentifiers, + UnrestrictedUserEmail, + UpdateCustomFieldDetails, + UpdateDefaultScreenScheme, + UpdateFieldConfigurationSchemeDetails, + UpdateNotificationSchemeDetails, + UpdatePriorityDetails, + UpdateProjectDetails, + UpdateResolutionDetails, + UpdateScreenDetails, + UpdateScreenSchemeDetails, + UpdateUiModificationDetails, + UpdateUserToGroupBean, + UpdatedProjectCategory, + User, + UserMigrationBean, + Version, + VersionIssueCounts, + VersionMoveBean, + VersionUnresolvedIssuesCount, + Votes, + Watchers, + WebhookRegistrationDetails, + WebhooksExpirationDate, + WorkflowIDs, + WorkflowRulesSearch, + WorkflowRulesSearchDetails, + WorkflowScheme, + WorkflowSchemeProjectAssociation, + WorkflowTransitionProperty, + WorkflowTransitionRulesUpdate, + WorkflowTransitionRulesUpdateErrors, + WorkflowsWithTransitionRulesDetails, + Worklog, + WorklogIdsRequestBean +} from "./api"; + +const api = new Api({ + baseUrl: "", +}); + +/** + * Get announcement banner configuration + * @request GET :/rest/api/3/announcementBanner + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetBanner( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getBanner({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update announcement banner configuration + * @request PUT :/rest/api/3/announcementBanner + * @allowrelaxedtypes + */ +export async function putRestSetBanner( + /** Request body */ + data: AnnouncementBannerConfigurationUpdate, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setBanner({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update custom fields + * @request POST :/rest/api/3/app/field/value + * @allowrelaxedtypes + */ +export async function postRestUpdateMultipleCustomFieldValues( + query: { + /** + * Whether to generate a changelog for this update. + */ + generateChangelog?: boolean; + }, + /** Request body */ + data: MultipleCustomFieldValuesUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateMultipleCustomFieldValues({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get custom field configurations + * @request GET :/rest/api/3/app/field/{fieldIdOrKey}/context/configuration + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetCustomFieldConfiguration( + query: { + /** + * The list of configuration IDs. To include multiple configurations, separate IDs with an ampersand: `id=10000&id=10001`. Can't be provided with `fieldContextId`, `issueId`, `projectKeyOrId`, or `issueTypeId`. + */ + id?: number[]; + /** + * The list of field context IDs. To include multiple field contexts, separate IDs with an ampersand: `fieldContextId=10000&fieldContextId=10001`. Can't be provided with `id`, `issueId`, `projectKeyOrId`, or `issueTypeId`. + */ + fieldContextId?: number[]; + /** + * The ID of the issue to filter results by. If the issue doesn't exist, an empty list is returned. Can't be provided with `projectKeyOrId`, or `issueTypeId`. + */ + issueId?: number; + /** + * The ID or key of the project to filter results by. Must be provided with `issueTypeId`. Can't be provided with `issueId`. + */ + projectKeyOrId?: string; + /** + * The ID of the issue type to filter results by. Must be provided with `projectKeyOrId`. Can't be provided with `issueId`. + */ + issueTypeId?: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID or key of the custom field, for example `customfield_10000`. + */ + fieldIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCustomFieldConfiguration({ + query: query, + fieldIdOrKey: fieldIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update custom field configurations + * @request PUT :/rest/api/3/app/field/{fieldIdOrKey}/context/configuration + * @allowrelaxedtypes + */ +export async function putRestUpdateCustomFieldConfiguration( + /** + * The ID or key of the custom field, for example `customfield_10000`. + */ + fieldIdOrKey: string, + /** Request body */ + data: CustomFieldConfigurations, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateCustomFieldConfiguration({ + fieldIdOrKey: fieldIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update custom field value + * @request PUT :/rest/api/3/app/field/{fieldIdOrKey}/value + * @allowrelaxedtypes + */ +export async function putRestUpdateCustomFieldValue( + query: { + /** + * Whether to generate a changelog for this update. + */ + generateChangelog?: boolean; + }, + /** + * The ID or key of the custom field. For example, `customfield_10010`. + */ + fieldIdOrKey: string, + /** Request body */ + data: CustomFieldValueUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateCustomFieldValue({ + query: query, + fieldIdOrKey: fieldIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get application property + * @request GET :/rest/api/3/application-properties + * @readonly + */ +export async function getRestGetApplicationProperty( + query: { + /** + * The key of the application property. + */ + key?: string; + /** + * The permission level of all items being returned in the list. + */ + permissionLevel?: string; + /** + * When a `key` isn't provided, this filters the list of results by the application property `key` using a regular expression. For example, using `jira.lf.*` will return all application properties with keys that start with *jira.lf.*. + */ + keyFilter?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getApplicationProperty({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get advanced settings + * @request GET :/rest/api/3/application-properties/advanced-settings + * @readonly + */ +export async function getRestGetAdvancedSettings( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAdvancedSettings({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set application property + * @request PUT :/rest/api/3/application-properties/{id} + */ +export async function putRestSetApplicationProperty( + /** + * The key of the application property to update. + */ + id: string, + /** Request body */ + data: SimpleApplicationPropertyBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setApplicationProperty({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all application roles + * @request GET :/rest/api/3/applicationrole + * @readonly + */ +export async function getRestGetAllApplicationRoles( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllApplicationRoles({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get application role + * @request GET :/rest/api/3/applicationrole/{key} + * @readonly + */ +export async function getRestGetApplicationRole( + /** + * The key of the application role. Use the [Get all application roles](#api-rest-api-3-applicationrole-get) operation to get the key for each application role. + */ + key: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getApplicationRole({ + key: key, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get attachment content + * @request GET :/rest/api/3/attachment/content/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAttachmentContent( + query: { + /** + * Whether a redirect is provided for the attachment download. Clients that do not automatically follow redirects can set this to `false` to avoid making multiple requests to download the attachment. + */ + redirect?: boolean; + }, + /** + * The ID of the attachment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAttachmentContent({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get Jira attachment settings + * @request GET :/rest/api/3/attachment/meta + * @readonly + */ +export async function getRestGetAttachmentMeta( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAttachmentMeta({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get attachment thumbnail + * @request GET :/rest/api/3/attachment/thumbnail/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAttachmentThumbnail( + query: { + /** + * Whether a redirect is provided for the attachment download. Clients that do not automatically follow redirects can set this to `false` to avoid making multiple requests to download the attachment. + */ + redirect?: boolean; + /** + * Whether a default thumbnail is returned when the requested thumbnail is not found. + */ + fallbackToDefault?: boolean; + /** + * The maximum width to scale the thumbnail to. + */ + width?: number; + /** + * The maximum height to scale the thumbnail to. + */ + height?: number; + }, + /** + * The ID of the attachment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAttachmentThumbnail({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete attachment + * @request DELETE :/rest/api/3/attachment/{id} + * @allowrelaxedtypes + */ +export async function deleteRestRemoveAttachment( + /** + * The ID of the attachment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeAttachment({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get attachment metadata + * @request GET :/rest/api/3/attachment/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAttachment( + /** + * The ID of the attachment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAttachment({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all metadata for an expanded attachment + * @request GET :/rest/api/3/attachment/{id}/expand/human + * @readonly + */ +export async function getRestExpandAttachmentForHumans( + /** + * The ID of the attachment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.expandAttachmentForHumans({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get contents metadata for an expanded attachment + * @request GET :/rest/api/3/attachment/{id}/expand/raw + * @readonly + */ +export async function getRestExpandAttachmentForMachines( + /** + * The ID of the attachment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.expandAttachmentForMachines({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get audit records + * @request GET :/rest/api/3/auditing/record + * @readonly + */ +export async function getRestGetAuditRecords( + query: { + /** + * The number of records to skip before returning the first result. + */ + offset?: number; + /** + * The maximum number of results to return. + */ + limit?: number; + /** + * The strings to match with audit field content, space separated. + */ + filter?: string; + /** + * The date and time on or after which returned audit records must have been created. If `to` is provided `from` must be before `to` or no audit records are returned. + */ + from?: string; + /** + * The date and time on or before which returned audit results must have been created. If `from` is provided `to` must be after `from` or no audit records are returned. + */ + to?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAuditRecords({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get system avatars by type + * @request GET :/rest/api/3/avatar/{type}/system + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllSystemAvatars( + /** + * The avatar type. + */ + type: "issuetype" | "project" | "user", + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllSystemAvatars({ + type: type, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get comments by IDs + * @request POST :/rest/api/3/comment/list + * @allowrelaxedtypes + */ +export async function postRestGetCommentsByIds( + query: { + /** +* Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts a comma-separated list. Expand options include: + + * `renderedBody` Returns the comment body rendered in HTML. + * `properties` Returns the comment's properties. +*/ + expand?: string; + }, + /** Request body */ + data: IssueCommentListRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCommentsByIds({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get comment property keys + * @request GET :/rest/api/3/comment/{commentId}/properties + * @readonly + */ +export async function getRestGetCommentPropertyKeys( + /** + * The ID of the comment. + */ + commentId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCommentPropertyKeys({ + commentId: commentId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete comment property + * @request DELETE :/rest/api/3/comment/{commentId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteCommentProperty( + /** + * The ID of the comment. + */ + commentId: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteCommentProperty({ + commentId: commentId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get comment property + * @request GET :/rest/api/3/comment/{commentId}/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetCommentProperty( + /** + * The ID of the comment. + */ + commentId: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCommentProperty({ + commentId: commentId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set comment property + * @request PUT :/rest/api/3/comment/{commentId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestSetCommentProperty( + /** + * The ID of the comment. + */ + commentId: string, + /** + * The key of the property. The maximum length is 255 characters. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setCommentProperty({ + commentId: commentId, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Create component + * @request POST :/rest/api/3/component + * @allowrelaxedtypes + */ +export async function postRestCreateComponent( + /** Request body */ + data: ProjectComponent, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createComponent({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete component + * @request DELETE :/rest/api/3/component/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteComponent( + query: { + /** + * The ID of the component to replace the deleted component. If this value is null no replacement is made. + */ + moveIssuesTo?: string; + }, + /** + * The ID of the component. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteComponent({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get component + * @request GET :/rest/api/3/component/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetComponent( + /** + * The ID of the component. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getComponent({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update component + * @request PUT :/rest/api/3/component/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateComponent( + /** + * The ID of the component. + */ + id: string, + /** Request body */ + data: ProjectComponent, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateComponent({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get component issues count + * @request GET :/rest/api/3/component/{id}/relatedIssueCounts + * @readonly + */ +export async function getRestGetComponentRelatedIssues( + /** + * The ID of the component. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getComponentRelatedIssues({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get global settings + * @request GET :/rest/api/3/configuration + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetConfiguration( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getConfiguration({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get selected time tracking provider + * @request GET :/rest/api/3/configuration/timetracking + * @readonly + */ +export async function getRestGetSelectedTimeTrackingImplementation( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getSelectedTimeTrackingImplementation({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Select time tracking provider + * @request PUT :/rest/api/3/configuration/timetracking + * @allowrelaxedtypes + */ +export async function putRestSelectTimeTrackingImplementation( + /** Request body */ + data: TimeTrackingProvider, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.selectTimeTrackingImplementation({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all time tracking providers + * @request GET :/rest/api/3/configuration/timetracking/list + * @readonly + */ +export async function getRestGetAvailableTimeTrackingImplementations( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAvailableTimeTrackingImplementations({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get time tracking settings + * @request GET :/rest/api/3/configuration/timetracking/options + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetSharedTimeTrackingConfiguration( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getSharedTimeTrackingConfiguration({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set time tracking settings + * @request PUT :/rest/api/3/configuration/timetracking/options + * @allowrelaxedtypes + */ +export async function putRestSetSharedTimeTrackingConfiguration( + /** Request body */ + data: TimeTrackingConfiguration, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setSharedTimeTrackingConfiguration({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get custom field option + * @request GET :/rest/api/3/customFieldOption/{id} + * @readonly + */ +export async function getRestGetCustomFieldOption( + /** + * The ID of the custom field option. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCustomFieldOption({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all dashboards + * @request GET :/rest/api/3/dashboard + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllDashboards( + query: { + /** +* The filter applied to the list of dashboards. Valid values are: + + * `favourite` Returns dashboards the user has marked as favorite. + * `my` Returns dashboards owned by the user. +*/ + filter?: "my" | "favourite"; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllDashboards({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create dashboard + * @request POST :/rest/api/3/dashboard + * @allowrelaxedtypes + */ +export async function postRestCreateDashboard( + /** Request body */ + data: DashboardDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createDashboard({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get available gadgets + * @request GET :/rest/api/3/dashboard/gadgets + * @readonly + */ +export async function getRestGetAllAvailableDashboardGadgets( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllAvailableDashboardGadgets({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Search for dashboards + * @request GET :/rest/api/3/dashboard/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetDashboardsPaginated( + query: { + /** + * String used to perform a case-insensitive partial match with `name`. + */ + dashboardName?: string; + /** + * User account ID used to return dashboards with the matching `owner.accountId`. This parameter cannot be used with the `owner` parameter. + */ + accountId?: string; + /** + * This parameter is deprecated because of privacy changes. Use `accountId` instead. See the [migration guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. User name used to return dashboards with the matching `owner.name`. This parameter cannot be used with the `accountId` parameter. + */ + owner?: string; + /** + * As a group's name can change, use of `groupId` is recommended. Group name used to return dashboards that are shared with a group that matches `sharePermissions.group.name`. This parameter cannot be used with the `groupId` parameter. + */ + groupname?: string; + /** + * Group ID used to return dashboards that are shared with a group that matches `sharePermissions.group.groupId`. This parameter cannot be used with the `groupname` parameter. + */ + groupId?: string; + /** + * Project ID used to returns dashboards that are shared with a project that matches `sharePermissions.project.id`. + */ + projectId?: number; + /** +* [Order](#ordering) the results by a field: + + * `description` Sorts by dashboard description. Note that this sort works independently of whether the expand to display the description field is in use. + * `favourite_count` Sorts by dashboard popularity. + * `id` Sorts by dashboard ID. + * `is_favourite` Sorts by whether the dashboard is marked as a favorite. + * `name` Sorts by dashboard name. + * `owner` Sorts by dashboard owner name. +*/ + orderBy?: + | "description" + | "-description" + | "+description" + | "favorite_count" + | "-favorite_count" + | "+favorite_count" + | "id" + | "-id" + | "+id" + | "is_favorite" + | "-is_favorite" + | "+is_favorite" + | "name" + | "-name" + | "+name" + | "owner" + | "-owner" + | "+owner"; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The status to filter by. It may be active, archived or deleted. + */ + status?: "active" | "archived" | "deleted"; + /** +* Use [expand](#expansion) to include additional information about dashboard in the response. This parameter accepts a comma-separated list. Expand options include: + + * `description` Returns the description of the dashboard. + * `owner` Returns the owner of the dashboard. + * `viewUrl` Returns the URL that is used to view the dashboard. + * `favourite` Returns `isFavourite`, an indicator of whether the user has set the dashboard as a favorite. + * `favouritedCount` Returns `popularity`, a count of how many users have set this dashboard as a favorite. + * `sharePermissions` Returns details of the share permissions defined for the dashboard. + * `editPermissions` Returns details of the edit permissions defined for the dashboard. + * `isWritable` Returns whether the current user has permission to edit the dashboard. +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDashboardsPaginated({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get gadgets + * @request GET :/rest/api/3/dashboard/{dashboardId}/gadget + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllGadgets( + query: { + /** + * The list of gadgets module keys. To include multiple module keys, separate module keys with ampersand: `moduleKey=key:one&moduleKey=key:two`. + */ + moduleKey?: string[]; + /** + * The list of gadgets URIs. To include multiple URIs, separate URIs with ampersand: `uri=/rest/example/uri/1&uri=/rest/example/uri/2`. + */ + uri?: string[]; + /** + * The list of gadgets IDs. To include multiple IDs, separate IDs with ampersand: `gadgetId=10000&gadgetId=10001`. + */ + gadgetId?: number[]; + }, + /** + * The ID of the dashboard. + */ + dashboardId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllGadgets({ + query: query, + dashboardId: dashboardId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add gadget to dashboard + * @request POST :/rest/api/3/dashboard/{dashboardId}/gadget + * @allowrelaxedtypes + */ +export async function postRestAddGadget( + /** + * The ID of the dashboard. + */ + dashboardId: number, + /** Request body */ + data: DashboardGadgetSettings, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addGadget({ + dashboardId: dashboardId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Remove gadget from dashboard + * @request DELETE :/rest/api/3/dashboard/{dashboardId}/gadget/{gadgetId} + * @allowrelaxedtypes + */ +export async function deleteRestRemoveGadget( + /** + * The ID of the dashboard. + */ + dashboardId: number, + /** + * The ID of the gadget. + */ + gadgetId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeGadget({ + dashboardId: dashboardId, + gadgetId: gadgetId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update gadget on dashboard + * @request PUT :/rest/api/3/dashboard/{dashboardId}/gadget/{gadgetId} + * @allowrelaxedtypes + */ +export async function putRestUpdateGadget( + /** + * The ID of the dashboard. + */ + dashboardId: number, + /** + * The ID of the gadget. + */ + gadgetId: number, + /** Request body */ + data: DashboardGadgetUpdateRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateGadget({ + dashboardId: dashboardId, + gadgetId: gadgetId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get dashboard item property keys + * @request GET :/rest/api/3/dashboard/{dashboardId}/items/{itemId}/properties + * @readonly + */ +export async function getRestGetDashboardItemPropertyKeys( + /** + * The ID of the dashboard. + */ + dashboardId: string, + /** + * The ID of the dashboard item. + */ + itemId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDashboardItemPropertyKeys({ + dashboardId: dashboardId, + itemId: itemId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete dashboard item property + * @request DELETE :/rest/api/3/dashboard/{dashboardId}/items/{itemId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteDashboardItemProperty( + /** + * The ID of the dashboard. + */ + dashboardId: string, + /** + * The ID of the dashboard item. + */ + itemId: string, + /** + * The key of the dashboard item property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteDashboardItemProperty({ + dashboardId: dashboardId, + itemId: itemId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get dashboard item property + * @request GET :/rest/api/3/dashboard/{dashboardId}/items/{itemId}/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetDashboardItemProperty( + /** + * The ID of the dashboard. + */ + dashboardId: string, + /** + * The ID of the dashboard item. + */ + itemId: string, + /** + * The key of the dashboard item property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDashboardItemProperty({ + dashboardId: dashboardId, + itemId: itemId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set dashboard item property + * @request PUT :/rest/api/3/dashboard/{dashboardId}/items/{itemId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestSetDashboardItemProperty( + /** + * The ID of the dashboard. + */ + dashboardId: string, + /** + * The ID of the dashboard item. + */ + itemId: string, + /** + * The key of the dashboard item property. The maximum length is 255 characters. For dashboard items with a spec URI and no complete module key, if the provided propertyKey is equal to "config", the request body's JSON must be an object with all keys and values as strings. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setDashboardItemProperty({ + dashboardId: dashboardId, + itemId: itemId, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete dashboard + * @request DELETE :/rest/api/3/dashboard/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteDashboard( + /** + * The ID of the dashboard. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteDashboard({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.error) { + throw result.error; + } else { + return new hasuraSdk.JSONValue(result.data); + } +} + +/** + * Get dashboard + * @request GET :/rest/api/3/dashboard/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetDashboard( + /** + * The ID of the dashboard. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDashboard({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update dashboard + * @request PUT :/rest/api/3/dashboard/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateDashboard( + /** + * The ID of the dashboard to update. + */ + id: string, + /** Request body */ + data: DashboardDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateDashboard({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Copy dashboard + * @request POST :/rest/api/3/dashboard/{id}/copy + * @allowrelaxedtypes + */ +export async function postRestCopyDashboard( + id: string, + /** Request body */ + data: DashboardDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.copyDashboard({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get events + * @request GET :/rest/api/3/events + * @readonly + */ +export async function getRestGetEvents( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getEvents({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Analyse Jira expression + * @request POST :/rest/api/3/expression/analyse + * @allowrelaxedtypes + */ +export async function postRestAnalyseExpression( + query: { + /** +* The check to perform: + + * `syntax` Each expression's syntax is checked to ensure the expression can be parsed. Also, syntactic limits are validated. For example, the expression's length. + * `type` EXPERIMENTAL. Each expression is type checked and the final type of the expression inferred. Any type errors that would result in the expression failure at runtime are reported. For example, accessing properties that don't exist or passing the wrong number of arguments to functions. Also performs the syntax check. + * `complexity` EXPERIMENTAL. Determines the formulae for how many [expensive operations](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#expensive-operations) each expression may execute. +*/ + check?: "syntax" | "type" | "complexity"; + }, + /** Request body */ + data: JiraExpressionForAnalysis, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.analyseExpression({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Evaluate Jira expression + * @request POST :/rest/api/3/expression/eval + * @allowrelaxedtypes + */ +export async function postRestEvaluateJiraExpression( + query: { + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts `meta.complexity` that returns information about the expression complexity. For example, the number of expensive operations used by the expression and how close the expression is to reaching the [complexity limit](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions). Useful when designing and debugging your expressions. + */ + expand?: string; + }, + /** Request body */ + data: JiraExpressionEvalRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.evaluateJiraExpression({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get fields + * @request GET :/rest/api/3/field + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetFields( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFields({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create custom field + * @request POST :/rest/api/3/field + * @allowrelaxedtypes + */ +export async function postRestCreateCustomField( + /** Request body */ + data: CustomFieldDefinitionJsonBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createCustomField({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get fields paginated + * @request GET :/rest/api/3/field/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetFieldsPaginated( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The type of fields to search. + */ + type?: ("custom" | "system")[]; + /** + * The IDs of the custom fields to return or, where `query` is specified, filter. + */ + id?: string[]; + /** + * String used to perform a case-insensitive partial match with field names or descriptions. + */ + query?: string; + /** +* [Order](#ordering) the results by a field: + + * `contextsCount` sorts by the number of contexts related to a field + * `lastUsed` sorts by the date when the value of the field last changed + * `name` sorts by the field name + * `screensCount` sorts by the number of screens related to a field +*/ + orderBy?: + | "contextsCount" + | "-contextsCount" + | "+contextsCount" + | "lastUsed" + | "-lastUsed" + | "+lastUsed" + | "name" + | "-name" + | "+name" + | "screensCount" + | "-screensCount" + | "+screensCount" + | "projectsCount" + | "-projectsCount" + | "+projectsCount"; + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `key` returns the key for each field + * `lastUsed` returns the date when the value of the field last changed + * `screensCount` returns the number of screens related to a field + * `contextsCount` returns the number of contexts related to a field + * `isLocked` returns information about whether the field is [locked](https://confluence.atlassian.com/x/ZSN7Og) + * `searcherKey` returns the searcher key for each custom field +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFieldsPaginated({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get fields in trash paginated + * @request GET :/rest/api/3/field/search/trashed + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetTrashedFieldsPaginated( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + id?: string[]; + /** + * String used to perform a case-insensitive partial match with field names or descriptions. + */ + query?: string; + expand?: + | "name" + | "-name" + | "+name" + | "trashDate" + | "-trashDate" + | "+trashDate" + | "plannedDeletionDate" + | "-plannedDeletionDate" + | "+plannedDeletionDate" + | "projectsCount" + | "-projectsCount" + | "+projectsCount"; + /** +* [Order](#ordering) the results by a field: + + * `name` sorts by the field name + * `trashDate` sorts by the date the field was moved to the trash + * `plannedDeletionDate` sorts by the planned deletion date +*/ + orderBy?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getTrashedFieldsPaginated({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update custom field + * @request PUT :/rest/api/3/field/{fieldId} + * @allowrelaxedtypes + */ +export async function putRestUpdateCustomField( + /** + * The ID of the custom field. + */ + fieldId: string, + /** Request body */ + data: UpdateCustomFieldDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateCustomField({ + fieldId: fieldId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get custom field contexts + * @request GET :/rest/api/3/field/{fieldId}/context + * @readonly + */ +export async function getRestGetContextsForField( + query: { + /** + * Whether to return contexts that apply to all issue types. + */ + isAnyIssueType?: boolean; + /** + * Whether to return contexts that apply to all projects. + */ + isGlobalContext?: boolean; + /** + * The list of context IDs. To include multiple contexts, separate IDs with ampersand: `contextId=10000&contextId=10001`. + */ + contextId?: number[]; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the custom field. + */ + fieldId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getContextsForField({ + query: query, + fieldId: fieldId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create custom field context + * @request POST :/rest/api/3/field/{fieldId}/context + */ +export async function postRestCreateCustomFieldContext( + /** + * The ID of the custom field. + */ + fieldId: string, + /** Request body */ + data: CreateCustomFieldContext, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createCustomFieldContext({ + fieldId: fieldId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get custom field contexts default values + * @request GET :/rest/api/3/field/{fieldId}/context/defaultValue + * @readonly + */ +export async function getRestGetDefaultValues( + query: { + /** + * The IDs of the contexts. + */ + contextId?: number[]; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the custom field, for example `customfield\_10000`. + */ + fieldId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDefaultValues({ + query: query, + fieldId: fieldId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set custom field contexts default values + * @request PUT :/rest/api/3/field/{fieldId}/context/defaultValue + * @allowrelaxedtypes + */ +export async function putRestSetDefaultValues( + /** + * The ID of the custom field. + */ + fieldId: string, + /** Request body */ + data: CustomFieldContextDefaultValueUpdate, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setDefaultValues({ + fieldId: fieldId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get issue types for custom field context + * @request GET :/rest/api/3/field/{fieldId}/context/issuetypemapping + * @readonly + */ +export async function getRestGetIssueTypeMappingsForContexts( + query: { + /** + * The ID of the context. To include multiple contexts, provide an ampersand-separated list. For example, `contextId=10001&contextId=10002`. + */ + contextId?: number[]; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the custom field. + */ + fieldId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypeMappingsForContexts({ + query: query, + fieldId: fieldId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get custom field contexts for projects and issue types + * @request POST :/rest/api/3/field/{fieldId}/context/mapping + */ +export async function postRestGetCustomFieldContextsForProjectsAndIssueTypes( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the custom field. + */ + fieldId: string, + /** Request body */ + data: ProjectIssueTypeMappings, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCustomFieldContextsForProjectsAndIssueTypes({ + query: query, + fieldId: fieldId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project mappings for custom field context + * @request GET :/rest/api/3/field/{fieldId}/context/projectmapping + * @readonly + */ +export async function getRestGetProjectContextMapping( + query: { + /** + * The list of context IDs. To include multiple context, separate IDs with ampersand: `contextId=10000&contextId=10001`. + */ + contextId?: number[]; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the custom field, for example `customfield\_10000`. + */ + fieldId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectContextMapping({ + query: query, + fieldId: fieldId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete custom field context + * @request DELETE :/rest/api/3/field/{fieldId}/context/{contextId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteCustomFieldContext( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteCustomFieldContext({ + fieldId: fieldId, + contextId: contextId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update custom field context + * @request PUT :/rest/api/3/field/{fieldId}/context/{contextId} + * @allowrelaxedtypes + */ +export async function putRestUpdateCustomFieldContext( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: CustomFieldContextUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateCustomFieldContext({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Add issue types to context + * @request PUT :/rest/api/3/field/{fieldId}/context/{contextId}/issuetype + * @allowrelaxedtypes + */ +export async function putRestAddIssueTypesToContext( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: IssueTypeIds, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addIssueTypesToContext({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Remove issue types from context + * @request POST :/rest/api/3/field/{fieldId}/context/{contextId}/issuetype/remove + * @allowrelaxedtypes + */ +export async function postRestRemoveIssueTypesFromContext( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: IssueTypeIds, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeIssueTypesFromContext({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get custom field options (context) + * @request GET :/rest/api/3/field/{fieldId}/context/{contextId}/option + * @readonly + */ +export async function getRestGetOptionsForContext( + query: { + /** + * The ID of the option. + */ + optionId?: number; + /** + * Whether only options are returned. + */ + onlyOptions?: boolean; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getOptionsForContext({ + query: query, + fieldId: fieldId, + contextId: contextId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create custom field options (context) + * @request POST :/rest/api/3/field/{fieldId}/context/{contextId}/option + */ +export async function postRestCreateCustomFieldOption( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: BulkCustomFieldOptionCreateRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createCustomFieldOption({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update custom field options (context) + * @request PUT :/rest/api/3/field/{fieldId}/context/{contextId}/option + */ +export async function putRestUpdateCustomFieldOption( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: BulkCustomFieldOptionUpdateRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateCustomFieldOption({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Reorder custom field options (context) + * @request PUT :/rest/api/3/field/{fieldId}/context/{contextId}/option/move + * @allowrelaxedtypes + */ +export async function putRestReorderCustomFieldOptions( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: OrderOfCustomFieldOptions, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.reorderCustomFieldOptions({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete custom field options (context) + * @request DELETE :/rest/api/3/field/{fieldId}/context/{contextId}/option/{optionId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteCustomFieldOption( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context from which an option should be deleted. + */ + contextId: number, + /** + * The ID of the option to delete. + */ + optionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteCustomFieldOption({ + fieldId: fieldId, + contextId: contextId, + optionId: optionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Assign custom field context to projects + * @request PUT :/rest/api/3/field/{fieldId}/context/{contextId}/project + * @allowrelaxedtypes + */ +export async function putRestAssignProjectsToCustomFieldContext( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: ProjectIds, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.assignProjectsToCustomFieldContext({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Remove custom field context from projects + * @request POST :/rest/api/3/field/{fieldId}/context/{contextId}/project/remove + * @allowrelaxedtypes + */ +export async function postRestRemoveCustomFieldContextFromProjects( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: ProjectIds, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeCustomFieldContextFromProjects({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get contexts for a field + * @request GET :/rest/api/3/field/{fieldId}/contexts + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetContextsForFieldDeprecated( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the field to return contexts for. + */ + fieldId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getContextsForFieldDeprecated({ + query: query, + fieldId: fieldId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get screens for a field + * @request GET :/rest/api/3/field/{fieldId}/screens + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetScreensForField( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * Use [expand](#expansion) to include additional information about screens in the response. This parameter accepts `tab` which returns details about the screen tabs the field is used in. + */ + expand?: string; + }, + /** + * The ID of the field to return screens for. + */ + fieldId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getScreensForField({ + query: query, + fieldId: fieldId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all issue field options + * @request GET :/rest/api/3/field/{fieldKey}/option + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllIssueFieldOptions( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllIssueFieldOptions({ + query: query, + fieldKey: fieldKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create issue field option + * @request POST :/rest/api/3/field/{fieldKey}/option + * @allowrelaxedtypes + */ +export async function postRestCreateIssueFieldOption( + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + /** Request body */ + data: IssueFieldOptionCreateBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssueFieldOption({ + fieldKey: fieldKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get selectable issue field options + * @request GET :/rest/api/3/field/{fieldKey}/option/suggestions/edit + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetSelectableIssueFieldOptions( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * Filters the results to options that are only available in the specified project. + */ + projectId?: number; + }, + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getSelectableIssueFieldOptions({ + query: query, + fieldKey: fieldKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get visible issue field options + * @request GET :/rest/api/3/field/{fieldKey}/option/suggestions/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetVisibleIssueFieldOptions( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * Filters the results to options that are only available in the specified project. + */ + projectId?: number; + }, + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getVisibleIssueFieldOptions({ + query: query, + fieldKey: fieldKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete issue field option + * @request DELETE :/rest/api/3/field/{fieldKey}/option/{optionId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueFieldOption( + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + /** + * The ID of the option to be deleted. + */ + optionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueFieldOption({ + fieldKey: fieldKey, + optionId: optionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get issue field option + * @request GET :/rest/api/3/field/{fieldKey}/option/{optionId} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueFieldOption( + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + /** + * The ID of the option to be returned. + */ + optionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueFieldOption({ + fieldKey: fieldKey, + optionId: optionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update issue field option + * @request PUT :/rest/api/3/field/{fieldKey}/option/{optionId} + * @allowrelaxedtypes + */ +export async function putRestUpdateIssueFieldOption( + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + /** + * The ID of the option to be updated. + */ + optionId: number, + /** Request body */ + data: IssueFieldOption, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateIssueFieldOption({ + fieldKey: fieldKey, + optionId: optionId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Replace issue field option + * @request DELETE :/rest/api/3/field/{fieldKey}/option/{optionId}/issue + * @allowrelaxedtypes + */ +export async function deleteRestReplaceIssueFieldOption( + query: { + /** + * The ID of the option that will replace the currently selected option. + */ + replaceWith?: number; + /** + * A JQL query that specifies the issues to be updated. For example, *project=10000*. + */ + jql?: string; + /** + * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect and Forge app users with admin permission. + */ + overrideScreenSecurity?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect and Forge app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag?: boolean; + }, + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + /** + * The ID of the option to be deselected. + */ + optionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.replaceIssueFieldOption({ + query: query, + fieldKey: fieldKey, + optionId: optionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete custom field + * @request DELETE :/rest/api/3/field/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteCustomField( + /** + * The ID of a custom field. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteCustomField({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Restore custom field from trash + * @request POST :/rest/api/3/field/{id}/restore + * @allowrelaxedtypes + */ +export async function postRestRestoreCustomField( + /** + * The ID of a custom field. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.restoreCustomField({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Move custom field to trash + * @request POST :/rest/api/3/field/{id}/trash + * @allowrelaxedtypes + */ +export async function postRestTrashCustomField( + /** + * The ID of a custom field. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.trashCustomField({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all field configurations + * @request GET :/rest/api/3/fieldconfiguration + * @readonly + */ +export async function getRestGetAllFieldConfigurations( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of field configuration IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + */ + id?: number[]; + /** + * If *true* returns default field configurations only. + */ + isDefault?: boolean; + /** + * The query string used to match against field configuration names and descriptions. + */ + query?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllFieldConfigurations({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create field configuration + * @request POST :/rest/api/3/fieldconfiguration + */ +export async function postRestCreateFieldConfiguration( + /** Request body */ + data: FieldConfigurationDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createFieldConfiguration({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete field configuration + * @request DELETE :/rest/api/3/fieldconfiguration/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteFieldConfiguration( + /** + * The ID of the field configuration. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteFieldConfiguration({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update field configuration + * @request PUT :/rest/api/3/fieldconfiguration/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateFieldConfiguration( + /** + * The ID of the field configuration. + */ + id: number, + /** Request body */ + data: FieldConfigurationDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateFieldConfiguration({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get field configuration items + * @request GET :/rest/api/3/fieldconfiguration/{id}/fields + * @readonly + */ +export async function getRestGetFieldConfigurationItems( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the field configuration. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFieldConfigurationItems({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update field configuration items + * @request PUT :/rest/api/3/fieldconfiguration/{id}/fields + * @allowrelaxedtypes + */ +export async function putRestUpdateFieldConfigurationItems( + /** + * The ID of the field configuration. + */ + id: number, + /** Request body */ + data: FieldConfigurationItemsDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateFieldConfigurationItems({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all field configuration schemes + * @request GET :/rest/api/3/fieldconfigurationscheme + * @readonly + */ +export async function getRestGetAllFieldConfigurationSchemes( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of field configuration scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + */ + id?: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllFieldConfigurationSchemes({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create field configuration scheme + * @request POST :/rest/api/3/fieldconfigurationscheme + */ +export async function postRestCreateFieldConfigurationScheme( + /** Request body */ + data: UpdateFieldConfigurationSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createFieldConfigurationScheme({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get field configuration issue type items + * @request GET :/rest/api/3/fieldconfigurationscheme/mapping + * @readonly + */ +export async function getRestGetFieldConfigurationSchemeMappings( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of field configuration scheme IDs. To include multiple field configuration schemes separate IDs with ampersand: `fieldConfigurationSchemeId=10000&fieldConfigurationSchemeId=10001`. + */ + fieldConfigurationSchemeId?: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFieldConfigurationSchemeMappings({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get field configuration schemes for projects + * @request GET :/rest/api/3/fieldconfigurationscheme/project + * @readonly + */ +export async function getRestGetFieldConfigurationSchemeProjectMapping( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of project IDs. To include multiple projects, separate IDs with ampersand: `projectId=10000&projectId=10001`. + */ + projectId: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFieldConfigurationSchemeProjectMapping({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Assign field configuration scheme to project + * @request PUT :/rest/api/3/fieldconfigurationscheme/project + * @allowrelaxedtypes + */ +export async function putRestAssignFieldConfigurationSchemeToProject( + /** Request body */ + data: FieldConfigurationSchemeProjectAssociation, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.assignFieldConfigurationSchemeToProject({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete field configuration scheme + * @request DELETE :/rest/api/3/fieldconfigurationscheme/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteFieldConfigurationScheme( + /** + * The ID of the field configuration scheme. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteFieldConfigurationScheme({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update field configuration scheme + * @request PUT :/rest/api/3/fieldconfigurationscheme/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateFieldConfigurationScheme( + /** + * The ID of the field configuration scheme. + */ + id: number, + /** Request body */ + data: UpdateFieldConfigurationSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateFieldConfigurationScheme({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Assign issue types to field configurations + * @request PUT :/rest/api/3/fieldconfigurationscheme/{id}/mapping + * @allowrelaxedtypes + */ +export async function putRestSetFieldConfigurationSchemeMapping( + /** + * The ID of the field configuration scheme. + */ + id: number, + /** Request body */ + data: AssociateFieldConfigurationsWithIssueTypesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setFieldConfigurationSchemeMapping({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Remove issue types from field configuration scheme + * @request POST :/rest/api/3/fieldconfigurationscheme/{id}/mapping/delete + * @allowrelaxedtypes + */ +export async function postRestRemoveIssueTypesFromGlobalFieldConfigurationScheme( + /** + * The ID of the field configuration scheme. + */ + id: number, + /** Request body */ + data: IssueTypeIdsToRemove, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.rest.removeIssueTypesFromGlobalFieldConfigurationScheme({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get filters + * @request GET :/rest/api/3/filter + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetFilters( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFilters({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create filter + * @request POST :/rest/api/3/filter + * @allowrelaxedtypes + */ +export async function postRestCreateFilter( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be created. Available to users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions?: boolean; + }, + /** Request body */ + data: Filter, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createFilter({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get default share scope + * @request GET :/rest/api/3/filter/defaultShareScope + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetDefaultShareScope( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDefaultShareScope({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set default share scope + * @request PUT :/rest/api/3/filter/defaultShareScope + * @allowrelaxedtypes + */ +export async function putRestSetDefaultShareScope( + /** Request body */ + data: DefaultShareScope, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setDefaultShareScope({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get favorite filters + * @request GET :/rest/api/3/filter/favourite + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetFavouriteFilters( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFavouriteFilters({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get my filters + * @request GET :/rest/api/3/filter/my + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetMyFilters( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + /** + * Include the user's favorite filters in the response. + */ + includeFavourites?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getMyFilters({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Search for filters + * @request GET :/rest/api/3/filter/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetFiltersPaginated( + query: { + /** + * String used to perform a case-insensitive partial match with `name`. + */ + filterName?: string; + /** + * User account ID used to return filters with the matching `owner.accountId`. This parameter cannot be used with `owner`. + */ + accountId?: string; + /** + * This parameter is deprecated because of privacy changes. Use `accountId` instead. See the [migration guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. User name used to return filters with the matching `owner.name`. This parameter cannot be used with `accountId`. + */ + owner?: string; + /** + * As a group's name can change, use of `groupId` is recommended to identify a group. Group name used to returns filters that are shared with a group that matches `sharePermissions.group.groupname`. This parameter cannot be used with the `groupId` parameter. + */ + groupname?: string; + /** + * Group ID used to returns filters that are shared with a group that matches `sharePermissions.group.groupId`. This parameter cannot be used with the `groupname` parameter. + */ + groupId?: string; + /** + * Project ID used to returns filters that are shared with a project that matches `sharePermissions.project.id`. + */ + projectId?: number; + /** + * The list of filter IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. Do not exceed 200 filter IDs. + */ + id?: number[]; + /** +* [Order](#ordering) the results by a field: + + * `description` Sorts by filter description. Note that this sorting works independently of whether the expand to display the description field is in use. + * `favourite_count` Sorts by the count of how many users have this filter as a favorite. + * `is_favourite` Sorts by whether the filter is marked as a favorite. + * `id` Sorts by filter ID. + * `name` Sorts by filter name. + * `owner` Sorts by the ID of the filter owner. + * `is_shared` Sorts by whether the filter is shared. +*/ + orderBy?: + | "description" + | "-description" + | "+description" + | "favourite_count" + | "-favourite_count" + | "+favourite_count" + | "id" + | "-id" + | "+id" + | "is_favourite" + | "-is_favourite" + | "+is_favourite" + | "name" + | "-name" + | "+name" + | "owner" + | "-owner" + | "+owner" + | "is_shared" + | "-is_shared" + | "+is_shared"; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `description` Returns the description of the filter. + * `favourite` Returns an indicator of whether the user has set the filter as a favorite. + * `favouritedCount` Returns a count of how many users have set this filter as a favorite. + * `jql` Returns the JQL query that the filter uses. + * `owner` Returns the owner of the filter. + * `searchUrl` Returns a URL to perform the filter's JQL query. + * `sharePermissions` Returns the share permissions defined for the filter. + * `editPermissions` Returns the edit permissions defined for the filter. + * `isWritable` Returns whether the current user has permission to edit the filter. + * `subscriptions` Returns the users that are subscribed to the filter. + * `viewUrl` Returns a URL to view the filter. +*/ + expand?: string; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be returned. Available to users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFiltersPaginated({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete filter + * @request DELETE :/rest/api/3/filter/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteFilter( + /** + * The ID of the filter to delete. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteFilter({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get filter + * @request GET :/rest/api/3/filter/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetFilter( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be returned. Available to users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions?: boolean; + }, + /** + * The ID of the filter to return. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFilter({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update filter + * @request PUT :/rest/api/3/filter/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateFilter( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable the addition of any share permissions to filters. Available to users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions?: boolean; + }, + /** + * The ID of the filter to update. + */ + id: number, + /** Request body */ + data: Filter, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateFilter({ + query: query, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Reset columns + * @request DELETE :/rest/api/3/filter/{id}/columns + * @allowrelaxedtypes + */ +export async function deleteRestResetColumns( + /** + * The ID of the filter. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.resetColumns({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get columns + * @request GET :/rest/api/3/filter/{id}/columns + * @readonly + */ +export async function getRestGetColumns( + /** + * The ID of the filter. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getColumns({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set columns + * @request PUT :/rest/api/3/filter/{id}/columns + * @allowrelaxedtypes + */ +export async function putRestSetColumns( + /** + * The ID of the filter. + */ + id: number, + /** Request body */ + data: string[], + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setColumns({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Remove filter as favorite + * @request DELETE :/rest/api/3/filter/{id}/favourite + * @allowrelaxedtypes + */ +export async function deleteRestDeleteFavouriteForFilter( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + }, + /** + * The ID of the filter. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteFavouriteForFilter({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add filter as favorite + * @request PUT :/rest/api/3/filter/{id}/favourite + * @allowrelaxedtypes + */ +export async function putRestSetFavouriteForFilter( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + }, + /** + * The ID of the filter. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setFavouriteForFilter({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Change filter owner + * @request PUT :/rest/api/3/filter/{id}/owner + * @allowrelaxedtypes + */ +export async function putRestChangeFilterOwner( + /** + * The ID of the filter to update. + */ + id: number, + /** Request body */ + data: ChangeFilterOwner, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.changeFilterOwner({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get share permissions + * @request GET :/rest/api/3/filter/{id}/permission + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetSharePermissions( + /** + * The ID of the filter. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getSharePermissions({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add share permission + * @request POST :/rest/api/3/filter/{id}/permission + * @allowrelaxedtypes + */ +export async function postRestAddSharePermission( + /** + * The ID of the filter. + */ + id: number, + /** Request body */ + data: SharePermissionInputBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addSharePermission({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete share permission + * @request DELETE :/rest/api/3/filter/{id}/permission/{permissionId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteSharePermission( + /** + * The ID of the filter. + */ + id: number, + /** + * The ID of the share permission. + */ + permissionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteSharePermission({ + id: id, + permissionId: permissionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get share permission + * @request GET :/rest/api/3/filter/{id}/permission/{permissionId} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetSharePermission( + /** + * The ID of the filter. + */ + id: number, + /** + * The ID of the share permission. + */ + permissionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getSharePermission({ + id: id, + permissionId: permissionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Remove group + * @request DELETE :/rest/api/3/group + * @allowrelaxedtypes + */ +export async function deleteRestRemoveGroup( + query: { + groupname?: string; + /** + * The ID of the group. This parameter cannot be used with the `groupname` parameter. + */ + groupId?: string; + /** +* As a group's name can change, use of `swapGroupId` is recommended to identify a group. +The group to transfer restrictions to. Only comments and worklogs are transferred. If restrictions are not transferred, comments and worklogs are inaccessible after the deletion. This parameter cannot be used with the `swapGroupId` parameter. +*/ + swapGroup?: string; + /** + * The ID of the group to transfer restrictions to. Only comments and worklogs are transferred. If restrictions are not transferred, comments and worklogs are inaccessible after the deletion. This parameter cannot be used with the `swapGroup` parameter. + */ + swapGroupId?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeGroup({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get group + * @request GET :/rest/api/3/group + * @readonly + */ +export async function getRestGetGroup( + query: { + /** +* As a group's name can change, use of `groupId` is recommended to identify a group. +The name of the group. This parameter cannot be used with the `groupId` parameter. +*/ + groupname?: string; + /** + * The ID of the group. This parameter cannot be used with the `groupName` parameter. + */ + groupId?: string; + /** + * List of fields to expand. + */ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getGroup({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create group + * @request POST :/rest/api/3/group + */ +export async function postRestCreateGroup( + /** Request body */ + data: AddGroupBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createGroup({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Bulk get groups + * @request GET :/rest/api/3/group/bulk + * @readonly + */ +export async function getRestBulkGetGroups( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The ID of a group. To specify multiple IDs, pass multiple `groupId` parameters. For example, `groupId=5b10a2844c20165700ede21g&groupId=5b10ac8d82e05b22cc7d4ef5`. + */ + groupId?: string[]; + /** + * The name of a group. To specify multiple names, pass multiple `groupName` parameters. For example, `groupName=administrators&groupName=jira-software-users`. + */ + groupName?: string[]; + /** + * The access level of a group. Valid values: 'site-admin', 'admin', 'user'. + */ + accessType?: string; + /** + * The application key of the product user groups to search for. Valid values: 'jira-servicedesk', 'jira-software', 'jira-product-discovery', 'jira-core'. + */ + applicationKey?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.bulkGetGroups({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get users from group + * @request GET :/rest/api/3/group/member + * @readonly + */ +export async function getRestGetUsersFromGroup( + query: { + /** +* As a group's name can change, use of `groupId` is recommended to identify a group. +The name of the group. This parameter cannot be used with the `groupId` parameter. +*/ + groupname?: string; + /** + * The ID of the group. This parameter cannot be used with the `groupName` parameter. + */ + groupId?: string; + /** + * Include inactive users. + */ + includeInactiveUsers?: boolean; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUsersFromGroup({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Remove user from group + * @request DELETE :/rest/api/3/group/user + * @allowrelaxedtypes + */ +export async function deleteRestRemoveUserFromGroup( + query: { + /** +* As a group's name can change, use of `groupId` is recommended to identify a group. +The name of the group. This parameter cannot be used with the `groupId` parameter. +*/ + groupname?: string; + /** + * The ID of the group. This parameter cannot be used with the `groupName` parameter. + */ + groupId?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeUserFromGroup({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Add user to group + * @request POST :/rest/api/3/group/user + */ +export async function postRestAddUserToGroup( + query: { + /** +* As a group's name can change, use of `groupId` is recommended to identify a group. +The name of the group. This parameter cannot be used with the `groupId` parameter. +*/ + groupname?: string; + /** + * The ID of the group. This parameter cannot be used with the `groupName` parameter. + */ + groupId?: string; + }, + /** Request body */ + data: UpdateUserToGroupBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addUserToGroup({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find groups + * @request GET :/rest/api/3/groups/picker + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindGroups( + query: { + /** + * This parameter is deprecated, setting it does not affect the results. To find groups containing a particular user, use [Get user groups](#api-rest-api-3-user-groups-get). + */ + accountId?: string; + /** + * The string to find in group names. + */ + query?: string; + /** +* As a group's name can change, use of `excludeGroupIds` is recommended to identify a group. +A group to exclude from the result. To exclude multiple groups, provide an ampersand-separated list. For example, `exclude=group1&exclude=group2`. This parameter cannot be used with the `excludeGroupIds` parameter. +*/ + exclude?: string[]; + /** + * A group ID to exclude from the result. To exclude multiple groups, provide an ampersand-separated list. For example, `excludeId=group1-id&excludeId=group2-id`. This parameter cannot be used with the `excludeGroups` parameter. + */ + excludeId?: string[]; + /** + * The maximum number of groups to return. The maximum number of groups that can be returned is limited by the system property `jira.ajax.autocomplete.limit`. + */ + maxResults?: number; + /** + * Whether the search for groups should be case insensitive. + */ + caseInsensitive?: boolean; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + userName?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findGroups({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find users and groups + * @request GET :/rest/api/3/groupuserpicker + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindUsersAndGroups( + query: { + /** + * The search string. + */ + query: string; + /** + * The maximum number of items to return in each list. + */ + maxResults?: number; + /** + * Whether the user avatar should be returned. If an invalid value is provided, the default value is used. + */ + showAvatar?: boolean; + /** + * The custom field ID of the field this request is for. + */ + fieldId?: string; + /** + * The ID of a project that returned users and groups must have permission to view. To include multiple projects, provide an ampersand-separated list. For example, `projectId=10000&projectId=10001`. This parameter is only used when `fieldId` is present. + */ + projectId?: string[]; + /** + * The ID of an issue type that returned users and groups must have permission to view. To include multiple issue types, provide an ampersand-separated list. For example, `issueTypeId=10000&issueTypeId=10001`. Special values, such as `-1` (all standard issue types) and `-2` (all subtask issue types), are supported. This parameter is only used when `fieldId` is present. + */ + issueTypeId?: string[]; + /** + * The size of the avatar to return. If an invalid value is provided, the default value is used. + */ + avatarSize?: + | "xsmall" + | "xsmall@2x" + | "xsmall@3x" + | "small" + | "small@2x" + | "small@3x" + | "medium" + | "medium@2x" + | "medium@3x" + | "large" + | "large@2x" + | "large@3x" + | "xlarge" + | "xlarge@2x" + | "xlarge@3x" + | "xxlarge" + | "xxlarge@2x" + | "xxlarge@3x" + | "xxxlarge" + | "xxxlarge@2x" + | "xxxlarge@3x"; + /** + * Whether the search for groups should be case insensitive. + */ + caseInsensitive?: boolean; + /** + * Whether Connect app users and groups should be excluded from the search results. If an invalid value is provided, the default value is used. + */ + excludeConnectAddons?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findUsersAndGroups({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get license + * @request GET :/rest/api/3/instance/license + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetLicense( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getLicense({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create issue + * @request POST :/rest/api/3/issue + * @allowrelaxedtypes + */ +export async function postRestCreateIssue( + query: { + /** + * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown under **Projects** in Jira. When provided, the issue type and request type are added to the user's history for a project. These values are then used to provide defaults on the issue create screen. + */ + updateHistory?: boolean; + }, + /** Request body */ + data: IssueUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssue({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Bulk create issue + * @request POST :/rest/api/3/issue/bulk + * @allowrelaxedtypes + */ +export async function postRestCreateIssues( + /** Request body */ + data: IssuesUpdateBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssues({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get create issue metadata + * @request GET :/rest/api/3/issue/createmeta + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetCreateIssueMeta( + query: { + /** + * List of project IDs. This parameter accepts a comma-separated list. Multiple project IDs can also be provided using an ampersand-separated list. For example, `projectIds=10000,10001&projectIds=10020,10021`. This parameter may be provided with `projectKeys`. + */ + projectIds?: string[]; + /** + * List of project keys. This parameter accepts a comma-separated list. Multiple project keys can also be provided using an ampersand-separated list. For example, `projectKeys=proj1,proj2&projectKeys=proj3`. This parameter may be provided with `projectIds`. + */ + projectKeys?: string[]; + /** + * List of issue type IDs. This parameter accepts a comma-separated list. Multiple issue type IDs can also be provided using an ampersand-separated list. For example, `issuetypeIds=10000,10001&issuetypeIds=10020,10021`. This parameter may be provided with `issuetypeNames`. + */ + issuetypeIds?: string[]; + /** + * List of issue type names. This parameter accepts a comma-separated list. Multiple issue type names can also be provided using an ampersand-separated list. For example, `issuetypeNames=name1,name2&issuetypeNames=name3`. This parameter may be provided with `issuetypeIds`. + */ + issuetypeNames?: string[]; + /** + * Use [expand](#expansion) to include additional information about issue metadata in the response. This parameter accepts `projects.issuetypes.fields`, which returns information about the fields in the issue creation screen for each issue type. Fields hidden from the screen are not returned. Use the information to populate the `fields` and `update` fields in [Create issue](#api-rest-api-3-issue-post) and [Create issues](#api-rest-api-3-issue-bulk-post). + */ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCreateIssueMeta({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue picker suggestions + * @request GET :/rest/api/3/issue/picker + * @readonly + */ +export async function getRestGetIssuePickerResource( + query: { + /** + * A string to match against text fields in the issue such as title, description, or comments. + */ + query?: string; + /** + * A JQL query defining a list of issues to search for the query term. Note that `username` and `userkey` cannot be used as search terms for this parameter, due to privacy reasons. Use `accountId` instead. + */ + currentJQL?: string; + /** + * The key of an issue to exclude from search results. For example, the issue the user is viewing when they perform this query. + */ + currentIssueKey?: string; + /** + * The ID of a project that suggested issues must belong to. + */ + currentProjectId?: string; + /** + * Indicate whether to include subtasks in the suggestions list. + */ + showSubTasks?: boolean; + /** + * When `currentIssueKey` is a subtask, whether to include the parent issue in the suggestions if it matches the query. + */ + showSubTaskParent?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssuePickerResource({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Bulk set issues properties by list + * @request POST :/rest/api/3/issue/properties + * @allowrelaxedtypes + */ +export async function postRestBulkSetIssuesPropertiesList( + /** Request body */ + data: IssueEntityProperties, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.bulkSetIssuesPropertiesList({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Bulk set issue properties by issue + * @request POST :/rest/api/3/issue/properties/multi + * @allowrelaxedtypes + */ +export async function postRestBulkSetIssuePropertiesByIssue( + /** Request body */ + data: MultiIssueEntityProperties, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.bulkSetIssuePropertiesByIssue({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Bulk delete issue property + * @request DELETE :/rest/api/3/issue/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestBulkDeleteIssueProperty( + /** + * The key of the property. + */ + propertyKey: string, + /** Request body */ + data: IssueFilterForBulkPropertyDelete, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.bulkDeleteIssueProperty({ + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Bulk set issue property + * @request PUT :/rest/api/3/issue/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestBulkSetIssueProperty( + /** + * The key of the property. The maximum length is 255 characters. + */ + propertyKey: string, + /** Request body */ + data: BulkIssuePropertyUpdateRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.bulkSetIssueProperty({ + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get is watching issue bulk + * @request POST :/rest/api/3/issue/watching + */ +export async function postRestGetIsWatchingIssueBulk( + /** Request body */ + data: IssueList, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIsWatchingIssueBulk({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete issue + * @request DELETE :/rest/api/3/issue/{issueIdOrKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssue( + query: { + /** + * Whether the issue's subtasks are deleted when the issue is deleted. + */ + deleteSubtasks?: "true" | "false"; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssue({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue + * @request GET :/rest/api/3/issue/{issueIdOrKey} + * @readonly + */ +export async function getRestGetIssue( + query: { + /** +* A list of fields to return for the issue. This parameter accepts a comma-separated list. Use it to retrieve a subset of fields. Allowed values: + + * `*all` Returns all fields. + * `*navigable` Returns navigable fields. + * Any issue field, prefixed with a minus to exclude. + +Examples: + + * `summary,comment` Returns only the summary and comments fields. + * `-description` Returns all (default) fields except description. + * `*navigable,-comment` Returns all navigable fields except comment. + +This parameter may be specified multiple times. For example, `fields=field1,field2& fields=field3`. + +Note: All fields are returned by default. This differs from [Search for issues using JQL (GET)](#api-rest-api-3-search-get) and [Search for issues using JQL (POST)](#api-rest-api-3-search-post) where the default is all navigable fields. +*/ + fields?: string[]; + /** + * Whether fields in `fields` are referenced by keys rather than IDs. This parameter is useful where fields have been added by a connect app and a field's key may differ from its ID. + */ + fieldsByKeys?: boolean; + /** +* Use [expand](#expansion) to include additional information about the issues in the response. This parameter accepts a comma-separated list. Expand options include: + + * `renderedFields` Returns field values rendered in HTML format. + * `names` Returns the display name of each field. + * `schema` Returns the schema describing a field type. + * `transitions` Returns all possible transitions for the issue. + * `editmeta` Returns information about how each field can be edited. + * `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * `versionedRepresentations` Returns a JSON array for each version of a field's value, with the highest number representing the most recent version. Note: When included in the request, the `fields` parameter is ignored. +*/ + expand?: string; + /** +* A list of issue properties to return for the issue. This parameter accepts a comma-separated list. Allowed values: + + * `*all` Returns all issue properties. + * Any issue property key, prefixed with a minus to exclude. + +Examples: + + * `*all` Returns all properties. + * `*all,-prop1` Returns all properties except `prop1`. + * `prop1,prop2` Returns `prop1` and `prop2` properties. + +This parameter may be specified multiple times. For example, `properties=prop1,prop2& properties=prop3`. +*/ + properties?: string[]; + /** + * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown under **Projects** in Jira. This also populates the [JQL issues search](#api-rest-api-3-search-get) `lastViewed` field. + */ + updateHistory?: boolean; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssue({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Edit issue + * @request PUT :/rest/api/3/issue/{issueIdOrKey} + * @allowrelaxedtypes + */ +export async function putRestEditIssue( + query: { + /** + * Whether a notification email about the issue update is sent to all watchers. To disable the notification, administer Jira or administer project permissions are required. If the user doesn't have the necessary permission the request is ignored. + */ + notifyUsers?: boolean; + /** + * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideScreenSecurity?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag?: boolean; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** Request body */ + data: IssueUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.editIssue({ + query: query, + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Assign issue + * @request PUT :/rest/api/3/issue/{issueIdOrKey}/assignee + * @allowrelaxedtypes + */ +export async function putRestAssignIssue( + /** + * The ID or key of the issue to be assigned. + */ + issueIdOrKey: string, + /** Request body */ + data: User, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.assignIssue({ + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Add attachment + * @request POST :/rest/api/3/issue/{issueIdOrKey}/attachments + */ +export async function postRestAddAttachment( + /** + * The ID or key of the issue that attachments are added to. + */ + issueIdOrKey: string, + /** Request body */ + data: File, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addAttachment({ + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get changelogs + * @request GET :/rest/api/3/issue/{issueIdOrKey}/changelog + * @readonly + */ +export async function getRestGetChangeLogs( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getChangeLogs({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get changelogs by IDs + * @request POST :/rest/api/3/issue/{issueIdOrKey}/changelog/list + */ +export async function postRestGetChangeLogsByIds( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** Request body */ + data: IssueChangelogIds, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getChangeLogsByIds({ + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get comments + * @request GET :/rest/api/3/issue/{issueIdOrKey}/comment + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetComments( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * [Order](#ordering) the results by a field. Accepts *created* to sort comments by their created date. + */ + orderBy?: "created" | "-created" | "+created"; + /** + * Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. + */ + expand?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getComments({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add comment + * @request POST :/rest/api/3/issue/{issueIdOrKey}/comment + * @allowrelaxedtypes + */ +export async function postRestAddComment( + query: { + /** + * Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. + */ + expand?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** Request body */ + data: Comment, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addComment({ + query: query, + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete comment + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/comment/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteComment( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the comment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteComment({ + issueIdOrKey: issueIdOrKey, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get comment + * @request GET :/rest/api/3/issue/{issueIdOrKey}/comment/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetComment( + query: { + /** + * Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. + */ + expand?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the comment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getComment({ + query: query, + issueIdOrKey: issueIdOrKey, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update comment + * @request PUT :/rest/api/3/issue/{issueIdOrKey}/comment/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateComment( + query: { + /** + * Whether users are notified when a comment is updated. + */ + notifyUsers?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with the *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag?: boolean; + /** + * Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. + */ + expand?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the comment. + */ + id: string, + /** Request body */ + data: Comment, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateComment({ + query: query, + issueIdOrKey: issueIdOrKey, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get edit issue metadata + * @request GET :/rest/api/3/issue/{issueIdOrKey}/editmeta + * @readonly + */ +export async function getRestGetEditIssueMeta( + query: { + /** + * Whether hidden fields are returned. Available to Connect app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideScreenSecurity?: boolean; + /** + * Whether non-editable fields are returned. Available to Connect app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag?: boolean; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getEditIssueMeta({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Send notification for issue + * @request POST :/rest/api/3/issue/{issueIdOrKey}/notify + * @allowrelaxedtypes + */ +export async function postRestNotify( + /** + * ID or key of the issue that the notification is sent for. + */ + issueIdOrKey: string, + /** Request body */ + data: Notification, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.notify({ + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get issue property keys + * @request GET :/rest/api/3/issue/{issueIdOrKey}/properties + * @readonly + */ +export async function getRestGetIssuePropertyKeys( + /** + * The key or ID of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssuePropertyKeys({ + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete issue property + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueProperty( + /** + * The key or ID of the issue. + */ + issueIdOrKey: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueProperty({ + issueIdOrKey: issueIdOrKey, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue property + * @request GET :/rest/api/3/issue/{issueIdOrKey}/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueProperty( + /** + * The key or ID of the issue. + */ + issueIdOrKey: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueProperty({ + issueIdOrKey: issueIdOrKey, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set issue property + * @request PUT :/rest/api/3/issue/{issueIdOrKey}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestSetIssueProperty( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The key of the issue property. The maximum length is 255 characters. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setIssueProperty({ + issueIdOrKey: issueIdOrKey, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete remote issue link by global ID + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/remotelink + * @allowrelaxedtypes + */ +export async function deleteRestDeleteRemoteIssueLinkByGlobalId( + query: { + /** + * The global ID of a remote issue link. + */ + globalId: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteRemoteIssueLinkByGlobalId({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get remote issue links + * @request GET :/rest/api/3/issue/{issueIdOrKey}/remotelink + * @readonly + */ +export async function getRestGetRemoteIssueLinks( + query: { + /** + * The global ID of the remote issue link. + */ + globalId?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getRemoteIssueLinks({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create or update remote issue link + * @request POST :/rest/api/3/issue/{issueIdOrKey}/remotelink + */ +export async function postRestCreateOrUpdateRemoteIssueLink( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** Request body */ + data: RemoteIssueLinkRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createOrUpdateRemoteIssueLink({ + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete remote issue link by ID + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/remotelink/{linkId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteRemoteIssueLinkById( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of a remote issue link. + */ + linkId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteRemoteIssueLinkById({ + issueIdOrKey: issueIdOrKey, + linkId: linkId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get remote issue link by ID + * @request GET :/rest/api/3/issue/{issueIdOrKey}/remotelink/{linkId} + * @readonly + */ +export async function getRestGetRemoteIssueLinkById( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the remote issue link. + */ + linkId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getRemoteIssueLinkById({ + issueIdOrKey: issueIdOrKey, + linkId: linkId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update remote issue link by ID + * @request PUT :/rest/api/3/issue/{issueIdOrKey}/remotelink/{linkId} + * @allowrelaxedtypes + */ +export async function putRestUpdateRemoteIssueLink( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the remote issue link. + */ + linkId: string, + /** Request body */ + data: RemoteIssueLinkRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateRemoteIssueLink({ + issueIdOrKey: issueIdOrKey, + linkId: linkId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get transitions + * @request GET :/rest/api/3/issue/{issueIdOrKey}/transitions + * @readonly + */ +export async function getRestGetTransitions( + query: { + /** + * Use [expand](#expansion) to include additional information about transitions in the response. This parameter accepts `transitions.fields`, which returns information about the fields in the transition screen for each transition. Fields hidden from the screen are not returned. Use this information to populate the `fields` and `update` fields in [Transition issue](#api-rest-api-3-issue-issueIdOrKey-transitions-post). + */ + expand?: string; + /** + * The ID of the transition. + */ + transitionId?: string; + /** + * Whether transitions with the condition *Hide From User Condition* are included in the response. + */ + skipRemoteOnlyCondition?: boolean; + /** + * Whether details of transitions that fail a condition are included in the response + */ + includeUnavailableTransitions?: boolean; + /** + * Whether the transitions are sorted by ops-bar sequence value first then category order (Todo, In Progress, Done) or only by ops-bar sequence value. + */ + sortByOpsBarAndStatus?: boolean; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getTransitions({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Transition issue + * @request POST :/rest/api/3/issue/{issueIdOrKey}/transitions + * @allowrelaxedtypes + */ +export async function postRestDoTransition( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** Request body */ + data: IssueUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.doTransition({ + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete vote + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/votes + * @allowrelaxedtypes + */ +export async function deleteRestRemoveVote( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeVote({ + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get votes + * @request GET :/rest/api/3/issue/{issueIdOrKey}/votes + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetVotes( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getVotes({ + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add vote + * @request POST :/rest/api/3/issue/{issueIdOrKey}/votes + * @allowrelaxedtypes + */ +export async function postRestAddVote( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addVote({ + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete watcher + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/watchers + * @allowrelaxedtypes + */ +export async function deleteRestRemoveWatcher( + query: { + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. Required. + */ + accountId?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeWatcher({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue watchers + * @request GET :/rest/api/3/issue/{issueIdOrKey}/watchers + * @readonly + */ +export async function getRestGetIssueWatchers( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueWatchers({ + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add watcher + * @request POST :/rest/api/3/issue/{issueIdOrKey}/watchers + * @allowrelaxedtypes + */ +export async function postRestAddWatcher( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** Request body */ + data: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addWatcher({ + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get issue worklogs + * @request GET :/rest/api/3/issue/{issueIdOrKey}/worklog + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueWorklog( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The worklog start date and time, as a UNIX timestamp in milliseconds, after which worklogs are returned. + */ + startedAfter?: number; + /** + * The worklog start date and time, as a UNIX timestamp in milliseconds, before which worklogs are returned. + */ + startedBefore?: number; + /** + * Use [expand](#expansion) to include additional information about worklogs in the response. This parameter accepts`properties`, which returns worklog properties. + */ + expand?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueWorklog({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add worklog + * @request POST :/rest/api/3/issue/{issueIdOrKey}/worklog + * @allowrelaxedtypes + */ +export async function postRestAddWorklog( + query: { + /** + * Whether users watching the issue are notified by email. + */ + notifyUsers?: boolean; + /** +* Defines how to update the issue's time estimate, the options are: + + * `new` Sets the estimate to a specific value, defined in `newEstimate`. + * `leave` Leaves the estimate unchanged. + * `manual` Reduces the estimate by amount specified in `reduceBy`. + * `auto` Reduces the estimate by the value of `timeSpent` in the worklog. +*/ + adjustEstimate?: "new" | "leave" | "manual" | "auto"; + /** + * The value to set as the issue's remaining time estimate, as days (\#d), hours (\#h), or minutes (\#m or \#). For example, *2d*. Required when `adjustEstimate` is `new`. + */ + newEstimate?: string; + /** + * The amount to reduce the issue's remaining estimate by, as days (\#d), hours (\#h), or minutes (\#m). For example, *2d*. Required when `adjustEstimate` is `manual`. + */ + reduceBy?: string; + /** + * Use [expand](#expansion) to include additional information about work logs in the response. This parameter accepts `properties`, which returns worklog properties. + */ + expand?: string; + /** + * Whether the worklog entry should be added to the issue even if the issue is not editable, because jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. + */ + overrideEditableFlag?: boolean; + }, + /** + * The ID or key the issue. + */ + issueIdOrKey: string, + /** Request body */ + data: Worklog, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addWorklog({ + query: query, + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete worklog + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/worklog/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorklog( + query: { + /** + * Whether users watching the issue are notified by email. + */ + notifyUsers?: boolean; + /** +* Defines how to update the issue's time estimate, the options are: + + * `new` Sets the estimate to a specific value, defined in `newEstimate`. + * `leave` Leaves the estimate unchanged. + * `manual` Increases the estimate by amount specified in `increaseBy`. + * `auto` Reduces the estimate by the value of `timeSpent` in the worklog. +*/ + adjustEstimate?: "new" | "leave" | "manual" | "auto"; + /** + * The value to set as the issue's remaining time estimate, as days (\#d), hours (\#h), or minutes (\#m or \#). For example, *2d*. Required when `adjustEstimate` is `new`. + */ + newEstimate?: string; + /** + * The amount to increase the issue's remaining estimate by, as days (\#d), hours (\#h), or minutes (\#m or \#). For example, *2d*. Required when `adjustEstimate` is `manual`. + */ + increaseBy?: string; + /** + * Whether the work log entry should be added to the issue even if the issue is not editable, because jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with admin permission can use this flag. + */ + overrideEditableFlag?: boolean; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the worklog. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorklog({ + query: query, + issueIdOrKey: issueIdOrKey, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get worklog + * @request GET :/rest/api/3/issue/{issueIdOrKey}/worklog/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorklog( + query: { + /** +* Use [expand](#expansion) to include additional information about work logs in the response. This parameter accepts + +`properties`, which returns worklog properties. +*/ + expand?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the worklog. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorklog({ + query: query, + issueIdOrKey: issueIdOrKey, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update worklog + * @request PUT :/rest/api/3/issue/{issueIdOrKey}/worklog/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateWorklog( + query: { + /** + * Whether users watching the issue are notified by email. + */ + notifyUsers?: boolean; + /** +* Defines how to update the issue's time estimate, the options are: + + * `new` Sets the estimate to a specific value, defined in `newEstimate`. + * `leave` Leaves the estimate unchanged. + * `auto` Updates the estimate by the difference between the original and updated value of `timeSpent` or `timeSpentSeconds`. +*/ + adjustEstimate?: "new" | "leave" | "manual" | "auto"; + /** + * The value to set as the issue's remaining time estimate, as days (\#d), hours (\#h), or minutes (\#m or \#). For example, *2d*. Required when `adjustEstimate` is `new`. + */ + newEstimate?: string; + /** + * Use [expand](#expansion) to include additional information about worklogs in the response. This parameter accepts `properties`, which returns worklog properties. + */ + expand?: string; + /** + * Whether the worklog should be added to the issue even if the issue is not editable. For example, because the issue is closed. Connect and Forge app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. + */ + overrideEditableFlag?: boolean; + }, + /** + * The ID or key the issue. + */ + issueIdOrKey: string, + /** + * The ID of the worklog. + */ + id: string, + /** Request body */ + data: Worklog, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateWorklog({ + query: query, + issueIdOrKey: issueIdOrKey, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get worklog property keys + * @request GET :/rest/api/3/issue/{issueIdOrKey}/worklog/{worklogId}/properties + * @readonly + */ +export async function getRestGetWorklogPropertyKeys( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the worklog. + */ + worklogId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorklogPropertyKeys({ + issueIdOrKey: issueIdOrKey, + worklogId: worklogId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete worklog property + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/worklog/{worklogId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorklogProperty( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the worklog. + */ + worklogId: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorklogProperty({ + issueIdOrKey: issueIdOrKey, + worklogId: worklogId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get worklog property + * @request GET :/rest/api/3/issue/{issueIdOrKey}/worklog/{worklogId}/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorklogProperty( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the worklog. + */ + worklogId: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorklogProperty({ + issueIdOrKey: issueIdOrKey, + worklogId: worklogId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set worklog property + * @request PUT :/rest/api/3/issue/{issueIdOrKey}/worklog/{worklogId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestSetWorklogProperty( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the worklog. + */ + worklogId: string, + /** + * The key of the issue property. The maximum length is 255 characters. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setWorklogProperty({ + issueIdOrKey: issueIdOrKey, + worklogId: worklogId, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Create issue link + * @request POST :/rest/api/3/issueLink + * @allowrelaxedtypes + */ +export async function postRestLinkIssues( + /** Request body */ + data: LinkIssueRequestJsonBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.linkIssues({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete issue link + * @request DELETE :/rest/api/3/issueLink/{linkId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueLink( + /** + * The ID of the issue link. + */ + linkId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueLink({ + linkId: linkId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue link + * @request GET :/rest/api/3/issueLink/{linkId} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueLink( + /** + * The ID of the issue link. + */ + linkId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueLink({ + linkId: linkId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue link types + * @request GET :/rest/api/3/issueLinkType + * @readonly + */ +export async function getRestGetIssueLinkTypes( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueLinkTypes({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create issue link type + * @request POST :/rest/api/3/issueLinkType + */ +export async function postRestCreateIssueLinkType( + /** Request body */ + data: IssueLinkType, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssueLinkType({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete issue link type + * @request DELETE :/rest/api/3/issueLinkType/{issueLinkTypeId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueLinkType( + /** + * The ID of the issue link type. + */ + issueLinkTypeId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueLinkType({ + issueLinkTypeId: issueLinkTypeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue link type + * @request GET :/rest/api/3/issueLinkType/{issueLinkTypeId} + * @readonly + */ +export async function getRestGetIssueLinkType( + /** + * The ID of the issue link type. + */ + issueLinkTypeId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueLinkType({ + issueLinkTypeId: issueLinkTypeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update issue link type + * @request PUT :/rest/api/3/issueLinkType/{issueLinkTypeId} + */ +export async function putRestUpdateIssueLinkType( + /** + * The ID of the issue link type. + */ + issueLinkTypeId: string, + /** Request body */ + data: IssueLinkType, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateIssueLinkType({ + issueLinkTypeId: issueLinkTypeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue security schemes + * @request GET :/rest/api/3/issuesecurityschemes + * @readonly + */ +export async function getRestGetIssueSecuritySchemes( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueSecuritySchemes({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue security scheme + * @request GET :/rest/api/3/issuesecurityschemes/{id} + * @readonly + */ +export async function getRestGetIssueSecurityScheme( + /** + * The ID of the issue security scheme. Use the [Get issue security schemes](#api-rest-api-3-issuesecurityschemes-get) operation to get a list of issue security scheme IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueSecurityScheme({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue security level members + * @request GET :/rest/api/3/issuesecurityschemes/{issueSecuritySchemeId}/members + * @readonly + */ +export async function getRestGetIssueSecurityLevelMembers( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of issue security level IDs. To include multiple issue security levels separate IDs with ampersand: `issueSecurityLevelId=10000&issueSecurityLevelId=10001`. + */ + issueSecurityLevelId?: number[]; + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + /** + * The ID of the issue security scheme. Use the [Get issue security schemes](#api-rest-api-3-issuesecurityschemes-get) operation to get a list of issue security scheme IDs. + */ + issueSecuritySchemeId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueSecurityLevelMembers({ + query: query, + issueSecuritySchemeId: issueSecuritySchemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all issue types for user + * @request GET :/rest/api/3/issuetype + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueAllTypes( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueAllTypes({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create issue type + * @request POST :/rest/api/3/issuetype + * @allowrelaxedtypes + */ +export async function postRestCreateIssueType( + /** Request body */ + data: IssueTypeCreateBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssueType({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue types for project + * @request GET :/rest/api/3/issuetype/project + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueTypesForProject( + query: { + /** + * The ID of the project. + */ + projectId: number; + /** +* The level of the issue type to filter by. Use: + + * `-1` for Subtask. + * `0` for Base. + * `1` for Epic. +*/ + level?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypesForProject({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete issue type + * @request DELETE :/rest/api/3/issuetype/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueType( + query: { + /** + * The ID of the replacement issue type. + */ + alternativeIssueTypeId?: string; + }, + /** + * The ID of the issue type. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueType({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue type + * @request GET :/rest/api/3/issuetype/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueType( + /** + * The ID of the issue type. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueType({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update issue type + * @request PUT :/rest/api/3/issuetype/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateIssueType( + /** + * The ID of the issue type. + */ + id: string, + /** Request body */ + data: IssueTypeUpdateBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateIssueType({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get alternative issue types + * @request GET :/rest/api/3/issuetype/{id}/alternatives + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAlternativeIssueTypes( + /** + * The ID of the issue type. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAlternativeIssueTypes({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Load issue type avatar + * @request POST :/rest/api/3/issuetype/{id}/avatar2 + */ +export async function postRestCreateIssueTypeAvatar( + query: { + /** + * The X coordinate of the top-left corner of the crop region. + */ + x?: number; + /** + * The Y coordinate of the top-left corner of the crop region. + */ + y?: number; + /** + * The length of each side of the crop region. + */ + size: number; + }, + /** + * The ID of the issue type. + */ + id: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssueTypeAvatar({ + query: query, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue type property keys + * @request GET :/rest/api/3/issuetype/{issueTypeId}/properties + * @readonly + */ +export async function getRestGetIssueTypePropertyKeys( + /** + * The ID of the issue type. + */ + issueTypeId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypePropertyKeys({ + issueTypeId: issueTypeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete issue type property + * @request DELETE :/rest/api/3/issuetype/{issueTypeId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueTypeProperty( + /** + * The ID of the issue type. + */ + issueTypeId: string, + /** + * The key of the property. Use [Get issue type property keys](#api-rest-api-3-issuetype-issueTypeId-properties-get) to get a list of all issue type property keys. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueTypeProperty({ + issueTypeId: issueTypeId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue type property + * @request GET :/rest/api/3/issuetype/{issueTypeId}/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueTypeProperty( + /** + * The ID of the issue type. + */ + issueTypeId: string, + /** + * The key of the property. Use [Get issue type property keys](#api-rest-api-3-issuetype-issueTypeId-properties-get) to get a list of all issue type property keys. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypeProperty({ + issueTypeId: issueTypeId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set issue type property + * @request PUT :/rest/api/3/issuetype/{issueTypeId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestSetIssueTypeProperty( + /** + * The ID of the issue type. + */ + issueTypeId: string, + /** + * The key of the issue type property. The maximum length is 255 characters. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setIssueTypeProperty({ + issueTypeId: issueTypeId, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all issue type schemes + * @request GET :/rest/api/3/issuetypescheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllIssueTypeSchemes( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of issue type schemes IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + */ + id?: number[]; + /** +* [Order](#ordering) the results by a field: + + * `name` Sorts by issue type scheme name. + * `id` Sorts by issue type scheme ID. +*/ + orderBy?: "name" | "-name" | "+name" | "id" | "-id" | "+id"; + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `projects` For each issue type schemes, returns information about the projects the issue type scheme is assigned to. + * `issueTypes` For each issue type schemes, returns information about the issueTypes the issue type scheme have. +*/ + expand?: string; + /** + * String used to perform a case-insensitive partial match with issue type scheme name. + */ + queryString?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllIssueTypeSchemes({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create issue type scheme + * @request POST :/rest/api/3/issuetypescheme + */ +export async function postRestCreateIssueTypeScheme( + /** Request body */ + data: IssueTypeSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssueTypeScheme({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue type scheme items + * @request GET :/rest/api/3/issuetypescheme/mapping + * @readonly + */ +export async function getRestGetIssueTypeSchemesMapping( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of issue type scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, `issueTypeSchemeId=10000&issueTypeSchemeId=10001`. + */ + issueTypeSchemeId?: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypeSchemesMapping({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue type schemes for projects + * @request GET :/rest/api/3/issuetypescheme/project + * @readonly + */ +export async function getRestGetIssueTypeSchemeForProjects( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of project IDs. To include multiple project IDs, provide an ampersand-separated list. For example, `projectId=10000&projectId=10001`. + */ + projectId: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypeSchemeForProjects({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Assign issue type scheme to project + * @request PUT :/rest/api/3/issuetypescheme/project + * @allowrelaxedtypes + */ +export async function putRestAssignIssueTypeSchemeToProject( + /** Request body */ + data: IssueTypeSchemeProjectAssociation, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.assignIssueTypeSchemeToProject({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete issue type scheme + * @request DELETE :/rest/api/3/issuetypescheme/{issueTypeSchemeId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueTypeScheme( + /** + * The ID of the issue type scheme. + */ + issueTypeSchemeId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueTypeScheme({ + issueTypeSchemeId: issueTypeSchemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update issue type scheme + * @request PUT :/rest/api/3/issuetypescheme/{issueTypeSchemeId} + * @allowrelaxedtypes + */ +export async function putRestUpdateIssueTypeScheme( + /** + * The ID of the issue type scheme. + */ + issueTypeSchemeId: number, + /** Request body */ + data: IssueTypeSchemeUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateIssueTypeScheme({ + issueTypeSchemeId: issueTypeSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Add issue types to issue type scheme + * @request PUT :/rest/api/3/issuetypescheme/{issueTypeSchemeId}/issuetype + * @allowrelaxedtypes + */ +export async function putRestAddIssueTypesToIssueTypeScheme( + /** + * The ID of the issue type scheme. + */ + issueTypeSchemeId: number, + /** Request body */ + data: IssueTypeIds, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addIssueTypesToIssueTypeScheme({ + issueTypeSchemeId: issueTypeSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Change order of issue types + * @request PUT :/rest/api/3/issuetypescheme/{issueTypeSchemeId}/issuetype/move + * @allowrelaxedtypes + */ +export async function putRestReorderIssueTypesInIssueTypeScheme( + /** + * The ID of the issue type scheme. + */ + issueTypeSchemeId: number, + /** Request body */ + data: OrderOfIssueTypes, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.reorderIssueTypesInIssueTypeScheme({ + issueTypeSchemeId: issueTypeSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Remove issue type from issue type scheme + * @request DELETE :/rest/api/3/issuetypescheme/{issueTypeSchemeId}/issuetype/{issueTypeId} + * @allowrelaxedtypes + */ +export async function deleteRestRemoveIssueTypeFromIssueTypeScheme( + /** + * The ID of the issue type scheme. + */ + issueTypeSchemeId: number, + /** + * The ID of the issue type. + */ + issueTypeId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeIssueTypeFromIssueTypeScheme({ + issueTypeSchemeId: issueTypeSchemeId, + issueTypeId: issueTypeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get issue type screen schemes + * @request GET :/rest/api/3/issuetypescreenscheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueTypeScreenSchemes( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of issue type screen scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + */ + id?: number[]; + /** + * String used to perform a case-insensitive partial match with issue type screen scheme name. + */ + queryString?: string; + /** +* [Order](#ordering) the results by a field: + + * `name` Sorts by issue type screen scheme name. + * `id` Sorts by issue type screen scheme ID. +*/ + orderBy?: "name" | "-name" | "+name" | "id" | "-id" | "+id"; + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts `projects` that, for each issue type screen schemes, returns information about the projects the issue type screen scheme is assigned to. + */ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypeScreenSchemes({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create issue type screen scheme + * @request POST :/rest/api/3/issuetypescreenscheme + */ +export async function postRestCreateIssueTypeScreenScheme( + /** Request body */ + data: IssueTypeScreenSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssueTypeScreenScheme({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue type screen scheme items + * @request GET :/rest/api/3/issuetypescreenscheme/mapping + * @readonly + */ +export async function getRestGetIssueTypeScreenSchemeMappings( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of issue type screen scheme IDs. To include multiple issue type screen schemes, separate IDs with ampersand: `issueTypeScreenSchemeId=10000&issueTypeScreenSchemeId=10001`. + */ + issueTypeScreenSchemeId?: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypeScreenSchemeMappings({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue type screen schemes for projects + * @request GET :/rest/api/3/issuetypescreenscheme/project + * @readonly + */ +export async function getRestGetIssueTypeScreenSchemeProjectAssociations( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of project IDs. To include multiple projects, separate IDs with ampersand: `projectId=10000&projectId=10001`. + */ + projectId: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypeScreenSchemeProjectAssociations({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Assign issue type screen scheme to project + * @request PUT :/rest/api/3/issuetypescreenscheme/project + * @allowrelaxedtypes + */ +export async function putRestAssignIssueTypeScreenSchemeToProject( + /** Request body */ + data: IssueTypeScreenSchemeProjectAssociation, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.assignIssueTypeScreenSchemeToProject({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete issue type screen scheme + * @request DELETE :/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueTypeScreenScheme( + /** + * The ID of the issue type screen scheme. + */ + issueTypeScreenSchemeId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueTypeScreenScheme({ + issueTypeScreenSchemeId: issueTypeScreenSchemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update issue type screen scheme + * @request PUT :/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId} + * @allowrelaxedtypes + */ +export async function putRestUpdateIssueTypeScreenScheme( + /** + * The ID of the issue type screen scheme. + */ + issueTypeScreenSchemeId: string, + /** Request body */ + data: IssueTypeScreenSchemeUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateIssueTypeScreenScheme({ + issueTypeScreenSchemeId: issueTypeScreenSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Append mappings to issue type screen scheme + * @request PUT :/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId}/mapping + * @allowrelaxedtypes + */ +export async function putRestAppendMappingsForIssueTypeScreenScheme( + /** + * The ID of the issue type screen scheme. + */ + issueTypeScreenSchemeId: string, + /** Request body */ + data: IssueTypeScreenSchemeMappingDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.appendMappingsForIssueTypeScreenScheme({ + issueTypeScreenSchemeId: issueTypeScreenSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update issue type screen scheme default screen scheme + * @request PUT :/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId}/mapping/default + * @allowrelaxedtypes + */ +export async function putRestUpdateDefaultScreenScheme( + /** + * The ID of the issue type screen scheme. + */ + issueTypeScreenSchemeId: string, + /** Request body */ + data: UpdateDefaultScreenScheme, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateDefaultScreenScheme({ + issueTypeScreenSchemeId: issueTypeScreenSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Remove mappings from issue type screen scheme + * @request POST :/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId}/mapping/remove + * @allowrelaxedtypes + */ +export async function postRestRemoveMappingsFromIssueTypeScreenScheme( + /** + * The ID of the issue type screen scheme. + */ + issueTypeScreenSchemeId: string, + /** Request body */ + data: IssueTypeIds, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeMappingsFromIssueTypeScreenScheme({ + issueTypeScreenSchemeId: issueTypeScreenSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get issue type screen scheme projects + * @request GET :/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId}/project + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectsForIssueTypeScreenScheme( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + query?: string; + }, + /** + * The ID of the issue type screen scheme. + */ + issueTypeScreenSchemeId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectsForIssueTypeScreenScheme({ + query: query, + issueTypeScreenSchemeId: issueTypeScreenSchemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get field reference data (GET) + * @request GET :/rest/api/3/jql/autocompletedata + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAutoComplete( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAutoComplete({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get field reference data (POST) + * @request POST :/rest/api/3/jql/autocompletedata + * @allowrelaxedtypes + */ +export async function postRestGetAutoCompletePost( + /** Request body */ + data: SearchAutoCompleteFilter, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAutoCompletePost({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get field auto complete suggestions + * @request GET :/rest/api/3/jql/autocompletedata/suggestions + * @readonly + */ +export async function getRestGetFieldAutoCompleteForQueryString( + query: { + /** + * The name of the field. + */ + fieldName?: string; + /** + * The partial field item name entered by the user. + */ + fieldValue?: string; + /** + * The name of the [ CHANGED operator predicate](https://confluence.atlassian.com/x/hQORLQ#Advancedsearching-operatorsreference-CHANGEDCHANGED) for which the suggestions are generated. The valid predicate operators are *by*, *from*, and *to*. + */ + predicateName?: string; + /** + * The partial predicate item name entered by the user. + */ + predicateValue?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFieldAutoCompleteForQueryString({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get precomputation + * @request GET :/rest/api/3/jql/function/computation + * @readonly + */ +export async function getRestGetPrecomputations( + query: { + functionKey?: string[]; + startAt?: number; + maxResults?: number; + orderBy?: string; + filter?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPrecomputations({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update precomputations + * @request POST :/rest/api/3/jql/function/computation + * @allowrelaxedtypes + */ +export async function postRestUpdatePrecomputations( + /** Request body */ + data: JqlFunctionPrecomputationUpdateRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updatePrecomputations({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Check issues against JQL + * @request POST :/rest/api/3/jql/match + */ +export async function postRestMatchIssues( + /** Request body */ + data: IssuesAndJQLQueries, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.matchIssues({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Parse JQL query + * @request POST :/rest/api/3/jql/parse + * @allowrelaxedtypes + */ +export async function postRestParseJqlQueries( + query: { + /** +* How to validate the JQL query and treat the validation results. Validation options include: + + * `strict` Returns all errors. If validation fails, the query structure is not returned. + * `warn` Returns all errors. If validation fails but the JQL query is correctly formed, the query structure is returned. + * `none` No validation is performed. If JQL query is correctly formed, the query structure is returned. +*/ + validation?: "strict" | "warn" | "none"; + }, + /** Request body */ + data: JqlQueriesToParse, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.parseJqlQueries({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Convert user identifiers to account IDs in JQL queries + * @request POST :/rest/api/3/jql/pdcleaner + */ +export async function postRestMigrateQueries( + /** Request body */ + data: JQLPersonalDataMigrationRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.migrateQueries({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Sanitize JQL queries + * @request POST :/rest/api/3/jql/sanitize + */ +export async function postRestSanitiseJqlQueries( + /** Request body */ + data: JqlQueriesToSanitize, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.sanitiseJqlQueries({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all labels + * @request GET :/rest/api/3/label + * @readonly + */ +export async function getRestGetAllLabels( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllLabels({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get approximate license count + * @request GET :/rest/api/3/license/approximateLicenseCount + * @readonly + */ +export async function getRestGetApproximateLicenseCount( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getApproximateLicenseCount({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get approximate application license count + * @request GET :/rest/api/3/license/approximateLicenseCount/product/{applicationKey} + * @readonly + */ +export async function getRestGetApproximateApplicationLicenseCount( + applicationKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getApproximateApplicationLicenseCount({ + applicationKey: applicationKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get my permissions + * @request GET :/rest/api/3/mypermissions + * @readonly + */ +export async function getRestGetMyPermissions( + query: { + /** + * The key of project. Ignored if `projectId` is provided. + */ + projectKey?: string; + /** + * The ID of project. + */ + projectId?: string; + /** + * The key of the issue. Ignored if `issueId` is provided. + */ + issueKey?: string; + /** + * The ID of the issue. + */ + issueId?: string; + /** + * A list of permission keys. (Required) This parameter accepts a comma-separated list. To get the list of available permissions, use [Get all permissions](#api-rest-api-3-permissions-get). + */ + permissions?: string; + projectUuid?: string; + projectConfigurationUuid?: string; + /** + * The ID of the comment. + */ + commentId?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getMyPermissions({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete preference + * @request DELETE :/rest/api/3/mypreferences + * @allowrelaxedtypes + */ +export async function deleteRestRemovePreference( + query: { + /** + * The key of the preference. + */ + key: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removePreference({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get preference + * @request GET :/rest/api/3/mypreferences + * @readonly + */ +export async function getRestGetPreference( + query: { + /** + * The key of the preference. + */ + key: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPreference({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set preference + * @request PUT :/rest/api/3/mypreferences + * @allowrelaxedtypes + */ +export async function putRestSetPreference( + query: { + /** + * The key of the preference. The maximum length is 255 characters. + */ + key: string; + }, + /** Request body */ + data: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setPreference({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete locale + * @request DELETE :/rest/api/3/mypreferences/locale + * @allowrelaxedtypes + */ +export async function deleteRestDeleteLocale( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteLocale({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get locale + * @request GET :/rest/api/3/mypreferences/locale + * @readonly + */ +export async function getRestGetLocale( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getLocale({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set locale + * @request PUT :/rest/api/3/mypreferences/locale + * @allowrelaxedtypes + */ +export async function putRestSetLocale( + /** Request body */ + data: Locale, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setLocale({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get current user + * @request GET :/rest/api/3/myself + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetCurrentUser( + query: { + /** +* Use [expand](#expansion) to include additional information about user in the response. This parameter accepts a comma-separated list. Expand options include: + + * `groups` Returns all groups, including nested groups, the user belongs to. + * `applicationRoles` Returns the application roles the user is assigned to. +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCurrentUser({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get notification schemes paginated + * @request GET :/rest/api/3/notificationscheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetNotificationSchemes( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: string; + /** + * The maximum number of items to return per page. + */ + maxResults?: string; + /** + * The list of notification schemes IDs to be filtered by + */ + id?: string[]; + /** + * The list of projects IDs to be filtered by + */ + projectId?: string[]; + /** + * When set to true, returns only the default notification scheme. If you provide project IDs not associated with the default, returns an empty page. The default value is false. + */ + onlyDefault?: boolean; + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `all` Returns all expandable information + * `field` Returns information about any custom fields assigned to receive an event + * `group` Returns information about any groups assigned to receive an event + * `notificationSchemeEvents` Returns a list of event associations. This list is returned for all expandable information + * `projectRole` Returns information about any project roles assigned to receive an event + * `user` Returns information about any users assigned to receive an event +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getNotificationSchemes({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create notification scheme + * @request POST :/rest/api/3/notificationscheme + */ +export async function postRestCreateNotificationScheme( + /** Request body */ + data: CreateNotificationSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createNotificationScheme({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get projects using notification schemes paginated + * @request GET :/rest/api/3/notificationscheme/project + * @readonly + */ +export async function getRestGetNotificationSchemeToProjectMappings( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: string; + /** + * The maximum number of items to return per page. + */ + maxResults?: string; + /** + * The list of notifications scheme IDs to be filtered out + */ + notificationSchemeId?: string[]; + /** + * The list of project IDs to be filtered out + */ + projectId?: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getNotificationSchemeToProjectMappings({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get notification scheme + * @request GET :/rest/api/3/notificationscheme/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetNotificationScheme( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `all` Returns all expandable information + * `field` Returns information about any custom fields assigned to receive an event + * `group` Returns information about any groups assigned to receive an event + * `notificationSchemeEvents` Returns a list of event associations. This list is returned for all expandable information + * `projectRole` Returns information about any project roles assigned to receive an event + * `user` Returns information about any users assigned to receive an event +*/ + expand?: string; + }, + /** + * The ID of the notification scheme. Use [Get notification schemes paginated](#api-rest-api-3-notificationscheme-get) to get a list of notification scheme IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getNotificationScheme({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update notification scheme + * @request PUT :/rest/api/3/notificationscheme/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateNotificationScheme( + /** + * The ID of the notification scheme. + */ + id: string, + /** Request body */ + data: UpdateNotificationSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateNotificationScheme({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Add notifications to notification scheme + * @request PUT :/rest/api/3/notificationscheme/{id}/notification + * @allowrelaxedtypes + */ +export async function putRestAddNotifications( + /** + * The ID of the notification scheme. + */ + id: string, + /** Request body */ + data: AddNotificationsDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addNotifications({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete notification scheme + * @request DELETE :/rest/api/3/notificationscheme/{notificationSchemeId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteNotificationScheme( + /** + * The ID of the notification scheme. + */ + notificationSchemeId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteNotificationScheme({ + notificationSchemeId: notificationSchemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Remove notification from notification scheme + * @request DELETE :/rest/api/3/notificationscheme/{notificationSchemeId}/notification/{notificationId} + * @allowrelaxedtypes + */ +export async function deleteRestRemoveNotificationFromNotificationScheme( + /** + * The ID of the notification scheme. + */ + notificationSchemeId: string, + /** + * The ID of the notification. + */ + notificationId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeNotificationFromNotificationScheme({ + notificationSchemeId: notificationSchemeId, + notificationId: notificationId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all permissions + * @request GET :/rest/api/3/permissions + * @readonly + */ +export async function getRestGetAllPermissions( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllPermissions({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get bulk permissions + * @request POST :/rest/api/3/permissions/check + */ +export async function postRestGetBulkPermissions( + /** Request body */ + data: BulkPermissionsRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getBulkPermissions({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get permitted projects + * @request POST :/rest/api/3/permissions/project + */ +export async function postRestGetPermittedProjects( + /** Request body */ + data: PermissionsKeysBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPermittedProjects({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all permission schemes + * @request GET :/rest/api/3/permissionscheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllPermissionSchemes( + query: { + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are included when you specify any value. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `permissions` Returns all permission grants for each permission scheme. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllPermissionSchemes({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create permission scheme + * @request POST :/rest/api/3/permissionscheme + * @allowrelaxedtypes + */ +export async function postRestCreatePermissionScheme( + query: { + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are always included when you specify any value. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `permissions` Returns all permission grants for each permission scheme. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + /** Request body */ + data: PermissionScheme, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createPermissionScheme({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete permission scheme + * @request DELETE :/rest/api/3/permissionscheme/{schemeId} + * @allowrelaxedtypes + */ +export async function deleteRestDeletePermissionScheme( + /** + * The ID of the permission scheme being deleted. + */ + schemeId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deletePermissionScheme({ + schemeId: schemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get permission scheme + * @request GET :/rest/api/3/permissionscheme/{schemeId} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetPermissionScheme( + query: { + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are included when you specify any value. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `permissions` Returns all permission grants for each permission scheme. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + /** + * The ID of the permission scheme to return. + */ + schemeId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPermissionScheme({ + query: query, + schemeId: schemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update permission scheme + * @request PUT :/rest/api/3/permissionscheme/{schemeId} + * @allowrelaxedtypes + */ +export async function putRestUpdatePermissionScheme( + query: { + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are always included when you specify any value. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `permissions` Returns all permission grants for each permission scheme. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + /** + * The ID of the permission scheme to update. + */ + schemeId: number, + /** Request body */ + data: PermissionScheme, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updatePermissionScheme({ + query: query, + schemeId: schemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get permission scheme grants + * @request GET :/rest/api/3/permissionscheme/{schemeId}/permission + * @readonly + */ +export async function getRestGetPermissionSchemeGrants( + query: { + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are always included when you specify any value. Expand options include: + + * `permissions` Returns all permission grants for each permission scheme. + * `user` Returns information about the user who is granted the permission. + * `group` Returns information about the group that is granted the permission. + * `projectRole` Returns information about the project role granted the permission. + * `field` Returns information about the custom field granted the permission. + * `all` Returns all expandable information. +*/ + expand?: string; + }, + /** + * The ID of the permission scheme. + */ + schemeId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPermissionSchemeGrants({ + query: query, + schemeId: schemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create permission grant + * @request POST :/rest/api/3/permissionscheme/{schemeId}/permission + */ +export async function postRestCreatePermissionGrant( + query: { + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are always included when you specify any value. Expand options include: + + * `permissions` Returns all permission grants for each permission scheme. + * `user` Returns information about the user who is granted the permission. + * `group` Returns information about the group that is granted the permission. + * `projectRole` Returns information about the project role granted the permission. + * `field` Returns information about the custom field granted the permission. + * `all` Returns all expandable information. +*/ + expand?: string; + }, + /** + * The ID of the permission scheme in which to create a new permission grant. + */ + schemeId: number, + /** Request body */ + data: PermissionGrant, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createPermissionGrant({ + query: query, + schemeId: schemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete permission scheme grant + * @request DELETE :/rest/api/3/permissionscheme/{schemeId}/permission/{permissionId} + * @allowrelaxedtypes + */ +export async function deleteRestDeletePermissionSchemeEntity( + /** + * The ID of the permission scheme to delete the permission grant from. + */ + schemeId: number, + /** + * The ID of the permission grant to delete. + */ + permissionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deletePermissionSchemeEntity({ + schemeId: schemeId, + permissionId: permissionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get permission scheme grant + * @request GET :/rest/api/3/permissionscheme/{schemeId}/permission/{permissionId} + * @readonly + */ +export async function getRestGetPermissionSchemeGrant( + query: { + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are always included when you specify any value. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `permissions` Returns all permission grants for each permission scheme. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + /** + * The ID of the permission scheme. + */ + schemeId: number, + /** + * The ID of the permission grant. + */ + permissionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPermissionSchemeGrant({ + query: query, + schemeId: schemeId, + permissionId: permissionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get priorities + * @request GET :/rest/api/3/priority + * @readonly + */ +export async function getRestGetPriorities( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPriorities({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create priority + * @request POST :/rest/api/3/priority + * @allowrelaxedtypes + */ +export async function postRestCreatePriority( + /** Request body */ + data: CreatePriorityDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createPriority({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set default priority + * @request PUT :/rest/api/3/priority/default + * @allowrelaxedtypes + */ +export async function putRestSetDefaultPriority( + /** Request body */ + data: SetDefaultPriorityRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setDefaultPriority({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Move priorities + * @request PUT :/rest/api/3/priority/move + * @allowrelaxedtypes + */ +export async function putRestMovePriorities( + /** Request body */ + data: ReorderIssuePriorities, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.movePriorities({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Search priorities + * @request GET :/rest/api/3/priority/search + * @readonly + */ +export async function getRestSearchPriorities( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: string; + /** + * The maximum number of items to return per page. + */ + maxResults?: string; + /** + * The list of priority IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=2&id=3`. + */ + id?: string[]; + /** + * Whether only the default priority is returned. + */ + onlyDefault?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.searchPriorities({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete priority + * @request DELETE :/rest/api/3/priority/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeletePriority( + query: { + /** + * The ID of the issue priority that will replace the currently selected resolution. + */ + replaceWith: string; + }, + /** + * The ID of the issue priority. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deletePriority({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get priority + * @request GET :/rest/api/3/priority/{id} + * @readonly + */ +export async function getRestGetPriority( + /** + * The ID of the issue priority. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPriority({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update priority + * @request PUT :/rest/api/3/priority/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdatePriority( + /** + * The ID of the issue priority. + */ + id: string, + /** Request body */ + data: UpdatePriorityDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updatePriority({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all projects + * @request GET :/rest/api/3/project + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllProjects( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expanded options include: + + * `description` Returns the project description. + * `issueTypes` Returns all issue types associated with the project. + * `lead` Returns information about the project lead. + * `projectKeys` Returns all project keys associated with the project. +*/ + expand?: string; + /** + * Returns the user's most recently accessed projects. You may specify the number of results to return up to a maximum of 20. If access is anonymous, then the recently accessed projects are based on the current HTTP session. + */ + recent?: number; + /** + * A list of project properties to return for the project. This parameter accepts a comma-separated list. + */ + properties?: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllProjects({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create project + * @request POST :/rest/api/3/project + * @allowrelaxedtypes + */ +export async function postRestCreateProject( + /** Request body */ + data: CreateProjectDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createProject({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get recent projects + * @request GET :/rest/api/3/project/recent + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetRecent( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expanded options include: + + * `description` Returns the project description. + * `projectKeys` Returns all project keys associated with a project. + * `lead` Returns information about the project lead. + * `issueTypes` Returns all issue types associated with the project. + * `url` Returns the URL associated with the project. + * `permissions` Returns the permissions associated with the project. + * `insight` EXPERIMENTAL. Returns the insight details of total issue count and last issue update time for the project. + * `*` Returns the project with all available expand options. +*/ + expand?: string; + /** + * EXPERIMENTAL. A list of project properties to return for the project. This parameter accepts a comma-separated list. Invalid property names are ignored. + */ + properties?: StringList[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getRecent({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get projects paginated + * @request GET :/rest/api/3/project/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestSearchProjects( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** +* [Order](#ordering) the results by a field. + + * `category` Sorts by project category. A complete list of category IDs is found using [Get all project categories](#api-rest-api-3-projectCategory-get). + * `issueCount` Sorts by the total number of issues in each project. + * `key` Sorts by project key. + * `lastIssueUpdatedTime` Sorts by the last issue update time. + * `name` Sorts by project name. + * `owner` Sorts by project lead. + * `archivedDate` EXPERIMENTAL. Sorts by project archived date. + * `deletedDate` EXPERIMENTAL. Sorts by project deleted date. +*/ + orderBy?: + | "category" + | "-category" + | "+category" + | "key" + | "-key" + | "+key" + | "name" + | "-name" + | "+name" + | "owner" + | "-owner" + | "+owner" + | "issueCount" + | "-issueCount" + | "+issueCount" + | "lastIssueUpdatedDate" + | "-lastIssueUpdatedDate" + | "+lastIssueUpdatedDate" + | "archivedDate" + | "+archivedDate" + | "-archivedDate" + | "deletedDate" + | "+deletedDate" + | "-deletedDate"; + /** + * The project IDs to filter the results by. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. Up to 50 project IDs can be provided. + */ + id?: number[]; + /** + * The project keys to filter the results by. To include multiple keys, provide an ampersand-separated list. For example, `keys=PA&keys=PB`. Up to 50 project keys can be provided. + */ + keys?: string[]; + /** + * Filter the results using a literal string. Projects with a matching `key` or `name` are returned (case insensitive). + */ + query?: string; + /** + * Orders results by the [project type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes). This parameter accepts a comma-separated list. Valid values are `business`, `service_desk`, and `software`. + */ + typeKey?: string; + /** + * The ID of the project's category. A complete list of category IDs is found using the [Get all project categories](#api-rest-api-3-projectCategory-get) operation. + */ + categoryId?: number; + /** +* Filter results by projects for which the user can: + + * `view` the project, meaning that they have one of the following permissions: + + * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * `browse` the project, meaning that they have the *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * `edit` the project, meaning that they have one of the following permissions: + + * *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). +*/ + action?: "view" | "browse" | "edit"; + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expanded options include: + + * `description` Returns the project description. + * `projectKeys` Returns all project keys associated with a project. + * `lead` Returns information about the project lead. + * `issueTypes` Returns all issue types associated with the project. + * `url` Returns the URL associated with the project. + * `insight` EXPERIMENTAL. Returns the insight details of total issue count and last issue update time for the project. +*/ + expand?: string; + /** +* EXPERIMENTAL. Filter results by project status: + + * `live` Search live projects. + * `archived` Search archived projects. + * `deleted` Search deleted projects, those in the recycle bin. +*/ + status?: ("live" | "archived" | "deleted")[]; + /** + * EXPERIMENTAL. A list of project properties to return for the project. This parameter accepts a comma-separated list. + */ + properties?: StringList[]; + /** + * EXPERIMENTAL. A query string used to search properties. The query string cannot be specified using a JSON object. For example, to search for the value of `nested` from `{"something":{"nested":1,"other":2}}` use `[thepropertykey].something.nested=1`. Note that the propertyQuery key is enclosed in square brackets to enable searching where the propertyQuery key includes dot (.) or equals (=) characters. Note that `thepropertykey` is only returned when included in `properties`. + */ + propertyQuery?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.searchProjects({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all project types + * @request GET :/rest/api/3/project/type + * @readonly + */ +export async function getRestGetAllProjectTypes( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllProjectTypes({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get licensed project types + * @request GET :/rest/api/3/project/type/accessible + * @readonly + */ +export async function getRestGetAllAccessibleProjectTypes( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllAccessibleProjectTypes({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project type by key + * @request GET :/rest/api/3/project/type/{projectTypeKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectTypeByKey( + /** + * The key of the project type. + */ + projectTypeKey: + | "software" + | "service_desk" + | "business" + | "product_discovery", + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectTypeByKey({ + projectTypeKey: projectTypeKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get accessible project type by key + * @request GET :/rest/api/3/project/type/{projectTypeKey}/accessible + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAccessibleProjectTypeByKey( + /** + * The key of the project type. + */ + projectTypeKey: + | "software" + | "service_desk" + | "business" + | "product_discovery", + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAccessibleProjectTypeByKey({ + projectTypeKey: projectTypeKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete project + * @request DELETE :/rest/api/3/project/{projectIdOrKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteProject( + query: { + /** + * Whether this project is placed in the Jira recycle bin where it will be available for restoration. + */ + enableUndo?: boolean; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteProject({ + query: query, + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get project + * @request GET :/rest/api/3/project/{projectIdOrKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProject( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Note that the project description, issue types, and project lead are included in all responses by default. Expand options include: + + * `description` The project description. + * `issueTypes` The issue types associated with the project. + * `lead` The project lead. + * `projectKeys` All project keys associated with the project. + * `issueTypeHierarchy` The project issue type hierarchy. +*/ + expand?: string; + /** + * A list of project properties to return for the project. This parameter accepts a comma-separated list. + */ + properties?: string[]; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProject({ + query: query, + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update project + * @request PUT :/rest/api/3/project/{projectIdOrKey} + * @allowrelaxedtypes + */ +export async function putRestUpdateProject( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Note that the project description, issue types, and project lead are included in all responses by default. Expand options include: + + * `description` The project description. + * `issueTypes` The issue types associated with the project. + * `lead` The project lead. + * `projectKeys` All project keys associated with the project. +*/ + expand?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** Request body */ + data: UpdateProjectDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateProject({ + query: query, + projectIdOrKey: projectIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Archive project + * @request POST :/rest/api/3/project/{projectIdOrKey}/archive + * @allowrelaxedtypes + */ +export async function postRestArchiveProject( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.archiveProject({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Set project avatar + * @request PUT :/rest/api/3/project/{projectIdOrKey}/avatar + * @allowrelaxedtypes + */ +export async function putRestUpdateProjectAvatar( + /** + * The ID or (case-sensitive) key of the project. + */ + projectIdOrKey: string, + /** Request body */ + data: Avatar, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateProjectAvatar({ + projectIdOrKey: projectIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete project avatar + * @request DELETE :/rest/api/3/project/{projectIdOrKey}/avatar/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteProjectAvatar( + /** + * The project ID or (case-sensitive) key. + */ + projectIdOrKey: string, + /** + * The ID of the avatar. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteProjectAvatar({ + projectIdOrKey: projectIdOrKey, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Load project avatar + * @request POST :/rest/api/3/project/{projectIdOrKey}/avatar2 + */ +export async function postRestCreateProjectAvatar( + query: { + /** + * The X coordinate of the top-left corner of the crop region. + */ + x?: number; + /** + * The Y coordinate of the top-left corner of the crop region. + */ + y?: number; + /** + * The length of each side of the crop region. + */ + size?: number; + }, + /** + * The ID or (case-sensitive) key of the project. + */ + projectIdOrKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createProjectAvatar({ + query: query, + projectIdOrKey: projectIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all project avatars + * @request GET :/rest/api/3/project/{projectIdOrKey}/avatars + * @readonly + */ +export async function getRestGetAllProjectAvatars( + /** + * The ID or (case-sensitive) key of the project. + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllProjectAvatars({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project components paginated + * @request GET :/rest/api/3/project/{projectIdOrKey}/component + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectComponentsPaginated( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** +* [Order](#ordering) the results by a field: + + * `description` Sorts by the component description. + * `issueCount` Sorts by the count of issues associated with the component. + * `lead` Sorts by the user key of the component's project lead. + * `name` Sorts by component name. +*/ + orderBy?: + | "description" + | "-description" + | "+description" + | "issueCount" + | "-issueCount" + | "+issueCount" + | "lead" + | "-lead" + | "+lead" + | "name" + | "-name" + | "+name"; + /** + * Filter the results using a literal string. Components with a matching `name` or `description` are returned (case insensitive). + */ + query?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectComponentsPaginated({ + query: query, + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project components + * @request GET :/rest/api/3/project/{projectIdOrKey}/components + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectComponents( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectComponents({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete project asynchronously + * @request POST :/rest/api/3/project/{projectIdOrKey}/delete + * @allowrelaxedtypes + */ +export async function postRestDeleteProjectAsynchronously( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteProjectAsynchronously({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get project features + * @request GET :/rest/api/3/project/{projectIdOrKey}/features + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetFeaturesForProject( + /** + * The ID or (case-sensitive) key of the project. + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFeaturesForProject({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set project feature state + * @request PUT :/rest/api/3/project/{projectIdOrKey}/features/{featureKey} + * @allowrelaxedtypes + */ +export async function putRestToggleFeatureForProject( + /** + * The ID or (case-sensitive) key of the project. + */ + projectIdOrKey: string, + /** + * The key of the feature. + */ + featureKey: string, + /** Request body */ + data: ProjectFeatureState, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.toggleFeatureForProject({ + projectIdOrKey: projectIdOrKey, + featureKey: featureKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project property keys + * @request GET :/rest/api/3/project/{projectIdOrKey}/properties + * @readonly + */ +export async function getRestGetProjectPropertyKeys( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectPropertyKeys({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete project property + * @request DELETE :/rest/api/3/project/{projectIdOrKey}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteProjectProperty( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The project property key. Use [Get project property keys](#api-rest-api-3-project-projectIdOrKey-properties-get) to get a list of all project property keys. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteProjectProperty({ + projectIdOrKey: projectIdOrKey, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get project property + * @request GET :/rest/api/3/project/{projectIdOrKey}/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectProperty( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The project property key. Use [Get project property keys](#api-rest-api-3-project-projectIdOrKey-properties-get) to get a list of all project property keys. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectProperty({ + projectIdOrKey: projectIdOrKey, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set project property + * @request PUT :/rest/api/3/project/{projectIdOrKey}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestSetProjectProperty( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The key of the project property. The maximum length is 255 characters. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setProjectProperty({ + projectIdOrKey: projectIdOrKey, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Restore deleted or archived project + * @request POST :/rest/api/3/project/{projectIdOrKey}/restore + * @allowrelaxedtypes + */ +export async function postRestRestore( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.restore({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project roles for project + * @request GET :/rest/api/3/project/{projectIdOrKey}/role + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectRoles( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectRoles({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete actors from project role + * @request DELETE :/rest/api/3/project/{projectIdOrKey}/role/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteActor( + query: { + /** + * The user account ID of the user to remove from the project role. + */ + user?: string; + /** + * The name of the group to remove from the project role. This parameter cannot be used with the `groupId` parameter. As a group's name can change, use of `groupId` is recommended. + */ + group?: string; + /** + * The ID of the group to remove from the project role. This parameter cannot be used with the `group` parameter. + */ + groupId?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteActor({ + query: query, + projectIdOrKey: projectIdOrKey, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get project role for project + * @request GET :/rest/api/3/project/{projectIdOrKey}/role/{id} + * @readonly + */ +export async function getRestGetProjectRole( + query: { + /** + * Exclude inactive users. + */ + excludeInactiveUsers?: boolean; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectRole({ + query: query, + projectIdOrKey: projectIdOrKey, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add actors to project role + * @request POST :/rest/api/3/project/{projectIdOrKey}/role/{id} + */ +export async function postRestAddActorUsers( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + /** Request body */ + data: ActorsMap, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addActorUsers({ + projectIdOrKey: projectIdOrKey, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set actors for project role + * @request PUT :/rest/api/3/project/{projectIdOrKey}/role/{id} + */ +export async function putRestSetActors( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + /** Request body */ + data: ProjectRoleActorsUpdateBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setActors({ + projectIdOrKey: projectIdOrKey, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project role details + * @request GET :/rest/api/3/project/{projectIdOrKey}/roledetails + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectRoleDetails( + query: { + /** + * Whether the roles should be filtered to include only those the user is assigned to. + */ + currentMember?: boolean; + excludeConnectAddons?: boolean; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectRoleDetails({ + query: query, + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all statuses for project + * @request GET :/rest/api/3/project/{projectIdOrKey}/statuses + * @readonly + */ +export async function getRestGetAllStatuses( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllStatuses({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update project type + * @request PUT :/rest/api/3/project/{projectIdOrKey}/type/{newProjectTypeKey} + * @allowrelaxedtypes + */ +export async function putRestUpdateProjectType( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The key of the new project type. + */ + newProjectTypeKey: "software" | "service_desk" | "business", + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateProjectType({ + projectIdOrKey: projectIdOrKey, + newProjectTypeKey: newProjectTypeKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project versions paginated + * @request GET :/rest/api/3/project/{projectIdOrKey}/version + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectVersionsPaginated( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** +* [Order](#ordering) the results by a field: + + * `description` Sorts by version description. + * `name` Sorts by version name. + * `releaseDate` Sorts by release date, starting with the oldest date. Versions with no release date are listed last. + * `sequence` Sorts by the order of appearance in the user interface. + * `startDate` Sorts by start date, starting with the oldest date. Versions with no start date are listed last. +*/ + orderBy?: + | "description" + | "-description" + | "+description" + | "name" + | "-name" + | "+name" + | "releaseDate" + | "-releaseDate" + | "+releaseDate" + | "sequence" + | "-sequence" + | "+sequence" + | "startDate" + | "-startDate" + | "+startDate"; + /** + * Filter the results using a literal string. Versions with matching `name` or `description` are returned (case insensitive). + */ + query?: string; + /** + * A list of status values used to filter the results by version status. This parameter accepts a comma-separated list. The status values are `released`, `unreleased`, and `archived`. + */ + status?: string; + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `issuesstatus` Returns the number of issues in each status category for each version. + * `operations` Returns actions that can be performed on the specified version. +*/ + expand?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectVersionsPaginated({ + query: query, + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project versions + * @request GET :/rest/api/3/project/{projectIdOrKey}/versions + * @readonly + */ +export async function getRestGetProjectVersions( + query: { + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts `operations`, which returns actions that can be performed on the version. + */ + expand?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectVersions({ + query: query, + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project's sender email + * @request GET :/rest/api/3/project/{projectId}/email + * @readonly + */ +export async function getRestGetProjectEmail( + /** + * The project ID. + */ + projectId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectEmail({ + projectId: projectId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set project's sender email + * @request PUT :/rest/api/3/project/{projectId}/email + * @allowrelaxedtypes + */ +export async function putRestUpdateProjectEmail( + /** + * The project ID. + */ + projectId: number, + /** Request body */ + data: ProjectEmailAddress, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateProjectEmail({ + projectId: projectId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get project issue type hierarchy + * @request GET :/rest/api/3/project/{projectId}/hierarchy + * @readonly + */ +export async function getRestGetHierarchy( + /** + * The ID of the project. + */ + projectId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getHierarchy({ + projectId: projectId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project issue security scheme + * @request GET :/rest/api/3/project/{projectKeyOrId}/issuesecuritylevelscheme + * @readonly + */ +export async function getRestGetProjectIssueSecurityScheme( + /** + * The project ID or project key (case sensitive). + */ + projectKeyOrId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectIssueSecurityScheme({ + projectKeyOrId: projectKeyOrId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project notification scheme + * @request GET :/rest/api/3/project/{projectKeyOrId}/notificationscheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetNotificationSchemeForProject( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `all` Returns all expandable information + * `field` Returns information about any custom fields assigned to receive an event + * `group` Returns information about any groups assigned to receive an event + * `notificationSchemeEvents` Returns a list of event associations. This list is returned for all expandable information + * `projectRole` Returns information about any project roles assigned to receive an event + * `user` Returns information about any users assigned to receive an event +*/ + expand?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectKeyOrId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getNotificationSchemeForProject({ + query: query, + projectKeyOrId: projectKeyOrId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get assigned permission scheme + * @request GET :/rest/api/3/project/{projectKeyOrId}/permissionscheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAssignedPermissionScheme( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are included when you specify any value. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `permissions` Returns all permission grants for each permission scheme. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectKeyOrId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAssignedPermissionScheme({ + query: query, + projectKeyOrId: projectKeyOrId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Assign permission scheme + * @request PUT :/rest/api/3/project/{projectKeyOrId}/permissionscheme + * @allowrelaxedtypes + */ +export async function putRestAssignPermissionScheme( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are included when you specify any value. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `permissions` Returns all permission grants for each permission scheme. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectKeyOrId: string, + /** Request body */ + data: IdBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.assignPermissionScheme({ + query: query, + projectKeyOrId: projectKeyOrId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project issue security levels + * @request GET :/rest/api/3/project/{projectKeyOrId}/securitylevel + * @readonly + */ +export async function getRestGetSecurityLevelsForProject( + /** + * The project ID or project key (case sensitive). + */ + projectKeyOrId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getSecurityLevelsForProject({ + projectKeyOrId: projectKeyOrId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all project categories + * @request GET :/rest/api/3/projectCategory + * @readonly + */ +export async function getRestGetAllProjectCategories( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllProjectCategories({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create project category + * @request POST :/rest/api/3/projectCategory + */ +export async function postRestCreateProjectCategory( + /** Request body */ + data: ProjectCategory, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createProjectCategory({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete project category + * @request DELETE :/rest/api/3/projectCategory/{id} + * @allowrelaxedtypes + */ +export async function deleteRestRemoveProjectCategory( + /** + * ID of the project category to delete. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeProjectCategory({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get project category by ID + * @request GET :/rest/api/3/projectCategory/{id} + * @readonly + */ +export async function getRestGetProjectCategoryById( + /** + * The ID of the project category. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectCategoryById({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update project category + * @request PUT :/rest/api/3/projectCategory/{id} + */ +export async function putRestUpdateProjectCategory( + id: number, + /** Request body */ + data: ProjectCategory, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateProjectCategory({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Validate project key + * @request GET :/rest/api/3/projectvalidate/key + * @readonly + */ +export async function getRestValidateProjectKey( + query: { + /** + * The project key. + */ + key?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.validateProjectKey({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get valid project key + * @request GET :/rest/api/3/projectvalidate/validProjectKey + * @readonly + */ +export async function getRestGetValidProjectKey( + query: { + /** + * The project key. + */ + key?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getValidProjectKey({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get valid project name + * @request GET :/rest/api/3/projectvalidate/validProjectName + * @readonly + */ +export async function getRestGetValidProjectName( + query: { + /** + * The project name. + */ + name: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getValidProjectName({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get resolutions + * @request GET :/rest/api/3/resolution + * @readonly + */ +export async function getRestGetResolutions( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getResolutions({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create resolution + * @request POST :/rest/api/3/resolution + */ +export async function postRestCreateResolution( + /** Request body */ + data: CreateResolutionDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createResolution({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set default resolution + * @request PUT :/rest/api/3/resolution/default + * @allowrelaxedtypes + */ +export async function putRestSetDefaultResolution( + /** Request body */ + data: SetDefaultResolutionRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setDefaultResolution({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Move resolutions + * @request PUT :/rest/api/3/resolution/move + * @allowrelaxedtypes + */ +export async function putRestMoveResolutions( + /** Request body */ + data: ReorderIssueResolutionsRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.moveResolutions({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Search resolutions + * @request GET :/rest/api/3/resolution/search + * @readonly + */ +export async function getRestSearchResolutions( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: string; + /** + * The maximum number of items to return per page. + */ + maxResults?: string; + /** + * The list of resolutions IDs to be filtered out + */ + id?: string[]; + /** + * When set to true, return default only, when IDs provided, if none of them is default, return empty page. Default value is false + */ + onlyDefault?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.searchResolutions({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete resolution + * @request DELETE :/rest/api/3/resolution/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteResolution( + query: { + /** + * The ID of the issue resolution that will replace the currently selected resolution. + */ + replaceWith: string; + }, + /** + * The ID of the issue resolution. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteResolution({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get resolution + * @request GET :/rest/api/3/resolution/{id} + * @readonly + */ +export async function getRestGetResolution( + /** + * The ID of the issue resolution value. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getResolution({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update resolution + * @request PUT :/rest/api/3/resolution/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateResolution( + /** + * The ID of the issue resolution. + */ + id: string, + /** Request body */ + data: UpdateResolutionDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateResolution({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all project roles + * @request GET :/rest/api/3/role + * @readonly + */ +export async function getRestGetAllProjectRoles( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllProjectRoles({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create project role + * @request POST :/rest/api/3/role + */ +export async function postRestCreateProjectRole( + /** Request body */ + data: CreateUpdateRoleRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createProjectRole({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete project role + * @request DELETE :/rest/api/3/role/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteProjectRole( + query: { + /** + * The ID of the project role that will replace the one being deleted. + */ + swap?: number; + }, + /** + * The ID of the project role to delete. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteProjectRole({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get project role by ID + * @request GET :/rest/api/3/role/{id} + * @readonly + */ +export async function getRestGetProjectRoleById( + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectRoleById({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Partial update project role + * @request POST :/rest/api/3/role/{id} + */ +export async function postRestPartialUpdateProjectRole( + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + /** Request body */ + data: CreateUpdateRoleRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.partialUpdateProjectRole({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Fully update project role + * @request PUT :/rest/api/3/role/{id} + */ +export async function putRestFullyUpdateProjectRole( + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + /** Request body */ + data: CreateUpdateRoleRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.fullyUpdateProjectRole({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete default actors from project role + * @request DELETE :/rest/api/3/role/{id}/actors + */ +export async function deleteRestDeleteProjectRoleActorsFromRole( + query: { + /** + * The user account ID of the user to remove as a default actor. + */ + user?: string; + /** + * The group ID of the group to be removed as a default actor. This parameter cannot be used with the `group` parameter. + */ + groupId?: string; + /** + * The group name of the group to be removed as a default actor.This parameter cannot be used with the `groupId` parameter. As a group's name can change, use of `groupId` is recommended. + */ + group?: string; + }, + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteProjectRoleActorsFromRole({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get default actors for project role + * @request GET :/rest/api/3/role/{id}/actors + * @readonly + */ +export async function getRestGetProjectRoleActorsForRole( + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectRoleActorsForRole({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add default actors to project role + * @request POST :/rest/api/3/role/{id}/actors + */ +export async function postRestAddProjectRoleActorsToRole( + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + /** Request body */ + data: ActorInputBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addProjectRoleActorsToRole({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get screens + * @request GET :/rest/api/3/screens + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetScreens( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of screen IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + */ + id?: number[]; + /** + * String used to perform a case-insensitive partial match with screen name. + */ + queryString?: string; + /** + * The scope filter string. To filter by multiple scope, provide an ampersand-separated list. For example, `scope=GLOBAL&scope=PROJECT`. + */ + scope?: ("GLOBAL" | "TEMPLATE" | "PROJECT")[]; + /** +* [Order](#ordering) the results by a field: + + * `id` Sorts by screen ID. + * `name` Sorts by screen name. +*/ + orderBy?: "name" | "-name" | "+name" | "id" | "-id" | "+id"; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getScreens({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create screen + * @request POST :/rest/api/3/screens + * @allowrelaxedtypes + */ +export async function postRestCreateScreen( + /** Request body */ + data: ScreenDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createScreen({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add field to default screen + * @request POST :/rest/api/3/screens/addToDefault/{fieldId} + * @allowrelaxedtypes + */ +export async function postRestAddFieldToDefaultScreen( + /** + * The ID of the field. + */ + fieldId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addFieldToDefaultScreen({ + fieldId: fieldId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete screen + * @request DELETE :/rest/api/3/screens/{screenId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteScreen( + /** + * The ID of the screen. + */ + screenId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteScreen({ + screenId: screenId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Update screen + * @request PUT :/rest/api/3/screens/{screenId} + * @allowrelaxedtypes + */ +export async function putRestUpdateScreen( + /** + * The ID of the screen. + */ + screenId: number, + /** Request body */ + data: UpdateScreenDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateScreen({ + screenId: screenId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get available screen fields + * @request GET :/rest/api/3/screens/{screenId}/availableFields + * @readonly + */ +export async function getRestGetAvailableScreenFields( + /** + * The ID of the screen. + */ + screenId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAvailableScreenFields({ + screenId: screenId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all screen tabs + * @request GET :/rest/api/3/screens/{screenId}/tabs + * @readonly + */ +export async function getRestGetAllScreenTabs( + query: { + /** + * The key of the project. + */ + projectKey?: string; + }, + /** + * The ID of the screen. + */ + screenId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllScreenTabs({ + query: query, + screenId: screenId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create screen tab + * @request POST :/rest/api/3/screens/{screenId}/tabs + */ +export async function postRestAddScreenTab( + /** + * The ID of the screen. + */ + screenId: number, + /** Request body */ + data: ScreenableTab, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addScreenTab({ + screenId: screenId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete screen tab + * @request DELETE :/rest/api/3/screens/{screenId}/tabs/{tabId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteScreenTab( + /** + * The ID of the screen. + */ + screenId: number, + /** + * The ID of the screen tab. + */ + tabId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteScreenTab({ + screenId: screenId, + tabId: tabId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Update screen tab + * @request PUT :/rest/api/3/screens/{screenId}/tabs/{tabId} + */ +export async function putRestRenameScreenTab( + /** + * The ID of the screen. + */ + screenId: number, + /** + * The ID of the screen tab. + */ + tabId: number, + /** Request body */ + data: ScreenableTab, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.renameScreenTab({ + screenId: screenId, + tabId: tabId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all screen tab fields + * @request GET :/rest/api/3/screens/{screenId}/tabs/{tabId}/fields + * @readonly + */ +export async function getRestGetAllScreenTabFields( + query: { + /** + * The key of the project. + */ + projectKey?: string; + }, + /** + * The ID of the screen. + */ + screenId: number, + /** + * The ID of the screen tab. + */ + tabId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllScreenTabFields({ + query: query, + screenId: screenId, + tabId: tabId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add screen tab field + * @request POST :/rest/api/3/screens/{screenId}/tabs/{tabId}/fields + */ +export async function postRestAddScreenTabField( + /** + * The ID of the screen. + */ + screenId: number, + /** + * The ID of the screen tab. + */ + tabId: number, + /** Request body */ + data: AddFieldBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addScreenTabField({ + screenId: screenId, + tabId: tabId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Remove screen tab field + * @request DELETE :/rest/api/3/screens/{screenId}/tabs/{tabId}/fields/{id} + * @allowrelaxedtypes + */ +export async function deleteRestRemoveScreenTabField( + /** + * The ID of the screen. + */ + screenId: number, + /** + * The ID of the screen tab. + */ + tabId: number, + /** + * The ID of the field. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeScreenTabField({ + screenId: screenId, + tabId: tabId, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Move screen tab field + * @request POST :/rest/api/3/screens/{screenId}/tabs/{tabId}/fields/{id}/move + * @allowrelaxedtypes + */ +export async function postRestMoveScreenTabField( + /** + * The ID of the screen. + */ + screenId: number, + /** + * The ID of the screen tab. + */ + tabId: number, + /** + * The ID of the field. + */ + id: string, + /** Request body */ + data: MoveFieldBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.moveScreenTabField({ + screenId: screenId, + tabId: tabId, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Move screen tab + * @request POST :/rest/api/3/screens/{screenId}/tabs/{tabId}/move/{pos} + * @allowrelaxedtypes + */ +export async function postRestMoveScreenTab( + /** + * The ID of the screen. + */ + screenId: number, + /** + * The ID of the screen tab. + */ + tabId: number, + /** + * The position of tab. The base index is 0. + */ + pos: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.moveScreenTab({ + screenId: screenId, + tabId: tabId, + pos: pos, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get screen schemes + * @request GET :/rest/api/3/screenscheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetScreenSchemes( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of screen scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + */ + id?: number[]; + /** + * Use [expand](#expansion) include additional information in the response. This parameter accepts `issueTypeScreenSchemes` that, for each screen schemes, returns information about the issue type screen scheme the screen scheme is assigned to. + */ + expand?: string; + /** + * String used to perform a case-insensitive partial match with screen scheme name. + */ + queryString?: string; + /** +* [Order](#ordering) the results by a field: + + * `id` Sorts by screen scheme ID. + * `name` Sorts by screen scheme name. +*/ + orderBy?: "name" | "-name" | "+name" | "id" | "-id" | "+id"; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getScreenSchemes({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create screen scheme + * @request POST :/rest/api/3/screenscheme + */ +export async function postRestCreateScreenScheme( + /** Request body */ + data: ScreenSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createScreenScheme({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete screen scheme + * @request DELETE :/rest/api/3/screenscheme/{screenSchemeId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteScreenScheme( + /** + * The ID of the screen scheme. + */ + screenSchemeId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteScreenScheme({ + screenSchemeId: screenSchemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Update screen scheme + * @request PUT :/rest/api/3/screenscheme/{screenSchemeId} + * @allowrelaxedtypes + */ +export async function putRestUpdateScreenScheme( + /** + * The ID of the screen scheme. + */ + screenSchemeId: string, + /** Request body */ + data: UpdateScreenSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateScreenScheme({ + screenSchemeId: screenSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Search for issues using JQL (GET) + * @request GET :/rest/api/3/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestSearchForIssuesUsingJql( + query: { + /** +* The [JQL](https://confluence.atlassian.com/x/egORLQ) that defines the search. Note: + + * If no JQL expression is provided, all issues are returned. + * `username` and `userkey` cannot be used as search terms due to privacy reasons. Use `accountId` instead. + * If a user has hidden their email address in their user profile, partial matches of the email address will not find the user. An exact match is required. +*/ + jql?: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. To manage page size, Jira may return fewer items per page where a large number of fields are requested. The greatest number of items returned per page is achieved when requesting `id` or `key` only. + */ + maxResults?: number; + /** +* Determines how to validate the JQL query and treat the validation results. Supported values are: + + * `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). + * `warn` Returns all errors as warnings. + * `none` No validation is performed. + * `true` *Deprecated* A legacy synonym for `strict`. + * `false` *Deprecated* A legacy synonym for `warn`. + +Note: If the JQL is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. +*/ + validateQuery?: "strict" | "warn" | "none" | "true" | "false"; + /** +* A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a comma-separated list. Expand options include: + + * `*all` Returns all fields. + * `*navigable` Returns navigable fields. + * Any issue field, prefixed with a minus to exclude. + +Examples: + + * `summary,comment` Returns only the summary and comments fields. + * `-description` Returns all navigable (default) fields except description. + * `*all,-comment` Returns all fields except comments. + +This parameter may be specified multiple times. For example, `fields=field1,field2&fields=field3`. + +Note: All navigable fields are returned by default. This differs from [GET issue](#api-rest-api-3-issue-issueIdOrKey-get) where the default is all fields. +*/ + fields?: string[]; + /** +* Use [expand](#expansion) to include additional information about issues in the response. This parameter accepts a comma-separated list. Expand options include: + + * `renderedFields` Returns field values rendered in HTML format. + * `names` Returns the display name of each field. + * `schema` Returns the schema describing a field type. + * `transitions` Returns all possible transitions for the issue. + * `operations` Returns all possible operations for the issue. + * `editmeta` Returns information about how each field can be edited. + * `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each version of a field's value, with the highest numbered item representing the most recent version. +*/ + expand?: string; + /** + * A list of issue property keys for issue properties to include in the results. This parameter accepts a comma-separated list. Multiple properties can also be provided using an ampersand separated list. For example, `properties=prop1,prop2&properties=prop3`. A maximum of 5 issue property keys can be specified. + */ + properties?: string[]; + /** + * Reference fields by their key (rather than ID). + */ + fieldsByKeys?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.searchForIssuesUsingJql({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Search for issues using JQL (POST) + * @request POST :/rest/api/3/search + * @allowrelaxedtypes + */ +export async function postRestSearchForIssuesUsingJqlPost( + /** Request body */ + data: SearchRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.searchForIssuesUsingJqlPost({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue security level + * @request GET :/rest/api/3/securitylevel/{id} + * @readonly + */ +export async function getRestGetIssueSecurityLevel( + /** + * The ID of the issue security level. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueSecurityLevel({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get Jira instance info + * @request GET :/rest/api/3/serverInfo + * @readonly + */ +export async function getRestGetServerInfo( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getServerInfo({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue navigator default columns + * @request GET :/rest/api/3/settings/columns + * @readonly + */ +export async function getRestGetIssueNavigatorDefaultColumns( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueNavigatorDefaultColumns({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set issue navigator default columns + * @request PUT :/rest/api/3/settings/columns + * @allowrelaxedtypes + */ +export async function putRestSetIssueNavigatorDefaultColumns( + /** Request body */ + data: string[], + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setIssueNavigatorDefaultColumns({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all statuses + * @request GET :/rest/api/3/status + * @readonly + */ +export async function getRestGetStatuses( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getStatuses({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get status + * @request GET :/rest/api/3/status/{idOrName} + * @readonly + */ +export async function getRestGetStatus( + /** + * The ID or name of the status. + */ + idOrName: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getStatus({ + idOrName: idOrName, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all status categories + * @request GET :/rest/api/3/statuscategory + * @readonly + */ +export async function getRestGetStatusCategories( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getStatusCategories({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get status category + * @request GET :/rest/api/3/statuscategory/{idOrKey} + * @readonly + */ +export async function getRestGetStatusCategory( + /** + * The ID or key of the status category. + */ + idOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getStatusCategory({ + idOrKey: idOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Bulk delete Statuses + * @request DELETE :/rest/api/3/statuses + * @allowrelaxedtypes + */ +export async function deleteRestDeleteStatusesById( + query: { + /** +* The list of status IDs. To include multiple IDs, provide an ampersand-separated list. For example, id=10000&id=10001. + +Min items `1`, Max items `50` +*/ + id?: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteStatusesById({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Bulk get statuses + * @request GET :/rest/api/3/statuses + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetStatusesById( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `usages` Returns the project and issue types that use the status in their workflow. +*/ + expand?: string; + /** +* The list of status IDs. To include multiple IDs, provide an ampersand-separated list. For example, id=10000&id=10001. + +Min items `1`, Max items `50` +*/ + id?: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getStatusesById({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Bulk create statuses + * @request POST :/rest/api/3/statuses + * @allowrelaxedtypes + */ +export async function postRestCreateStatuses( + /** Request body */ + data: StatusCreateRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createStatuses({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Bulk update statuses + * @request PUT :/rest/api/3/statuses + * @allowrelaxedtypes + */ +export async function putRestUpdateStatuses( + /** Request body */ + data: StatusUpdateRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateStatuses({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Search statuses paginated + * @request GET :/rest/api/3/statuses/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestSearch( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `usages` Returns the project and issue types that use the status in their workflow. +*/ + expand?: string; + /** + * The project the status is part of or null for global statuses. + */ + projectId?: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * Term to match status names against or null to search for all statuses in the search scope. + */ + searchString?: string; + /** + * Category of the status to filter by. The supported values are: `TODO`, `IN_PROGRESS`, and `DONE`. + */ + statusCategory?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.search({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get task + * @request GET :/rest/api/3/task/{taskId} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetTask( + /** + * The ID of the task. + */ + taskId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getTask({ + taskId: taskId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Cancel task + * @request POST :/rest/api/3/task/{taskId}/cancel + * @allowrelaxedtypes + */ +export async function postRestCancelTask( + /** + * The ID of the task. + */ + taskId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.cancelTask({ + taskId: taskId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get UI modifications + * @request GET :/rest/api/3/uiModifications + * @readonly + */ +export async function getRestGetUiModifications( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `data` Returns UI modification data. + * `contexts` Returns UI modification contexts. +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUiModifications({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create UI modification + * @request POST :/rest/api/3/uiModifications + */ +export async function postRestCreateUiModification( + /** Request body */ + data: CreateUiModificationDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createUiModification({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete UI modification + * @request DELETE :/rest/api/3/uiModifications/{uiModificationId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteUiModification( + /** + * The ID of the UI modification. + */ + uiModificationId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteUiModification({ + uiModificationId: uiModificationId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update UI modification + * @request PUT :/rest/api/3/uiModifications/{uiModificationId} + * @allowrelaxedtypes + */ +export async function putRestUpdateUiModification( + /** + * The ID of the UI modification. + */ + uiModificationId: string, + /** Request body */ + data: UpdateUiModificationDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateUiModification({ + uiModificationId: uiModificationId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get avatars + * @request GET :/rest/api/3/universal_avatar/type/{type}/owner/{entityId} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAvatars( + /** + * The avatar type. + */ + type: "project" | "issuetype", + /** + * The ID of the item the avatar is associated with. + */ + entityId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAvatars({ + type: type, + entityId: entityId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Load avatar + * @request POST :/rest/api/3/universal_avatar/type/{type}/owner/{entityId} + * @allowrelaxedtypes + */ +export async function postRestStoreAvatar( + query: { + /** + * The X coordinate of the top-left corner of the crop region. + */ + x?: number; + /** + * The Y coordinate of the top-left corner of the crop region. + */ + y?: number; + /** + * The length of each side of the crop region. + */ + size: number; + }, + /** + * The avatar type. + */ + type: "project" | "issuetype", + /** + * The ID of the item the avatar is associated with. + */ + entityId: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.storeAvatar({ + query: query, + type: type, + entityId: entityId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete avatar + * @request DELETE :/rest/api/3/universal_avatar/type/{type}/owner/{owningObjectId}/avatar/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteAvatar( + /** + * The avatar type. + */ + type: "project" | "issuetype", + /** + * The ID of the item the avatar is associated with. + */ + owningObjectId: string, + /** + * The ID of the avatar. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteAvatar({ + type: type, + owningObjectId: owningObjectId, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get avatar image by type + * @request GET :/rest/api/3/universal_avatar/view/type/{type} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAvatarImageByType( + query: { + /** + * The size of the avatar image. If not provided the default size is returned. + */ + size?: "xsmall" | "small" | "medium" | "large" | "xlarge"; + /** + * The format to return the avatar image in. If not provided the original content format is returned. + */ + format?: "png" | "svg"; + }, + /** + * The icon type of the avatar. + */ + type: "issuetype" | "project", + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAvatarImageByType({ + query: query, + type: type, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get avatar image by ID + * @request GET :/rest/api/3/universal_avatar/view/type/{type}/avatar/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAvatarImageById( + query: { + /** + * The size of the avatar image. If not provided the default size is returned. + */ + size?: "xsmall" | "small" | "medium" | "large" | "xlarge"; + /** + * The format to return the avatar image in. If not provided the original content format is returned. + */ + format?: "png" | "svg"; + }, + /** + * The icon type of the avatar. + */ + type: "issuetype" | "project", + /** + * The ID of the avatar. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAvatarImageById({ + query: query, + type: type, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get avatar image by owner + * @request GET :/rest/api/3/universal_avatar/view/type/{type}/owner/{entityId} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAvatarImageByOwner( + query: { + /** + * The size of the avatar image. If not provided the default size is returned. + */ + size?: "xsmall" | "small" | "medium" | "large" | "xlarge"; + /** + * The format to return the avatar image in. If not provided the original content format is returned. + */ + format?: "png" | "svg"; + }, + /** + * The icon type of the avatar. + */ + type: "issuetype" | "project", + /** + * The ID of the project or issue type the avatar belongs to. + */ + entityId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAvatarImageByOwner({ + query: query, + type: type, + entityId: entityId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete user + * @request DELETE :/rest/api/3/user + * @allowrelaxedtypes + */ +export async function deleteRestRemoveUser( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + key?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeUser({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get user + * @request GET :/rest/api/3/user + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetUser( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. Required. + */ + accountId?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide) for details. + */ + username?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide) for details. + */ + key?: string; + /** +* Use [expand](#expansion) to include additional information about users in the response. This parameter accepts a comma-separated list. Expand options include: + + * `groups` includes all groups and nested groups to which the user belongs. + * `applicationRoles` includes details of all the applications to which the user has access. +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUser({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create user + * @request POST :/rest/api/3/user + * @allowrelaxedtypes + */ +export async function postRestCreateUser( + /** Request body */ + data: NewUserDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createUser({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find users assignable to projects + * @request GET :/rest/api/3/user/assignable/multiProjectSearch + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindBulkAssignableUsers( + query: { + /** + * A query string that is matched against user attributes, such as `displayName` and `emailAddress`, to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. Required, unless `accountId` is specified. + */ + query?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. + */ + accountId?: string; + /** + * A list of project keys (case sensitive). This parameter accepts a comma-separated list. + */ + projectKeys: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findBulkAssignableUsers({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find users assignable to issues + * @request GET :/rest/api/3/user/assignable/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindAssignableUsers( + query: { + /** + * A query string that is matched against user attributes, such as `displayName`, and `emailAddress`, to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. Required, unless `username` or `accountId` is specified. + */ + query?: string; + /** + * The sessionId of this request. SessionId is the same until the assignee is set. + */ + sessionId?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. + */ + accountId?: string; + /** + * The project ID or project key (case sensitive). Required, unless `issueKey` is specified. + */ + project?: string; + /** + * The key of the issue. Required, unless `project` is specified. + */ + issueKey?: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return. This operation may return less than the maximum number of items even if more are available. The operation fetches users up to the maximum and then, from the fetched users, returns only the users that can be assigned to the issue. + */ + maxResults?: number; + /** + * The ID of the transition. + */ + actionDescriptorId?: number; + recommend?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findAssignableUsers({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Bulk get users + * @request GET :/rest/api/3/user/bulk + * @allowrelaxedtypes + * @readonly + */ +export async function getRestBulkGetUsers( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string[]; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + key?: string[]; + /** + * The account ID of a user. To specify multiple users, pass multiple `accountId` parameters. For example, `accountId=5b10a2844c20165700ede21g&accountId=5b10ac8d82e05b22cc7d4ef5`. + */ + accountId: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.bulkGetUsers({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get account IDs for users + * @request GET :/rest/api/3/user/bulk/migration + * @readonly + */ +export async function getRestBulkGetUsersMigration( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * Username of a user. To specify multiple users, pass multiple copies of this parameter. For example, `username=fred&username=barney`. Required if `key` isn't provided. Cannot be provided if `key` is present. + */ + username?: string[]; + /** + * Key of a user. To specify multiple users, pass multiple copies of this parameter. For example, `key=fred&key=barney`. Required if `username` isn't provided. Cannot be provided if `username` is present. + */ + key?: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.bulkGetUsersMigration({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Reset user default columns + * @request DELETE :/rest/api/3/user/columns + * @allowrelaxedtypes + */ +export async function deleteRestResetUserColumns( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.resetUserColumns({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get user default columns + * @request GET :/rest/api/3/user/columns + * @readonly + */ +export async function getRestGetUserDefaultColumns( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId?: string; + /** + * This parameter is no longer available See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUserDefaultColumns({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set user default columns + * @request PUT :/rest/api/3/user/columns + * @allowrelaxedtypes + */ +export async function putRestSetUserColumns( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId?: string; + }, + /** Request body */ + data: string[], + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setUserColumns({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get user email + * @request GET :/rest/api/3/user/email + * @readonly + */ +export async function getRestGetUserEmail( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, `5b10ac8d82e05b22cc7d4ef5`. + */ + accountId: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUserEmail({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get user email bulk + * @request GET :/rest/api/3/user/email/bulk + * @readonly + */ +export async function getRestGetUserEmailBulk( + query: { + /** + * The account IDs of the users for which emails are required. An `accountId` is an identifier that uniquely identifies the user across all Atlassian products. For example, `5b10ac8d82e05b22cc7d4ef5`. Note, this should be treated as an opaque identifier (that is, do not assume any structure in the value). + */ + accountId: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUserEmailBulk({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get user groups + * @request GET :/rest/api/3/user/groups + * @readonly + */ +export async function getRestGetUserGroups( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + key?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUserGroups({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find users with permissions + * @request GET :/rest/api/3/user/permission/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindUsersWithAllPermissions( + query: { + /** + * A query string that is matched against user attributes, such as `displayName` and `emailAddress`, to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. Required, unless `accountId` is specified. + */ + query?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. + */ + accountId?: string; + /** +* A comma separated list of permissions. Permissions can be specified as any: + + * permission returned by [Get all permissions](#api-rest-api-3-permissions-get). + * custom project permission added by Connect apps. + * (deprecated) one of the following: + + * ASSIGNABLE\_USER + * ASSIGN\_ISSUE + * ATTACHMENT\_DELETE\_ALL + * ATTACHMENT\_DELETE\_OWN + * BROWSE + * CLOSE\_ISSUE + * COMMENT\_DELETE\_ALL + * COMMENT\_DELETE\_OWN + * COMMENT\_EDIT\_ALL + * COMMENT\_EDIT\_OWN + * COMMENT\_ISSUE + * CREATE\_ATTACHMENT + * CREATE\_ISSUE + * DELETE\_ISSUE + * EDIT\_ISSUE + * LINK\_ISSUE + * MANAGE\_WATCHER\_LIST + * MODIFY\_REPORTER + * MOVE\_ISSUE + * PROJECT\_ADMIN + * RESOLVE\_ISSUE + * SCHEDULE\_ISSUE + * SET\_ISSUE\_SECURITY + * TRANSITION\_ISSUE + * VIEW\_VERSION\_CONTROL + * VIEW\_VOTERS\_AND\_WATCHERS + * VIEW\_WORKFLOW\_READONLY + * WORKLOG\_DELETE\_ALL + * WORKLOG\_DELETE\_OWN + * WORKLOG\_EDIT\_ALL + * WORKLOG\_EDIT\_OWN + * WORK\_ISSUE +*/ + permissions: string; + /** + * The issue key for the issue. + */ + issueKey?: string; + /** + * The project key for the project (case sensitive). + */ + projectKey?: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findUsersWithAllPermissions({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find users for picker + * @request GET :/rest/api/3/user/picker + * @readonly + */ +export async function getRestFindUsersForPicker( + query: { + /** + * A query string that is matched against user attributes, such as `displayName`, and `emailAddress`, to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. + */ + query: string; + /** + * The maximum number of items to return. The total number of matched users is returned in `total`. + */ + maxResults?: number; + /** + * Include the URI to the user's avatar. + */ + showAvatar?: boolean; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + exclude?: string[]; + /** + * A list of account IDs to exclude from the search results. This parameter accepts a comma-separated list. Multiple account IDs can also be provided using an ampersand-separated list. For example, `excludeAccountIds=5b10a2844c20165700ede21g,5b10a0effa615349cb016cd8&excludeAccountIds=5b10ac8d82e05b22cc7d4ef5`. Cannot be provided with `exclude`. + */ + excludeAccountIds?: string[]; + avatarSize?: string; + excludeConnectUsers?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findUsersForPicker({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get user property keys + * @request GET :/rest/api/3/user/properties + * @readonly + */ +export async function getRestGetUserPropertyKeys( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + userKey?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUserPropertyKeys({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete user property + * @request DELETE :/rest/api/3/user/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteUserProperty( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + userKey?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + }, + /** + * The key of the user's property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteUserProperty({ + query: query, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get user property + * @request GET :/rest/api/3/user/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetUserProperty( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + userKey?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + }, + /** + * The key of the user's property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUserProperty({ + query: query, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set user property + * @request PUT :/rest/api/3/user/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestSetUserProperty( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + userKey?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + }, + /** + * The key of the user's property. The maximum length is 255 characters. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setUserProperty({ + query: query, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Find users + * @request GET :/rest/api/3/user/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindUsers( + query: { + /** + * A query string that is matched against user attributes ( `displayName`, and `emailAddress`) to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. Required, unless `accountId` or `property` is specified. + */ + query?: string; + username?: string; + /** + * A query string that is matched exactly against a user `accountId`. Required, unless `query` or `property` is specified. + */ + accountId?: string; + /** + * The index of the first item to return in a page of filtered results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * A query string used to search properties. Property keys are specified by path, so property keys containing dot (.) or equals (=) characters cannot be used. The query string cannot be specified using a JSON object. Example: To search for the value of `nested` from `{"something":{"nested":1,"other":2}}` use `thepropertykey.something.nested=1`. Required, unless `accountId` or `query` is specified. + */ + property?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findUsers({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find users by query + * @request GET :/rest/api/3/user/search/query + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindUsersByQuery( + query: { + /** + * The search query. + */ + query: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findUsersByQuery({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find user keys by query + * @request GET :/rest/api/3/user/search/query/key + * @readonly + */ +export async function getRestFindUserKeysByQuery( + query: { + /** + * The search query. + */ + query: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findUserKeysByQuery({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find users with browse permission + * @request GET :/rest/api/3/user/viewissue/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindUsersWithBrowsePermission( + query: { + /** + * A query string that is matched against user attributes, such as `displayName` and `emailAddress`, to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. Required, unless `accountId` is specified. + */ + query?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. + */ + accountId?: string; + /** + * The issue key for the issue. Required, unless `projectKey` is specified. + */ + issueKey?: string; + /** + * The project key for the project (case sensitive). Required, unless `issueKey` is specified. + */ + projectKey?: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findUsersWithBrowsePermission({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all users default + * @request GET :/rest/api/3/users + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllUsersDefault( + query: { + /** + * The index of the first item to return. + */ + startAt?: number; + /** + * The maximum number of items to return. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllUsersDefault({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all users + * @request GET :/rest/api/3/users/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllUsers( + query: { + /** + * The index of the first item to return. + */ + startAt?: number; + /** + * The maximum number of items to return. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllUsers({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create version + * @request POST :/rest/api/3/version + */ +export async function postRestCreateVersion( + /** Request body */ + data: Version, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createVersion({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete version + * @request DELETE :/rest/api/3/version/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteVersion( + query: { + /** + * The ID of the version to update `fixVersion` to when the field contains the deleted version. The replacement version must be in the same project as the version being deleted and cannot be the version being deleted. + */ + moveFixIssuesTo?: string; + /** + * The ID of the version to update `affectedVersion` to when the field contains the deleted version. The replacement version must be in the same project as the version being deleted and cannot be the version being deleted. + */ + moveAffectedIssuesTo?: string; + }, + /** + * The ID of the version. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteVersion({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get version + * @request GET :/rest/api/3/version/{id} + * @readonly + */ +export async function getRestGetVersion( + query: { + /** +* Use [expand](#expansion) to include additional information about version in the response. This parameter accepts a comma-separated list. Expand options include: + + * `operations` Returns the list of operations available for this version. + * `issuesstatus` Returns the count of issues in this version for each of the status categories *to do*, *in progress*, *done*, and *unmapped*. The *unmapped* property represents the number of issues with a status other than *to do*, *in progress*, and *done*. +*/ + expand?: string; + }, + /** + * The ID of the version. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getVersion({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update version + * @request PUT :/rest/api/3/version/{id} + */ +export async function putRestUpdateVersion( + /** + * The ID of the version. + */ + id: string, + /** Request body */ + data: Version, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateVersion({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Merge versions + * @request PUT :/rest/api/3/version/{id}/mergeto/{moveIssuesTo} + * @allowrelaxedtypes + */ +export async function putRestMergeVersions( + /** + * The ID of the version to delete. + */ + id: string, + /** + * The ID of the version to merge into. + */ + moveIssuesTo: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.mergeVersions({ + id: id, + moveIssuesTo: moveIssuesTo, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Move version + * @request POST :/rest/api/3/version/{id}/move + * @allowrelaxedtypes + */ +export async function postRestMoveVersion( + /** + * The ID of the version to be moved. + */ + id: string, + /** Request body */ + data: VersionMoveBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.moveVersion({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get version's related issues count + * @request GET :/rest/api/3/version/{id}/relatedIssueCounts + * @readonly + */ +export async function getRestGetVersionRelatedIssues( + /** + * The ID of the version. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getVersionRelatedIssues({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete and replace version + * @request POST :/rest/api/3/version/{id}/removeAndSwap + * @allowrelaxedtypes + */ +export async function postRestDeleteAndReplaceVersion( + /** + * The ID of the version. + */ + id: string, + /** Request body */ + data: DeleteAndReplaceVersionBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteAndReplaceVersion({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get version's unresolved issues count + * @request GET :/rest/api/3/version/{id}/unresolvedIssueCount + * @readonly + */ +export async function getRestGetVersionUnresolvedIssues( + /** + * The ID of the version. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getVersionUnresolvedIssues({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete webhooks by ID + * @request DELETE :/rest/api/3/webhook + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWebhookById( + /** Request body */ + data: ContainerForWebhookIDs, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWebhookById({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.error) { + throw result.error; + } else { + return new hasuraSdk.JSONValue(result.data); + } +} + +/** + * Get dynamic webhooks for app + * @request GET :/rest/api/3/webhook + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetDynamicWebhooksForApp( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDynamicWebhooksForApp({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Register dynamic webhooks + * @request POST :/rest/api/3/webhook + * @allowrelaxedtypes + */ +export async function postRestRegisterDynamicWebhooks( + /** Request body */ + data: WebhookRegistrationDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.registerDynamicWebhooks({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get failed webhooks + * @request GET :/rest/api/3/webhook/failed + * @readonly + */ +export async function getRestGetFailedWebhooks( + query: { + /** + * The maximum number of webhooks to return per page. If obeying the maxResults directive would result in records with the same failure time being split across pages, the directive is ignored and all records with the same failure time included on the page. + */ + maxResults?: number; + /** + * The time after which any webhook failure must have occurred for the record to be returned, expressed as milliseconds since the UNIX epoch. + */ + after?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFailedWebhooks({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Extend webhook life + * @request PUT :/rest/api/3/webhook/refresh + */ +export async function putRestRefreshWebhooks( + /** Request body */ + data: ContainerForWebhookIDs, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.refreshWebhooks({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all workflows + * @request GET :/rest/api/3/workflow + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllWorkflows( + query: { + /** + * The name of the workflow to be returned. Only one workflow can be specified. + */ + workflowName?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllWorkflows({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create workflow + * @request POST :/rest/api/3/workflow + * @allowrelaxedtypes + */ +export async function postRestCreateWorkflow( + /** Request body */ + data: CreateWorkflowDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createWorkflow({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get workflow transition rule configurations + * @request GET :/rest/api/3/workflow/rule/config + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorkflowTransitionRuleConfigurations( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The types of the transition rules to return. + */ + types: ("postfunction" | "condition" | "validator")[]; + /** + * The transition rule class keys, as defined in the Connect app descriptor, of the transition rules to return. + */ + keys?: string[]; + /** + * EXPERIMENTAL: The list of workflow names to filter by. + */ + workflowNames?: string[]; + /** + * EXPERIMENTAL: The list of `tags` to filter by. + */ + withTags?: string[]; + /** + * EXPERIMENTAL: Whether draft or published workflows are returned. If not provided, both workflow types are returned. + */ + draft?: boolean; + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts `transition`, which, for each rule, returns information about the transition the rule is assigned to. + */ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowTransitionRuleConfigurations({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update workflow transition rule configurations + * @request PUT :/rest/api/3/workflow/rule/config + */ +export async function putRestUpdateWorkflowTransitionRuleConfigurations( + /** Request body */ + data: WorkflowTransitionRulesUpdate, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateWorkflowTransitionRuleConfigurations({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete workflow transition rule configurations + * @request PUT :/rest/api/3/workflow/rule/config/delete + */ +export async function putRestDeleteWorkflowTransitionRuleConfigurations( + /** Request body */ + data: WorkflowsWithTransitionRulesDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorkflowTransitionRuleConfigurations({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get workflows paginated + * @request GET :/rest/api/3/workflow/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorkflowsPaginated( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The name of a workflow to return. To include multiple workflows, provide an ampersand-separated list. For example, `workflowName=name1&workflowName=name2`. + */ + workflowName?: string[]; + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `transitions` For each workflow, returns information about the transitions inside the workflow. + * `transitions.rules` For each workflow transition, returns information about its rules. Transitions are included automatically if this expand is requested. + * `transitions.properties` For each workflow transition, returns information about its properties. Transitions are included automatically if this expand is requested. + * `statuses` For each workflow, returns information about the statuses inside the workflow. + * `statuses.properties` For each workflow status, returns information about its properties. Statuses are included automatically if this expand is requested. + * `default` For each workflow, returns information about whether this is the default workflow. + * `schemes` For each workflow, returns information about the workflow schemes the workflow is assigned to. + * `projects` For each workflow, returns information about the projects the workflow is assigned to, through workflow schemes. + * `hasDraftWorkflow` For each workflow, returns information about whether the workflow has a draft version. + * `operations` For each workflow, returns information about the actions that can be undertaken on the workflow. +*/ + expand?: string; + /** + * String used to perform a case-insensitive partial match with workflow name. + */ + queryString?: string; + /** +* [Order](#ordering) the results by a field: + + * `name` Sorts by workflow name. + * `created` Sorts by create time. + * `updated` Sorts by update time. +*/ + orderBy?: + | "name" + | "-name" + | "+name" + | "created" + | "-created" + | "+created" + | "updated" + | "+updated" + | "-updated"; + /** + * Filters active and inactive workflows. + */ + isActive?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowsPaginated({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete workflow transition property + * @request DELETE :/rest/api/3/workflow/transitions/{transitionId}/properties + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorkflowTransitionProperty( + query: { + /** + * The name of the transition property to delete, also known as the name of the property. + */ + key: string; + /** + * The name of the workflow that the transition belongs to. + */ + workflowName: string; + /** + * The workflow status. Set to `live` for inactive workflows or `draft` for draft workflows. Active workflows cannot be edited. + */ + workflowMode?: "live" | "draft"; + }, + /** + * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown next to the transition. + */ + transitionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorkflowTransitionProperty({ + query: query, + transitionId: transitionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get workflow transition properties + * @request GET :/rest/api/3/workflow/transitions/{transitionId}/properties + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorkflowTransitionProperties( + query: { + /** + * Some properties with keys that have the *jira.* prefix are reserved, which means they are not editable. To include these properties in the results, set this parameter to *true*. + */ + includeReservedKeys?: boolean; + /** + * The key of the property being returned, also known as the name of the property. If this parameter is not specified, all properties on the transition are returned. + */ + key?: string; + /** + * The name of the workflow that the transition belongs to. + */ + workflowName: string; + /** + * The workflow status. Set to *live* for active and inactive workflows, or *draft* for draft workflows. + */ + workflowMode?: "live" | "draft"; + }, + /** + * The ID of the transition. To get the ID, view the workflow in text mode in the Jira administration console. The ID is shown next to the transition. + */ + transitionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowTransitionProperties({ + query: query, + transitionId: transitionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create workflow transition property + * @request POST :/rest/api/3/workflow/transitions/{transitionId}/properties + * @allowrelaxedtypes + */ +export async function postRestCreateWorkflowTransitionProperty( + query: { + /** + * The key of the property being added, also known as the name of the property. Set this to the same value as the `key` defined in the request body. + */ + key: string; + /** + * The name of the workflow that the transition belongs to. + */ + workflowName: string; + /** + * The workflow status. Set to *live* for inactive workflows or *draft* for draft workflows. Active workflows cannot be edited. + */ + workflowMode?: "live" | "draft"; + }, + /** + * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown next to the transition. + */ + transitionId: number, + /** Request body */ + data: WorkflowTransitionProperty, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createWorkflowTransitionProperty({ + query: query, + transitionId: transitionId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update workflow transition property + * @request PUT :/rest/api/3/workflow/transitions/{transitionId}/properties + * @allowrelaxedtypes + */ +export async function putRestUpdateWorkflowTransitionProperty( + query: { + /** + * The key of the property being updated, also known as the name of the property. Set this to the same value as the `key` defined in the request body. + */ + key: string; + /** + * The name of the workflow that the transition belongs to. + */ + workflowName: string; + /** + * The workflow status. Set to `live` for inactive workflows or `draft` for draft workflows. Active workflows cannot be edited. + */ + workflowMode?: "live" | "draft"; + }, + /** + * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown next to the transition. + */ + transitionId: number, + /** Request body */ + data: WorkflowTransitionProperty, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateWorkflowTransitionProperty({ + query: query, + transitionId: transitionId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete inactive workflow + * @request DELETE :/rest/api/3/workflow/{entityId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteInactiveWorkflow( + /** + * The entity ID of the workflow. + */ + entityId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteInactiveWorkflow({ + entityId: entityId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get all workflow schemes + * @request GET :/rest/api/3/workflowscheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllWorkflowSchemes( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllWorkflowSchemes({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create workflow scheme + * @request POST :/rest/api/3/workflowscheme + * @allowrelaxedtypes + */ +export async function postRestCreateWorkflowScheme( + /** Request body */ + data: WorkflowScheme, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createWorkflowScheme({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get workflow scheme project associations + * @request GET :/rest/api/3/workflowscheme/project + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorkflowSchemeProjectAssociations( + query: { + /** + * The ID of a project to return the workflow schemes for. To include multiple projects, provide an ampersand-Jim: oneseparated list. For example, `projectId=10000&projectId=10001`. + */ + projectId: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowSchemeProjectAssociations({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Assign workflow scheme to project + * @request PUT :/rest/api/3/workflowscheme/project + * @allowrelaxedtypes + */ +export async function putRestAssignSchemeToProject( + /** Request body */ + data: WorkflowSchemeProjectAssociation, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.assignSchemeToProject({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete workflow scheme + * @request DELETE :/rest/api/3/workflowscheme/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorkflowScheme( + /** + * The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the URL as `schemeId`. For example, *schemeId=10301*. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorkflowScheme({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get workflow scheme + * @request GET :/rest/api/3/workflowscheme/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorkflowScheme( + query: { + /** + * Returns the workflow scheme's draft rather than scheme itself, if set to true. If the workflow scheme does not have a draft, then the workflow scheme is returned. + */ + returnDraftIfExists?: boolean; + }, + /** + * The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the URL as `schemeId`. For example, *schemeId=10301*. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowScheme({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update workflow scheme + * @request PUT :/rest/api/3/workflowscheme/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateWorkflowScheme( + /** + * The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the URL as `schemeId`. For example, *schemeId=10301*. + */ + id: number, + /** Request body */ + data: WorkflowScheme, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateWorkflowScheme({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create draft workflow scheme + * @request POST :/rest/api/3/workflowscheme/{id}/createdraft + * @allowrelaxedtypes + */ +export async function postRestCreateWorkflowSchemeDraftFromParent( + /** + * The ID of the active workflow scheme that the draft is created from. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createWorkflowSchemeDraftFromParent({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete default workflow + * @request DELETE :/rest/api/3/workflowscheme/{id}/default + * @allowrelaxedtypes + */ +export async function deleteRestDeleteDefaultWorkflow( + query: { + /** + * Set to true to create or update the draft of a workflow scheme and delete the mapping from the draft, when the workflow scheme cannot be edited. Defaults to `false`. + */ + updateDraftIfNeeded?: boolean; + }, + /** + * The ID of the workflow scheme. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteDefaultWorkflow({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get default workflow + * @request GET :/rest/api/3/workflowscheme/{id}/default + * @readonly + */ +export async function getRestGetDefaultWorkflow( + query: { + /** + * Set to `true` to return the default workflow for the workflow scheme's draft rather than scheme itself. If the workflow scheme does not have a draft, then the default workflow for the workflow scheme is returned. + */ + returnDraftIfExists?: boolean; + }, + /** + * The ID of the workflow scheme. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDefaultWorkflow({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update default workflow + * @request PUT :/rest/api/3/workflowscheme/{id}/default + * @allowrelaxedtypes + */ +export async function putRestUpdateDefaultWorkflow( + /** + * The ID of the workflow scheme. + */ + id: number, + /** Request body */ + data: DefaultWorkflow, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateDefaultWorkflow({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete draft workflow scheme + * @request DELETE :/rest/api/3/workflowscheme/{id}/draft + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorkflowSchemeDraft( + /** + * The ID of the active workflow scheme that the draft was created from. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorkflowSchemeDraft({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get draft workflow scheme + * @request GET :/rest/api/3/workflowscheme/{id}/draft + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorkflowSchemeDraft( + /** + * The ID of the active workflow scheme that the draft was created from. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowSchemeDraft({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update draft workflow scheme + * @request PUT :/rest/api/3/workflowscheme/{id}/draft + * @allowrelaxedtypes + */ +export async function putRestUpdateWorkflowSchemeDraft( + /** + * The ID of the active workflow scheme that the draft was created from. + */ + id: number, + /** Request body */ + data: WorkflowScheme, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateWorkflowSchemeDraft({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete draft default workflow + * @request DELETE :/rest/api/3/workflowscheme/{id}/draft/default + * @allowrelaxedtypes + */ +export async function deleteRestDeleteDraftDefaultWorkflow( + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteDraftDefaultWorkflow({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get draft default workflow + * @request GET :/rest/api/3/workflowscheme/{id}/draft/default + * @readonly + */ +export async function getRestGetDraftDefaultWorkflow( + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDraftDefaultWorkflow({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update draft default workflow + * @request PUT :/rest/api/3/workflowscheme/{id}/draft/default + * @allowrelaxedtypes + */ +export async function putRestUpdateDraftDefaultWorkflow( + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + /** Request body */ + data: DefaultWorkflow, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateDraftDefaultWorkflow({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete workflow for issue type in draft workflow scheme + * @request DELETE :/rest/api/3/workflowscheme/{id}/draft/issuetype/{issueType} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorkflowSchemeDraftIssueType( + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + /** + * The ID of the issue type. + */ + issueType: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorkflowSchemeDraftIssueType({ + id: id, + issueType: issueType, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get workflow for issue type in draft workflow scheme + * @request GET :/rest/api/3/workflowscheme/{id}/draft/issuetype/{issueType} + * @readonly + */ +export async function getRestGetWorkflowSchemeDraftIssueType( + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + /** + * The ID of the issue type. + */ + issueType: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowSchemeDraftIssueType({ + id: id, + issueType: issueType, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set workflow for issue type in draft workflow scheme + * @request PUT :/rest/api/3/workflowscheme/{id}/draft/issuetype/{issueType} + * @allowrelaxedtypes + */ +export async function putRestSetWorkflowSchemeDraftIssueType( + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + /** + * The ID of the issue type. + */ + issueType: string, + /** Request body */ + data: IssueTypeWorkflowMapping, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setWorkflowSchemeDraftIssueType({ + id: id, + issueType: issueType, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Publish draft workflow scheme + * @request POST :/rest/api/3/workflowscheme/{id}/draft/publish + * @allowrelaxedtypes + */ +export async function postRestPublishDraftWorkflowScheme( + query: { + /** + * Whether the request only performs a validation. + */ + validateOnly?: boolean; + }, + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + /** Request body */ + data: PublishDraftWorkflowScheme, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.publishDraftWorkflowScheme({ + query: query, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.error) { + throw result.error; + } else { + return new hasuraSdk.JSONValue(result.data); + } +} + +/** + * Delete issue types for workflow in draft workflow scheme + * @request DELETE :/rest/api/3/workflowscheme/{id}/draft/workflow + * @allowrelaxedtypes + */ +export async function deleteRestDeleteDraftWorkflowMapping( + query: { + /** + * The name of the workflow. + */ + workflowName: string; + }, + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteDraftWorkflowMapping({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue types for workflows in draft workflow scheme + * @request GET :/rest/api/3/workflowscheme/{id}/draft/workflow + * @readonly + */ +export async function getRestGetDraftWorkflow( + query: { + /** + * The name of a workflow in the scheme. Limits the results to the workflow-issue type mapping for the specified workflow. + */ + workflowName?: string; + }, + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDraftWorkflow({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set issue types for workflow in workflow scheme + * @request PUT :/rest/api/3/workflowscheme/{id}/draft/workflow + * @allowrelaxedtypes + */ +export async function putRestUpdateDraftWorkflowMapping( + query: { + /** + * The name of the workflow. + */ + workflowName: string; + }, + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + /** Request body */ + data: IssueTypesWorkflowMapping, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateDraftWorkflowMapping({ + query: query, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete workflow for issue type in workflow scheme + * @request DELETE :/rest/api/3/workflowscheme/{id}/issuetype/{issueType} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorkflowSchemeIssueType( + query: { + /** + * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the workflow scheme cannot be edited. Defaults to `false`. + */ + updateDraftIfNeeded?: boolean; + }, + /** + * The ID of the workflow scheme. + */ + id: number, + /** + * The ID of the issue type. + */ + issueType: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorkflowSchemeIssueType({ + query: query, + id: id, + issueType: issueType, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get workflow for issue type in workflow scheme + * @request GET :/rest/api/3/workflowscheme/{id}/issuetype/{issueType} + * @readonly + */ +export async function getRestGetWorkflowSchemeIssueType( + query: { + /** + * Returns the mapping from the workflow scheme's draft rather than the workflow scheme, if set to true. If no draft exists, the mapping from the workflow scheme is returned. + */ + returnDraftIfExists?: boolean; + }, + /** + * The ID of the workflow scheme. + */ + id: number, + /** + * The ID of the issue type. + */ + issueType: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowSchemeIssueType({ + query: query, + id: id, + issueType: issueType, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set workflow for issue type in workflow scheme + * @request PUT :/rest/api/3/workflowscheme/{id}/issuetype/{issueType} + * @allowrelaxedtypes + */ +export async function putRestSetWorkflowSchemeIssueType( + /** + * The ID of the workflow scheme. + */ + id: number, + /** + * The ID of the issue type. + */ + issueType: string, + /** Request body */ + data: IssueTypeWorkflowMapping, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setWorkflowSchemeIssueType({ + id: id, + issueType: issueType, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete issue types for workflow in workflow scheme + * @request DELETE :/rest/api/3/workflowscheme/{id}/workflow + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorkflowMapping( + query: { + /** + * The name of the workflow. + */ + workflowName: string; + /** + * Set to true to create or update the draft of a workflow scheme and delete the mapping from the draft, when the workflow scheme cannot be edited. Defaults to `false`. + */ + updateDraftIfNeeded?: boolean; + }, + /** + * The ID of the workflow scheme. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorkflowMapping({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue types for workflows in workflow scheme + * @request GET :/rest/api/3/workflowscheme/{id}/workflow + * @readonly + */ +export async function getRestGetWorkflow( + query: { + /** + * The name of a workflow in the scheme. Limits the results to the workflow-issue type mapping for the specified workflow. + */ + workflowName?: string; + /** + * Returns the mapping from the workflow scheme's draft rather than the workflow scheme, if set to true. If no draft exists, the mapping from the workflow scheme is returned. + */ + returnDraftIfExists?: boolean; + }, + /** + * The ID of the workflow scheme. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflow({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set issue types for workflow in workflow scheme + * @request PUT :/rest/api/3/workflowscheme/{id}/workflow + * @allowrelaxedtypes + */ +export async function putRestUpdateWorkflowMapping( + query: { + /** + * The name of the workflow. + */ + workflowName: string; + }, + /** + * The ID of the workflow scheme. + */ + id: number, + /** Request body */ + data: IssueTypesWorkflowMapping, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateWorkflowMapping({ + query: query, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get IDs of deleted worklogs + * @request GET :/rest/api/3/worklog/deleted + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIdsOfWorklogsDeletedSince( + query: { + /** + * The date and time, as a UNIX timestamp in milliseconds, after which deleted worklogs are returned. + */ + since?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIdsOfWorklogsDeletedSince({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get worklogs + * @request POST :/rest/api/3/worklog/list + * @allowrelaxedtypes + */ +export async function postRestGetWorklogsForIds( + query: { + /** + * Use [expand](#expansion) to include additional information about worklogs in the response. This parameter accepts `properties` that returns the properties of each worklog. + */ + expand?: string; + }, + /** Request body */ + data: WorklogIdsRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorklogsForIds({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get IDs of updated worklogs + * @request GET :/rest/api/3/worklog/updated + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIdsOfWorklogsModifiedSince( + query: { + /** + * The date and time, as a UNIX timestamp in milliseconds, after which updated worklogs are returned. + */ + since?: number; + /** + * Use [expand](#expansion) to include additional information about worklogs in the response. This parameter accepts `properties` that returns the properties of each worklog. + */ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIdsOfWorklogsModifiedSince({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get app properties + * @request GET :/rest/atlassian-connect/1/addons/{addonKey}/properties + * @readonly + */ +export async function getRestAddonPropertiesResourceGetAddonPropertiesGet( + /** + * The key of the app, as defined in its descriptor. + */ + addonKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addonPropertiesResourceGetAddonPropertiesGet({ + addonKey: addonKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete app property + * @request DELETE :/rest/atlassian-connect/1/addons/{addonKey}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestAddonPropertiesResourceDeleteAddonPropertyDelete( + /** + * The key of the app, as defined in its descriptor. + */ + addonKey: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.rest.addonPropertiesResourceDeleteAddonPropertyDelete({ + addonKey: addonKey, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.error) { + throw result.error; + } else { + return new hasuraSdk.JSONValue(result.data); + } +} + +/** + * Get app property + * @request GET :/rest/atlassian-connect/1/addons/{addonKey}/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestAddonPropertiesResourceGetAddonPropertyGet( + /** + * The key of the app, as defined in its descriptor. + */ + addonKey: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addonPropertiesResourceGetAddonPropertyGet({ + addonKey: addonKey, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set app property + * @request PUT :/rest/atlassian-connect/1/addons/{addonKey}/properties/{propertyKey} + */ +export async function putRestAddonPropertiesResourcePutAddonPropertyPut( + /** + * The key of the app, as defined in its descriptor. + */ + addonKey: string, + /** + * The key of the property. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addonPropertiesResourcePutAddonPropertyPut({ + addonKey: addonKey, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Remove modules + * @request DELETE :/rest/atlassian-connect/1/app/module/dynamic + * @allowrelaxedtypes + */ +export async function deleteRestDynamicModulesResourceRemoveModulesDelete( + query: { + /** +* The key of the module to remove. To include multiple module keys, provide multiple copies of this parameter. +For example, `moduleKey=dynamic-attachment-entity-property&moduleKey=dynamic-select-field`. +Nonexistent keys are ignored. +*/ + moduleKey?: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.dynamicModulesResourceRemoveModulesDelete({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.error) { + throw result.error; + } else { + return new hasuraSdk.JSONValue(result.data); + } +} + +/** + * Get modules + * @request GET :/rest/atlassian-connect/1/app/module/dynamic + * @allowrelaxedtypes + * @readonly + */ +export async function getRestDynamicModulesResourceGetModulesGet( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.dynamicModulesResourceGetModulesGet({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Register modules + * @request POST :/rest/atlassian-connect/1/app/module/dynamic + * @allowrelaxedtypes + */ +export async function postRestDynamicModulesResourceRegisterModulesPost( + /** Request body */ + data: ConnectModules, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.dynamicModulesResourceRegisterModulesPost({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.error) { + throw result.error; + } else { + return new hasuraSdk.JSONValue(result.data); + } +} + +/** + * Bulk update custom field value + * @request PUT :/rest/atlassian-connect/1/migration/field + * @allowrelaxedtypes + */ +export async function putRestAppIssueFieldValueUpdateResourceUpdateIssueFieldsPut( + /** Request body */ + data: ConnectCustomFieldValues, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.rest.appIssueFieldValueUpdateResourceUpdateIssueFieldsPut({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Bulk update entity properties + * @request PUT :/rest/atlassian-connect/1/migration/properties/{entityType} + * @allowrelaxedtypes + */ +export async function putRestMigrationResourceUpdateEntityPropertiesValuePut( + /** + * The type indicating the object that contains the entity properties. + */ + entityType: + | "IssueProperty" + | "CommentProperty" + | "DashboardItemProperty" + | "IssueTypeProperty" + | "ProjectProperty" + | "UserProperty" + | "WorklogProperty" + | "BoardProperty" + | "SprintProperty", + /** Request body */ + data: EntityPropertyDetails[], + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.migrationResourceUpdateEntityPropertiesValuePut( + { + entityType: entityType, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get workflow transition rule configurations + * @request POST :/rest/atlassian-connect/1/migration/workflow/rule/search + */ +export async function postRestMigrationResourceWorkflowRuleSearchPost( + /** Request body */ + data: WorkflowRulesSearch, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.migrationResourceWorkflowRuleSearchPost({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} diff --git a/src/app/parser/typescript/test-data/cleanup-tests/atlassian-jira/test b/src/app/parser/typescript/test-data/cleanup-tests/atlassian-jira/test new file mode 100644 index 0000000..095b89f --- /dev/null +++ b/src/app/parser/typescript/test-data/cleanup-tests/atlassian-jira/test @@ -0,0 +1,16081 @@ +import { + NotificationSchemeEventDetails, + GroupName, + FieldConfigurationToIssueTypeMapping, + UserDetails, + AttachmentArchiveEntry, + AttachmentArchiveItemReadable, + User, + AssociatedItemBean, + ChangedValueBean, + AuditRecordBean, + AutoCompleteSuggestion, + AvailableDashboardGadget, + Avatar, + CustomFieldOptionCreate, + CustomFieldOptionUpdate, + IssueFilterForBulkPropertySet, + ErrorCollection, + BulkProjectPermissionGrants, + BulkProjectPermissions, + EntityProperty, + ChangedWorklog, + HistoryMetadata, + ChangeDetails, + Visibility, + JqlQueryClause, + TimeTrackingConfiguration, + ConnectCustomFieldValue, + ConnectModule, + RuleConfiguration, + WorkflowTransition, + ProjectFeature, + RegisteredWebhook, + WorkflowSchemeAssociations, + Scope, + JQLQueryWithUnknownUsers, + UiModificationContextDetails, + CreateWorkflowCondition, + CreateWorkflowStatusDetails, + CreateWorkflowTransitionDetails, + CreateWorkflowTransitionRulesDetails, + CreateWorkflowTransitionScreenDetails, + CreateWorkflowTransitionRule, + NestedResponse, + BulkOperationErrorResult, + CreatedIssue, + BaseCustomContextVariable, + BaseCustomContextVariableTypeMapping, + IssueContextVariable, + JsonContextVariable, + UserContextVariable, + ContextualConfiguration, + BaseCustomFieldContextDefaultValue, + BaseCustomFieldContextDefaultValueTypeMapping, + CustomFieldContextDefaultValueDate, + CustomFieldContextDefaultValueDateTime, + CustomFieldContextDefaultValueFloat, + CustomFieldContextDefaultValueForgeDateTimeField, + CustomFieldContextDefaultValueForgeGroupField, + CustomFieldContextDefaultValueForgeMultiGroupField, + CustomFieldContextDefaultValueForgeNumberField, + CustomFieldContextDefaultValueForgeObjectField, + CustomFieldContextDefaultValueForgeStringField, + CustomFieldContextDefaultValueForgeMultiStringField, + CustomFieldContextDefaultValueForgeUserField, + CustomFieldContextDefaultValueForgeMultiUserField, + CustomFieldContextDefaultValueMultipleGroupPicker, + CustomFieldContextDefaultValueSingleGroupPicker, + CustomFieldContextDefaultValueLabels, + CustomFieldContextDefaultValueMultiUserPicker, + CustomFieldContextDefaultValueCascadingOption, + CustomFieldContextDefaultValueMultipleOption, + CustomFieldContextDefaultValueSingleOption, + CustomFieldContextDefaultValueProject, + CustomFieldContextDefaultValueReadOnly, + CustomFieldContextSingleUserPickerDefaults, + CustomFieldContextDefaultValueTextArea, + CustomFieldContextDefaultValueTextField, + CustomFieldContextDefaultValueURL, + CustomFieldContextDefaultValueMultipleVersionPicker, + CustomFieldContextDefaultValueSingleVersionPicker, + UserFilter, + CustomFieldContextDefaultValue, + CustomFieldContextOption, + CustomFieldValueUpdate, + SharePermission, + UserBean, + DashboardGadgetPosition, + DashboardGadget, + CustomFieldReplacement, + FieldDetails, + FailedWebhook, + FieldLastUsed, + JsonTypeBean, + JqlQueryField, + JqlQueryClauseTimePredicate, + FieldConfigurationItem, + FieldConfigurationScheme, + JqlQueryClauseOperand, + IssueTypeDetails, + Priority, + StatusDetails, + TimeTrackingDetails, + UserList, + FilterSubscriptionsList, + FilterSubscription, + GroupLabel, + FoundGroup, + UserPickerUser, + FoundGroups, + FoundUsers, + PagedListUserDetailsApplicationUser, + SimplifiedHierarchyLevel, + HistoryMetadataParticipant, + PageOfChangelogs, + IssueUpdateMetadata, + IncludedFields, + Operations, + IssueTransition, + ProjectIssueCreateMetadata, + JsonNode, + IssueFieldOptionConfiguration, + IssueFieldOptionScopeBean, + GlobalScopeBean, + ProjectScopeBean, + LinkedIssue, + IssueLinkType, + IssueMatchesForJQL, + IssuePickerSuggestionsIssueType, + SuggestedIssue, + PermissionHolder, + FieldMetadata, + IssueTypeScheme, + IssueTypeScreenSchemeMapping, + IssueTypeScreenScheme, + FieldUpdateOperation, + IssuesJqlMetaDataBean, + IssueUpdateDetails, + FieldReferenceData, + FunctionReferenceData, + JexpJqlIssues, + JiraExpressionComplexity, + JiraExpressionValidationError, + CustomContextVariable, + IdOrKeyBean, + JexpIssues, + JiraExpressionEvalContextBean, + JiraExpressionsComplexityBean, + IssuesMetaBean, + JiraExpressionEvaluationMetaDataBean, + JiraExpressionAnalysis, + JiraExpressionsComplexityValueBean, + StatusScope, + ProjectIssueTypes, + JqlFunctionPrecomputationUpdateBean, + JqlQueryToSanitize, + JqlQueryOrderByClause, + CompoundClause, + FieldValueClause, + FieldWasClause, + FieldChangedClause, + ListOperand, + ValueOperand, + FunctionOperand, + KeywordOperand, + JqlQueryFieldEntityProperty, + JqlQueryOrderByClauseElement, + LicensedApplication, + LinkGroup, + SimpleLink, + Comment, + Fields, + JqlQueryUnitaryOperand, + IssueEntityPropertiesForMultiUpdate, + MultipleCustomFieldValuesUpdate, + WarningCollection, + NotificationRecipientsRestrictions, + NotificationRecipients, + NotificationEvent, + RestrictedPermission, + NotificationSchemeEvent, + EventNotification, + NotificationSchemeEventTypeId, + NotificationSchemeNotificationDetails, + Changelog, + ComponentWithIssueCount, + Context, + ContextForProjectAndIssueType, + CustomFieldContext, + CustomFieldContextProjectMapping, + Dashboard, + Field, + FieldConfigurationDetails, + FieldConfigurationIssueTypeItem, + FieldConfigurationSchemeProjects, + FilterDetails, + GroupDetails, + IssueFieldOption, + IssueSecurityLevelMember, + IssueTypeSchemeMapping, + IssueTypeSchemeProjects, + IssueTypeScreenSchemeItem, + IssueTypeScreenSchemesProjects, + IssueTypeToContextMapping, + JqlFunctionPrecomputationBean, + NotificationScheme, + NotificationSchemeAndProjectMappingJsonBean, + Project, + ProjectDetails, + ResolutionJsonBean, + Screen, + ScreenScheme, + ScreenWithTab, + UiModificationDetails, + UserKey, + Version, + Webhook, + Workflow, + WorkflowScheme, + WorkflowTransitionRules, + JiraStatus, + Worklog, + ParsedJqlQuery, + JqlQuery, + PermissionGrant, + PermissionScheme, + UserPermission, + ProjectIdentifierBean, + AvatarUrlsBean, + ProjectComponent, + ProjectInsight, + Hierarchy, + ProjectLandingPageInfo, + ProjectPermissions, + ProjectCategory, + UpdatedProjectCategory, + IssueTypeIssueCreateMetadata, + SecurityLevel, + ProjectIssueTypesHierarchyLevel, + ProjectIssueTypeMapping, + ProjectId, + IssueTypeInfo, + RoleActor, + PropertyKey, + StatusMapping, + Application, + RemoteObject, + Icon, + Status, + SimpleErrorCollection, + ProjectRoleGroup, + ProjectRoleUser, + SanitizedJqlQuery, + PageBeanIssueTypeScreenScheme, + ScreenTypes, + ScreenableTab, + IssueBean, + SecurityScheme, + HealthCheckResult, + ListWrapperCallbackApplicationRole, + ApplicationRole, + ListWrapperCallbackGroupName, + StatusCreate, + StatusCategory, + StatusUpdate, + RemoveOptionFromIssuesResult, + WorkflowRules, + TransitionScreenDetails, + UpdateScreenTypes, + SimpleListWrapperApplicationRole, + SimpleListWrapperGroupName, + UserBeanAvatarUrls, + VersionIssuesStatus, + VersionUsageInCustomField, + WebhookDetails, + PublishedWorkflowId, + WorkflowOperations, + WorkflowSchemeIdName, + WorkflowStatus, + Transition, + WorkflowCondition, + BaseWorkflowCondition, + BaseWorkflowConditionNodeTypeMapping, + WorkflowCompoundCondition, + WorkflowSimpleCondition, + WorkflowTransitionRule, + ConnectWorkflowTransitionRule, + WorkflowId, + WorkflowTransitionRulesUpdateErrorDetails, + WorkflowTransitionRulesDetails, + AnnouncementBannerConfiguration, + ActorInputBean, + ActorsMap, + AddFieldBean, + AddGroupBean, + AddNotificationsDetails, + AnnouncementBannerConfigurationUpdate, + ApplicationProperty, + AssociateFieldConfigurationsWithIssueTypesRequest, + Attachment, + AttachmentArchive, + AttachmentArchiveImpl, + AttachmentArchiveMetadataReadable, + AttachmentMetadata, + AttachmentSettings, + AuditRecords, + AutoCompleteSuggestions, + AvailableDashboardGadgetsResponse, + Avatars, + BulkCustomFieldOptionCreateRequest, + BulkCustomFieldOptionUpdateRequest, + BulkIssueIsWatching, + BulkIssuePropertyUpdateRequest, + BulkPermissionGrants, + BulkPermissionsRequestBean, + ChangeFilterOwner, + ChangedWorklogs, + ColumnItem, + ComponentIssuesCount, + Configuration, + ConnectCustomFieldValues, + ConnectModules, + ContainerForProjectFeatures, + ContainerForRegisteredWebhooks, + ContainerForWebhookIDs, + ContainerOfWorkflowSchemeAssociations, + ConvertedJQLQueries, + CreateCustomFieldContext, + CreateNotificationSchemeDetails, + CreatePriorityDetails, + CreateProjectDetails, + CreateResolutionDetails, + CreateUiModificationDetails, + CreateUpdateRoleRequestBean, + CreateWorkflowDetails, + CreatedIssues, + CustomFieldConfigurations, + CustomFieldContextDefaultValueUpdate, + CustomFieldContextUpdateDetails, + CustomFieldCreatedContextOptionsList, + CustomFieldDefinitionJsonBean, + CustomFieldOption, + CustomFieldUpdatedContextOptionsList, + CustomFieldValueUpdateDetails, + DashboardDetails, + DashboardGadgetResponse, + DashboardGadgetSettings, + DashboardGadgetUpdateRequest, + DefaultShareScope, + DefaultWorkflow, + DeleteAndReplaceVersionBean, + DeprecatedWorkflow, + EntityPropertyDetails, + ErrorMessage, + FailedWebhooks, + FieldConfiguration, + FieldConfigurationItemsDetails, + FieldConfigurationSchemeProjectAssociation, + Filter, + FoundUsersAndGroups, + IconBean, + IdBean, + IssueChangelogIds, + IssueCommentListRequestBean, + IssueCreateMetadata, + IssueEntityProperties, + IssueEvent, + IssueFieldOptionCreateBean, + IssueFilterForBulkPropertyDelete, + IssueLink, + IssueLinkTypes, + IssueList, + IssueMatches, + IssuePickerSuggestions, + IssueTypeCreateBean, + IssueTypeIds, + IssueTypeIdsToRemove, + IssueTypeSchemeDetails, + IssueTypeSchemeID, + IssueTypeSchemeProjectAssociation, + IssueTypeSchemeUpdateDetails, + IssueTypeScreenSchemeDetails, + IssueTypeScreenSchemeId, + IssueTypeScreenSchemeMappingDetails, + IssueTypeScreenSchemeProjectAssociation, + IssueTypeScreenSchemeUpdateDetails, + IssueTypeUpdateBean, + IssueTypeWithStatus, + IssueTypeWorkflowMapping, + IssueTypesWorkflowMapping, + IssuesAndJQLQueries, + IssuesUpdateBean, + JQLPersonalDataMigrationRequest, + JQLReferenceData, + JiraExpressionEvalRequestBean, + JiraExpressionForAnalysis, + JiraExpressionResult, + JiraExpressionsAnalysis, + JqlFunctionPrecomputationUpdateRequestBean, + JqlQueriesToParse, + JqlQueriesToSanitize, + License, + LicenseMetric, + LinkIssueRequestJsonBean, + Locale, + MoveFieldBean, + MultiIssueEntityProperties, + MultipleCustomFieldValuesUpdateDetails, + NewUserDetails, + Notification, + NotificationSchemeId, + OperationMessage, + OrderOfCustomFieldOptions, + OrderOfIssueTypes, + PageBeanChangelog, + PageBeanComment, + PageBeanComponentWithIssueCount, + PageBeanContext, + PageBeanContextForProjectAndIssueType, + PageBeanContextualConfiguration, + PageBeanCustomFieldContext, + PageBeanCustomFieldContextDefaultValue, + PageBeanCustomFieldContextOption, + PageBeanCustomFieldContextProjectMapping, + PageBeanDashboard, + PageBeanField, + PageBeanFieldConfigurationDetails, + PageBeanFieldConfigurationIssueTypeItem, + PageBeanFieldConfigurationItem, + PageBeanFieldConfigurationScheme, + PageBeanFieldConfigurationSchemeProjects, + PageBeanFilterDetails, + PageBeanGroupDetails, + PageBeanIssueFieldOption, + PageBeanIssueSecurityLevelMember, + PageBeanIssueTypeScheme, + PageBeanIssueTypeSchemeMapping, + PageBeanIssueTypeSchemeProjects, + PageBeanIssueTypeScreenSchemeItem, + PageBeanIssueTypeScreenSchemesProjects, + PageBeanIssueTypeToContextMapping, + PageBeanJqlFunctionPrecomputationBean, + PageBeanNotificationScheme, + PageBeanNotificationSchemeAndProjectMappingJsonBean, + PageBeanPriority, + PageBeanProject, + PageBeanProjectDetails, + PageBeanResolutionJsonBean, + PageBeanScreen, + PageBeanScreenScheme, + PageBeanScreenWithTab, + PageBeanString, + PageBeanUiModificationDetails, + PageBeanUser, + PageBeanUserDetails, + PageBeanUserKey, + PageBeanVersion, + PageBeanWebhook, + PageBeanWorkflow, + PageBeanWorkflowScheme, + PageBeanWorkflowTransitionRules, + PageOfComments, + PageOfDashboards, + PageOfStatuses, + PageOfWorklogs, + PaginatedResponseComment, + ParsedJqlQueries, + PermissionGrants, + PermissionSchemes, + Permissions, + PermissionsKeysBean, + PermittedProjects, + PriorityId, + ProjectAvatars, + ProjectEmailAddress, + ProjectFeatureState, + ProjectIdentifiers, + ProjectIds, + ProjectIssueSecurityLevels, + ProjectIssueTypeHierarchy, + ProjectIssueTypeMappings, + ProjectRoleActorsUpdateBean, + ProjectRoleDetails, + ProjectType, + PropertyKeys, + PublishDraftWorkflowScheme, + RemoteIssueLink, + RemoteIssueLinkIdentifies, + RemoteIssueLinkRequest, + ReorderIssuePriorities, + ReorderIssueResolutionsRequest, + Resolution, + ResolutionId, + RichText, + SanitizedJqlQueries, + ScreenDetails, + ScreenSchemeDetails, + ScreenSchemeId, + ScreenableField, + SearchAutoCompleteFilter, + SearchRequestBean, + SearchResults, + SecuritySchemes, + ServerInformation, + ServiceManagementNavigationInfo, + SetDefaultPriorityRequest, + SetDefaultResolutionRequest, + SharePermissionInputBean, + SimpleApplicationPropertyBean, + SoftwareNavigationInfo, + StatusCreateRequest, + StatusUpdateRequest, + StringList, + SystemAvatars, + TaskProgressBeanObject, + TaskProgressBeanRemoveOptionFromIssuesResult, + TimeTrackingProvider, + Transitions, + UiModificationIdentifiers, + UnrestrictedUserEmail, + UpdateCustomFieldDetails, + UpdateDefaultScreenScheme, + UpdateFieldConfigurationSchemeDetails, + UpdateNotificationSchemeDetails, + UpdatePriorityDetails, + UpdateProjectDetails, + UpdateResolutionDetails, + UpdateScreenDetails, + UpdateScreenSchemeDetails, + UpdateUiModificationDetails, + UpdateUserToGroupBean, + UserMigrationBean, + VersionIssueCounts, + VersionMoveBean, + VersionUnresolvedIssuesCount, + Votes, + Watchers, + WebhookRegistrationDetails, + WebhooksExpirationDate, + WorkManagementNavigationInfo, + WorkflowIDs, + WorkflowRulesSearch, + WorkflowRulesSearchDetails, + WorkflowSchemeProjectAssociation, + WorkflowTransitionProperty, + WorkflowTransitionRulesUpdate, + WorkflowTransitionRulesUpdateErrors, + WorkflowsWithTransitionRulesDetails, + WorklogIdsRequestBean, + Api, +} from "./api"; +import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; + +const api = new Api({ + baseUrl: "", +}); + +/** + * Get announcement banner configuration + * @request GET :/rest/api/3/announcementBanner + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetBanner( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getBanner({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update announcement banner configuration + * @request PUT :/rest/api/3/announcementBanner + * @allowrelaxedtypes + */ +export async function putRestSetBanner( + /** Request body */ + data: AnnouncementBannerConfigurationUpdate, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setBanner({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update custom fields + * @request POST :/rest/api/3/app/field/value + * @allowrelaxedtypes + */ +export async function postRestUpdateMultipleCustomFieldValues( + query: { + /** + * Whether to generate a changelog for this update. + */ + generateChangelog?: boolean; + }, + /** Request body */ + data: MultipleCustomFieldValuesUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateMultipleCustomFieldValues({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get custom field configurations + * @request GET :/rest/api/3/app/field/{fieldIdOrKey}/context/configuration + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetCustomFieldConfiguration( + query: { + /** + * The list of configuration IDs. To include multiple configurations, separate IDs with an ampersand: `id=10000&id=10001`. Can't be provided with `fieldContextId`, `issueId`, `projectKeyOrId`, or `issueTypeId`. + */ + id?: number[]; + /** + * The list of field context IDs. To include multiple field contexts, separate IDs with an ampersand: `fieldContextId=10000&fieldContextId=10001`. Can't be provided with `id`, `issueId`, `projectKeyOrId`, or `issueTypeId`. + */ + fieldContextId?: number[]; + /** + * The ID of the issue to filter results by. If the issue doesn't exist, an empty list is returned. Can't be provided with `projectKeyOrId`, or `issueTypeId`. + */ + issueId?: number; + /** + * The ID or key of the project to filter results by. Must be provided with `issueTypeId`. Can't be provided with `issueId`. + */ + projectKeyOrId?: string; + /** + * The ID of the issue type to filter results by. Must be provided with `projectKeyOrId`. Can't be provided with `issueId`. + */ + issueTypeId?: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID or key of the custom field, for example `customfield_10000`. + */ + fieldIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCustomFieldConfiguration({ + query: query, + fieldIdOrKey: fieldIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update custom field configurations + * @request PUT :/rest/api/3/app/field/{fieldIdOrKey}/context/configuration + * @allowrelaxedtypes + */ +export async function putRestUpdateCustomFieldConfiguration( + /** + * The ID or key of the custom field, for example `customfield_10000`. + */ + fieldIdOrKey: string, + /** Request body */ + data: CustomFieldConfigurations, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateCustomFieldConfiguration({ + fieldIdOrKey: fieldIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update custom field value + * @request PUT :/rest/api/3/app/field/{fieldIdOrKey}/value + * @allowrelaxedtypes + */ +export async function putRestUpdateCustomFieldValue( + query: { + /** + * Whether to generate a changelog for this update. + */ + generateChangelog?: boolean; + }, + /** + * The ID or key of the custom field. For example, `customfield_10010`. + */ + fieldIdOrKey: string, + /** Request body */ + data: CustomFieldValueUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateCustomFieldValue({ + query: query, + fieldIdOrKey: fieldIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get application property + * @request GET :/rest/api/3/application-properties + * @readonly + */ +export async function getRestGetApplicationProperty( + query: { + /** + * The key of the application property. + */ + key?: string; + /** + * The permission level of all items being returned in the list. + */ + permissionLevel?: string; + /** + * When a `key` isn't provided, this filters the list of results by the application property `key` using a regular expression. For example, using `jira.lf.*` will return all application properties with keys that start with *jira.lf.*. + */ + keyFilter?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getApplicationProperty({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get advanced settings + * @request GET :/rest/api/3/application-properties/advanced-settings + * @readonly + */ +export async function getRestGetAdvancedSettings( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAdvancedSettings({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set application property + * @request PUT :/rest/api/3/application-properties/{id} + */ +export async function putRestSetApplicationProperty( + /** + * The key of the application property to update. + */ + id: string, + /** Request body */ + data: SimpleApplicationPropertyBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setApplicationProperty({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all application roles + * @request GET :/rest/api/3/applicationrole + * @readonly + */ +export async function getRestGetAllApplicationRoles( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllApplicationRoles({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get application role + * @request GET :/rest/api/3/applicationrole/{key} + * @readonly + */ +export async function getRestGetApplicationRole( + /** + * The key of the application role. Use the [Get all application roles](#api-rest-api-3-applicationrole-get) operation to get the key for each application role. + */ + key: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getApplicationRole({ + key: key, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get attachment content + * @request GET :/rest/api/3/attachment/content/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAttachmentContent( + query: { + /** + * Whether a redirect is provided for the attachment download. Clients that do not automatically follow redirects can set this to `false` to avoid making multiple requests to download the attachment. + */ + redirect?: boolean; + }, + /** + * The ID of the attachment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAttachmentContent({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get Jira attachment settings + * @request GET :/rest/api/3/attachment/meta + * @readonly + */ +export async function getRestGetAttachmentMeta( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAttachmentMeta({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get attachment thumbnail + * @request GET :/rest/api/3/attachment/thumbnail/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAttachmentThumbnail( + query: { + /** + * Whether a redirect is provided for the attachment download. Clients that do not automatically follow redirects can set this to `false` to avoid making multiple requests to download the attachment. + */ + redirect?: boolean; + /** + * Whether a default thumbnail is returned when the requested thumbnail is not found. + */ + fallbackToDefault?: boolean; + /** + * The maximum width to scale the thumbnail to. + */ + width?: number; + /** + * The maximum height to scale the thumbnail to. + */ + height?: number; + }, + /** + * The ID of the attachment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAttachmentThumbnail({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete attachment + * @request DELETE :/rest/api/3/attachment/{id} + * @allowrelaxedtypes + */ +export async function deleteRestRemoveAttachment( + /** + * The ID of the attachment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeAttachment({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get attachment metadata + * @request GET :/rest/api/3/attachment/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAttachment( + /** + * The ID of the attachment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAttachment({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all metadata for an expanded attachment + * @request GET :/rest/api/3/attachment/{id}/expand/human + * @readonly + */ +export async function getRestExpandAttachmentForHumans( + /** + * The ID of the attachment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.expandAttachmentForHumans({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get contents metadata for an expanded attachment + * @request GET :/rest/api/3/attachment/{id}/expand/raw + * @readonly + */ +export async function getRestExpandAttachmentForMachines( + /** + * The ID of the attachment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.expandAttachmentForMachines({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get audit records + * @request GET :/rest/api/3/auditing/record + * @readonly + */ +export async function getRestGetAuditRecords( + query: { + /** + * The number of records to skip before returning the first result. + */ + offset?: number; + /** + * The maximum number of results to return. + */ + limit?: number; + /** + * The strings to match with audit field content, space separated. + */ + filter?: string; + /** + * The date and time on or after which returned audit records must have been created. If `to` is provided `from` must be before `to` or no audit records are returned. + */ + from?: string; + /** + * The date and time on or before which returned audit results must have been created. If `from` is provided `to` must be after `from` or no audit records are returned. + */ + to?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAuditRecords({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get system avatars by type + * @request GET :/rest/api/3/avatar/{type}/system + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllSystemAvatars( + /** + * The avatar type. + */ + type: "issuetype" | "project" | "user", + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllSystemAvatars({ + type: type, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get comments by IDs + * @request POST :/rest/api/3/comment/list + * @allowrelaxedtypes + */ +export async function postRestGetCommentsByIds( + query: { + /** +* Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts a comma-separated list. Expand options include: + + * `renderedBody` Returns the comment body rendered in HTML. + * `properties` Returns the comment's properties. +*/ + expand?: string; + }, + /** Request body */ + data: IssueCommentListRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCommentsByIds({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get comment property keys + * @request GET :/rest/api/3/comment/{commentId}/properties + * @readonly + */ +export async function getRestGetCommentPropertyKeys( + /** + * The ID of the comment. + */ + commentId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCommentPropertyKeys({ + commentId: commentId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete comment property + * @request DELETE :/rest/api/3/comment/{commentId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteCommentProperty( + /** + * The ID of the comment. + */ + commentId: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteCommentProperty({ + commentId: commentId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get comment property + * @request GET :/rest/api/3/comment/{commentId}/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetCommentProperty( + /** + * The ID of the comment. + */ + commentId: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCommentProperty({ + commentId: commentId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set comment property + * @request PUT :/rest/api/3/comment/{commentId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestSetCommentProperty( + /** + * The ID of the comment. + */ + commentId: string, + /** + * The key of the property. The maximum length is 255 characters. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setCommentProperty({ + commentId: commentId, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Create component + * @request POST :/rest/api/3/component + * @allowrelaxedtypes + */ +export async function postRestCreateComponent( + /** Request body */ + data: ProjectComponent, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createComponent({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete component + * @request DELETE :/rest/api/3/component/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteComponent( + query: { + /** + * The ID of the component to replace the deleted component. If this value is null no replacement is made. + */ + moveIssuesTo?: string; + }, + /** + * The ID of the component. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteComponent({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get component + * @request GET :/rest/api/3/component/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetComponent( + /** + * The ID of the component. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getComponent({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update component + * @request PUT :/rest/api/3/component/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateComponent( + /** + * The ID of the component. + */ + id: string, + /** Request body */ + data: ProjectComponent, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateComponent({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get component issues count + * @request GET :/rest/api/3/component/{id}/relatedIssueCounts + * @readonly + */ +export async function getRestGetComponentRelatedIssues( + /** + * The ID of the component. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getComponentRelatedIssues({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get global settings + * @request GET :/rest/api/3/configuration + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetConfiguration( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getConfiguration({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get selected time tracking provider + * @request GET :/rest/api/3/configuration/timetracking + * @readonly + */ +export async function getRestGetSelectedTimeTrackingImplementation( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getSelectedTimeTrackingImplementation({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Select time tracking provider + * @request PUT :/rest/api/3/configuration/timetracking + * @allowrelaxedtypes + */ +export async function putRestSelectTimeTrackingImplementation( + /** Request body */ + data: TimeTrackingProvider, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.selectTimeTrackingImplementation({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all time tracking providers + * @request GET :/rest/api/3/configuration/timetracking/list + * @readonly + */ +export async function getRestGetAvailableTimeTrackingImplementations( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAvailableTimeTrackingImplementations({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get time tracking settings + * @request GET :/rest/api/3/configuration/timetracking/options + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetSharedTimeTrackingConfiguration( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getSharedTimeTrackingConfiguration({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set time tracking settings + * @request PUT :/rest/api/3/configuration/timetracking/options + * @allowrelaxedtypes + */ +export async function putRestSetSharedTimeTrackingConfiguration( + /** Request body */ + data: TimeTrackingConfiguration, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setSharedTimeTrackingConfiguration({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get custom field option + * @request GET :/rest/api/3/customFieldOption/{id} + * @readonly + */ +export async function getRestGetCustomFieldOption( + /** + * The ID of the custom field option. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCustomFieldOption({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all dashboards + * @request GET :/rest/api/3/dashboard + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllDashboards( + query: { + /** +* The filter applied to the list of dashboards. Valid values are: + + * `favourite` Returns dashboards the user has marked as favorite. + * `my` Returns dashboards owned by the user. +*/ + filter?: "my" | "favourite"; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllDashboards({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create dashboard + * @request POST :/rest/api/3/dashboard + * @allowrelaxedtypes + */ +export async function postRestCreateDashboard( + /** Request body */ + data: DashboardDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createDashboard({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get available gadgets + * @request GET :/rest/api/3/dashboard/gadgets + * @readonly + */ +export async function getRestGetAllAvailableDashboardGadgets( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllAvailableDashboardGadgets({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Search for dashboards + * @request GET :/rest/api/3/dashboard/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetDashboardsPaginated( + query: { + /** + * String used to perform a case-insensitive partial match with `name`. + */ + dashboardName?: string; + /** + * User account ID used to return dashboards with the matching `owner.accountId`. This parameter cannot be used with the `owner` parameter. + */ + accountId?: string; + /** + * This parameter is deprecated because of privacy changes. Use `accountId` instead. See the [migration guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. User name used to return dashboards with the matching `owner.name`. This parameter cannot be used with the `accountId` parameter. + */ + owner?: string; + /** + * As a group's name can change, use of `groupId` is recommended. Group name used to return dashboards that are shared with a group that matches `sharePermissions.group.name`. This parameter cannot be used with the `groupId` parameter. + */ + groupname?: string; + /** + * Group ID used to return dashboards that are shared with a group that matches `sharePermissions.group.groupId`. This parameter cannot be used with the `groupname` parameter. + */ + groupId?: string; + /** + * Project ID used to returns dashboards that are shared with a project that matches `sharePermissions.project.id`. + */ + projectId?: number; + /** +* [Order](#ordering) the results by a field: + + * `description` Sorts by dashboard description. Note that this sort works independently of whether the expand to display the description field is in use. + * `favourite_count` Sorts by dashboard popularity. + * `id` Sorts by dashboard ID. + * `is_favourite` Sorts by whether the dashboard is marked as a favorite. + * `name` Sorts by dashboard name. + * `owner` Sorts by dashboard owner name. +*/ + orderBy?: + | "description" + | "-description" + | "+description" + | "favorite_count" + | "-favorite_count" + | "+favorite_count" + | "id" + | "-id" + | "+id" + | "is_favorite" + | "-is_favorite" + | "+is_favorite" + | "name" + | "-name" + | "+name" + | "owner" + | "-owner" + | "+owner"; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The status to filter by. It may be active, archived or deleted. + */ + status?: "active" | "archived" | "deleted"; + /** +* Use [expand](#expansion) to include additional information about dashboard in the response. This parameter accepts a comma-separated list. Expand options include: + + * `description` Returns the description of the dashboard. + * `owner` Returns the owner of the dashboard. + * `viewUrl` Returns the URL that is used to view the dashboard. + * `favourite` Returns `isFavourite`, an indicator of whether the user has set the dashboard as a favorite. + * `favouritedCount` Returns `popularity`, a count of how many users have set this dashboard as a favorite. + * `sharePermissions` Returns details of the share permissions defined for the dashboard. + * `editPermissions` Returns details of the edit permissions defined for the dashboard. + * `isWritable` Returns whether the current user has permission to edit the dashboard. +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDashboardsPaginated({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get gadgets + * @request GET :/rest/api/3/dashboard/{dashboardId}/gadget + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllGadgets( + query: { + /** + * The list of gadgets module keys. To include multiple module keys, separate module keys with ampersand: `moduleKey=key:one&moduleKey=key:two`. + */ + moduleKey?: string[]; + /** + * The list of gadgets URIs. To include multiple URIs, separate URIs with ampersand: `uri=/rest/example/uri/1&uri=/rest/example/uri/2`. + */ + uri?: string[]; + /** + * The list of gadgets IDs. To include multiple IDs, separate IDs with ampersand: `gadgetId=10000&gadgetId=10001`. + */ + gadgetId?: number[]; + }, + /** + * The ID of the dashboard. + */ + dashboardId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllGadgets({ + query: query, + dashboardId: dashboardId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add gadget to dashboard + * @request POST :/rest/api/3/dashboard/{dashboardId}/gadget + * @allowrelaxedtypes + */ +export async function postRestAddGadget( + /** + * The ID of the dashboard. + */ + dashboardId: number, + /** Request body */ + data: DashboardGadgetSettings, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addGadget({ + dashboardId: dashboardId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Remove gadget from dashboard + * @request DELETE :/rest/api/3/dashboard/{dashboardId}/gadget/{gadgetId} + * @allowrelaxedtypes + */ +export async function deleteRestRemoveGadget( + /** + * The ID of the dashboard. + */ + dashboardId: number, + /** + * The ID of the gadget. + */ + gadgetId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeGadget({ + dashboardId: dashboardId, + gadgetId: gadgetId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update gadget on dashboard + * @request PUT :/rest/api/3/dashboard/{dashboardId}/gadget/{gadgetId} + * @allowrelaxedtypes + */ +export async function putRestUpdateGadget( + /** + * The ID of the dashboard. + */ + dashboardId: number, + /** + * The ID of the gadget. + */ + gadgetId: number, + /** Request body */ + data: DashboardGadgetUpdateRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateGadget({ + dashboardId: dashboardId, + gadgetId: gadgetId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get dashboard item property keys + * @request GET :/rest/api/3/dashboard/{dashboardId}/items/{itemId}/properties + * @readonly + */ +export async function getRestGetDashboardItemPropertyKeys( + /** + * The ID of the dashboard. + */ + dashboardId: string, + /** + * The ID of the dashboard item. + */ + itemId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDashboardItemPropertyKeys({ + dashboardId: dashboardId, + itemId: itemId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete dashboard item property + * @request DELETE :/rest/api/3/dashboard/{dashboardId}/items/{itemId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteDashboardItemProperty( + /** + * The ID of the dashboard. + */ + dashboardId: string, + /** + * The ID of the dashboard item. + */ + itemId: string, + /** + * The key of the dashboard item property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteDashboardItemProperty({ + dashboardId: dashboardId, + itemId: itemId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get dashboard item property + * @request GET :/rest/api/3/dashboard/{dashboardId}/items/{itemId}/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetDashboardItemProperty( + /** + * The ID of the dashboard. + */ + dashboardId: string, + /** + * The ID of the dashboard item. + */ + itemId: string, + /** + * The key of the dashboard item property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDashboardItemProperty({ + dashboardId: dashboardId, + itemId: itemId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set dashboard item property + * @request PUT :/rest/api/3/dashboard/{dashboardId}/items/{itemId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestSetDashboardItemProperty( + /** + * The ID of the dashboard. + */ + dashboardId: string, + /** + * The ID of the dashboard item. + */ + itemId: string, + /** + * The key of the dashboard item property. The maximum length is 255 characters. For dashboard items with a spec URI and no complete module key, if the provided propertyKey is equal to "config", the request body's JSON must be an object with all keys and values as strings. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setDashboardItemProperty({ + dashboardId: dashboardId, + itemId: itemId, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete dashboard + * @request DELETE :/rest/api/3/dashboard/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteDashboard( + /** + * The ID of the dashboard. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteDashboard({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.error) { + throw result.error; + } else { + return new hasuraSdk.JSONValue(result.data); + } +} + +/** + * Get dashboard + * @request GET :/rest/api/3/dashboard/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetDashboard( + /** + * The ID of the dashboard. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDashboard({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update dashboard + * @request PUT :/rest/api/3/dashboard/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateDashboard( + /** + * The ID of the dashboard to update. + */ + id: string, + /** Request body */ + data: DashboardDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateDashboard({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Copy dashboard + * @request POST :/rest/api/3/dashboard/{id}/copy + * @allowrelaxedtypes + */ +export async function postRestCopyDashboard( + id: string, + /** Request body */ + data: DashboardDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.copyDashboard({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get events + * @request GET :/rest/api/3/events + * @readonly + */ +export async function getRestGetEvents( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getEvents({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Analyse Jira expression + * @request POST :/rest/api/3/expression/analyse + * @allowrelaxedtypes + */ +export async function postRestAnalyseExpression( + query: { + /** +* The check to perform: + + * `syntax` Each expression's syntax is checked to ensure the expression can be parsed. Also, syntactic limits are validated. For example, the expression's length. + * `type` EXPERIMENTAL. Each expression is type checked and the final type of the expression inferred. Any type errors that would result in the expression failure at runtime are reported. For example, accessing properties that don't exist or passing the wrong number of arguments to functions. Also performs the syntax check. + * `complexity` EXPERIMENTAL. Determines the formulae for how many [expensive operations](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#expensive-operations) each expression may execute. +*/ + check?: "syntax" | "type" | "complexity"; + }, + /** Request body */ + data: JiraExpressionForAnalysis, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.analyseExpression({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Evaluate Jira expression + * @request POST :/rest/api/3/expression/eval + * @allowrelaxedtypes + */ +export async function postRestEvaluateJiraExpression( + query: { + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts `meta.complexity` that returns information about the expression complexity. For example, the number of expensive operations used by the expression and how close the expression is to reaching the [complexity limit](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions). Useful when designing and debugging your expressions. + */ + expand?: string; + }, + /** Request body */ + data: JiraExpressionEvalRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.evaluateJiraExpression({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get fields + * @request GET :/rest/api/3/field + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetFields( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFields({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create custom field + * @request POST :/rest/api/3/field + * @allowrelaxedtypes + */ +export async function postRestCreateCustomField( + /** Request body */ + data: CustomFieldDefinitionJsonBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createCustomField({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get fields paginated + * @request GET :/rest/api/3/field/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetFieldsPaginated( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The type of fields to search. + */ + type?: ("custom" | "system")[]; + /** + * The IDs of the custom fields to return or, where `query` is specified, filter. + */ + id?: string[]; + /** + * String used to perform a case-insensitive partial match with field names or descriptions. + */ + query?: string; + /** +* [Order](#ordering) the results by a field: + + * `contextsCount` sorts by the number of contexts related to a field + * `lastUsed` sorts by the date when the value of the field last changed + * `name` sorts by the field name + * `screensCount` sorts by the number of screens related to a field +*/ + orderBy?: + | "contextsCount" + | "-contextsCount" + | "+contextsCount" + | "lastUsed" + | "-lastUsed" + | "+lastUsed" + | "name" + | "-name" + | "+name" + | "screensCount" + | "-screensCount" + | "+screensCount" + | "projectsCount" + | "-projectsCount" + | "+projectsCount"; + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `key` returns the key for each field + * `lastUsed` returns the date when the value of the field last changed + * `screensCount` returns the number of screens related to a field + * `contextsCount` returns the number of contexts related to a field + * `isLocked` returns information about whether the field is [locked](https://confluence.atlassian.com/x/ZSN7Og) + * `searcherKey` returns the searcher key for each custom field +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFieldsPaginated({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get fields in trash paginated + * @request GET :/rest/api/3/field/search/trashed + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetTrashedFieldsPaginated( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + id?: string[]; + /** + * String used to perform a case-insensitive partial match with field names or descriptions. + */ + query?: string; + expand?: + | "name" + | "-name" + | "+name" + | "trashDate" + | "-trashDate" + | "+trashDate" + | "plannedDeletionDate" + | "-plannedDeletionDate" + | "+plannedDeletionDate" + | "projectsCount" + | "-projectsCount" + | "+projectsCount"; + /** +* [Order](#ordering) the results by a field: + + * `name` sorts by the field name + * `trashDate` sorts by the date the field was moved to the trash + * `plannedDeletionDate` sorts by the planned deletion date +*/ + orderBy?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getTrashedFieldsPaginated({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update custom field + * @request PUT :/rest/api/3/field/{fieldId} + * @allowrelaxedtypes + */ +export async function putRestUpdateCustomField( + /** + * The ID of the custom field. + */ + fieldId: string, + /** Request body */ + data: UpdateCustomFieldDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateCustomField({ + fieldId: fieldId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get custom field contexts + * @request GET :/rest/api/3/field/{fieldId}/context + * @readonly + */ +export async function getRestGetContextsForField( + query: { + /** + * Whether to return contexts that apply to all issue types. + */ + isAnyIssueType?: boolean; + /** + * Whether to return contexts that apply to all projects. + */ + isGlobalContext?: boolean; + /** + * The list of context IDs. To include multiple contexts, separate IDs with ampersand: `contextId=10000&contextId=10001`. + */ + contextId?: number[]; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the custom field. + */ + fieldId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getContextsForField({ + query: query, + fieldId: fieldId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create custom field context + * @request POST :/rest/api/3/field/{fieldId}/context + */ +export async function postRestCreateCustomFieldContext( + /** + * The ID of the custom field. + */ + fieldId: string, + /** Request body */ + data: CreateCustomFieldContext, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createCustomFieldContext({ + fieldId: fieldId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get custom field contexts default values + * @request GET :/rest/api/3/field/{fieldId}/context/defaultValue + * @readonly + */ +export async function getRestGetDefaultValues( + query: { + /** + * The IDs of the contexts. + */ + contextId?: number[]; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the custom field, for example `customfield\_10000`. + */ + fieldId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDefaultValues({ + query: query, + fieldId: fieldId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set custom field contexts default values + * @request PUT :/rest/api/3/field/{fieldId}/context/defaultValue + * @allowrelaxedtypes + */ +export async function putRestSetDefaultValues( + /** + * The ID of the custom field. + */ + fieldId: string, + /** Request body */ + data: CustomFieldContextDefaultValueUpdate, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setDefaultValues({ + fieldId: fieldId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get issue types for custom field context + * @request GET :/rest/api/3/field/{fieldId}/context/issuetypemapping + * @readonly + */ +export async function getRestGetIssueTypeMappingsForContexts( + query: { + /** + * The ID of the context. To include multiple contexts, provide an ampersand-separated list. For example, `contextId=10001&contextId=10002`. + */ + contextId?: number[]; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the custom field. + */ + fieldId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypeMappingsForContexts({ + query: query, + fieldId: fieldId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get custom field contexts for projects and issue types + * @request POST :/rest/api/3/field/{fieldId}/context/mapping + */ +export async function postRestGetCustomFieldContextsForProjectsAndIssueTypes( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the custom field. + */ + fieldId: string, + /** Request body */ + data: ProjectIssueTypeMappings, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCustomFieldContextsForProjectsAndIssueTypes({ + query: query, + fieldId: fieldId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project mappings for custom field context + * @request GET :/rest/api/3/field/{fieldId}/context/projectmapping + * @readonly + */ +export async function getRestGetProjectContextMapping( + query: { + /** + * The list of context IDs. To include multiple context, separate IDs with ampersand: `contextId=10000&contextId=10001`. + */ + contextId?: number[]; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the custom field, for example `customfield\_10000`. + */ + fieldId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectContextMapping({ + query: query, + fieldId: fieldId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete custom field context + * @request DELETE :/rest/api/3/field/{fieldId}/context/{contextId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteCustomFieldContext( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteCustomFieldContext({ + fieldId: fieldId, + contextId: contextId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update custom field context + * @request PUT :/rest/api/3/field/{fieldId}/context/{contextId} + * @allowrelaxedtypes + */ +export async function putRestUpdateCustomFieldContext( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: CustomFieldContextUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateCustomFieldContext({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Add issue types to context + * @request PUT :/rest/api/3/field/{fieldId}/context/{contextId}/issuetype + * @allowrelaxedtypes + */ +export async function putRestAddIssueTypesToContext( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: IssueTypeIds, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addIssueTypesToContext({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Remove issue types from context + * @request POST :/rest/api/3/field/{fieldId}/context/{contextId}/issuetype/remove + * @allowrelaxedtypes + */ +export async function postRestRemoveIssueTypesFromContext( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: IssueTypeIds, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeIssueTypesFromContext({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get custom field options (context) + * @request GET :/rest/api/3/field/{fieldId}/context/{contextId}/option + * @readonly + */ +export async function getRestGetOptionsForContext( + query: { + /** + * The ID of the option. + */ + optionId?: number; + /** + * Whether only options are returned. + */ + onlyOptions?: boolean; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getOptionsForContext({ + query: query, + fieldId: fieldId, + contextId: contextId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create custom field options (context) + * @request POST :/rest/api/3/field/{fieldId}/context/{contextId}/option + */ +export async function postRestCreateCustomFieldOption( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: BulkCustomFieldOptionCreateRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createCustomFieldOption({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update custom field options (context) + * @request PUT :/rest/api/3/field/{fieldId}/context/{contextId}/option + */ +export async function putRestUpdateCustomFieldOption( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: BulkCustomFieldOptionUpdateRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateCustomFieldOption({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Reorder custom field options (context) + * @request PUT :/rest/api/3/field/{fieldId}/context/{contextId}/option/move + * @allowrelaxedtypes + */ +export async function putRestReorderCustomFieldOptions( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: OrderOfCustomFieldOptions, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.reorderCustomFieldOptions({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete custom field options (context) + * @request DELETE :/rest/api/3/field/{fieldId}/context/{contextId}/option/{optionId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteCustomFieldOption( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context from which an option should be deleted. + */ + contextId: number, + /** + * The ID of the option to delete. + */ + optionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteCustomFieldOption({ + fieldId: fieldId, + contextId: contextId, + optionId: optionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Assign custom field context to projects + * @request PUT :/rest/api/3/field/{fieldId}/context/{contextId}/project + * @allowrelaxedtypes + */ +export async function putRestAssignProjectsToCustomFieldContext( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: ProjectIds, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.assignProjectsToCustomFieldContext({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Remove custom field context from projects + * @request POST :/rest/api/3/field/{fieldId}/context/{contextId}/project/remove + * @allowrelaxedtypes + */ +export async function postRestRemoveCustomFieldContextFromProjects( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: ProjectIds, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeCustomFieldContextFromProjects({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get contexts for a field + * @request GET :/rest/api/3/field/{fieldId}/contexts + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetContextsForFieldDeprecated( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the field to return contexts for. + */ + fieldId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getContextsForFieldDeprecated({ + query: query, + fieldId: fieldId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get screens for a field + * @request GET :/rest/api/3/field/{fieldId}/screens + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetScreensForField( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * Use [expand](#expansion) to include additional information about screens in the response. This parameter accepts `tab` which returns details about the screen tabs the field is used in. + */ + expand?: string; + }, + /** + * The ID of the field to return screens for. + */ + fieldId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getScreensForField({ + query: query, + fieldId: fieldId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all issue field options + * @request GET :/rest/api/3/field/{fieldKey}/option + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllIssueFieldOptions( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllIssueFieldOptions({ + query: query, + fieldKey: fieldKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create issue field option + * @request POST :/rest/api/3/field/{fieldKey}/option + * @allowrelaxedtypes + */ +export async function postRestCreateIssueFieldOption( + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + /** Request body */ + data: IssueFieldOptionCreateBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssueFieldOption({ + fieldKey: fieldKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get selectable issue field options + * @request GET :/rest/api/3/field/{fieldKey}/option/suggestions/edit + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetSelectableIssueFieldOptions( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * Filters the results to options that are only available in the specified project. + */ + projectId?: number; + }, + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getSelectableIssueFieldOptions({ + query: query, + fieldKey: fieldKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get visible issue field options + * @request GET :/rest/api/3/field/{fieldKey}/option/suggestions/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetVisibleIssueFieldOptions( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * Filters the results to options that are only available in the specified project. + */ + projectId?: number; + }, + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getVisibleIssueFieldOptions({ + query: query, + fieldKey: fieldKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete issue field option + * @request DELETE :/rest/api/3/field/{fieldKey}/option/{optionId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueFieldOption( + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + /** + * The ID of the option to be deleted. + */ + optionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueFieldOption({ + fieldKey: fieldKey, + optionId: optionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get issue field option + * @request GET :/rest/api/3/field/{fieldKey}/option/{optionId} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueFieldOption( + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + /** + * The ID of the option to be returned. + */ + optionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueFieldOption({ + fieldKey: fieldKey, + optionId: optionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update issue field option + * @request PUT :/rest/api/3/field/{fieldKey}/option/{optionId} + * @allowrelaxedtypes + */ +export async function putRestUpdateIssueFieldOption( + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + /** + * The ID of the option to be updated. + */ + optionId: number, + /** Request body */ + data: IssueFieldOption, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateIssueFieldOption({ + fieldKey: fieldKey, + optionId: optionId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Replace issue field option + * @request DELETE :/rest/api/3/field/{fieldKey}/option/{optionId}/issue + * @allowrelaxedtypes + */ +export async function deleteRestReplaceIssueFieldOption( + query: { + /** + * The ID of the option that will replace the currently selected option. + */ + replaceWith?: number; + /** + * A JQL query that specifies the issues to be updated. For example, *project=10000*. + */ + jql?: string; + /** + * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect and Forge app users with admin permission. + */ + overrideScreenSecurity?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect and Forge app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag?: boolean; + }, + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + /** + * The ID of the option to be deselected. + */ + optionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.replaceIssueFieldOption({ + query: query, + fieldKey: fieldKey, + optionId: optionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete custom field + * @request DELETE :/rest/api/3/field/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteCustomField( + /** + * The ID of a custom field. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteCustomField({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Restore custom field from trash + * @request POST :/rest/api/3/field/{id}/restore + * @allowrelaxedtypes + */ +export async function postRestRestoreCustomField( + /** + * The ID of a custom field. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.restoreCustomField({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Move custom field to trash + * @request POST :/rest/api/3/field/{id}/trash + * @allowrelaxedtypes + */ +export async function postRestTrashCustomField( + /** + * The ID of a custom field. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.trashCustomField({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all field configurations + * @request GET :/rest/api/3/fieldconfiguration + * @readonly + */ +export async function getRestGetAllFieldConfigurations( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of field configuration IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + */ + id?: number[]; + /** + * If *true* returns default field configurations only. + */ + isDefault?: boolean; + /** + * The query string used to match against field configuration names and descriptions. + */ + query?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllFieldConfigurations({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create field configuration + * @request POST :/rest/api/3/fieldconfiguration + */ +export async function postRestCreateFieldConfiguration( + /** Request body */ + data: FieldConfigurationDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createFieldConfiguration({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete field configuration + * @request DELETE :/rest/api/3/fieldconfiguration/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteFieldConfiguration( + /** + * The ID of the field configuration. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteFieldConfiguration({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update field configuration + * @request PUT :/rest/api/3/fieldconfiguration/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateFieldConfiguration( + /** + * The ID of the field configuration. + */ + id: number, + /** Request body */ + data: FieldConfigurationDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateFieldConfiguration({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get field configuration items + * @request GET :/rest/api/3/fieldconfiguration/{id}/fields + * @readonly + */ +export async function getRestGetFieldConfigurationItems( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the field configuration. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFieldConfigurationItems({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update field configuration items + * @request PUT :/rest/api/3/fieldconfiguration/{id}/fields + * @allowrelaxedtypes + */ +export async function putRestUpdateFieldConfigurationItems( + /** + * The ID of the field configuration. + */ + id: number, + /** Request body */ + data: FieldConfigurationItemsDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateFieldConfigurationItems({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all field configuration schemes + * @request GET :/rest/api/3/fieldconfigurationscheme + * @readonly + */ +export async function getRestGetAllFieldConfigurationSchemes( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of field configuration scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + */ + id?: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllFieldConfigurationSchemes({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create field configuration scheme + * @request POST :/rest/api/3/fieldconfigurationscheme + */ +export async function postRestCreateFieldConfigurationScheme( + /** Request body */ + data: UpdateFieldConfigurationSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createFieldConfigurationScheme({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get field configuration issue type items + * @request GET :/rest/api/3/fieldconfigurationscheme/mapping + * @readonly + */ +export async function getRestGetFieldConfigurationSchemeMappings( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of field configuration scheme IDs. To include multiple field configuration schemes separate IDs with ampersand: `fieldConfigurationSchemeId=10000&fieldConfigurationSchemeId=10001`. + */ + fieldConfigurationSchemeId?: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFieldConfigurationSchemeMappings({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get field configuration schemes for projects + * @request GET :/rest/api/3/fieldconfigurationscheme/project + * @readonly + */ +export async function getRestGetFieldConfigurationSchemeProjectMapping( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of project IDs. To include multiple projects, separate IDs with ampersand: `projectId=10000&projectId=10001`. + */ + projectId: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFieldConfigurationSchemeProjectMapping({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Assign field configuration scheme to project + * @request PUT :/rest/api/3/fieldconfigurationscheme/project + * @allowrelaxedtypes + */ +export async function putRestAssignFieldConfigurationSchemeToProject( + /** Request body */ + data: FieldConfigurationSchemeProjectAssociation, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.assignFieldConfigurationSchemeToProject({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete field configuration scheme + * @request DELETE :/rest/api/3/fieldconfigurationscheme/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteFieldConfigurationScheme( + /** + * The ID of the field configuration scheme. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteFieldConfigurationScheme({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update field configuration scheme + * @request PUT :/rest/api/3/fieldconfigurationscheme/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateFieldConfigurationScheme( + /** + * The ID of the field configuration scheme. + */ + id: number, + /** Request body */ + data: UpdateFieldConfigurationSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateFieldConfigurationScheme({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Assign issue types to field configurations + * @request PUT :/rest/api/3/fieldconfigurationscheme/{id}/mapping + * @allowrelaxedtypes + */ +export async function putRestSetFieldConfigurationSchemeMapping( + /** + * The ID of the field configuration scheme. + */ + id: number, + /** Request body */ + data: AssociateFieldConfigurationsWithIssueTypesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setFieldConfigurationSchemeMapping({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Remove issue types from field configuration scheme + * @request POST :/rest/api/3/fieldconfigurationscheme/{id}/mapping/delete + * @allowrelaxedtypes + */ +export async function postRestRemoveIssueTypesFromGlobalFieldConfigurationScheme( + /** + * The ID of the field configuration scheme. + */ + id: number, + /** Request body */ + data: IssueTypeIdsToRemove, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.rest.removeIssueTypesFromGlobalFieldConfigurationScheme({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get filters + * @request GET :/rest/api/3/filter + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetFilters( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFilters({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create filter + * @request POST :/rest/api/3/filter + * @allowrelaxedtypes + */ +export async function postRestCreateFilter( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be created. Available to users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions?: boolean; + }, + /** Request body */ + data: Filter, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createFilter({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get default share scope + * @request GET :/rest/api/3/filter/defaultShareScope + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetDefaultShareScope( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDefaultShareScope({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set default share scope + * @request PUT :/rest/api/3/filter/defaultShareScope + * @allowrelaxedtypes + */ +export async function putRestSetDefaultShareScope( + /** Request body */ + data: DefaultShareScope, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setDefaultShareScope({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get favorite filters + * @request GET :/rest/api/3/filter/favourite + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetFavouriteFilters( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFavouriteFilters({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get my filters + * @request GET :/rest/api/3/filter/my + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetMyFilters( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + /** + * Include the user's favorite filters in the response. + */ + includeFavourites?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getMyFilters({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Search for filters + * @request GET :/rest/api/3/filter/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetFiltersPaginated( + query: { + /** + * String used to perform a case-insensitive partial match with `name`. + */ + filterName?: string; + /** + * User account ID used to return filters with the matching `owner.accountId`. This parameter cannot be used with `owner`. + */ + accountId?: string; + /** + * This parameter is deprecated because of privacy changes. Use `accountId` instead. See the [migration guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. User name used to return filters with the matching `owner.name`. This parameter cannot be used with `accountId`. + */ + owner?: string; + /** + * As a group's name can change, use of `groupId` is recommended to identify a group. Group name used to returns filters that are shared with a group that matches `sharePermissions.group.groupname`. This parameter cannot be used with the `groupId` parameter. + */ + groupname?: string; + /** + * Group ID used to returns filters that are shared with a group that matches `sharePermissions.group.groupId`. This parameter cannot be used with the `groupname` parameter. + */ + groupId?: string; + /** + * Project ID used to returns filters that are shared with a project that matches `sharePermissions.project.id`. + */ + projectId?: number; + /** + * The list of filter IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. Do not exceed 200 filter IDs. + */ + id?: number[]; + /** +* [Order](#ordering) the results by a field: + + * `description` Sorts by filter description. Note that this sorting works independently of whether the expand to display the description field is in use. + * `favourite_count` Sorts by the count of how many users have this filter as a favorite. + * `is_favourite` Sorts by whether the filter is marked as a favorite. + * `id` Sorts by filter ID. + * `name` Sorts by filter name. + * `owner` Sorts by the ID of the filter owner. + * `is_shared` Sorts by whether the filter is shared. +*/ + orderBy?: + | "description" + | "-description" + | "+description" + | "favourite_count" + | "-favourite_count" + | "+favourite_count" + | "id" + | "-id" + | "+id" + | "is_favourite" + | "-is_favourite" + | "+is_favourite" + | "name" + | "-name" + | "+name" + | "owner" + | "-owner" + | "+owner" + | "is_shared" + | "-is_shared" + | "+is_shared"; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `description` Returns the description of the filter. + * `favourite` Returns an indicator of whether the user has set the filter as a favorite. + * `favouritedCount` Returns a count of how many users have set this filter as a favorite. + * `jql` Returns the JQL query that the filter uses. + * `owner` Returns the owner of the filter. + * `searchUrl` Returns a URL to perform the filter's JQL query. + * `sharePermissions` Returns the share permissions defined for the filter. + * `editPermissions` Returns the edit permissions defined for the filter. + * `isWritable` Returns whether the current user has permission to edit the filter. + * `subscriptions` Returns the users that are subscribed to the filter. + * `viewUrl` Returns a URL to view the filter. +*/ + expand?: string; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be returned. Available to users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFiltersPaginated({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete filter + * @request DELETE :/rest/api/3/filter/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteFilter( + /** + * The ID of the filter to delete. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteFilter({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get filter + * @request GET :/rest/api/3/filter/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetFilter( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be returned. Available to users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions?: boolean; + }, + /** + * The ID of the filter to return. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFilter({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update filter + * @request PUT :/rest/api/3/filter/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateFilter( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable the addition of any share permissions to filters. Available to users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions?: boolean; + }, + /** + * The ID of the filter to update. + */ + id: number, + /** Request body */ + data: Filter, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateFilter({ + query: query, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Reset columns + * @request DELETE :/rest/api/3/filter/{id}/columns + * @allowrelaxedtypes + */ +export async function deleteRestResetColumns( + /** + * The ID of the filter. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.resetColumns({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get columns + * @request GET :/rest/api/3/filter/{id}/columns + * @readonly + */ +export async function getRestGetColumns( + /** + * The ID of the filter. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getColumns({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set columns + * @request PUT :/rest/api/3/filter/{id}/columns + * @allowrelaxedtypes + */ +export async function putRestSetColumns( + /** + * The ID of the filter. + */ + id: number, + /** Request body */ + data: string[], + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setColumns({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Remove filter as favorite + * @request DELETE :/rest/api/3/filter/{id}/favourite + * @allowrelaxedtypes + */ +export async function deleteRestDeleteFavouriteForFilter( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + }, + /** + * The ID of the filter. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteFavouriteForFilter({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add filter as favorite + * @request PUT :/rest/api/3/filter/{id}/favourite + * @allowrelaxedtypes + */ +export async function putRestSetFavouriteForFilter( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + }, + /** + * The ID of the filter. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setFavouriteForFilter({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Change filter owner + * @request PUT :/rest/api/3/filter/{id}/owner + * @allowrelaxedtypes + */ +export async function putRestChangeFilterOwner( + /** + * The ID of the filter to update. + */ + id: number, + /** Request body */ + data: ChangeFilterOwner, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.changeFilterOwner({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get share permissions + * @request GET :/rest/api/3/filter/{id}/permission + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetSharePermissions( + /** + * The ID of the filter. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getSharePermissions({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add share permission + * @request POST :/rest/api/3/filter/{id}/permission + * @allowrelaxedtypes + */ +export async function postRestAddSharePermission( + /** + * The ID of the filter. + */ + id: number, + /** Request body */ + data: SharePermissionInputBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addSharePermission({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete share permission + * @request DELETE :/rest/api/3/filter/{id}/permission/{permissionId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteSharePermission( + /** + * The ID of the filter. + */ + id: number, + /** + * The ID of the share permission. + */ + permissionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteSharePermission({ + id: id, + permissionId: permissionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get share permission + * @request GET :/rest/api/3/filter/{id}/permission/{permissionId} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetSharePermission( + /** + * The ID of the filter. + */ + id: number, + /** + * The ID of the share permission. + */ + permissionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getSharePermission({ + id: id, + permissionId: permissionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Remove group + * @request DELETE :/rest/api/3/group + * @allowrelaxedtypes + */ +export async function deleteRestRemoveGroup( + query: { + groupname?: string; + /** + * The ID of the group. This parameter cannot be used with the `groupname` parameter. + */ + groupId?: string; + /** +* As a group's name can change, use of `swapGroupId` is recommended to identify a group. +The group to transfer restrictions to. Only comments and worklogs are transferred. If restrictions are not transferred, comments and worklogs are inaccessible after the deletion. This parameter cannot be used with the `swapGroupId` parameter. +*/ + swapGroup?: string; + /** + * The ID of the group to transfer restrictions to. Only comments and worklogs are transferred. If restrictions are not transferred, comments and worklogs are inaccessible after the deletion. This parameter cannot be used with the `swapGroup` parameter. + */ + swapGroupId?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeGroup({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get group + * @request GET :/rest/api/3/group + * @readonly + */ +export async function getRestGetGroup( + query: { + /** +* As a group's name can change, use of `groupId` is recommended to identify a group. +The name of the group. This parameter cannot be used with the `groupId` parameter. +*/ + groupname?: string; + /** + * The ID of the group. This parameter cannot be used with the `groupName` parameter. + */ + groupId?: string; + /** + * List of fields to expand. + */ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getGroup({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create group + * @request POST :/rest/api/3/group + */ +export async function postRestCreateGroup( + /** Request body */ + data: AddGroupBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createGroup({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Bulk get groups + * @request GET :/rest/api/3/group/bulk + * @readonly + */ +export async function getRestBulkGetGroups( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The ID of a group. To specify multiple IDs, pass multiple `groupId` parameters. For example, `groupId=5b10a2844c20165700ede21g&groupId=5b10ac8d82e05b22cc7d4ef5`. + */ + groupId?: string[]; + /** + * The name of a group. To specify multiple names, pass multiple `groupName` parameters. For example, `groupName=administrators&groupName=jira-software-users`. + */ + groupName?: string[]; + /** + * The access level of a group. Valid values: 'site-admin', 'admin', 'user'. + */ + accessType?: string; + /** + * The application key of the product user groups to search for. Valid values: 'jira-servicedesk', 'jira-software', 'jira-product-discovery', 'jira-core'. + */ + applicationKey?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.bulkGetGroups({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get users from group + * @request GET :/rest/api/3/group/member + * @readonly + */ +export async function getRestGetUsersFromGroup( + query: { + /** +* As a group's name can change, use of `groupId` is recommended to identify a group. +The name of the group. This parameter cannot be used with the `groupId` parameter. +*/ + groupname?: string; + /** + * The ID of the group. This parameter cannot be used with the `groupName` parameter. + */ + groupId?: string; + /** + * Include inactive users. + */ + includeInactiveUsers?: boolean; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUsersFromGroup({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Remove user from group + * @request DELETE :/rest/api/3/group/user + * @allowrelaxedtypes + */ +export async function deleteRestRemoveUserFromGroup( + query: { + /** +* As a group's name can change, use of `groupId` is recommended to identify a group. +The name of the group. This parameter cannot be used with the `groupId` parameter. +*/ + groupname?: string; + /** + * The ID of the group. This parameter cannot be used with the `groupName` parameter. + */ + groupId?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeUserFromGroup({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Add user to group + * @request POST :/rest/api/3/group/user + */ +export async function postRestAddUserToGroup( + query: { + /** +* As a group's name can change, use of `groupId` is recommended to identify a group. +The name of the group. This parameter cannot be used with the `groupId` parameter. +*/ + groupname?: string; + /** + * The ID of the group. This parameter cannot be used with the `groupName` parameter. + */ + groupId?: string; + }, + /** Request body */ + data: UpdateUserToGroupBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addUserToGroup({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find groups + * @request GET :/rest/api/3/groups/picker + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindGroups( + query: { + /** + * This parameter is deprecated, setting it does not affect the results. To find groups containing a particular user, use [Get user groups](#api-rest-api-3-user-groups-get). + */ + accountId?: string; + /** + * The string to find in group names. + */ + query?: string; + /** +* As a group's name can change, use of `excludeGroupIds` is recommended to identify a group. +A group to exclude from the result. To exclude multiple groups, provide an ampersand-separated list. For example, `exclude=group1&exclude=group2`. This parameter cannot be used with the `excludeGroupIds` parameter. +*/ + exclude?: string[]; + /** + * A group ID to exclude from the result. To exclude multiple groups, provide an ampersand-separated list. For example, `excludeId=group1-id&excludeId=group2-id`. This parameter cannot be used with the `excludeGroups` parameter. + */ + excludeId?: string[]; + /** + * The maximum number of groups to return. The maximum number of groups that can be returned is limited by the system property `jira.ajax.autocomplete.limit`. + */ + maxResults?: number; + /** + * Whether the search for groups should be case insensitive. + */ + caseInsensitive?: boolean; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + userName?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findGroups({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find users and groups + * @request GET :/rest/api/3/groupuserpicker + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindUsersAndGroups( + query: { + /** + * The search string. + */ + query: string; + /** + * The maximum number of items to return in each list. + */ + maxResults?: number; + /** + * Whether the user avatar should be returned. If an invalid value is provided, the default value is used. + */ + showAvatar?: boolean; + /** + * The custom field ID of the field this request is for. + */ + fieldId?: string; + /** + * The ID of a project that returned users and groups must have permission to view. To include multiple projects, provide an ampersand-separated list. For example, `projectId=10000&projectId=10001`. This parameter is only used when `fieldId` is present. + */ + projectId?: string[]; + /** + * The ID of an issue type that returned users and groups must have permission to view. To include multiple issue types, provide an ampersand-separated list. For example, `issueTypeId=10000&issueTypeId=10001`. Special values, such as `-1` (all standard issue types) and `-2` (all subtask issue types), are supported. This parameter is only used when `fieldId` is present. + */ + issueTypeId?: string[]; + /** + * The size of the avatar to return. If an invalid value is provided, the default value is used. + */ + avatarSize?: + | "xsmall" + | "xsmall@2x" + | "xsmall@3x" + | "small" + | "small@2x" + | "small@3x" + | "medium" + | "medium@2x" + | "medium@3x" + | "large" + | "large@2x" + | "large@3x" + | "xlarge" + | "xlarge@2x" + | "xlarge@3x" + | "xxlarge" + | "xxlarge@2x" + | "xxlarge@3x" + | "xxxlarge" + | "xxxlarge@2x" + | "xxxlarge@3x"; + /** + * Whether the search for groups should be case insensitive. + */ + caseInsensitive?: boolean; + /** + * Whether Connect app users and groups should be excluded from the search results. If an invalid value is provided, the default value is used. + */ + excludeConnectAddons?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findUsersAndGroups({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get license + * @request GET :/rest/api/3/instance/license + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetLicense( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getLicense({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create issue + * @request POST :/rest/api/3/issue + * @allowrelaxedtypes + */ +export async function postRestCreateIssue( + query: { + /** + * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown under **Projects** in Jira. When provided, the issue type and request type are added to the user's history for a project. These values are then used to provide defaults on the issue create screen. + */ + updateHistory?: boolean; + }, + /** Request body */ + data: IssueUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssue({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Bulk create issue + * @request POST :/rest/api/3/issue/bulk + * @allowrelaxedtypes + */ +export async function postRestCreateIssues( + /** Request body */ + data: IssuesUpdateBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssues({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get create issue metadata + * @request GET :/rest/api/3/issue/createmeta + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetCreateIssueMeta( + query: { + /** + * List of project IDs. This parameter accepts a comma-separated list. Multiple project IDs can also be provided using an ampersand-separated list. For example, `projectIds=10000,10001&projectIds=10020,10021`. This parameter may be provided with `projectKeys`. + */ + projectIds?: string[]; + /** + * List of project keys. This parameter accepts a comma-separated list. Multiple project keys can also be provided using an ampersand-separated list. For example, `projectKeys=proj1,proj2&projectKeys=proj3`. This parameter may be provided with `projectIds`. + */ + projectKeys?: string[]; + /** + * List of issue type IDs. This parameter accepts a comma-separated list. Multiple issue type IDs can also be provided using an ampersand-separated list. For example, `issuetypeIds=10000,10001&issuetypeIds=10020,10021`. This parameter may be provided with `issuetypeNames`. + */ + issuetypeIds?: string[]; + /** + * List of issue type names. This parameter accepts a comma-separated list. Multiple issue type names can also be provided using an ampersand-separated list. For example, `issuetypeNames=name1,name2&issuetypeNames=name3`. This parameter may be provided with `issuetypeIds`. + */ + issuetypeNames?: string[]; + /** + * Use [expand](#expansion) to include additional information about issue metadata in the response. This parameter accepts `projects.issuetypes.fields`, which returns information about the fields in the issue creation screen for each issue type. Fields hidden from the screen are not returned. Use the information to populate the `fields` and `update` fields in [Create issue](#api-rest-api-3-issue-post) and [Create issues](#api-rest-api-3-issue-bulk-post). + */ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCreateIssueMeta({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue picker suggestions + * @request GET :/rest/api/3/issue/picker + * @readonly + */ +export async function getRestGetIssuePickerResource( + query: { + /** + * A string to match against text fields in the issue such as title, description, or comments. + */ + query?: string; + /** + * A JQL query defining a list of issues to search for the query term. Note that `username` and `userkey` cannot be used as search terms for this parameter, due to privacy reasons. Use `accountId` instead. + */ + currentJQL?: string; + /** + * The key of an issue to exclude from search results. For example, the issue the user is viewing when they perform this query. + */ + currentIssueKey?: string; + /** + * The ID of a project that suggested issues must belong to. + */ + currentProjectId?: string; + /** + * Indicate whether to include subtasks in the suggestions list. + */ + showSubTasks?: boolean; + /** + * When `currentIssueKey` is a subtask, whether to include the parent issue in the suggestions if it matches the query. + */ + showSubTaskParent?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssuePickerResource({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Bulk set issues properties by list + * @request POST :/rest/api/3/issue/properties + * @allowrelaxedtypes + */ +export async function postRestBulkSetIssuesPropertiesList( + /** Request body */ + data: IssueEntityProperties, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.bulkSetIssuesPropertiesList({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Bulk set issue properties by issue + * @request POST :/rest/api/3/issue/properties/multi + * @allowrelaxedtypes + */ +export async function postRestBulkSetIssuePropertiesByIssue( + /** Request body */ + data: MultiIssueEntityProperties, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.bulkSetIssuePropertiesByIssue({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Bulk delete issue property + * @request DELETE :/rest/api/3/issue/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestBulkDeleteIssueProperty( + /** + * The key of the property. + */ + propertyKey: string, + /** Request body */ + data: IssueFilterForBulkPropertyDelete, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.bulkDeleteIssueProperty({ + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Bulk set issue property + * @request PUT :/rest/api/3/issue/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestBulkSetIssueProperty( + /** + * The key of the property. The maximum length is 255 characters. + */ + propertyKey: string, + /** Request body */ + data: BulkIssuePropertyUpdateRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.bulkSetIssueProperty({ + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get is watching issue bulk + * @request POST :/rest/api/3/issue/watching + */ +export async function postRestGetIsWatchingIssueBulk( + /** Request body */ + data: IssueList, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIsWatchingIssueBulk({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete issue + * @request DELETE :/rest/api/3/issue/{issueIdOrKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssue( + query: { + /** + * Whether the issue's subtasks are deleted when the issue is deleted. + */ + deleteSubtasks?: "true" | "false"; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssue({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue + * @request GET :/rest/api/3/issue/{issueIdOrKey} + * @readonly + */ +export async function getRestGetIssue( + query: { + /** +* A list of fields to return for the issue. This parameter accepts a comma-separated list. Use it to retrieve a subset of fields. Allowed values: + + * `*all` Returns all fields. + * `*navigable` Returns navigable fields. + * Any issue field, prefixed with a minus to exclude. + +Examples: + + * `summary,comment` Returns only the summary and comments fields. + * `-description` Returns all (default) fields except description. + * `*navigable,-comment` Returns all navigable fields except comment. + +This parameter may be specified multiple times. For example, `fields=field1,field2& fields=field3`. + +Note: All fields are returned by default. This differs from [Search for issues using JQL (GET)](#api-rest-api-3-search-get) and [Search for issues using JQL (POST)](#api-rest-api-3-search-post) where the default is all navigable fields. +*/ + fields?: string[]; + /** + * Whether fields in `fields` are referenced by keys rather than IDs. This parameter is useful where fields have been added by a connect app and a field's key may differ from its ID. + */ + fieldsByKeys?: boolean; + /** +* Use [expand](#expansion) to include additional information about the issues in the response. This parameter accepts a comma-separated list. Expand options include: + + * `renderedFields` Returns field values rendered in HTML format. + * `names` Returns the display name of each field. + * `schema` Returns the schema describing a field type. + * `transitions` Returns all possible transitions for the issue. + * `editmeta` Returns information about how each field can be edited. + * `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * `versionedRepresentations` Returns a JSON array for each version of a field's value, with the highest number representing the most recent version. Note: When included in the request, the `fields` parameter is ignored. +*/ + expand?: string; + /** +* A list of issue properties to return for the issue. This parameter accepts a comma-separated list. Allowed values: + + * `*all` Returns all issue properties. + * Any issue property key, prefixed with a minus to exclude. + +Examples: + + * `*all` Returns all properties. + * `*all,-prop1` Returns all properties except `prop1`. + * `prop1,prop2` Returns `prop1` and `prop2` properties. + +This parameter may be specified multiple times. For example, `properties=prop1,prop2& properties=prop3`. +*/ + properties?: string[]; + /** + * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown under **Projects** in Jira. This also populates the [JQL issues search](#api-rest-api-3-search-get) `lastViewed` field. + */ + updateHistory?: boolean; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssue({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Edit issue + * @request PUT :/rest/api/3/issue/{issueIdOrKey} + * @allowrelaxedtypes + */ +export async function putRestEditIssue( + query: { + /** + * Whether a notification email about the issue update is sent to all watchers. To disable the notification, administer Jira or administer project permissions are required. If the user doesn't have the necessary permission the request is ignored. + */ + notifyUsers?: boolean; + /** + * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideScreenSecurity?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag?: boolean; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** Request body */ + data: IssueUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.editIssue({ + query: query, + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Assign issue + * @request PUT :/rest/api/3/issue/{issueIdOrKey}/assignee + * @allowrelaxedtypes + */ +export async function putRestAssignIssue( + /** + * The ID or key of the issue to be assigned. + */ + issueIdOrKey: string, + /** Request body */ + data: User, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.assignIssue({ + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Add attachment + * @request POST :/rest/api/3/issue/{issueIdOrKey}/attachments + */ +export async function postRestAddAttachment( + /** + * The ID or key of the issue that attachments are added to. + */ + issueIdOrKey: string, + /** Request body */ + data: File, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addAttachment({ + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get changelogs + * @request GET :/rest/api/3/issue/{issueIdOrKey}/changelog + * @readonly + */ +export async function getRestGetChangeLogs( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getChangeLogs({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get changelogs by IDs + * @request POST :/rest/api/3/issue/{issueIdOrKey}/changelog/list + */ +export async function postRestGetChangeLogsByIds( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** Request body */ + data: IssueChangelogIds, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getChangeLogsByIds({ + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get comments + * @request GET :/rest/api/3/issue/{issueIdOrKey}/comment + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetComments( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * [Order](#ordering) the results by a field. Accepts *created* to sort comments by their created date. + */ + orderBy?: "created" | "-created" | "+created"; + /** + * Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. + */ + expand?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getComments({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add comment + * @request POST :/rest/api/3/issue/{issueIdOrKey}/comment + * @allowrelaxedtypes + */ +export async function postRestAddComment( + query: { + /** + * Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. + */ + expand?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** Request body */ + data: Comment, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addComment({ + query: query, + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete comment + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/comment/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteComment( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the comment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteComment({ + issueIdOrKey: issueIdOrKey, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get comment + * @request GET :/rest/api/3/issue/{issueIdOrKey}/comment/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetComment( + query: { + /** + * Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. + */ + expand?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the comment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getComment({ + query: query, + issueIdOrKey: issueIdOrKey, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update comment + * @request PUT :/rest/api/3/issue/{issueIdOrKey}/comment/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateComment( + query: { + /** + * Whether users are notified when a comment is updated. + */ + notifyUsers?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with the *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag?: boolean; + /** + * Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. + */ + expand?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the comment. + */ + id: string, + /** Request body */ + data: Comment, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateComment({ + query: query, + issueIdOrKey: issueIdOrKey, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get edit issue metadata + * @request GET :/rest/api/3/issue/{issueIdOrKey}/editmeta + * @readonly + */ +export async function getRestGetEditIssueMeta( + query: { + /** + * Whether hidden fields are returned. Available to Connect app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideScreenSecurity?: boolean; + /** + * Whether non-editable fields are returned. Available to Connect app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag?: boolean; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getEditIssueMeta({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Send notification for issue + * @request POST :/rest/api/3/issue/{issueIdOrKey}/notify + * @allowrelaxedtypes + */ +export async function postRestNotify( + /** + * ID or key of the issue that the notification is sent for. + */ + issueIdOrKey: string, + /** Request body */ + data: Notification, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.notify({ + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get issue property keys + * @request GET :/rest/api/3/issue/{issueIdOrKey}/properties + * @readonly + */ +export async function getRestGetIssuePropertyKeys( + /** + * The key or ID of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssuePropertyKeys({ + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete issue property + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueProperty( + /** + * The key or ID of the issue. + */ + issueIdOrKey: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueProperty({ + issueIdOrKey: issueIdOrKey, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue property + * @request GET :/rest/api/3/issue/{issueIdOrKey}/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueProperty( + /** + * The key or ID of the issue. + */ + issueIdOrKey: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueProperty({ + issueIdOrKey: issueIdOrKey, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set issue property + * @request PUT :/rest/api/3/issue/{issueIdOrKey}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestSetIssueProperty( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The key of the issue property. The maximum length is 255 characters. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setIssueProperty({ + issueIdOrKey: issueIdOrKey, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete remote issue link by global ID + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/remotelink + * @allowrelaxedtypes + */ +export async function deleteRestDeleteRemoteIssueLinkByGlobalId( + query: { + /** + * The global ID of a remote issue link. + */ + globalId: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteRemoteIssueLinkByGlobalId({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get remote issue links + * @request GET :/rest/api/3/issue/{issueIdOrKey}/remotelink + * @readonly + */ +export async function getRestGetRemoteIssueLinks( + query: { + /** + * The global ID of the remote issue link. + */ + globalId?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getRemoteIssueLinks({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create or update remote issue link + * @request POST :/rest/api/3/issue/{issueIdOrKey}/remotelink + */ +export async function postRestCreateOrUpdateRemoteIssueLink( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** Request body */ + data: RemoteIssueLinkRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createOrUpdateRemoteIssueLink({ + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete remote issue link by ID + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/remotelink/{linkId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteRemoteIssueLinkById( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of a remote issue link. + */ + linkId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteRemoteIssueLinkById({ + issueIdOrKey: issueIdOrKey, + linkId: linkId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get remote issue link by ID + * @request GET :/rest/api/3/issue/{issueIdOrKey}/remotelink/{linkId} + * @readonly + */ +export async function getRestGetRemoteIssueLinkById( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the remote issue link. + */ + linkId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getRemoteIssueLinkById({ + issueIdOrKey: issueIdOrKey, + linkId: linkId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update remote issue link by ID + * @request PUT :/rest/api/3/issue/{issueIdOrKey}/remotelink/{linkId} + * @allowrelaxedtypes + */ +export async function putRestUpdateRemoteIssueLink( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the remote issue link. + */ + linkId: string, + /** Request body */ + data: RemoteIssueLinkRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateRemoteIssueLink({ + issueIdOrKey: issueIdOrKey, + linkId: linkId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get transitions + * @request GET :/rest/api/3/issue/{issueIdOrKey}/transitions + * @readonly + */ +export async function getRestGetTransitions( + query: { + /** + * Use [expand](#expansion) to include additional information about transitions in the response. This parameter accepts `transitions.fields`, which returns information about the fields in the transition screen for each transition. Fields hidden from the screen are not returned. Use this information to populate the `fields` and `update` fields in [Transition issue](#api-rest-api-3-issue-issueIdOrKey-transitions-post). + */ + expand?: string; + /** + * The ID of the transition. + */ + transitionId?: string; + /** + * Whether transitions with the condition *Hide From User Condition* are included in the response. + */ + skipRemoteOnlyCondition?: boolean; + /** + * Whether details of transitions that fail a condition are included in the response + */ + includeUnavailableTransitions?: boolean; + /** + * Whether the transitions are sorted by ops-bar sequence value first then category order (Todo, In Progress, Done) or only by ops-bar sequence value. + */ + sortByOpsBarAndStatus?: boolean; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getTransitions({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Transition issue + * @request POST :/rest/api/3/issue/{issueIdOrKey}/transitions + * @allowrelaxedtypes + */ +export async function postRestDoTransition( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** Request body */ + data: IssueUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.doTransition({ + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete vote + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/votes + * @allowrelaxedtypes + */ +export async function deleteRestRemoveVote( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeVote({ + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get votes + * @request GET :/rest/api/3/issue/{issueIdOrKey}/votes + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetVotes( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getVotes({ + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add vote + * @request POST :/rest/api/3/issue/{issueIdOrKey}/votes + * @allowrelaxedtypes + */ +export async function postRestAddVote( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addVote({ + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete watcher + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/watchers + * @allowrelaxedtypes + */ +export async function deleteRestRemoveWatcher( + query: { + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. Required. + */ + accountId?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeWatcher({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue watchers + * @request GET :/rest/api/3/issue/{issueIdOrKey}/watchers + * @readonly + */ +export async function getRestGetIssueWatchers( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueWatchers({ + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add watcher + * @request POST :/rest/api/3/issue/{issueIdOrKey}/watchers + * @allowrelaxedtypes + */ +export async function postRestAddWatcher( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** Request body */ + data: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addWatcher({ + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get issue worklogs + * @request GET :/rest/api/3/issue/{issueIdOrKey}/worklog + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueWorklog( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The worklog start date and time, as a UNIX timestamp in milliseconds, after which worklogs are returned. + */ + startedAfter?: number; + /** + * The worklog start date and time, as a UNIX timestamp in milliseconds, before which worklogs are returned. + */ + startedBefore?: number; + /** + * Use [expand](#expansion) to include additional information about worklogs in the response. This parameter accepts`properties`, which returns worklog properties. + */ + expand?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueWorklog({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add worklog + * @request POST :/rest/api/3/issue/{issueIdOrKey}/worklog + * @allowrelaxedtypes + */ +export async function postRestAddWorklog( + query: { + /** + * Whether users watching the issue are notified by email. + */ + notifyUsers?: boolean; + /** +* Defines how to update the issue's time estimate, the options are: + + * `new` Sets the estimate to a specific value, defined in `newEstimate`. + * `leave` Leaves the estimate unchanged. + * `manual` Reduces the estimate by amount specified in `reduceBy`. + * `auto` Reduces the estimate by the value of `timeSpent` in the worklog. +*/ + adjustEstimate?: "new" | "leave" | "manual" | "auto"; + /** + * The value to set as the issue's remaining time estimate, as days (\#d), hours (\#h), or minutes (\#m or \#). For example, *2d*. Required when `adjustEstimate` is `new`. + */ + newEstimate?: string; + /** + * The amount to reduce the issue's remaining estimate by, as days (\#d), hours (\#h), or minutes (\#m). For example, *2d*. Required when `adjustEstimate` is `manual`. + */ + reduceBy?: string; + /** + * Use [expand](#expansion) to include additional information about work logs in the response. This parameter accepts `properties`, which returns worklog properties. + */ + expand?: string; + /** + * Whether the worklog entry should be added to the issue even if the issue is not editable, because jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. + */ + overrideEditableFlag?: boolean; + }, + /** + * The ID or key the issue. + */ + issueIdOrKey: string, + /** Request body */ + data: Worklog, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addWorklog({ + query: query, + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete worklog + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/worklog/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorklog( + query: { + /** + * Whether users watching the issue are notified by email. + */ + notifyUsers?: boolean; + /** +* Defines how to update the issue's time estimate, the options are: + + * `new` Sets the estimate to a specific value, defined in `newEstimate`. + * `leave` Leaves the estimate unchanged. + * `manual` Increases the estimate by amount specified in `increaseBy`. + * `auto` Reduces the estimate by the value of `timeSpent` in the worklog. +*/ + adjustEstimate?: "new" | "leave" | "manual" | "auto"; + /** + * The value to set as the issue's remaining time estimate, as days (\#d), hours (\#h), or minutes (\#m or \#). For example, *2d*. Required when `adjustEstimate` is `new`. + */ + newEstimate?: string; + /** + * The amount to increase the issue's remaining estimate by, as days (\#d), hours (\#h), or minutes (\#m or \#). For example, *2d*. Required when `adjustEstimate` is `manual`. + */ + increaseBy?: string; + /** + * Whether the work log entry should be added to the issue even if the issue is not editable, because jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with admin permission can use this flag. + */ + overrideEditableFlag?: boolean; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the worklog. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorklog({ + query: query, + issueIdOrKey: issueIdOrKey, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get worklog + * @request GET :/rest/api/3/issue/{issueIdOrKey}/worklog/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorklog( + query: { + /** +* Use [expand](#expansion) to include additional information about work logs in the response. This parameter accepts + +`properties`, which returns worklog properties. +*/ + expand?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the worklog. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorklog({ + query: query, + issueIdOrKey: issueIdOrKey, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update worklog + * @request PUT :/rest/api/3/issue/{issueIdOrKey}/worklog/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateWorklog( + query: { + /** + * Whether users watching the issue are notified by email. + */ + notifyUsers?: boolean; + /** +* Defines how to update the issue's time estimate, the options are: + + * `new` Sets the estimate to a specific value, defined in `newEstimate`. + * `leave` Leaves the estimate unchanged. + * `auto` Updates the estimate by the difference between the original and updated value of `timeSpent` or `timeSpentSeconds`. +*/ + adjustEstimate?: "new" | "leave" | "manual" | "auto"; + /** + * The value to set as the issue's remaining time estimate, as days (\#d), hours (\#h), or minutes (\#m or \#). For example, *2d*. Required when `adjustEstimate` is `new`. + */ + newEstimate?: string; + /** + * Use [expand](#expansion) to include additional information about worklogs in the response. This parameter accepts `properties`, which returns worklog properties. + */ + expand?: string; + /** + * Whether the worklog should be added to the issue even if the issue is not editable. For example, because the issue is closed. Connect and Forge app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. + */ + overrideEditableFlag?: boolean; + }, + /** + * The ID or key the issue. + */ + issueIdOrKey: string, + /** + * The ID of the worklog. + */ + id: string, + /** Request body */ + data: Worklog, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateWorklog({ + query: query, + issueIdOrKey: issueIdOrKey, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get worklog property keys + * @request GET :/rest/api/3/issue/{issueIdOrKey}/worklog/{worklogId}/properties + * @readonly + */ +export async function getRestGetWorklogPropertyKeys( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the worklog. + */ + worklogId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorklogPropertyKeys({ + issueIdOrKey: issueIdOrKey, + worklogId: worklogId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete worklog property + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/worklog/{worklogId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorklogProperty( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the worklog. + */ + worklogId: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorklogProperty({ + issueIdOrKey: issueIdOrKey, + worklogId: worklogId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get worklog property + * @request GET :/rest/api/3/issue/{issueIdOrKey}/worklog/{worklogId}/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorklogProperty( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the worklog. + */ + worklogId: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorklogProperty({ + issueIdOrKey: issueIdOrKey, + worklogId: worklogId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set worklog property + * @request PUT :/rest/api/3/issue/{issueIdOrKey}/worklog/{worklogId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestSetWorklogProperty( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the worklog. + */ + worklogId: string, + /** + * The key of the issue property. The maximum length is 255 characters. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setWorklogProperty({ + issueIdOrKey: issueIdOrKey, + worklogId: worklogId, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Create issue link + * @request POST :/rest/api/3/issueLink + * @allowrelaxedtypes + */ +export async function postRestLinkIssues( + /** Request body */ + data: LinkIssueRequestJsonBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.linkIssues({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete issue link + * @request DELETE :/rest/api/3/issueLink/{linkId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueLink( + /** + * The ID of the issue link. + */ + linkId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueLink({ + linkId: linkId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue link + * @request GET :/rest/api/3/issueLink/{linkId} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueLink( + /** + * The ID of the issue link. + */ + linkId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueLink({ + linkId: linkId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue link types + * @request GET :/rest/api/3/issueLinkType + * @readonly + */ +export async function getRestGetIssueLinkTypes( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueLinkTypes({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create issue link type + * @request POST :/rest/api/3/issueLinkType + */ +export async function postRestCreateIssueLinkType( + /** Request body */ + data: IssueLinkType, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssueLinkType({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete issue link type + * @request DELETE :/rest/api/3/issueLinkType/{issueLinkTypeId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueLinkType( + /** + * The ID of the issue link type. + */ + issueLinkTypeId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueLinkType({ + issueLinkTypeId: issueLinkTypeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue link type + * @request GET :/rest/api/3/issueLinkType/{issueLinkTypeId} + * @readonly + */ +export async function getRestGetIssueLinkType( + /** + * The ID of the issue link type. + */ + issueLinkTypeId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueLinkType({ + issueLinkTypeId: issueLinkTypeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update issue link type + * @request PUT :/rest/api/3/issueLinkType/{issueLinkTypeId} + */ +export async function putRestUpdateIssueLinkType( + /** + * The ID of the issue link type. + */ + issueLinkTypeId: string, + /** Request body */ + data: IssueLinkType, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateIssueLinkType({ + issueLinkTypeId: issueLinkTypeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue security schemes + * @request GET :/rest/api/3/issuesecurityschemes + * @readonly + */ +export async function getRestGetIssueSecuritySchemes( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueSecuritySchemes({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue security scheme + * @request GET :/rest/api/3/issuesecurityschemes/{id} + * @readonly + */ +export async function getRestGetIssueSecurityScheme( + /** + * The ID of the issue security scheme. Use the [Get issue security schemes](#api-rest-api-3-issuesecurityschemes-get) operation to get a list of issue security scheme IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueSecurityScheme({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue security level members + * @request GET :/rest/api/3/issuesecurityschemes/{issueSecuritySchemeId}/members + * @readonly + */ +export async function getRestGetIssueSecurityLevelMembers( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of issue security level IDs. To include multiple issue security levels separate IDs with ampersand: `issueSecurityLevelId=10000&issueSecurityLevelId=10001`. + */ + issueSecurityLevelId?: number[]; + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + /** + * The ID of the issue security scheme. Use the [Get issue security schemes](#api-rest-api-3-issuesecurityschemes-get) operation to get a list of issue security scheme IDs. + */ + issueSecuritySchemeId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueSecurityLevelMembers({ + query: query, + issueSecuritySchemeId: issueSecuritySchemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all issue types for user + * @request GET :/rest/api/3/issuetype + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueAllTypes( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueAllTypes({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create issue type + * @request POST :/rest/api/3/issuetype + * @allowrelaxedtypes + */ +export async function postRestCreateIssueType( + /** Request body */ + data: IssueTypeCreateBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssueType({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue types for project + * @request GET :/rest/api/3/issuetype/project + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueTypesForProject( + query: { + /** + * The ID of the project. + */ + projectId: number; + /** +* The level of the issue type to filter by. Use: + + * `-1` for Subtask. + * `0` for Base. + * `1` for Epic. +*/ + level?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypesForProject({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete issue type + * @request DELETE :/rest/api/3/issuetype/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueType( + query: { + /** + * The ID of the replacement issue type. + */ + alternativeIssueTypeId?: string; + }, + /** + * The ID of the issue type. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueType({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue type + * @request GET :/rest/api/3/issuetype/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueType( + /** + * The ID of the issue type. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueType({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update issue type + * @request PUT :/rest/api/3/issuetype/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateIssueType( + /** + * The ID of the issue type. + */ + id: string, + /** Request body */ + data: IssueTypeUpdateBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateIssueType({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get alternative issue types + * @request GET :/rest/api/3/issuetype/{id}/alternatives + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAlternativeIssueTypes( + /** + * The ID of the issue type. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAlternativeIssueTypes({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Load issue type avatar + * @request POST :/rest/api/3/issuetype/{id}/avatar2 + */ +export async function postRestCreateIssueTypeAvatar( + query: { + /** + * The X coordinate of the top-left corner of the crop region. + */ + x?: number; + /** + * The Y coordinate of the top-left corner of the crop region. + */ + y?: number; + /** + * The length of each side of the crop region. + */ + size: number; + }, + /** + * The ID of the issue type. + */ + id: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssueTypeAvatar({ + query: query, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue type property keys + * @request GET :/rest/api/3/issuetype/{issueTypeId}/properties + * @readonly + */ +export async function getRestGetIssueTypePropertyKeys( + /** + * The ID of the issue type. + */ + issueTypeId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypePropertyKeys({ + issueTypeId: issueTypeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete issue type property + * @request DELETE :/rest/api/3/issuetype/{issueTypeId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueTypeProperty( + /** + * The ID of the issue type. + */ + issueTypeId: string, + /** + * The key of the property. Use [Get issue type property keys](#api-rest-api-3-issuetype-issueTypeId-properties-get) to get a list of all issue type property keys. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueTypeProperty({ + issueTypeId: issueTypeId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue type property + * @request GET :/rest/api/3/issuetype/{issueTypeId}/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueTypeProperty( + /** + * The ID of the issue type. + */ + issueTypeId: string, + /** + * The key of the property. Use [Get issue type property keys](#api-rest-api-3-issuetype-issueTypeId-properties-get) to get a list of all issue type property keys. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypeProperty({ + issueTypeId: issueTypeId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set issue type property + * @request PUT :/rest/api/3/issuetype/{issueTypeId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestSetIssueTypeProperty( + /** + * The ID of the issue type. + */ + issueTypeId: string, + /** + * The key of the issue type property. The maximum length is 255 characters. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setIssueTypeProperty({ + issueTypeId: issueTypeId, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all issue type schemes + * @request GET :/rest/api/3/issuetypescheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllIssueTypeSchemes( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of issue type schemes IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + */ + id?: number[]; + /** +* [Order](#ordering) the results by a field: + + * `name` Sorts by issue type scheme name. + * `id` Sorts by issue type scheme ID. +*/ + orderBy?: "name" | "-name" | "+name" | "id" | "-id" | "+id"; + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `projects` For each issue type schemes, returns information about the projects the issue type scheme is assigned to. + * `issueTypes` For each issue type schemes, returns information about the issueTypes the issue type scheme have. +*/ + expand?: string; + /** + * String used to perform a case-insensitive partial match with issue type scheme name. + */ + queryString?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllIssueTypeSchemes({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create issue type scheme + * @request POST :/rest/api/3/issuetypescheme + */ +export async function postRestCreateIssueTypeScheme( + /** Request body */ + data: IssueTypeSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssueTypeScheme({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue type scheme items + * @request GET :/rest/api/3/issuetypescheme/mapping + * @readonly + */ +export async function getRestGetIssueTypeSchemesMapping( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of issue type scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, `issueTypeSchemeId=10000&issueTypeSchemeId=10001`. + */ + issueTypeSchemeId?: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypeSchemesMapping({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue type schemes for projects + * @request GET :/rest/api/3/issuetypescheme/project + * @readonly + */ +export async function getRestGetIssueTypeSchemeForProjects( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of project IDs. To include multiple project IDs, provide an ampersand-separated list. For example, `projectId=10000&projectId=10001`. + */ + projectId: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypeSchemeForProjects({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Assign issue type scheme to project + * @request PUT :/rest/api/3/issuetypescheme/project + * @allowrelaxedtypes + */ +export async function putRestAssignIssueTypeSchemeToProject( + /** Request body */ + data: IssueTypeSchemeProjectAssociation, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.assignIssueTypeSchemeToProject({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete issue type scheme + * @request DELETE :/rest/api/3/issuetypescheme/{issueTypeSchemeId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueTypeScheme( + /** + * The ID of the issue type scheme. + */ + issueTypeSchemeId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueTypeScheme({ + issueTypeSchemeId: issueTypeSchemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update issue type scheme + * @request PUT :/rest/api/3/issuetypescheme/{issueTypeSchemeId} + * @allowrelaxedtypes + */ +export async function putRestUpdateIssueTypeScheme( + /** + * The ID of the issue type scheme. + */ + issueTypeSchemeId: number, + /** Request body */ + data: IssueTypeSchemeUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateIssueTypeScheme({ + issueTypeSchemeId: issueTypeSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Add issue types to issue type scheme + * @request PUT :/rest/api/3/issuetypescheme/{issueTypeSchemeId}/issuetype + * @allowrelaxedtypes + */ +export async function putRestAddIssueTypesToIssueTypeScheme( + /** + * The ID of the issue type scheme. + */ + issueTypeSchemeId: number, + /** Request body */ + data: IssueTypeIds, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addIssueTypesToIssueTypeScheme({ + issueTypeSchemeId: issueTypeSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Change order of issue types + * @request PUT :/rest/api/3/issuetypescheme/{issueTypeSchemeId}/issuetype/move + * @allowrelaxedtypes + */ +export async function putRestReorderIssueTypesInIssueTypeScheme( + /** + * The ID of the issue type scheme. + */ + issueTypeSchemeId: number, + /** Request body */ + data: OrderOfIssueTypes, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.reorderIssueTypesInIssueTypeScheme({ + issueTypeSchemeId: issueTypeSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Remove issue type from issue type scheme + * @request DELETE :/rest/api/3/issuetypescheme/{issueTypeSchemeId}/issuetype/{issueTypeId} + * @allowrelaxedtypes + */ +export async function deleteRestRemoveIssueTypeFromIssueTypeScheme( + /** + * The ID of the issue type scheme. + */ + issueTypeSchemeId: number, + /** + * The ID of the issue type. + */ + issueTypeId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeIssueTypeFromIssueTypeScheme({ + issueTypeSchemeId: issueTypeSchemeId, + issueTypeId: issueTypeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get issue type screen schemes + * @request GET :/rest/api/3/issuetypescreenscheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueTypeScreenSchemes( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of issue type screen scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + */ + id?: number[]; + /** + * String used to perform a case-insensitive partial match with issue type screen scheme name. + */ + queryString?: string; + /** +* [Order](#ordering) the results by a field: + + * `name` Sorts by issue type screen scheme name. + * `id` Sorts by issue type screen scheme ID. +*/ + orderBy?: "name" | "-name" | "+name" | "id" | "-id" | "+id"; + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts `projects` that, for each issue type screen schemes, returns information about the projects the issue type screen scheme is assigned to. + */ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypeScreenSchemes({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create issue type screen scheme + * @request POST :/rest/api/3/issuetypescreenscheme + */ +export async function postRestCreateIssueTypeScreenScheme( + /** Request body */ + data: IssueTypeScreenSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssueTypeScreenScheme({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue type screen scheme items + * @request GET :/rest/api/3/issuetypescreenscheme/mapping + * @readonly + */ +export async function getRestGetIssueTypeScreenSchemeMappings( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of issue type screen scheme IDs. To include multiple issue type screen schemes, separate IDs with ampersand: `issueTypeScreenSchemeId=10000&issueTypeScreenSchemeId=10001`. + */ + issueTypeScreenSchemeId?: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypeScreenSchemeMappings({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue type screen schemes for projects + * @request GET :/rest/api/3/issuetypescreenscheme/project + * @readonly + */ +export async function getRestGetIssueTypeScreenSchemeProjectAssociations( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of project IDs. To include multiple projects, separate IDs with ampersand: `projectId=10000&projectId=10001`. + */ + projectId: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypeScreenSchemeProjectAssociations({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Assign issue type screen scheme to project + * @request PUT :/rest/api/3/issuetypescreenscheme/project + * @allowrelaxedtypes + */ +export async function putRestAssignIssueTypeScreenSchemeToProject( + /** Request body */ + data: IssueTypeScreenSchemeProjectAssociation, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.assignIssueTypeScreenSchemeToProject({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete issue type screen scheme + * @request DELETE :/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueTypeScreenScheme( + /** + * The ID of the issue type screen scheme. + */ + issueTypeScreenSchemeId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueTypeScreenScheme({ + issueTypeScreenSchemeId: issueTypeScreenSchemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update issue type screen scheme + * @request PUT :/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId} + * @allowrelaxedtypes + */ +export async function putRestUpdateIssueTypeScreenScheme( + /** + * The ID of the issue type screen scheme. + */ + issueTypeScreenSchemeId: string, + /** Request body */ + data: IssueTypeScreenSchemeUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateIssueTypeScreenScheme({ + issueTypeScreenSchemeId: issueTypeScreenSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Append mappings to issue type screen scheme + * @request PUT :/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId}/mapping + * @allowrelaxedtypes + */ +export async function putRestAppendMappingsForIssueTypeScreenScheme( + /** + * The ID of the issue type screen scheme. + */ + issueTypeScreenSchemeId: string, + /** Request body */ + data: IssueTypeScreenSchemeMappingDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.appendMappingsForIssueTypeScreenScheme({ + issueTypeScreenSchemeId: issueTypeScreenSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update issue type screen scheme default screen scheme + * @request PUT :/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId}/mapping/default + * @allowrelaxedtypes + */ +export async function putRestUpdateDefaultScreenScheme( + /** + * The ID of the issue type screen scheme. + */ + issueTypeScreenSchemeId: string, + /** Request body */ + data: UpdateDefaultScreenScheme, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateDefaultScreenScheme({ + issueTypeScreenSchemeId: issueTypeScreenSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Remove mappings from issue type screen scheme + * @request POST :/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId}/mapping/remove + * @allowrelaxedtypes + */ +export async function postRestRemoveMappingsFromIssueTypeScreenScheme( + /** + * The ID of the issue type screen scheme. + */ + issueTypeScreenSchemeId: string, + /** Request body */ + data: IssueTypeIds, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeMappingsFromIssueTypeScreenScheme({ + issueTypeScreenSchemeId: issueTypeScreenSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get issue type screen scheme projects + * @request GET :/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId}/project + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectsForIssueTypeScreenScheme( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + query?: string; + }, + /** + * The ID of the issue type screen scheme. + */ + issueTypeScreenSchemeId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectsForIssueTypeScreenScheme({ + query: query, + issueTypeScreenSchemeId: issueTypeScreenSchemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get field reference data (GET) + * @request GET :/rest/api/3/jql/autocompletedata + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAutoComplete( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAutoComplete({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get field reference data (POST) + * @request POST :/rest/api/3/jql/autocompletedata + * @allowrelaxedtypes + */ +export async function postRestGetAutoCompletePost( + /** Request body */ + data: SearchAutoCompleteFilter, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAutoCompletePost({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get field auto complete suggestions + * @request GET :/rest/api/3/jql/autocompletedata/suggestions + * @readonly + */ +export async function getRestGetFieldAutoCompleteForQueryString( + query: { + /** + * The name of the field. + */ + fieldName?: string; + /** + * The partial field item name entered by the user. + */ + fieldValue?: string; + /** + * The name of the [ CHANGED operator predicate](https://confluence.atlassian.com/x/hQORLQ#Advancedsearching-operatorsreference-CHANGEDCHANGED) for which the suggestions are generated. The valid predicate operators are *by*, *from*, and *to*. + */ + predicateName?: string; + /** + * The partial predicate item name entered by the user. + */ + predicateValue?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFieldAutoCompleteForQueryString({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get precomputation + * @request GET :/rest/api/3/jql/function/computation + * @readonly + */ +export async function getRestGetPrecomputations( + query: { + functionKey?: string[]; + startAt?: number; + maxResults?: number; + orderBy?: string; + filter?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPrecomputations({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update precomputations + * @request POST :/rest/api/3/jql/function/computation + * @allowrelaxedtypes + */ +export async function postRestUpdatePrecomputations( + /** Request body */ + data: JqlFunctionPrecomputationUpdateRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updatePrecomputations({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Check issues against JQL + * @request POST :/rest/api/3/jql/match + */ +export async function postRestMatchIssues( + /** Request body */ + data: IssuesAndJQLQueries, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.matchIssues({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Parse JQL query + * @request POST :/rest/api/3/jql/parse + * @allowrelaxedtypes + */ +export async function postRestParseJqlQueries( + query: { + /** +* How to validate the JQL query and treat the validation results. Validation options include: + + * `strict` Returns all errors. If validation fails, the query structure is not returned. + * `warn` Returns all errors. If validation fails but the JQL query is correctly formed, the query structure is returned. + * `none` No validation is performed. If JQL query is correctly formed, the query structure is returned. +*/ + validation?: "strict" | "warn" | "none"; + }, + /** Request body */ + data: JqlQueriesToParse, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.parseJqlQueries({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Convert user identifiers to account IDs in JQL queries + * @request POST :/rest/api/3/jql/pdcleaner + */ +export async function postRestMigrateQueries( + /** Request body */ + data: JQLPersonalDataMigrationRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.migrateQueries({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Sanitize JQL queries + * @request POST :/rest/api/3/jql/sanitize + */ +export async function postRestSanitiseJqlQueries( + /** Request body */ + data: JqlQueriesToSanitize, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.sanitiseJqlQueries({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all labels + * @request GET :/rest/api/3/label + * @readonly + */ +export async function getRestGetAllLabels( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllLabels({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get approximate license count + * @request GET :/rest/api/3/license/approximateLicenseCount + * @readonly + */ +export async function getRestGetApproximateLicenseCount( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getApproximateLicenseCount({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get approximate application license count + * @request GET :/rest/api/3/license/approximateLicenseCount/product/{applicationKey} + * @readonly + */ +export async function getRestGetApproximateApplicationLicenseCount( + applicationKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getApproximateApplicationLicenseCount({ + applicationKey: applicationKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get my permissions + * @request GET :/rest/api/3/mypermissions + * @readonly + */ +export async function getRestGetMyPermissions( + query: { + /** + * The key of project. Ignored if `projectId` is provided. + */ + projectKey?: string; + /** + * The ID of project. + */ + projectId?: string; + /** + * The key of the issue. Ignored if `issueId` is provided. + */ + issueKey?: string; + /** + * The ID of the issue. + */ + issueId?: string; + /** + * A list of permission keys. (Required) This parameter accepts a comma-separated list. To get the list of available permissions, use [Get all permissions](#api-rest-api-3-permissions-get). + */ + permissions?: string; + projectUuid?: string; + projectConfigurationUuid?: string; + /** + * The ID of the comment. + */ + commentId?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getMyPermissions({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete preference + * @request DELETE :/rest/api/3/mypreferences + * @allowrelaxedtypes + */ +export async function deleteRestRemovePreference( + query: { + /** + * The key of the preference. + */ + key: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removePreference({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get preference + * @request GET :/rest/api/3/mypreferences + * @readonly + */ +export async function getRestGetPreference( + query: { + /** + * The key of the preference. + */ + key: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPreference({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set preference + * @request PUT :/rest/api/3/mypreferences + * @allowrelaxedtypes + */ +export async function putRestSetPreference( + query: { + /** + * The key of the preference. The maximum length is 255 characters. + */ + key: string; + }, + /** Request body */ + data: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setPreference({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete locale + * @request DELETE :/rest/api/3/mypreferences/locale + * @allowrelaxedtypes + */ +export async function deleteRestDeleteLocale( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteLocale({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get locale + * @request GET :/rest/api/3/mypreferences/locale + * @readonly + */ +export async function getRestGetLocale( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getLocale({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set locale + * @request PUT :/rest/api/3/mypreferences/locale + * @allowrelaxedtypes + */ +export async function putRestSetLocale( + /** Request body */ + data: Locale, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setLocale({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get current user + * @request GET :/rest/api/3/myself + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetCurrentUser( + query: { + /** +* Use [expand](#expansion) to include additional information about user in the response. This parameter accepts a comma-separated list. Expand options include: + + * `groups` Returns all groups, including nested groups, the user belongs to. + * `applicationRoles` Returns the application roles the user is assigned to. +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCurrentUser({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get notification schemes paginated + * @request GET :/rest/api/3/notificationscheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetNotificationSchemes( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: string; + /** + * The maximum number of items to return per page. + */ + maxResults?: string; + /** + * The list of notification schemes IDs to be filtered by + */ + id?: string[]; + /** + * The list of projects IDs to be filtered by + */ + projectId?: string[]; + /** + * When set to true, returns only the default notification scheme. If you provide project IDs not associated with the default, returns an empty page. The default value is false. + */ + onlyDefault?: boolean; + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `all` Returns all expandable information + * `field` Returns information about any custom fields assigned to receive an event + * `group` Returns information about any groups assigned to receive an event + * `notificationSchemeEvents` Returns a list of event associations. This list is returned for all expandable information + * `projectRole` Returns information about any project roles assigned to receive an event + * `user` Returns information about any users assigned to receive an event +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getNotificationSchemes({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create notification scheme + * @request POST :/rest/api/3/notificationscheme + */ +export async function postRestCreateNotificationScheme( + /** Request body */ + data: CreateNotificationSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createNotificationScheme({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get projects using notification schemes paginated + * @request GET :/rest/api/3/notificationscheme/project + * @readonly + */ +export async function getRestGetNotificationSchemeToProjectMappings( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: string; + /** + * The maximum number of items to return per page. + */ + maxResults?: string; + /** + * The list of notifications scheme IDs to be filtered out + */ + notificationSchemeId?: string[]; + /** + * The list of project IDs to be filtered out + */ + projectId?: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getNotificationSchemeToProjectMappings({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get notification scheme + * @request GET :/rest/api/3/notificationscheme/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetNotificationScheme( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `all` Returns all expandable information + * `field` Returns information about any custom fields assigned to receive an event + * `group` Returns information about any groups assigned to receive an event + * `notificationSchemeEvents` Returns a list of event associations. This list is returned for all expandable information + * `projectRole` Returns information about any project roles assigned to receive an event + * `user` Returns information about any users assigned to receive an event +*/ + expand?: string; + }, + /** + * The ID of the notification scheme. Use [Get notification schemes paginated](#api-rest-api-3-notificationscheme-get) to get a list of notification scheme IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getNotificationScheme({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update notification scheme + * @request PUT :/rest/api/3/notificationscheme/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateNotificationScheme( + /** + * The ID of the notification scheme. + */ + id: string, + /** Request body */ + data: UpdateNotificationSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateNotificationScheme({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Add notifications to notification scheme + * @request PUT :/rest/api/3/notificationscheme/{id}/notification + * @allowrelaxedtypes + */ +export async function putRestAddNotifications( + /** + * The ID of the notification scheme. + */ + id: string, + /** Request body */ + data: AddNotificationsDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addNotifications({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete notification scheme + * @request DELETE :/rest/api/3/notificationscheme/{notificationSchemeId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteNotificationScheme( + /** + * The ID of the notification scheme. + */ + notificationSchemeId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteNotificationScheme({ + notificationSchemeId: notificationSchemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Remove notification from notification scheme + * @request DELETE :/rest/api/3/notificationscheme/{notificationSchemeId}/notification/{notificationId} + * @allowrelaxedtypes + */ +export async function deleteRestRemoveNotificationFromNotificationScheme( + /** + * The ID of the notification scheme. + */ + notificationSchemeId: string, + /** + * The ID of the notification. + */ + notificationId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeNotificationFromNotificationScheme({ + notificationSchemeId: notificationSchemeId, + notificationId: notificationId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all permissions + * @request GET :/rest/api/3/permissions + * @readonly + */ +export async function getRestGetAllPermissions( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllPermissions({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get bulk permissions + * @request POST :/rest/api/3/permissions/check + */ +export async function postRestGetBulkPermissions( + /** Request body */ + data: BulkPermissionsRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getBulkPermissions({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get permitted projects + * @request POST :/rest/api/3/permissions/project + */ +export async function postRestGetPermittedProjects( + /** Request body */ + data: PermissionsKeysBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPermittedProjects({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all permission schemes + * @request GET :/rest/api/3/permissionscheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllPermissionSchemes( + query: { + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are included when you specify any value. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `permissions` Returns all permission grants for each permission scheme. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllPermissionSchemes({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create permission scheme + * @request POST :/rest/api/3/permissionscheme + * @allowrelaxedtypes + */ +export async function postRestCreatePermissionScheme( + query: { + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are always included when you specify any value. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `permissions` Returns all permission grants for each permission scheme. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + /** Request body */ + data: PermissionScheme, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createPermissionScheme({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete permission scheme + * @request DELETE :/rest/api/3/permissionscheme/{schemeId} + * @allowrelaxedtypes + */ +export async function deleteRestDeletePermissionScheme( + /** + * The ID of the permission scheme being deleted. + */ + schemeId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deletePermissionScheme({ + schemeId: schemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get permission scheme + * @request GET :/rest/api/3/permissionscheme/{schemeId} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetPermissionScheme( + query: { + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are included when you specify any value. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `permissions` Returns all permission grants for each permission scheme. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + /** + * The ID of the permission scheme to return. + */ + schemeId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPermissionScheme({ + query: query, + schemeId: schemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update permission scheme + * @request PUT :/rest/api/3/permissionscheme/{schemeId} + * @allowrelaxedtypes + */ +export async function putRestUpdatePermissionScheme( + query: { + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are always included when you specify any value. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `permissions` Returns all permission grants for each permission scheme. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + /** + * The ID of the permission scheme to update. + */ + schemeId: number, + /** Request body */ + data: PermissionScheme, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updatePermissionScheme({ + query: query, + schemeId: schemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get permission scheme grants + * @request GET :/rest/api/3/permissionscheme/{schemeId}/permission + * @readonly + */ +export async function getRestGetPermissionSchemeGrants( + query: { + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are always included when you specify any value. Expand options include: + + * `permissions` Returns all permission grants for each permission scheme. + * `user` Returns information about the user who is granted the permission. + * `group` Returns information about the group that is granted the permission. + * `projectRole` Returns information about the project role granted the permission. + * `field` Returns information about the custom field granted the permission. + * `all` Returns all expandable information. +*/ + expand?: string; + }, + /** + * The ID of the permission scheme. + */ + schemeId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPermissionSchemeGrants({ + query: query, + schemeId: schemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create permission grant + * @request POST :/rest/api/3/permissionscheme/{schemeId}/permission + */ +export async function postRestCreatePermissionGrant( + query: { + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are always included when you specify any value. Expand options include: + + * `permissions` Returns all permission grants for each permission scheme. + * `user` Returns information about the user who is granted the permission. + * `group` Returns information about the group that is granted the permission. + * `projectRole` Returns information about the project role granted the permission. + * `field` Returns information about the custom field granted the permission. + * `all` Returns all expandable information. +*/ + expand?: string; + }, + /** + * The ID of the permission scheme in which to create a new permission grant. + */ + schemeId: number, + /** Request body */ + data: PermissionGrant, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createPermissionGrant({ + query: query, + schemeId: schemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete permission scheme grant + * @request DELETE :/rest/api/3/permissionscheme/{schemeId}/permission/{permissionId} + * @allowrelaxedtypes + */ +export async function deleteRestDeletePermissionSchemeEntity( + /** + * The ID of the permission scheme to delete the permission grant from. + */ + schemeId: number, + /** + * The ID of the permission grant to delete. + */ + permissionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deletePermissionSchemeEntity({ + schemeId: schemeId, + permissionId: permissionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get permission scheme grant + * @request GET :/rest/api/3/permissionscheme/{schemeId}/permission/{permissionId} + * @readonly + */ +export async function getRestGetPermissionSchemeGrant( + query: { + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are always included when you specify any value. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `permissions` Returns all permission grants for each permission scheme. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + /** + * The ID of the permission scheme. + */ + schemeId: number, + /** + * The ID of the permission grant. + */ + permissionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPermissionSchemeGrant({ + query: query, + schemeId: schemeId, + permissionId: permissionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get priorities + * @request GET :/rest/api/3/priority + * @readonly + */ +export async function getRestGetPriorities( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPriorities({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create priority + * @request POST :/rest/api/3/priority + * @allowrelaxedtypes + */ +export async function postRestCreatePriority( + /** Request body */ + data: CreatePriorityDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createPriority({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set default priority + * @request PUT :/rest/api/3/priority/default + * @allowrelaxedtypes + */ +export async function putRestSetDefaultPriority( + /** Request body */ + data: SetDefaultPriorityRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setDefaultPriority({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Move priorities + * @request PUT :/rest/api/3/priority/move + * @allowrelaxedtypes + */ +export async function putRestMovePriorities( + /** Request body */ + data: ReorderIssuePriorities, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.movePriorities({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Search priorities + * @request GET :/rest/api/3/priority/search + * @readonly + */ +export async function getRestSearchPriorities( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: string; + /** + * The maximum number of items to return per page. + */ + maxResults?: string; + /** + * The list of priority IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=2&id=3`. + */ + id?: string[]; + /** + * Whether only the default priority is returned. + */ + onlyDefault?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.searchPriorities({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete priority + * @request DELETE :/rest/api/3/priority/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeletePriority( + query: { + /** + * The ID of the issue priority that will replace the currently selected resolution. + */ + replaceWith: string; + }, + /** + * The ID of the issue priority. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deletePriority({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get priority + * @request GET :/rest/api/3/priority/{id} + * @readonly + */ +export async function getRestGetPriority( + /** + * The ID of the issue priority. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPriority({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update priority + * @request PUT :/rest/api/3/priority/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdatePriority( + /** + * The ID of the issue priority. + */ + id: string, + /** Request body */ + data: UpdatePriorityDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updatePriority({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all projects + * @request GET :/rest/api/3/project + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllProjects( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expanded options include: + + * `description` Returns the project description. + * `issueTypes` Returns all issue types associated with the project. + * `lead` Returns information about the project lead. + * `projectKeys` Returns all project keys associated with the project. +*/ + expand?: string; + /** + * Returns the user's most recently accessed projects. You may specify the number of results to return up to a maximum of 20. If access is anonymous, then the recently accessed projects are based on the current HTTP session. + */ + recent?: number; + /** + * A list of project properties to return for the project. This parameter accepts a comma-separated list. + */ + properties?: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllProjects({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create project + * @request POST :/rest/api/3/project + * @allowrelaxedtypes + */ +export async function postRestCreateProject( + /** Request body */ + data: CreateProjectDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createProject({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get recent projects + * @request GET :/rest/api/3/project/recent + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetRecent( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expanded options include: + + * `description` Returns the project description. + * `projectKeys` Returns all project keys associated with a project. + * `lead` Returns information about the project lead. + * `issueTypes` Returns all issue types associated with the project. + * `url` Returns the URL associated with the project. + * `permissions` Returns the permissions associated with the project. + * `insight` EXPERIMENTAL. Returns the insight details of total issue count and last issue update time for the project. + * `*` Returns the project with all available expand options. +*/ + expand?: string; + /** + * EXPERIMENTAL. A list of project properties to return for the project. This parameter accepts a comma-separated list. Invalid property names are ignored. + */ + properties?: StringList[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getRecent({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get projects paginated + * @request GET :/rest/api/3/project/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestSearchProjects( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** +* [Order](#ordering) the results by a field. + + * `category` Sorts by project category. A complete list of category IDs is found using [Get all project categories](#api-rest-api-3-projectCategory-get). + * `issueCount` Sorts by the total number of issues in each project. + * `key` Sorts by project key. + * `lastIssueUpdatedTime` Sorts by the last issue update time. + * `name` Sorts by project name. + * `owner` Sorts by project lead. + * `archivedDate` EXPERIMENTAL. Sorts by project archived date. + * `deletedDate` EXPERIMENTAL. Sorts by project deleted date. +*/ + orderBy?: + | "category" + | "-category" + | "+category" + | "key" + | "-key" + | "+key" + | "name" + | "-name" + | "+name" + | "owner" + | "-owner" + | "+owner" + | "issueCount" + | "-issueCount" + | "+issueCount" + | "lastIssueUpdatedDate" + | "-lastIssueUpdatedDate" + | "+lastIssueUpdatedDate" + | "archivedDate" + | "+archivedDate" + | "-archivedDate" + | "deletedDate" + | "+deletedDate" + | "-deletedDate"; + /** + * The project IDs to filter the results by. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. Up to 50 project IDs can be provided. + */ + id?: number[]; + /** + * The project keys to filter the results by. To include multiple keys, provide an ampersand-separated list. For example, `keys=PA&keys=PB`. Up to 50 project keys can be provided. + */ + keys?: string[]; + /** + * Filter the results using a literal string. Projects with a matching `key` or `name` are returned (case insensitive). + */ + query?: string; + /** + * Orders results by the [project type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes). This parameter accepts a comma-separated list. Valid values are `business`, `service_desk`, and `software`. + */ + typeKey?: string; + /** + * The ID of the project's category. A complete list of category IDs is found using the [Get all project categories](#api-rest-api-3-projectCategory-get) operation. + */ + categoryId?: number; + /** +* Filter results by projects for which the user can: + + * `view` the project, meaning that they have one of the following permissions: + + * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * `browse` the project, meaning that they have the *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * `edit` the project, meaning that they have one of the following permissions: + + * *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). +*/ + action?: "view" | "browse" | "edit"; + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expanded options include: + + * `description` Returns the project description. + * `projectKeys` Returns all project keys associated with a project. + * `lead` Returns information about the project lead. + * `issueTypes` Returns all issue types associated with the project. + * `url` Returns the URL associated with the project. + * `insight` EXPERIMENTAL. Returns the insight details of total issue count and last issue update time for the project. +*/ + expand?: string; + /** +* EXPERIMENTAL. Filter results by project status: + + * `live` Search live projects. + * `archived` Search archived projects. + * `deleted` Search deleted projects, those in the recycle bin. +*/ + status?: ("live" | "archived" | "deleted")[]; + /** + * EXPERIMENTAL. A list of project properties to return for the project. This parameter accepts a comma-separated list. + */ + properties?: StringList[]; + /** + * EXPERIMENTAL. A query string used to search properties. The query string cannot be specified using a JSON object. For example, to search for the value of `nested` from `{"something":{"nested":1,"other":2}}` use `[thepropertykey].something.nested=1`. Note that the propertyQuery key is enclosed in square brackets to enable searching where the propertyQuery key includes dot (.) or equals (=) characters. Note that `thepropertykey` is only returned when included in `properties`. + */ + propertyQuery?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.searchProjects({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all project types + * @request GET :/rest/api/3/project/type + * @readonly + */ +export async function getRestGetAllProjectTypes( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllProjectTypes({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get licensed project types + * @request GET :/rest/api/3/project/type/accessible + * @readonly + */ +export async function getRestGetAllAccessibleProjectTypes( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllAccessibleProjectTypes({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project type by key + * @request GET :/rest/api/3/project/type/{projectTypeKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectTypeByKey( + /** + * The key of the project type. + */ + projectTypeKey: + | "software" + | "service_desk" + | "business" + | "product_discovery", + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectTypeByKey({ + projectTypeKey: projectTypeKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get accessible project type by key + * @request GET :/rest/api/3/project/type/{projectTypeKey}/accessible + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAccessibleProjectTypeByKey( + /** + * The key of the project type. + */ + projectTypeKey: + | "software" + | "service_desk" + | "business" + | "product_discovery", + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAccessibleProjectTypeByKey({ + projectTypeKey: projectTypeKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete project + * @request DELETE :/rest/api/3/project/{projectIdOrKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteProject( + query: { + /** + * Whether this project is placed in the Jira recycle bin where it will be available for restoration. + */ + enableUndo?: boolean; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteProject({ + query: query, + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get project + * @request GET :/rest/api/3/project/{projectIdOrKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProject( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Note that the project description, issue types, and project lead are included in all responses by default. Expand options include: + + * `description` The project description. + * `issueTypes` The issue types associated with the project. + * `lead` The project lead. + * `projectKeys` All project keys associated with the project. + * `issueTypeHierarchy` The project issue type hierarchy. +*/ + expand?: string; + /** + * A list of project properties to return for the project. This parameter accepts a comma-separated list. + */ + properties?: string[]; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProject({ + query: query, + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update project + * @request PUT :/rest/api/3/project/{projectIdOrKey} + * @allowrelaxedtypes + */ +export async function putRestUpdateProject( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Note that the project description, issue types, and project lead are included in all responses by default. Expand options include: + + * `description` The project description. + * `issueTypes` The issue types associated with the project. + * `lead` The project lead. + * `projectKeys` All project keys associated with the project. +*/ + expand?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** Request body */ + data: UpdateProjectDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateProject({ + query: query, + projectIdOrKey: projectIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Archive project + * @request POST :/rest/api/3/project/{projectIdOrKey}/archive + * @allowrelaxedtypes + */ +export async function postRestArchiveProject( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.archiveProject({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Set project avatar + * @request PUT :/rest/api/3/project/{projectIdOrKey}/avatar + * @allowrelaxedtypes + */ +export async function putRestUpdateProjectAvatar( + /** + * The ID or (case-sensitive) key of the project. + */ + projectIdOrKey: string, + /** Request body */ + data: Avatar, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateProjectAvatar({ + projectIdOrKey: projectIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete project avatar + * @request DELETE :/rest/api/3/project/{projectIdOrKey}/avatar/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteProjectAvatar( + /** + * The project ID or (case-sensitive) key. + */ + projectIdOrKey: string, + /** + * The ID of the avatar. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteProjectAvatar({ + projectIdOrKey: projectIdOrKey, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Load project avatar + * @request POST :/rest/api/3/project/{projectIdOrKey}/avatar2 + */ +export async function postRestCreateProjectAvatar( + query: { + /** + * The X coordinate of the top-left corner of the crop region. + */ + x?: number; + /** + * The Y coordinate of the top-left corner of the crop region. + */ + y?: number; + /** + * The length of each side of the crop region. + */ + size?: number; + }, + /** + * The ID or (case-sensitive) key of the project. + */ + projectIdOrKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createProjectAvatar({ + query: query, + projectIdOrKey: projectIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all project avatars + * @request GET :/rest/api/3/project/{projectIdOrKey}/avatars + * @readonly + */ +export async function getRestGetAllProjectAvatars( + /** + * The ID or (case-sensitive) key of the project. + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllProjectAvatars({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project components paginated + * @request GET :/rest/api/3/project/{projectIdOrKey}/component + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectComponentsPaginated( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** +* [Order](#ordering) the results by a field: + + * `description` Sorts by the component description. + * `issueCount` Sorts by the count of issues associated with the component. + * `lead` Sorts by the user key of the component's project lead. + * `name` Sorts by component name. +*/ + orderBy?: + | "description" + | "-description" + | "+description" + | "issueCount" + | "-issueCount" + | "+issueCount" + | "lead" + | "-lead" + | "+lead" + | "name" + | "-name" + | "+name"; + /** + * Filter the results using a literal string. Components with a matching `name` or `description` are returned (case insensitive). + */ + query?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectComponentsPaginated({ + query: query, + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project components + * @request GET :/rest/api/3/project/{projectIdOrKey}/components + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectComponents( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectComponents({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete project asynchronously + * @request POST :/rest/api/3/project/{projectIdOrKey}/delete + * @allowrelaxedtypes + */ +export async function postRestDeleteProjectAsynchronously( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteProjectAsynchronously({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get project features + * @request GET :/rest/api/3/project/{projectIdOrKey}/features + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetFeaturesForProject( + /** + * The ID or (case-sensitive) key of the project. + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFeaturesForProject({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set project feature state + * @request PUT :/rest/api/3/project/{projectIdOrKey}/features/{featureKey} + * @allowrelaxedtypes + */ +export async function putRestToggleFeatureForProject( + /** + * The ID or (case-sensitive) key of the project. + */ + projectIdOrKey: string, + /** + * The key of the feature. + */ + featureKey: string, + /** Request body */ + data: ProjectFeatureState, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.toggleFeatureForProject({ + projectIdOrKey: projectIdOrKey, + featureKey: featureKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project property keys + * @request GET :/rest/api/3/project/{projectIdOrKey}/properties + * @readonly + */ +export async function getRestGetProjectPropertyKeys( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectPropertyKeys({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete project property + * @request DELETE :/rest/api/3/project/{projectIdOrKey}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteProjectProperty( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The project property key. Use [Get project property keys](#api-rest-api-3-project-projectIdOrKey-properties-get) to get a list of all project property keys. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteProjectProperty({ + projectIdOrKey: projectIdOrKey, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get project property + * @request GET :/rest/api/3/project/{projectIdOrKey}/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectProperty( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The project property key. Use [Get project property keys](#api-rest-api-3-project-projectIdOrKey-properties-get) to get a list of all project property keys. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectProperty({ + projectIdOrKey: projectIdOrKey, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set project property + * @request PUT :/rest/api/3/project/{projectIdOrKey}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestSetProjectProperty( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The key of the project property. The maximum length is 255 characters. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setProjectProperty({ + projectIdOrKey: projectIdOrKey, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Restore deleted or archived project + * @request POST :/rest/api/3/project/{projectIdOrKey}/restore + * @allowrelaxedtypes + */ +export async function postRestRestore( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.restore({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project roles for project + * @request GET :/rest/api/3/project/{projectIdOrKey}/role + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectRoles( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectRoles({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete actors from project role + * @request DELETE :/rest/api/3/project/{projectIdOrKey}/role/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteActor( + query: { + /** + * The user account ID of the user to remove from the project role. + */ + user?: string; + /** + * The name of the group to remove from the project role. This parameter cannot be used with the `groupId` parameter. As a group's name can change, use of `groupId` is recommended. + */ + group?: string; + /** + * The ID of the group to remove from the project role. This parameter cannot be used with the `group` parameter. + */ + groupId?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteActor({ + query: query, + projectIdOrKey: projectIdOrKey, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get project role for project + * @request GET :/rest/api/3/project/{projectIdOrKey}/role/{id} + * @readonly + */ +export async function getRestGetProjectRole( + query: { + /** + * Exclude inactive users. + */ + excludeInactiveUsers?: boolean; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectRole({ + query: query, + projectIdOrKey: projectIdOrKey, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add actors to project role + * @request POST :/rest/api/3/project/{projectIdOrKey}/role/{id} + */ +export async function postRestAddActorUsers( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + /** Request body */ + data: ActorsMap, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addActorUsers({ + projectIdOrKey: projectIdOrKey, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set actors for project role + * @request PUT :/rest/api/3/project/{projectIdOrKey}/role/{id} + */ +export async function putRestSetActors( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + /** Request body */ + data: ProjectRoleActorsUpdateBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setActors({ + projectIdOrKey: projectIdOrKey, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project role details + * @request GET :/rest/api/3/project/{projectIdOrKey}/roledetails + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectRoleDetails( + query: { + /** + * Whether the roles should be filtered to include only those the user is assigned to. + */ + currentMember?: boolean; + excludeConnectAddons?: boolean; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectRoleDetails({ + query: query, + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all statuses for project + * @request GET :/rest/api/3/project/{projectIdOrKey}/statuses + * @readonly + */ +export async function getRestGetAllStatuses( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllStatuses({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update project type + * @request PUT :/rest/api/3/project/{projectIdOrKey}/type/{newProjectTypeKey} + * @allowrelaxedtypes + */ +export async function putRestUpdateProjectType( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The key of the new project type. + */ + newProjectTypeKey: "software" | "service_desk" | "business", + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateProjectType({ + projectIdOrKey: projectIdOrKey, + newProjectTypeKey: newProjectTypeKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project versions paginated + * @request GET :/rest/api/3/project/{projectIdOrKey}/version + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectVersionsPaginated( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** +* [Order](#ordering) the results by a field: + + * `description` Sorts by version description. + * `name` Sorts by version name. + * `releaseDate` Sorts by release date, starting with the oldest date. Versions with no release date are listed last. + * `sequence` Sorts by the order of appearance in the user interface. + * `startDate` Sorts by start date, starting with the oldest date. Versions with no start date are listed last. +*/ + orderBy?: + | "description" + | "-description" + | "+description" + | "name" + | "-name" + | "+name" + | "releaseDate" + | "-releaseDate" + | "+releaseDate" + | "sequence" + | "-sequence" + | "+sequence" + | "startDate" + | "-startDate" + | "+startDate"; + /** + * Filter the results using a literal string. Versions with matching `name` or `description` are returned (case insensitive). + */ + query?: string; + /** + * A list of status values used to filter the results by version status. This parameter accepts a comma-separated list. The status values are `released`, `unreleased`, and `archived`. + */ + status?: string; + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `issuesstatus` Returns the number of issues in each status category for each version. + * `operations` Returns actions that can be performed on the specified version. +*/ + expand?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectVersionsPaginated({ + query: query, + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project versions + * @request GET :/rest/api/3/project/{projectIdOrKey}/versions + * @readonly + */ +export async function getRestGetProjectVersions( + query: { + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts `operations`, which returns actions that can be performed on the version. + */ + expand?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectVersions({ + query: query, + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project's sender email + * @request GET :/rest/api/3/project/{projectId}/email + * @readonly + */ +export async function getRestGetProjectEmail( + /** + * The project ID. + */ + projectId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectEmail({ + projectId: projectId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set project's sender email + * @request PUT :/rest/api/3/project/{projectId}/email + * @allowrelaxedtypes + */ +export async function putRestUpdateProjectEmail( + /** + * The project ID. + */ + projectId: number, + /** Request body */ + data: ProjectEmailAddress, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateProjectEmail({ + projectId: projectId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get project issue type hierarchy + * @request GET :/rest/api/3/project/{projectId}/hierarchy + * @readonly + */ +export async function getRestGetHierarchy( + /** + * The ID of the project. + */ + projectId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getHierarchy({ + projectId: projectId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project issue security scheme + * @request GET :/rest/api/3/project/{projectKeyOrId}/issuesecuritylevelscheme + * @readonly + */ +export async function getRestGetProjectIssueSecurityScheme( + /** + * The project ID or project key (case sensitive). + */ + projectKeyOrId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectIssueSecurityScheme({ + projectKeyOrId: projectKeyOrId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project notification scheme + * @request GET :/rest/api/3/project/{projectKeyOrId}/notificationscheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetNotificationSchemeForProject( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `all` Returns all expandable information + * `field` Returns information about any custom fields assigned to receive an event + * `group` Returns information about any groups assigned to receive an event + * `notificationSchemeEvents` Returns a list of event associations. This list is returned for all expandable information + * `projectRole` Returns information about any project roles assigned to receive an event + * `user` Returns information about any users assigned to receive an event +*/ + expand?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectKeyOrId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getNotificationSchemeForProject({ + query: query, + projectKeyOrId: projectKeyOrId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get assigned permission scheme + * @request GET :/rest/api/3/project/{projectKeyOrId}/permissionscheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAssignedPermissionScheme( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are included when you specify any value. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `permissions` Returns all permission grants for each permission scheme. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectKeyOrId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAssignedPermissionScheme({ + query: query, + projectKeyOrId: projectKeyOrId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Assign permission scheme + * @request PUT :/rest/api/3/project/{projectKeyOrId}/permissionscheme + * @allowrelaxedtypes + */ +export async function putRestAssignPermissionScheme( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are included when you specify any value. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `permissions` Returns all permission grants for each permission scheme. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectKeyOrId: string, + /** Request body */ + data: IdBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.assignPermissionScheme({ + query: query, + projectKeyOrId: projectKeyOrId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project issue security levels + * @request GET :/rest/api/3/project/{projectKeyOrId}/securitylevel + * @readonly + */ +export async function getRestGetSecurityLevelsForProject( + /** + * The project ID or project key (case sensitive). + */ + projectKeyOrId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getSecurityLevelsForProject({ + projectKeyOrId: projectKeyOrId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all project categories + * @request GET :/rest/api/3/projectCategory + * @readonly + */ +export async function getRestGetAllProjectCategories( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllProjectCategories({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create project category + * @request POST :/rest/api/3/projectCategory + */ +export async function postRestCreateProjectCategory( + /** Request body */ + data: ProjectCategory, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createProjectCategory({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete project category + * @request DELETE :/rest/api/3/projectCategory/{id} + * @allowrelaxedtypes + */ +export async function deleteRestRemoveProjectCategory( + /** + * ID of the project category to delete. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeProjectCategory({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get project category by ID + * @request GET :/rest/api/3/projectCategory/{id} + * @readonly + */ +export async function getRestGetProjectCategoryById( + /** + * The ID of the project category. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectCategoryById({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update project category + * @request PUT :/rest/api/3/projectCategory/{id} + */ +export async function putRestUpdateProjectCategory( + id: number, + /** Request body */ + data: ProjectCategory, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateProjectCategory({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Validate project key + * @request GET :/rest/api/3/projectvalidate/key + * @readonly + */ +export async function getRestValidateProjectKey( + query: { + /** + * The project key. + */ + key?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.validateProjectKey({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get valid project key + * @request GET :/rest/api/3/projectvalidate/validProjectKey + * @readonly + */ +export async function getRestGetValidProjectKey( + query: { + /** + * The project key. + */ + key?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getValidProjectKey({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get valid project name + * @request GET :/rest/api/3/projectvalidate/validProjectName + * @readonly + */ +export async function getRestGetValidProjectName( + query: { + /** + * The project name. + */ + name: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getValidProjectName({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get resolutions + * @request GET :/rest/api/3/resolution + * @readonly + */ +export async function getRestGetResolutions( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getResolutions({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create resolution + * @request POST :/rest/api/3/resolution + */ +export async function postRestCreateResolution( + /** Request body */ + data: CreateResolutionDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createResolution({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set default resolution + * @request PUT :/rest/api/3/resolution/default + * @allowrelaxedtypes + */ +export async function putRestSetDefaultResolution( + /** Request body */ + data: SetDefaultResolutionRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setDefaultResolution({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Move resolutions + * @request PUT :/rest/api/3/resolution/move + * @allowrelaxedtypes + */ +export async function putRestMoveResolutions( + /** Request body */ + data: ReorderIssueResolutionsRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.moveResolutions({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Search resolutions + * @request GET :/rest/api/3/resolution/search + * @readonly + */ +export async function getRestSearchResolutions( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: string; + /** + * The maximum number of items to return per page. + */ + maxResults?: string; + /** + * The list of resolutions IDs to be filtered out + */ + id?: string[]; + /** + * When set to true, return default only, when IDs provided, if none of them is default, return empty page. Default value is false + */ + onlyDefault?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.searchResolutions({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete resolution + * @request DELETE :/rest/api/3/resolution/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteResolution( + query: { + /** + * The ID of the issue resolution that will replace the currently selected resolution. + */ + replaceWith: string; + }, + /** + * The ID of the issue resolution. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteResolution({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get resolution + * @request GET :/rest/api/3/resolution/{id} + * @readonly + */ +export async function getRestGetResolution( + /** + * The ID of the issue resolution value. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getResolution({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update resolution + * @request PUT :/rest/api/3/resolution/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateResolution( + /** + * The ID of the issue resolution. + */ + id: string, + /** Request body */ + data: UpdateResolutionDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateResolution({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all project roles + * @request GET :/rest/api/3/role + * @readonly + */ +export async function getRestGetAllProjectRoles( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllProjectRoles({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create project role + * @request POST :/rest/api/3/role + */ +export async function postRestCreateProjectRole( + /** Request body */ + data: CreateUpdateRoleRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createProjectRole({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete project role + * @request DELETE :/rest/api/3/role/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteProjectRole( + query: { + /** + * The ID of the project role that will replace the one being deleted. + */ + swap?: number; + }, + /** + * The ID of the project role to delete. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteProjectRole({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get project role by ID + * @request GET :/rest/api/3/role/{id} + * @readonly + */ +export async function getRestGetProjectRoleById( + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectRoleById({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Partial update project role + * @request POST :/rest/api/3/role/{id} + */ +export async function postRestPartialUpdateProjectRole( + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + /** Request body */ + data: CreateUpdateRoleRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.partialUpdateProjectRole({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Fully update project role + * @request PUT :/rest/api/3/role/{id} + */ +export async function putRestFullyUpdateProjectRole( + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + /** Request body */ + data: CreateUpdateRoleRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.fullyUpdateProjectRole({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete default actors from project role + * @request DELETE :/rest/api/3/role/{id}/actors + */ +export async function deleteRestDeleteProjectRoleActorsFromRole( + query: { + /** + * The user account ID of the user to remove as a default actor. + */ + user?: string; + /** + * The group ID of the group to be removed as a default actor. This parameter cannot be used with the `group` parameter. + */ + groupId?: string; + /** + * The group name of the group to be removed as a default actor.This parameter cannot be used with the `groupId` parameter. As a group's name can change, use of `groupId` is recommended. + */ + group?: string; + }, + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteProjectRoleActorsFromRole({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get default actors for project role + * @request GET :/rest/api/3/role/{id}/actors + * @readonly + */ +export async function getRestGetProjectRoleActorsForRole( + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectRoleActorsForRole({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add default actors to project role + * @request POST :/rest/api/3/role/{id}/actors + */ +export async function postRestAddProjectRoleActorsToRole( + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + /** Request body */ + data: ActorInputBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addProjectRoleActorsToRole({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get screens + * @request GET :/rest/api/3/screens + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetScreens( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of screen IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + */ + id?: number[]; + /** + * String used to perform a case-insensitive partial match with screen name. + */ + queryString?: string; + /** + * The scope filter string. To filter by multiple scope, provide an ampersand-separated list. For example, `scope=GLOBAL&scope=PROJECT`. + */ + scope?: ("GLOBAL" | "TEMPLATE" | "PROJECT")[]; + /** +* [Order](#ordering) the results by a field: + + * `id` Sorts by screen ID. + * `name` Sorts by screen name. +*/ + orderBy?: "name" | "-name" | "+name" | "id" | "-id" | "+id"; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getScreens({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create screen + * @request POST :/rest/api/3/screens + * @allowrelaxedtypes + */ +export async function postRestCreateScreen( + /** Request body */ + data: ScreenDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createScreen({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add field to default screen + * @request POST :/rest/api/3/screens/addToDefault/{fieldId} + * @allowrelaxedtypes + */ +export async function postRestAddFieldToDefaultScreen( + /** + * The ID of the field. + */ + fieldId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addFieldToDefaultScreen({ + fieldId: fieldId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete screen + * @request DELETE :/rest/api/3/screens/{screenId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteScreen( + /** + * The ID of the screen. + */ + screenId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteScreen({ + screenId: screenId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Update screen + * @request PUT :/rest/api/3/screens/{screenId} + * @allowrelaxedtypes + */ +export async function putRestUpdateScreen( + /** + * The ID of the screen. + */ + screenId: number, + /** Request body */ + data: UpdateScreenDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateScreen({ + screenId: screenId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get available screen fields + * @request GET :/rest/api/3/screens/{screenId}/availableFields + * @readonly + */ +export async function getRestGetAvailableScreenFields( + /** + * The ID of the screen. + */ + screenId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAvailableScreenFields({ + screenId: screenId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all screen tabs + * @request GET :/rest/api/3/screens/{screenId}/tabs + * @readonly + */ +export async function getRestGetAllScreenTabs( + query: { + /** + * The key of the project. + */ + projectKey?: string; + }, + /** + * The ID of the screen. + */ + screenId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllScreenTabs({ + query: query, + screenId: screenId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create screen tab + * @request POST :/rest/api/3/screens/{screenId}/tabs + */ +export async function postRestAddScreenTab( + /** + * The ID of the screen. + */ + screenId: number, + /** Request body */ + data: ScreenableTab, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addScreenTab({ + screenId: screenId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete screen tab + * @request DELETE :/rest/api/3/screens/{screenId}/tabs/{tabId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteScreenTab( + /** + * The ID of the screen. + */ + screenId: number, + /** + * The ID of the screen tab. + */ + tabId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteScreenTab({ + screenId: screenId, + tabId: tabId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Update screen tab + * @request PUT :/rest/api/3/screens/{screenId}/tabs/{tabId} + */ +export async function putRestRenameScreenTab( + /** + * The ID of the screen. + */ + screenId: number, + /** + * The ID of the screen tab. + */ + tabId: number, + /** Request body */ + data: ScreenableTab, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.renameScreenTab({ + screenId: screenId, + tabId: tabId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all screen tab fields + * @request GET :/rest/api/3/screens/{screenId}/tabs/{tabId}/fields + * @readonly + */ +export async function getRestGetAllScreenTabFields( + query: { + /** + * The key of the project. + */ + projectKey?: string; + }, + /** + * The ID of the screen. + */ + screenId: number, + /** + * The ID of the screen tab. + */ + tabId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllScreenTabFields({ + query: query, + screenId: screenId, + tabId: tabId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add screen tab field + * @request POST :/rest/api/3/screens/{screenId}/tabs/{tabId}/fields + */ +export async function postRestAddScreenTabField( + /** + * The ID of the screen. + */ + screenId: number, + /** + * The ID of the screen tab. + */ + tabId: number, + /** Request body */ + data: AddFieldBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addScreenTabField({ + screenId: screenId, + tabId: tabId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Remove screen tab field + * @request DELETE :/rest/api/3/screens/{screenId}/tabs/{tabId}/fields/{id} + * @allowrelaxedtypes + */ +export async function deleteRestRemoveScreenTabField( + /** + * The ID of the screen. + */ + screenId: number, + /** + * The ID of the screen tab. + */ + tabId: number, + /** + * The ID of the field. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeScreenTabField({ + screenId: screenId, + tabId: tabId, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Move screen tab field + * @request POST :/rest/api/3/screens/{screenId}/tabs/{tabId}/fields/{id}/move + * @allowrelaxedtypes + */ +export async function postRestMoveScreenTabField( + /** + * The ID of the screen. + */ + screenId: number, + /** + * The ID of the screen tab. + */ + tabId: number, + /** + * The ID of the field. + */ + id: string, + /** Request body */ + data: MoveFieldBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.moveScreenTabField({ + screenId: screenId, + tabId: tabId, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Move screen tab + * @request POST :/rest/api/3/screens/{screenId}/tabs/{tabId}/move/{pos} + * @allowrelaxedtypes + */ +export async function postRestMoveScreenTab( + /** + * The ID of the screen. + */ + screenId: number, + /** + * The ID of the screen tab. + */ + tabId: number, + /** + * The position of tab. The base index is 0. + */ + pos: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.moveScreenTab({ + screenId: screenId, + tabId: tabId, + pos: pos, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get screen schemes + * @request GET :/rest/api/3/screenscheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetScreenSchemes( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of screen scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + */ + id?: number[]; + /** + * Use [expand](#expansion) include additional information in the response. This parameter accepts `issueTypeScreenSchemes` that, for each screen schemes, returns information about the issue type screen scheme the screen scheme is assigned to. + */ + expand?: string; + /** + * String used to perform a case-insensitive partial match with screen scheme name. + */ + queryString?: string; + /** +* [Order](#ordering) the results by a field: + + * `id` Sorts by screen scheme ID. + * `name` Sorts by screen scheme name. +*/ + orderBy?: "name" | "-name" | "+name" | "id" | "-id" | "+id"; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getScreenSchemes({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create screen scheme + * @request POST :/rest/api/3/screenscheme + */ +export async function postRestCreateScreenScheme( + /** Request body */ + data: ScreenSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createScreenScheme({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete screen scheme + * @request DELETE :/rest/api/3/screenscheme/{screenSchemeId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteScreenScheme( + /** + * The ID of the screen scheme. + */ + screenSchemeId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteScreenScheme({ + screenSchemeId: screenSchemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Update screen scheme + * @request PUT :/rest/api/3/screenscheme/{screenSchemeId} + * @allowrelaxedtypes + */ +export async function putRestUpdateScreenScheme( + /** + * The ID of the screen scheme. + */ + screenSchemeId: string, + /** Request body */ + data: UpdateScreenSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateScreenScheme({ + screenSchemeId: screenSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Search for issues using JQL (GET) + * @request GET :/rest/api/3/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestSearchForIssuesUsingJql( + query: { + /** +* The [JQL](https://confluence.atlassian.com/x/egORLQ) that defines the search. Note: + + * If no JQL expression is provided, all issues are returned. + * `username` and `userkey` cannot be used as search terms due to privacy reasons. Use `accountId` instead. + * If a user has hidden their email address in their user profile, partial matches of the email address will not find the user. An exact match is required. +*/ + jql?: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. To manage page size, Jira may return fewer items per page where a large number of fields are requested. The greatest number of items returned per page is achieved when requesting `id` or `key` only. + */ + maxResults?: number; + /** +* Determines how to validate the JQL query and treat the validation results. Supported values are: + + * `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). + * `warn` Returns all errors as warnings. + * `none` No validation is performed. + * `true` *Deprecated* A legacy synonym for `strict`. + * `false` *Deprecated* A legacy synonym for `warn`. + +Note: If the JQL is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. +*/ + validateQuery?: "strict" | "warn" | "none" | "true" | "false"; + /** +* A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a comma-separated list. Expand options include: + + * `*all` Returns all fields. + * `*navigable` Returns navigable fields. + * Any issue field, prefixed with a minus to exclude. + +Examples: + + * `summary,comment` Returns only the summary and comments fields. + * `-description` Returns all navigable (default) fields except description. + * `*all,-comment` Returns all fields except comments. + +This parameter may be specified multiple times. For example, `fields=field1,field2&fields=field3`. + +Note: All navigable fields are returned by default. This differs from [GET issue](#api-rest-api-3-issue-issueIdOrKey-get) where the default is all fields. +*/ + fields?: string[]; + /** +* Use [expand](#expansion) to include additional information about issues in the response. This parameter accepts a comma-separated list. Expand options include: + + * `renderedFields` Returns field values rendered in HTML format. + * `names` Returns the display name of each field. + * `schema` Returns the schema describing a field type. + * `transitions` Returns all possible transitions for the issue. + * `operations` Returns all possible operations for the issue. + * `editmeta` Returns information about how each field can be edited. + * `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each version of a field's value, with the highest numbered item representing the most recent version. +*/ + expand?: string; + /** + * A list of issue property keys for issue properties to include in the results. This parameter accepts a comma-separated list. Multiple properties can also be provided using an ampersand separated list. For example, `properties=prop1,prop2&properties=prop3`. A maximum of 5 issue property keys can be specified. + */ + properties?: string[]; + /** + * Reference fields by their key (rather than ID). + */ + fieldsByKeys?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.searchForIssuesUsingJql({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Search for issues using JQL (POST) + * @request POST :/rest/api/3/search + * @allowrelaxedtypes + */ +export async function postRestSearchForIssuesUsingJqlPost( + /** Request body */ + data: SearchRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.searchForIssuesUsingJqlPost({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue security level + * @request GET :/rest/api/3/securitylevel/{id} + * @readonly + */ +export async function getRestGetIssueSecurityLevel( + /** + * The ID of the issue security level. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueSecurityLevel({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get Jira instance info + * @request GET :/rest/api/3/serverInfo + * @readonly + */ +export async function getRestGetServerInfo( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getServerInfo({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue navigator default columns + * @request GET :/rest/api/3/settings/columns + * @readonly + */ +export async function getRestGetIssueNavigatorDefaultColumns( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueNavigatorDefaultColumns({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set issue navigator default columns + * @request PUT :/rest/api/3/settings/columns + * @allowrelaxedtypes + */ +export async function putRestSetIssueNavigatorDefaultColumns( + /** Request body */ + data: string[], + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setIssueNavigatorDefaultColumns({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all statuses + * @request GET :/rest/api/3/status + * @readonly + */ +export async function getRestGetStatuses( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getStatuses({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get status + * @request GET :/rest/api/3/status/{idOrName} + * @readonly + */ +export async function getRestGetStatus( + /** + * The ID or name of the status. + */ + idOrName: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getStatus({ + idOrName: idOrName, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all status categories + * @request GET :/rest/api/3/statuscategory + * @readonly + */ +export async function getRestGetStatusCategories( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getStatusCategories({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get status category + * @request GET :/rest/api/3/statuscategory/{idOrKey} + * @readonly + */ +export async function getRestGetStatusCategory( + /** + * The ID or key of the status category. + */ + idOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getStatusCategory({ + idOrKey: idOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Bulk delete Statuses + * @request DELETE :/rest/api/3/statuses + * @allowrelaxedtypes + */ +export async function deleteRestDeleteStatusesById( + query: { + /** +* The list of status IDs. To include multiple IDs, provide an ampersand-separated list. For example, id=10000&id=10001. + +Min items `1`, Max items `50` +*/ + id?: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteStatusesById({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Bulk get statuses + * @request GET :/rest/api/3/statuses + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetStatusesById( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `usages` Returns the project and issue types that use the status in their workflow. +*/ + expand?: string; + /** +* The list of status IDs. To include multiple IDs, provide an ampersand-separated list. For example, id=10000&id=10001. + +Min items `1`, Max items `50` +*/ + id?: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getStatusesById({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Bulk create statuses + * @request POST :/rest/api/3/statuses + * @allowrelaxedtypes + */ +export async function postRestCreateStatuses( + /** Request body */ + data: StatusCreateRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createStatuses({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Bulk update statuses + * @request PUT :/rest/api/3/statuses + * @allowrelaxedtypes + */ +export async function putRestUpdateStatuses( + /** Request body */ + data: StatusUpdateRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateStatuses({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Search statuses paginated + * @request GET :/rest/api/3/statuses/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestSearch( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `usages` Returns the project and issue types that use the status in their workflow. +*/ + expand?: string; + /** + * The project the status is part of or null for global statuses. + */ + projectId?: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * Term to match status names against or null to search for all statuses in the search scope. + */ + searchString?: string; + /** + * Category of the status to filter by. The supported values are: `TODO`, `IN_PROGRESS`, and `DONE`. + */ + statusCategory?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.search({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get task + * @request GET :/rest/api/3/task/{taskId} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetTask( + /** + * The ID of the task. + */ + taskId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getTask({ + taskId: taskId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Cancel task + * @request POST :/rest/api/3/task/{taskId}/cancel + * @allowrelaxedtypes + */ +export async function postRestCancelTask( + /** + * The ID of the task. + */ + taskId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.cancelTask({ + taskId: taskId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get UI modifications + * @request GET :/rest/api/3/uiModifications + * @readonly + */ +export async function getRestGetUiModifications( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `data` Returns UI modification data. + * `contexts` Returns UI modification contexts. +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUiModifications({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create UI modification + * @request POST :/rest/api/3/uiModifications + */ +export async function postRestCreateUiModification( + /** Request body */ + data: CreateUiModificationDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createUiModification({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete UI modification + * @request DELETE :/rest/api/3/uiModifications/{uiModificationId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteUiModification( + /** + * The ID of the UI modification. + */ + uiModificationId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteUiModification({ + uiModificationId: uiModificationId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update UI modification + * @request PUT :/rest/api/3/uiModifications/{uiModificationId} + * @allowrelaxedtypes + */ +export async function putRestUpdateUiModification( + /** + * The ID of the UI modification. + */ + uiModificationId: string, + /** Request body */ + data: UpdateUiModificationDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateUiModification({ + uiModificationId: uiModificationId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get avatars + * @request GET :/rest/api/3/universal_avatar/type/{type}/owner/{entityId} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAvatars( + /** + * The avatar type. + */ + type: "project" | "issuetype", + /** + * The ID of the item the avatar is associated with. + */ + entityId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAvatars({ + type: type, + entityId: entityId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Load avatar + * @request POST :/rest/api/3/universal_avatar/type/{type}/owner/{entityId} + * @allowrelaxedtypes + */ +export async function postRestStoreAvatar( + query: { + /** + * The X coordinate of the top-left corner of the crop region. + */ + x?: number; + /** + * The Y coordinate of the top-left corner of the crop region. + */ + y?: number; + /** + * The length of each side of the crop region. + */ + size: number; + }, + /** + * The avatar type. + */ + type: "project" | "issuetype", + /** + * The ID of the item the avatar is associated with. + */ + entityId: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.storeAvatar({ + query: query, + type: type, + entityId: entityId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete avatar + * @request DELETE :/rest/api/3/universal_avatar/type/{type}/owner/{owningObjectId}/avatar/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteAvatar( + /** + * The avatar type. + */ + type: "project" | "issuetype", + /** + * The ID of the item the avatar is associated with. + */ + owningObjectId: string, + /** + * The ID of the avatar. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteAvatar({ + type: type, + owningObjectId: owningObjectId, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get avatar image by type + * @request GET :/rest/api/3/universal_avatar/view/type/{type} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAvatarImageByType( + query: { + /** + * The size of the avatar image. If not provided the default size is returned. + */ + size?: "xsmall" | "small" | "medium" | "large" | "xlarge"; + /** + * The format to return the avatar image in. If not provided the original content format is returned. + */ + format?: "png" | "svg"; + }, + /** + * The icon type of the avatar. + */ + type: "issuetype" | "project", + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAvatarImageByType({ + query: query, + type: type, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get avatar image by ID + * @request GET :/rest/api/3/universal_avatar/view/type/{type}/avatar/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAvatarImageById( + query: { + /** + * The size of the avatar image. If not provided the default size is returned. + */ + size?: "xsmall" | "small" | "medium" | "large" | "xlarge"; + /** + * The format to return the avatar image in. If not provided the original content format is returned. + */ + format?: "png" | "svg"; + }, + /** + * The icon type of the avatar. + */ + type: "issuetype" | "project", + /** + * The ID of the avatar. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAvatarImageById({ + query: query, + type: type, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get avatar image by owner + * @request GET :/rest/api/3/universal_avatar/view/type/{type}/owner/{entityId} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAvatarImageByOwner( + query: { + /** + * The size of the avatar image. If not provided the default size is returned. + */ + size?: "xsmall" | "small" | "medium" | "large" | "xlarge"; + /** + * The format to return the avatar image in. If not provided the original content format is returned. + */ + format?: "png" | "svg"; + }, + /** + * The icon type of the avatar. + */ + type: "issuetype" | "project", + /** + * The ID of the project or issue type the avatar belongs to. + */ + entityId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAvatarImageByOwner({ + query: query, + type: type, + entityId: entityId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete user + * @request DELETE :/rest/api/3/user + * @allowrelaxedtypes + */ +export async function deleteRestRemoveUser( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + key?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeUser({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get user + * @request GET :/rest/api/3/user + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetUser( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. Required. + */ + accountId?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide) for details. + */ + username?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide) for details. + */ + key?: string; + /** +* Use [expand](#expansion) to include additional information about users in the response. This parameter accepts a comma-separated list. Expand options include: + + * `groups` includes all groups and nested groups to which the user belongs. + * `applicationRoles` includes details of all the applications to which the user has access. +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUser({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create user + * @request POST :/rest/api/3/user + * @allowrelaxedtypes + */ +export async function postRestCreateUser( + /** Request body */ + data: NewUserDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createUser({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find users assignable to projects + * @request GET :/rest/api/3/user/assignable/multiProjectSearch + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindBulkAssignableUsers( + query: { + /** + * A query string that is matched against user attributes, such as `displayName` and `emailAddress`, to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. Required, unless `accountId` is specified. + */ + query?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. + */ + accountId?: string; + /** + * A list of project keys (case sensitive). This parameter accepts a comma-separated list. + */ + projectKeys: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findBulkAssignableUsers({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find users assignable to issues + * @request GET :/rest/api/3/user/assignable/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindAssignableUsers( + query: { + /** + * A query string that is matched against user attributes, such as `displayName`, and `emailAddress`, to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. Required, unless `username` or `accountId` is specified. + */ + query?: string; + /** + * The sessionId of this request. SessionId is the same until the assignee is set. + */ + sessionId?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. + */ + accountId?: string; + /** + * The project ID or project key (case sensitive). Required, unless `issueKey` is specified. + */ + project?: string; + /** + * The key of the issue. Required, unless `project` is specified. + */ + issueKey?: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return. This operation may return less than the maximum number of items even if more are available. The operation fetches users up to the maximum and then, from the fetched users, returns only the users that can be assigned to the issue. + */ + maxResults?: number; + /** + * The ID of the transition. + */ + actionDescriptorId?: number; + recommend?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findAssignableUsers({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Bulk get users + * @request GET :/rest/api/3/user/bulk + * @allowrelaxedtypes + * @readonly + */ +export async function getRestBulkGetUsers( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string[]; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + key?: string[]; + /** + * The account ID of a user. To specify multiple users, pass multiple `accountId` parameters. For example, `accountId=5b10a2844c20165700ede21g&accountId=5b10ac8d82e05b22cc7d4ef5`. + */ + accountId: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.bulkGetUsers({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get account IDs for users + * @request GET :/rest/api/3/user/bulk/migration + * @readonly + */ +export async function getRestBulkGetUsersMigration( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * Username of a user. To specify multiple users, pass multiple copies of this parameter. For example, `username=fred&username=barney`. Required if `key` isn't provided. Cannot be provided if `key` is present. + */ + username?: string[]; + /** + * Key of a user. To specify multiple users, pass multiple copies of this parameter. For example, `key=fred&key=barney`. Required if `username` isn't provided. Cannot be provided if `username` is present. + */ + key?: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.bulkGetUsersMigration({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Reset user default columns + * @request DELETE :/rest/api/3/user/columns + * @allowrelaxedtypes + */ +export async function deleteRestResetUserColumns( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.resetUserColumns({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get user default columns + * @request GET :/rest/api/3/user/columns + * @readonly + */ +export async function getRestGetUserDefaultColumns( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId?: string; + /** + * This parameter is no longer available See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUserDefaultColumns({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set user default columns + * @request PUT :/rest/api/3/user/columns + * @allowrelaxedtypes + */ +export async function putRestSetUserColumns( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId?: string; + }, + /** Request body */ + data: string[], + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setUserColumns({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get user email + * @request GET :/rest/api/3/user/email + * @readonly + */ +export async function getRestGetUserEmail( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, `5b10ac8d82e05b22cc7d4ef5`. + */ + accountId: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUserEmail({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get user email bulk + * @request GET :/rest/api/3/user/email/bulk + * @readonly + */ +export async function getRestGetUserEmailBulk( + query: { + /** + * The account IDs of the users for which emails are required. An `accountId` is an identifier that uniquely identifies the user across all Atlassian products. For example, `5b10ac8d82e05b22cc7d4ef5`. Note, this should be treated as an opaque identifier (that is, do not assume any structure in the value). + */ + accountId: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUserEmailBulk({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get user groups + * @request GET :/rest/api/3/user/groups + * @readonly + */ +export async function getRestGetUserGroups( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + key?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUserGroups({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find users with permissions + * @request GET :/rest/api/3/user/permission/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindUsersWithAllPermissions( + query: { + /** + * A query string that is matched against user attributes, such as `displayName` and `emailAddress`, to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. Required, unless `accountId` is specified. + */ + query?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. + */ + accountId?: string; + /** +* A comma separated list of permissions. Permissions can be specified as any: + + * permission returned by [Get all permissions](#api-rest-api-3-permissions-get). + * custom project permission added by Connect apps. + * (deprecated) one of the following: + + * ASSIGNABLE\_USER + * ASSIGN\_ISSUE + * ATTACHMENT\_DELETE\_ALL + * ATTACHMENT\_DELETE\_OWN + * BROWSE + * CLOSE\_ISSUE + * COMMENT\_DELETE\_ALL + * COMMENT\_DELETE\_OWN + * COMMENT\_EDIT\_ALL + * COMMENT\_EDIT\_OWN + * COMMENT\_ISSUE + * CREATE\_ATTACHMENT + * CREATE\_ISSUE + * DELETE\_ISSUE + * EDIT\_ISSUE + * LINK\_ISSUE + * MANAGE\_WATCHER\_LIST + * MODIFY\_REPORTER + * MOVE\_ISSUE + * PROJECT\_ADMIN + * RESOLVE\_ISSUE + * SCHEDULE\_ISSUE + * SET\_ISSUE\_SECURITY + * TRANSITION\_ISSUE + * VIEW\_VERSION\_CONTROL + * VIEW\_VOTERS\_AND\_WATCHERS + * VIEW\_WORKFLOW\_READONLY + * WORKLOG\_DELETE\_ALL + * WORKLOG\_DELETE\_OWN + * WORKLOG\_EDIT\_ALL + * WORKLOG\_EDIT\_OWN + * WORK\_ISSUE +*/ + permissions: string; + /** + * The issue key for the issue. + */ + issueKey?: string; + /** + * The project key for the project (case sensitive). + */ + projectKey?: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findUsersWithAllPermissions({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find users for picker + * @request GET :/rest/api/3/user/picker + * @readonly + */ +export async function getRestFindUsersForPicker( + query: { + /** + * A query string that is matched against user attributes, such as `displayName`, and `emailAddress`, to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. + */ + query: string; + /** + * The maximum number of items to return. The total number of matched users is returned in `total`. + */ + maxResults?: number; + /** + * Include the URI to the user's avatar. + */ + showAvatar?: boolean; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + exclude?: string[]; + /** + * A list of account IDs to exclude from the search results. This parameter accepts a comma-separated list. Multiple account IDs can also be provided using an ampersand-separated list. For example, `excludeAccountIds=5b10a2844c20165700ede21g,5b10a0effa615349cb016cd8&excludeAccountIds=5b10ac8d82e05b22cc7d4ef5`. Cannot be provided with `exclude`. + */ + excludeAccountIds?: string[]; + avatarSize?: string; + excludeConnectUsers?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findUsersForPicker({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get user property keys + * @request GET :/rest/api/3/user/properties + * @readonly + */ +export async function getRestGetUserPropertyKeys( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + userKey?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUserPropertyKeys({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete user property + * @request DELETE :/rest/api/3/user/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteUserProperty( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + userKey?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + }, + /** + * The key of the user's property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteUserProperty({ + query: query, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get user property + * @request GET :/rest/api/3/user/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetUserProperty( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + userKey?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + }, + /** + * The key of the user's property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUserProperty({ + query: query, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set user property + * @request PUT :/rest/api/3/user/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestSetUserProperty( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + userKey?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + }, + /** + * The key of the user's property. The maximum length is 255 characters. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setUserProperty({ + query: query, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Find users + * @request GET :/rest/api/3/user/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindUsers( + query: { + /** + * A query string that is matched against user attributes ( `displayName`, and `emailAddress`) to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. Required, unless `accountId` or `property` is specified. + */ + query?: string; + username?: string; + /** + * A query string that is matched exactly against a user `accountId`. Required, unless `query` or `property` is specified. + */ + accountId?: string; + /** + * The index of the first item to return in a page of filtered results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * A query string used to search properties. Property keys are specified by path, so property keys containing dot (.) or equals (=) characters cannot be used. The query string cannot be specified using a JSON object. Example: To search for the value of `nested` from `{"something":{"nested":1,"other":2}}` use `thepropertykey.something.nested=1`. Required, unless `accountId` or `query` is specified. + */ + property?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findUsers({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find users by query + * @request GET :/rest/api/3/user/search/query + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindUsersByQuery( + query: { + /** + * The search query. + */ + query: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findUsersByQuery({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find user keys by query + * @request GET :/rest/api/3/user/search/query/key + * @readonly + */ +export async function getRestFindUserKeysByQuery( + query: { + /** + * The search query. + */ + query: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findUserKeysByQuery({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find users with browse permission + * @request GET :/rest/api/3/user/viewissue/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindUsersWithBrowsePermission( + query: { + /** + * A query string that is matched against user attributes, such as `displayName` and `emailAddress`, to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. Required, unless `accountId` is specified. + */ + query?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. + */ + accountId?: string; + /** + * The issue key for the issue. Required, unless `projectKey` is specified. + */ + issueKey?: string; + /** + * The project key for the project (case sensitive). Required, unless `issueKey` is specified. + */ + projectKey?: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findUsersWithBrowsePermission({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all users default + * @request GET :/rest/api/3/users + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllUsersDefault( + query: { + /** + * The index of the first item to return. + */ + startAt?: number; + /** + * The maximum number of items to return. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllUsersDefault({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all users + * @request GET :/rest/api/3/users/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllUsers( + query: { + /** + * The index of the first item to return. + */ + startAt?: number; + /** + * The maximum number of items to return. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllUsers({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create version + * @request POST :/rest/api/3/version + */ +export async function postRestCreateVersion( + /** Request body */ + data: Version, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createVersion({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete version + * @request DELETE :/rest/api/3/version/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteVersion( + query: { + /** + * The ID of the version to update `fixVersion` to when the field contains the deleted version. The replacement version must be in the same project as the version being deleted and cannot be the version being deleted. + */ + moveFixIssuesTo?: string; + /** + * The ID of the version to update `affectedVersion` to when the field contains the deleted version. The replacement version must be in the same project as the version being deleted and cannot be the version being deleted. + */ + moveAffectedIssuesTo?: string; + }, + /** + * The ID of the version. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteVersion({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get version + * @request GET :/rest/api/3/version/{id} + * @readonly + */ +export async function getRestGetVersion( + query: { + /** +* Use [expand](#expansion) to include additional information about version in the response. This parameter accepts a comma-separated list. Expand options include: + + * `operations` Returns the list of operations available for this version. + * `issuesstatus` Returns the count of issues in this version for each of the status categories *to do*, *in progress*, *done*, and *unmapped*. The *unmapped* property represents the number of issues with a status other than *to do*, *in progress*, and *done*. +*/ + expand?: string; + }, + /** + * The ID of the version. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getVersion({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update version + * @request PUT :/rest/api/3/version/{id} + */ +export async function putRestUpdateVersion( + /** + * The ID of the version. + */ + id: string, + /** Request body */ + data: Version, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateVersion({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Merge versions + * @request PUT :/rest/api/3/version/{id}/mergeto/{moveIssuesTo} + * @allowrelaxedtypes + */ +export async function putRestMergeVersions( + /** + * The ID of the version to delete. + */ + id: string, + /** + * The ID of the version to merge into. + */ + moveIssuesTo: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.mergeVersions({ + id: id, + moveIssuesTo: moveIssuesTo, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Move version + * @request POST :/rest/api/3/version/{id}/move + * @allowrelaxedtypes + */ +export async function postRestMoveVersion( + /** + * The ID of the version to be moved. + */ + id: string, + /** Request body */ + data: VersionMoveBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.moveVersion({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get version's related issues count + * @request GET :/rest/api/3/version/{id}/relatedIssueCounts + * @readonly + */ +export async function getRestGetVersionRelatedIssues( + /** + * The ID of the version. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getVersionRelatedIssues({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete and replace version + * @request POST :/rest/api/3/version/{id}/removeAndSwap + * @allowrelaxedtypes + */ +export async function postRestDeleteAndReplaceVersion( + /** + * The ID of the version. + */ + id: string, + /** Request body */ + data: DeleteAndReplaceVersionBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteAndReplaceVersion({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get version's unresolved issues count + * @request GET :/rest/api/3/version/{id}/unresolvedIssueCount + * @readonly + */ +export async function getRestGetVersionUnresolvedIssues( + /** + * The ID of the version. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getVersionUnresolvedIssues({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete webhooks by ID + * @request DELETE :/rest/api/3/webhook + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWebhookById( + /** Request body */ + data: ContainerForWebhookIDs, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWebhookById({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.error) { + throw result.error; + } else { + return new hasuraSdk.JSONValue(result.data); + } +} + +/** + * Get dynamic webhooks for app + * @request GET :/rest/api/3/webhook + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetDynamicWebhooksForApp( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDynamicWebhooksForApp({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Register dynamic webhooks + * @request POST :/rest/api/3/webhook + * @allowrelaxedtypes + */ +export async function postRestRegisterDynamicWebhooks( + /** Request body */ + data: WebhookRegistrationDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.registerDynamicWebhooks({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get failed webhooks + * @request GET :/rest/api/3/webhook/failed + * @readonly + */ +export async function getRestGetFailedWebhooks( + query: { + /** + * The maximum number of webhooks to return per page. If obeying the maxResults directive would result in records with the same failure time being split across pages, the directive is ignored and all records with the same failure time included on the page. + */ + maxResults?: number; + /** + * The time after which any webhook failure must have occurred for the record to be returned, expressed as milliseconds since the UNIX epoch. + */ + after?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFailedWebhooks({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Extend webhook life + * @request PUT :/rest/api/3/webhook/refresh + */ +export async function putRestRefreshWebhooks( + /** Request body */ + data: ContainerForWebhookIDs, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.refreshWebhooks({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all workflows + * @request GET :/rest/api/3/workflow + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllWorkflows( + query: { + /** + * The name of the workflow to be returned. Only one workflow can be specified. + */ + workflowName?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllWorkflows({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create workflow + * @request POST :/rest/api/3/workflow + * @allowrelaxedtypes + */ +export async function postRestCreateWorkflow( + /** Request body */ + data: CreateWorkflowDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createWorkflow({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get workflow transition rule configurations + * @request GET :/rest/api/3/workflow/rule/config + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorkflowTransitionRuleConfigurations( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The types of the transition rules to return. + */ + types: ("postfunction" | "condition" | "validator")[]; + /** + * The transition rule class keys, as defined in the Connect app descriptor, of the transition rules to return. + */ + keys?: string[]; + /** + * EXPERIMENTAL: The list of workflow names to filter by. + */ + workflowNames?: string[]; + /** + * EXPERIMENTAL: The list of `tags` to filter by. + */ + withTags?: string[]; + /** + * EXPERIMENTAL: Whether draft or published workflows are returned. If not provided, both workflow types are returned. + */ + draft?: boolean; + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts `transition`, which, for each rule, returns information about the transition the rule is assigned to. + */ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowTransitionRuleConfigurations({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update workflow transition rule configurations + * @request PUT :/rest/api/3/workflow/rule/config + */ +export async function putRestUpdateWorkflowTransitionRuleConfigurations( + /** Request body */ + data: WorkflowTransitionRulesUpdate, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateWorkflowTransitionRuleConfigurations({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete workflow transition rule configurations + * @request PUT :/rest/api/3/workflow/rule/config/delete + */ +export async function putRestDeleteWorkflowTransitionRuleConfigurations( + /** Request body */ + data: WorkflowsWithTransitionRulesDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorkflowTransitionRuleConfigurations({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get workflows paginated + * @request GET :/rest/api/3/workflow/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorkflowsPaginated( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The name of a workflow to return. To include multiple workflows, provide an ampersand-separated list. For example, `workflowName=name1&workflowName=name2`. + */ + workflowName?: string[]; + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `transitions` For each workflow, returns information about the transitions inside the workflow. + * `transitions.rules` For each workflow transition, returns information about its rules. Transitions are included automatically if this expand is requested. + * `transitions.properties` For each workflow transition, returns information about its properties. Transitions are included automatically if this expand is requested. + * `statuses` For each workflow, returns information about the statuses inside the workflow. + * `statuses.properties` For each workflow status, returns information about its properties. Statuses are included automatically if this expand is requested. + * `default` For each workflow, returns information about whether this is the default workflow. + * `schemes` For each workflow, returns information about the workflow schemes the workflow is assigned to. + * `projects` For each workflow, returns information about the projects the workflow is assigned to, through workflow schemes. + * `hasDraftWorkflow` For each workflow, returns information about whether the workflow has a draft version. + * `operations` For each workflow, returns information about the actions that can be undertaken on the workflow. +*/ + expand?: string; + /** + * String used to perform a case-insensitive partial match with workflow name. + */ + queryString?: string; + /** +* [Order](#ordering) the results by a field: + + * `name` Sorts by workflow name. + * `created` Sorts by create time. + * `updated` Sorts by update time. +*/ + orderBy?: + | "name" + | "-name" + | "+name" + | "created" + | "-created" + | "+created" + | "updated" + | "+updated" + | "-updated"; + /** + * Filters active and inactive workflows. + */ + isActive?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowsPaginated({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete workflow transition property + * @request DELETE :/rest/api/3/workflow/transitions/{transitionId}/properties + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorkflowTransitionProperty( + query: { + /** + * The name of the transition property to delete, also known as the name of the property. + */ + key: string; + /** + * The name of the workflow that the transition belongs to. + */ + workflowName: string; + /** + * The workflow status. Set to `live` for inactive workflows or `draft` for draft workflows. Active workflows cannot be edited. + */ + workflowMode?: "live" | "draft"; + }, + /** + * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown next to the transition. + */ + transitionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorkflowTransitionProperty({ + query: query, + transitionId: transitionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get workflow transition properties + * @request GET :/rest/api/3/workflow/transitions/{transitionId}/properties + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorkflowTransitionProperties( + query: { + /** + * Some properties with keys that have the *jira.* prefix are reserved, which means they are not editable. To include these properties in the results, set this parameter to *true*. + */ + includeReservedKeys?: boolean; + /** + * The key of the property being returned, also known as the name of the property. If this parameter is not specified, all properties on the transition are returned. + */ + key?: string; + /** + * The name of the workflow that the transition belongs to. + */ + workflowName: string; + /** + * The workflow status. Set to *live* for active and inactive workflows, or *draft* for draft workflows. + */ + workflowMode?: "live" | "draft"; + }, + /** + * The ID of the transition. To get the ID, view the workflow in text mode in the Jira administration console. The ID is shown next to the transition. + */ + transitionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowTransitionProperties({ + query: query, + transitionId: transitionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create workflow transition property + * @request POST :/rest/api/3/workflow/transitions/{transitionId}/properties + * @allowrelaxedtypes + */ +export async function postRestCreateWorkflowTransitionProperty( + query: { + /** + * The key of the property being added, also known as the name of the property. Set this to the same value as the `key` defined in the request body. + */ + key: string; + /** + * The name of the workflow that the transition belongs to. + */ + workflowName: string; + /** + * The workflow status. Set to *live* for inactive workflows or *draft* for draft workflows. Active workflows cannot be edited. + */ + workflowMode?: "live" | "draft"; + }, + /** + * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown next to the transition. + */ + transitionId: number, + /** Request body */ + data: WorkflowTransitionProperty, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createWorkflowTransitionProperty({ + query: query, + transitionId: transitionId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update workflow transition property + * @request PUT :/rest/api/3/workflow/transitions/{transitionId}/properties + * @allowrelaxedtypes + */ +export async function putRestUpdateWorkflowTransitionProperty( + query: { + /** + * The key of the property being updated, also known as the name of the property. Set this to the same value as the `key` defined in the request body. + */ + key: string; + /** + * The name of the workflow that the transition belongs to. + */ + workflowName: string; + /** + * The workflow status. Set to `live` for inactive workflows or `draft` for draft workflows. Active workflows cannot be edited. + */ + workflowMode?: "live" | "draft"; + }, + /** + * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown next to the transition. + */ + transitionId: number, + /** Request body */ + data: WorkflowTransitionProperty, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateWorkflowTransitionProperty({ + query: query, + transitionId: transitionId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete inactive workflow + * @request DELETE :/rest/api/3/workflow/{entityId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteInactiveWorkflow( + /** + * The entity ID of the workflow. + */ + entityId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteInactiveWorkflow({ + entityId: entityId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get all workflow schemes + * @request GET :/rest/api/3/workflowscheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllWorkflowSchemes( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllWorkflowSchemes({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create workflow scheme + * @request POST :/rest/api/3/workflowscheme + * @allowrelaxedtypes + */ +export async function postRestCreateWorkflowScheme( + /** Request body */ + data: WorkflowScheme, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createWorkflowScheme({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get workflow scheme project associations + * @request GET :/rest/api/3/workflowscheme/project + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorkflowSchemeProjectAssociations( + query: { + /** + * The ID of a project to return the workflow schemes for. To include multiple projects, provide an ampersand-Jim: oneseparated list. For example, `projectId=10000&projectId=10001`. + */ + projectId: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowSchemeProjectAssociations({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Assign workflow scheme to project + * @request PUT :/rest/api/3/workflowscheme/project + * @allowrelaxedtypes + */ +export async function putRestAssignSchemeToProject( + /** Request body */ + data: WorkflowSchemeProjectAssociation, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.assignSchemeToProject({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete workflow scheme + * @request DELETE :/rest/api/3/workflowscheme/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorkflowScheme( + /** + * The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the URL as `schemeId`. For example, *schemeId=10301*. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorkflowScheme({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get workflow scheme + * @request GET :/rest/api/3/workflowscheme/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorkflowScheme( + query: { + /** + * Returns the workflow scheme's draft rather than scheme itself, if set to true. If the workflow scheme does not have a draft, then the workflow scheme is returned. + */ + returnDraftIfExists?: boolean; + }, + /** + * The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the URL as `schemeId`. For example, *schemeId=10301*. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowScheme({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update workflow scheme + * @request PUT :/rest/api/3/workflowscheme/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateWorkflowScheme( + /** + * The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the URL as `schemeId`. For example, *schemeId=10301*. + */ + id: number, + /** Request body */ + data: WorkflowScheme, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateWorkflowScheme({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create draft workflow scheme + * @request POST :/rest/api/3/workflowscheme/{id}/createdraft + * @allowrelaxedtypes + */ +export async function postRestCreateWorkflowSchemeDraftFromParent( + /** + * The ID of the active workflow scheme that the draft is created from. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createWorkflowSchemeDraftFromParent({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete default workflow + * @request DELETE :/rest/api/3/workflowscheme/{id}/default + * @allowrelaxedtypes + */ +export async function deleteRestDeleteDefaultWorkflow( + query: { + /** + * Set to true to create or update the draft of a workflow scheme and delete the mapping from the draft, when the workflow scheme cannot be edited. Defaults to `false`. + */ + updateDraftIfNeeded?: boolean; + }, + /** + * The ID of the workflow scheme. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteDefaultWorkflow({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get default workflow + * @request GET :/rest/api/3/workflowscheme/{id}/default + * @readonly + */ +export async function getRestGetDefaultWorkflow( + query: { + /** + * Set to `true` to return the default workflow for the workflow scheme's draft rather than scheme itself. If the workflow scheme does not have a draft, then the default workflow for the workflow scheme is returned. + */ + returnDraftIfExists?: boolean; + }, + /** + * The ID of the workflow scheme. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDefaultWorkflow({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update default workflow + * @request PUT :/rest/api/3/workflowscheme/{id}/default + * @allowrelaxedtypes + */ +export async function putRestUpdateDefaultWorkflow( + /** + * The ID of the workflow scheme. + */ + id: number, + /** Request body */ + data: DefaultWorkflow, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateDefaultWorkflow({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete draft workflow scheme + * @request DELETE :/rest/api/3/workflowscheme/{id}/draft + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorkflowSchemeDraft( + /** + * The ID of the active workflow scheme that the draft was created from. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorkflowSchemeDraft({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get draft workflow scheme + * @request GET :/rest/api/3/workflowscheme/{id}/draft + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorkflowSchemeDraft( + /** + * The ID of the active workflow scheme that the draft was created from. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowSchemeDraft({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update draft workflow scheme + * @request PUT :/rest/api/3/workflowscheme/{id}/draft + * @allowrelaxedtypes + */ +export async function putRestUpdateWorkflowSchemeDraft( + /** + * The ID of the active workflow scheme that the draft was created from. + */ + id: number, + /** Request body */ + data: WorkflowScheme, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateWorkflowSchemeDraft({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete draft default workflow + * @request DELETE :/rest/api/3/workflowscheme/{id}/draft/default + * @allowrelaxedtypes + */ +export async function deleteRestDeleteDraftDefaultWorkflow( + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteDraftDefaultWorkflow({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get draft default workflow + * @request GET :/rest/api/3/workflowscheme/{id}/draft/default + * @readonly + */ +export async function getRestGetDraftDefaultWorkflow( + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDraftDefaultWorkflow({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update draft default workflow + * @request PUT :/rest/api/3/workflowscheme/{id}/draft/default + * @allowrelaxedtypes + */ +export async function putRestUpdateDraftDefaultWorkflow( + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + /** Request body */ + data: DefaultWorkflow, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateDraftDefaultWorkflow({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete workflow for issue type in draft workflow scheme + * @request DELETE :/rest/api/3/workflowscheme/{id}/draft/issuetype/{issueType} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorkflowSchemeDraftIssueType( + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + /** + * The ID of the issue type. + */ + issueType: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorkflowSchemeDraftIssueType({ + id: id, + issueType: issueType, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get workflow for issue type in draft workflow scheme + * @request GET :/rest/api/3/workflowscheme/{id}/draft/issuetype/{issueType} + * @readonly + */ +export async function getRestGetWorkflowSchemeDraftIssueType( + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + /** + * The ID of the issue type. + */ + issueType: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowSchemeDraftIssueType({ + id: id, + issueType: issueType, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set workflow for issue type in draft workflow scheme + * @request PUT :/rest/api/3/workflowscheme/{id}/draft/issuetype/{issueType} + * @allowrelaxedtypes + */ +export async function putRestSetWorkflowSchemeDraftIssueType( + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + /** + * The ID of the issue type. + */ + issueType: string, + /** Request body */ + data: IssueTypeWorkflowMapping, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setWorkflowSchemeDraftIssueType({ + id: id, + issueType: issueType, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Publish draft workflow scheme + * @request POST :/rest/api/3/workflowscheme/{id}/draft/publish + * @allowrelaxedtypes + */ +export async function postRestPublishDraftWorkflowScheme( + query: { + /** + * Whether the request only performs a validation. + */ + validateOnly?: boolean; + }, + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + /** Request body */ + data: PublishDraftWorkflowScheme, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.publishDraftWorkflowScheme({ + query: query, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.error) { + throw result.error; + } else { + return new hasuraSdk.JSONValue(result.data); + } +} + +/** + * Delete issue types for workflow in draft workflow scheme + * @request DELETE :/rest/api/3/workflowscheme/{id}/draft/workflow + * @allowrelaxedtypes + */ +export async function deleteRestDeleteDraftWorkflowMapping( + query: { + /** + * The name of the workflow. + */ + workflowName: string; + }, + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteDraftWorkflowMapping({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue types for workflows in draft workflow scheme + * @request GET :/rest/api/3/workflowscheme/{id}/draft/workflow + * @readonly + */ +export async function getRestGetDraftWorkflow( + query: { + /** + * The name of a workflow in the scheme. Limits the results to the workflow-issue type mapping for the specified workflow. + */ + workflowName?: string; + }, + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDraftWorkflow({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set issue types for workflow in workflow scheme + * @request PUT :/rest/api/3/workflowscheme/{id}/draft/workflow + * @allowrelaxedtypes + */ +export async function putRestUpdateDraftWorkflowMapping( + query: { + /** + * The name of the workflow. + */ + workflowName: string; + }, + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + /** Request body */ + data: IssueTypesWorkflowMapping, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateDraftWorkflowMapping({ + query: query, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete workflow for issue type in workflow scheme + * @request DELETE :/rest/api/3/workflowscheme/{id}/issuetype/{issueType} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorkflowSchemeIssueType( + query: { + /** + * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the workflow scheme cannot be edited. Defaults to `false`. + */ + updateDraftIfNeeded?: boolean; + }, + /** + * The ID of the workflow scheme. + */ + id: number, + /** + * The ID of the issue type. + */ + issueType: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorkflowSchemeIssueType({ + query: query, + id: id, + issueType: issueType, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get workflow for issue type in workflow scheme + * @request GET :/rest/api/3/workflowscheme/{id}/issuetype/{issueType} + * @readonly + */ +export async function getRestGetWorkflowSchemeIssueType( + query: { + /** + * Returns the mapping from the workflow scheme's draft rather than the workflow scheme, if set to true. If no draft exists, the mapping from the workflow scheme is returned. + */ + returnDraftIfExists?: boolean; + }, + /** + * The ID of the workflow scheme. + */ + id: number, + /** + * The ID of the issue type. + */ + issueType: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowSchemeIssueType({ + query: query, + id: id, + issueType: issueType, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set workflow for issue type in workflow scheme + * @request PUT :/rest/api/3/workflowscheme/{id}/issuetype/{issueType} + * @allowrelaxedtypes + */ +export async function putRestSetWorkflowSchemeIssueType( + /** + * The ID of the workflow scheme. + */ + id: number, + /** + * The ID of the issue type. + */ + issueType: string, + /** Request body */ + data: IssueTypeWorkflowMapping, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setWorkflowSchemeIssueType({ + id: id, + issueType: issueType, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete issue types for workflow in workflow scheme + * @request DELETE :/rest/api/3/workflowscheme/{id}/workflow + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorkflowMapping( + query: { + /** + * The name of the workflow. + */ + workflowName: string; + /** + * Set to true to create or update the draft of a workflow scheme and delete the mapping from the draft, when the workflow scheme cannot be edited. Defaults to `false`. + */ + updateDraftIfNeeded?: boolean; + }, + /** + * The ID of the workflow scheme. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorkflowMapping({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue types for workflows in workflow scheme + * @request GET :/rest/api/3/workflowscheme/{id}/workflow + * @readonly + */ +export async function getRestGetWorkflow( + query: { + /** + * The name of a workflow in the scheme. Limits the results to the workflow-issue type mapping for the specified workflow. + */ + workflowName?: string; + /** + * Returns the mapping from the workflow scheme's draft rather than the workflow scheme, if set to true. If no draft exists, the mapping from the workflow scheme is returned. + */ + returnDraftIfExists?: boolean; + }, + /** + * The ID of the workflow scheme. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflow({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set issue types for workflow in workflow scheme + * @request PUT :/rest/api/3/workflowscheme/{id}/workflow + * @allowrelaxedtypes + */ +export async function putRestUpdateWorkflowMapping( + query: { + /** + * The name of the workflow. + */ + workflowName: string; + }, + /** + * The ID of the workflow scheme. + */ + id: number, + /** Request body */ + data: IssueTypesWorkflowMapping, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateWorkflowMapping({ + query: query, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get IDs of deleted worklogs + * @request GET :/rest/api/3/worklog/deleted + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIdsOfWorklogsDeletedSince( + query: { + /** + * The date and time, as a UNIX timestamp in milliseconds, after which deleted worklogs are returned. + */ + since?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIdsOfWorklogsDeletedSince({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get worklogs + * @request POST :/rest/api/3/worklog/list + * @allowrelaxedtypes + */ +export async function postRestGetWorklogsForIds( + query: { + /** + * Use [expand](#expansion) to include additional information about worklogs in the response. This parameter accepts `properties` that returns the properties of each worklog. + */ + expand?: string; + }, + /** Request body */ + data: WorklogIdsRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorklogsForIds({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get IDs of updated worklogs + * @request GET :/rest/api/3/worklog/updated + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIdsOfWorklogsModifiedSince( + query: { + /** + * The date and time, as a UNIX timestamp in milliseconds, after which updated worklogs are returned. + */ + since?: number; + /** + * Use [expand](#expansion) to include additional information about worklogs in the response. This parameter accepts `properties` that returns the properties of each worklog. + */ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIdsOfWorklogsModifiedSince({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get app properties + * @request GET :/rest/atlassian-connect/1/addons/{addonKey}/properties + * @readonly + */ +export async function getRestAddonPropertiesResourceGetAddonPropertiesGet( + /** + * The key of the app, as defined in its descriptor. + */ + addonKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addonPropertiesResourceGetAddonPropertiesGet({ + addonKey: addonKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete app property + * @request DELETE :/rest/atlassian-connect/1/addons/{addonKey}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestAddonPropertiesResourceDeleteAddonPropertyDelete( + /** + * The key of the app, as defined in its descriptor. + */ + addonKey: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.rest.addonPropertiesResourceDeleteAddonPropertyDelete({ + addonKey: addonKey, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.error) { + throw result.error; + } else { + return new hasuraSdk.JSONValue(result.data); + } +} + +/** + * Get app property + * @request GET :/rest/atlassian-connect/1/addons/{addonKey}/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestAddonPropertiesResourceGetAddonPropertyGet( + /** + * The key of the app, as defined in its descriptor. + */ + addonKey: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addonPropertiesResourceGetAddonPropertyGet({ + addonKey: addonKey, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set app property + * @request PUT :/rest/atlassian-connect/1/addons/{addonKey}/properties/{propertyKey} + */ +export async function putRestAddonPropertiesResourcePutAddonPropertyPut( + /** + * The key of the app, as defined in its descriptor. + */ + addonKey: string, + /** + * The key of the property. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addonPropertiesResourcePutAddonPropertyPut({ + addonKey: addonKey, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Remove modules + * @request DELETE :/rest/atlassian-connect/1/app/module/dynamic + * @allowrelaxedtypes + */ +export async function deleteRestDynamicModulesResourceRemoveModulesDelete( + query: { + /** +* The key of the module to remove. To include multiple module keys, provide multiple copies of this parameter. +For example, `moduleKey=dynamic-attachment-entity-property&moduleKey=dynamic-select-field`. +Nonexistent keys are ignored. +*/ + moduleKey?: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.dynamicModulesResourceRemoveModulesDelete({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.error) { + throw result.error; + } else { + return new hasuraSdk.JSONValue(result.data); + } +} + +/** + * Get modules + * @request GET :/rest/atlassian-connect/1/app/module/dynamic + * @allowrelaxedtypes + * @readonly + */ +export async function getRestDynamicModulesResourceGetModulesGet( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.dynamicModulesResourceGetModulesGet({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Register modules + * @request POST :/rest/atlassian-connect/1/app/module/dynamic + * @allowrelaxedtypes + */ +export async function postRestDynamicModulesResourceRegisterModulesPost( + /** Request body */ + data: ConnectModules, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.dynamicModulesResourceRegisterModulesPost({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.error) { + throw result.error; + } else { + return new hasuraSdk.JSONValue(result.data); + } +} + +/** + * Bulk update custom field value + * @request PUT :/rest/atlassian-connect/1/migration/field + * @allowrelaxedtypes + */ +export async function putRestAppIssueFieldValueUpdateResourceUpdateIssueFieldsPut( + /** Request body */ + data: ConnectCustomFieldValues, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.rest.appIssueFieldValueUpdateResourceUpdateIssueFieldsPut({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Bulk update entity properties + * @request PUT :/rest/atlassian-connect/1/migration/properties/{entityType} + * @allowrelaxedtypes + */ +export async function putRestMigrationResourceUpdateEntityPropertiesValuePut( + /** + * The type indicating the object that contains the entity properties. + */ + entityType: + | "IssueProperty" + | "CommentProperty" + | "DashboardItemProperty" + | "IssueTypeProperty" + | "ProjectProperty" + | "UserProperty" + | "WorklogProperty" + | "BoardProperty" + | "SprintProperty", + /** Request body */ + data: EntityPropertyDetails[], + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.migrationResourceUpdateEntityPropertiesValuePut( + { + entityType: entityType, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get workflow transition rule configurations + * @request POST :/rest/atlassian-connect/1/migration/workflow/rule/search + */ +export async function postRestMigrationResourceWorkflowRuleSearchPost( + /** Request body */ + data: WorkflowRulesSearch, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.migrationResourceWorkflowRuleSearchPost({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} diff --git a/src/app/writer/functions-ts-writer.ts b/src/app/writer/functions-ts-writer.ts index 075ff54..1de8c7e 100644 --- a/src/app/writer/functions-ts-writer.ts +++ b/src/app/writer/functions-ts-writer.ts @@ -1,42 +1,43 @@ import * as types from "../types"; import * as fs from "fs"; import * as tsParser from "../parser/typescript"; -import * as prettier from "prettier"; import * as logger from "../../util/logger"; +import * as cleanup from "../parser/typescript/cleanup"; +import * as format from "../parser/typescript/fomat"; -export async function writeToFileSystem(codeToWrite: types.GeneratedCode) { - if (!fs.existsSync(codeToWrite.filePath)) { - logger.info(`Creating ${codeToWrite.filePath}`); - await writeContentToFile(codeToWrite.filePath, codeToWrite.fileContent); +export async function writeToFileSystem( + functionsTs: types.GeneratedCode, + apiTs: types.GeneratedCode, +) { + if (!fs.existsSync(functionsTs.filePath)) { + logger.info(`Creating ${functionsTs.filePath}`); + await writeContentToFile(functionsTs, apiTs); return; } - logger.info(`Overwriting ${codeToWrite.filePath}`); - const staleFile = fs.readFileSync(codeToWrite.filePath).toString(); + logger.info(`Overwriting ${functionsTs.filePath}`); + const staleFile = fs.readFileSync(functionsTs.filePath).toString(); - let freshFile = tsParser.preserveUserChanges( + functionsTs.fileContent = tsParser.preserveUserChanges( staleFile, - codeToWrite.fileContent, + functionsTs.fileContent, ); - await writeContentToFile(codeToWrite.filePath, freshFile); + await writeContentToFile(functionsTs, apiTs); } -async function writeContentToFile(filePath: string, codeContent: string) { - codeContent = await formatCode(codeContent); - fs.writeFileSync(filePath, codeContent); +async function writeContentToFile( + functionsTs: types.GeneratedCode, + apiTs: types.GeneratedCode, +) { + await cleanupAndFormat(functionsTs, apiTs); + fs.writeFileSync(functionsTs.filePath, functionsTs.fileContent); } -async function formatCode(code: string): Promise { - try { - code = await prettier.format(code, { - parser: "typescript", - }); - } catch (e) { - logger.error( - "Error while formatting code. The resulting code will be unformatted and may contain syntax errors. Error: ", - e, - ); - } - return code; +export async function cleanupAndFormat( + functionsTs: types.GeneratedCode, + apiTs: types.GeneratedCode, +) { + cleanup.fixImports([functionsTs, apiTs]); + functionsTs.fileContent = await format.format(functionsTs.fileContent); } diff --git a/src/app/writer/index.ts b/src/app/writer/index.ts index 883e22a..374d870 100644 --- a/src/app/writer/index.ts +++ b/src/app/writer/index.ts @@ -11,13 +11,13 @@ export async function writeToFileSystem(codeToWrite: types.GeneratedCode[]) { try { const apiTsCode = codeToWrite.filter( (element) => element.fileType === "api-ts", - ); + )[0]!; const functionsTsCode = codeToWrite.filter( (element) => element.fileType === "functions-ts", - ); + )[0]!; - apiWriter.writeToFileSystem(apiTsCode[0]!); - await functionsWriter.writeToFileSystem(functionsTsCode[0]!); + apiWriter.writeToFileSystem(apiTsCode); + await functionsWriter.writeToFileSystem(functionsTsCode, apiTsCode); await packageJsonWriter.writeToFileSystem(); tsConfigWriter.writeToFileSystem(); diff --git a/tests/test-data/golden-files/1password b/tests/test-data/golden-files/1password new file mode 100644 index 0000000..ce13a05 --- /dev/null +++ b/tests/test-data/golden-files/1password @@ -0,0 +1,468 @@ +import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; +import { + APIRequest, + Api, + File, + FullItem, + Item, + Patch, + ServiceDependency, + Vault, +} from "./api"; + +const api = new Api({ + baseUrl: "", +}); + +/** + * Retrieve a list of API Requests that have been made. + * @request GET :/activity + * @allowrelaxedtypes + * @readonly + */ +export async function getActivityGetApiActivity( + query: { + /** + * How many API Events should be retrieved in a single request. + */ + limit?: number; + /** + * How far into the collection of API Events should the response start + */ + offset?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.activity.getApiActivity({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get state of the server and its dependencies. + * @request GET :/health + * @readonly + */ +export async function getHealthGetServerHealth( + headers?: hasuraSdk.JSONValue, +): Promise<{ + dependencies?: ServiceDependency[]; + name: string; + /** The Connect server's version */ + version: string; +}> { + const result = await api.health.getServerHealth({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Ping the server for liveness + * @request GET :/heartbeat + * @readonly + */ +export async function getHeartbeatGetHeartbeat( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.heartbeat.getHeartbeat({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Query server for exposed Prometheus metrics + * @request GET :/metrics + * @readonly + */ +export async function getMetricsGetPrometheusMetrics( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.metrics.getPrometheusMetrics({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all Vaults + * @request GET :/vaults + * @allowrelaxedtypes + * @readonly + */ +export async function getVaultsGetVaults( + query: { + /** + * Filter the Vault collection based on Vault name using SCIM eq filter + */ + filter?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.vaults.getVaults({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get Vault details and metadata + * @request GET :/vaults/{vaultUuid} + * @allowrelaxedtypes + * @readonly + */ +export async function getVaultsGetVaultById( + /** + * The UUID of the Vault to fetch Items from + */ + vaultUuid: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.vaults.getVaultById({ + vaultUuid: vaultUuid, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all items for inside a Vault + * @request GET :/vaults/{vaultUuid}/items + * @allowrelaxedtypes + * @readonly + */ +export async function getVaultsGetVaultItems( + query: { + /** + * Filter the Item collection based on Item name using SCIM eq filter + */ + filter?: string; + }, + /** + * The UUID of the Vault to fetch Items from + */ + vaultUuid: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.vaults.getVaultItems({ + query: query, + vaultUuid: vaultUuid, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create a new Item + * @request POST :/vaults/{vaultUuid}/items + * @allowrelaxedtypes + */ +export async function postVaultsCreateVaultItem( + /** + * The UUID of the Vault to create an Item in + */ + vaultUuid: string, + /** Request body */ + data: FullItem, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.vaults.createVaultItem({ + vaultUuid: vaultUuid, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete an Item + * @request DELETE :/vaults/{vaultUuid}/items/{itemUuid} + * @allowrelaxedtypes + */ +export async function deleteVaultsDeleteVaultItem( + /** + * The UUID of the Vault the item is in + */ + vaultUuid: string, + /** + * The UUID of the Item to update + */ + itemUuid: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.vaults.deleteVaultItem({ + vaultUuid: vaultUuid, + itemUuid: itemUuid, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.error) { + throw result.error; + } else { + return new hasuraSdk.JSONValue(result.data); + } +} + +/** + * Get the details of an Item + * @request GET :/vaults/{vaultUuid}/items/{itemUuid} + * @allowrelaxedtypes + * @readonly + */ +export async function getVaultsGetVaultItemById( + /** + * The UUID of the Vault to fetch Item from + */ + vaultUuid: string, + /** + * The UUID of the Item to fetch + */ + itemUuid: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.vaults.getVaultItemById({ + vaultUuid: vaultUuid, + itemUuid: itemUuid, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update a subset of Item attributes + * @request PATCH :/vaults/{vaultUuid}/items/{itemUuid} + * @allowrelaxedtypes + */ +export async function patchVaultsPatchVaultItem( + /** + * The UUID of the Vault the item is in + */ + vaultUuid: string, + /** + * The UUID of the Item to update + */ + itemUuid: string, + /** Request body */ + data: Patch, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.vaults.patchVaultItem({ + vaultUuid: vaultUuid, + itemUuid: itemUuid, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update an Item + * @request PUT :/vaults/{vaultUuid}/items/{itemUuid} + * @allowrelaxedtypes + */ +export async function putVaultsUpdateVaultItem( + /** + * The UUID of the Item's Vault + */ + vaultUuid: string, + /** + * The UUID of the Item to update + */ + itemUuid: string, + /** Request body */ + data: FullItem, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.vaults.updateVaultItem({ + vaultUuid: vaultUuid, + itemUuid: itemUuid, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all the files inside an Item + * @request GET :/vaults/{vaultUuid}/items/{itemUuid}/files + * @readonly + */ +export async function getVaultsGetItemFiles( + query: { + /** + * Tells server to return the base64-encoded file contents in the response. + */ + inline_files?: boolean; + }, + /** + * The UUID of the Vault to fetch Items from + */ + vaultUuid: string, + /** + * The UUID of the Item to fetch files from + */ + itemUuid: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.vaults.getItemFiles({ + query: query, + vaultUuid: vaultUuid, + itemUuid: itemUuid, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get the details of a File + * @request GET :/vaults/{vaultUuid}/items/{itemUuid}/files/{fileUuid} + * @readonly + */ +export async function getVaultsGetDetailsOfFileById( + query: { + /** + * Tells server to return the base64-encoded file contents in the response. + */ + inline_files?: boolean; + }, + /** + * The UUID of the Vault to fetch Item from + */ + vaultUuid: string, + /** + * The UUID of the Item to fetch File from + */ + itemUuid: string, + /** + * The UUID of the File to fetch + */ + fileUuid: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.vaults.getDetailsOfFileById({ + query: query, + vaultUuid: vaultUuid, + itemUuid: itemUuid, + fileUuid: fileUuid, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get the content of a File + * @request GET :/vaults/{vaultUuid}/items/{itemUuid}/files/{fileUuid}/content + * @readonly + */ +export async function getVaultsDownloadFileById( + /** + * The UUID of the Vault the item is in + */ + vaultUuid: string, + /** + * The UUID of the Item the File is in + */ + itemUuid: string, + /** + * UUID of the file to get content from + */ + fileUuid: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.vaults.downloadFileById({ + vaultUuid: vaultUuid, + itemUuid: itemUuid, + fileUuid: fileUuid, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} diff --git a/tests/test-data/golden-files/acko-insurance b/tests/test-data/golden-files/acko-insurance new file mode 100644 index 0000000..9cefe12 --- /dev/null +++ b/tests/test-data/golden-files/acko-insurance @@ -0,0 +1,141 @@ +import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; +import { Api, ConsentArtifactSchema } from "./api"; + +const api = new Api({ + baseUrl: "", +}); + +/** + * Insurance Policy - Car + * @request POST :/cripc/certificate + * @allowrelaxedtypes + */ +export async function postCripcCripc( + /** Request body */ + data: { + certificateParameters?: { + /** + * Phone Number + * @example "10 Digits without any prefix" + */ + phoneno: string; + /** + * Policy Number + * @example "DXXXXXXXXXXXXX/XX OR AROGXXXXXXXXXX" + */ + policyno: string; + }; + consentArtifact?: ConsentArtifactSchema; + /** The format of the certificate in response. */ + format: "pdf"; + /** + * A unique transaction id for this request in UUID format. It is used for tracking the request. + * @format uuid + * @example "f7f1469c-29b0-4325-9dfc-c567200a70f7" + */ + txnId: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.cripc.cripc({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.error) { + throw result.error; + } else { + return new hasuraSdk.JSONValue(result.data); + } +} + +/** + * Insurance Policy - Health + * @request POST :/hlipc/certificate + * @allowrelaxedtypes + */ +export async function postHlipcHlipc( + /** Request body */ + data: { + certificateParameters?: { + /** + * Phone Number + * @example "10 Digits without any prefix" + */ + phoneno: string; + /** + * Policy Number + * @example "DXXXXXXXXXXXXX/XX OR AROGXXXXXXXXXX" + */ + policyno: string; + }; + consentArtifact?: ConsentArtifactSchema; + /** The format of the certificate in response. */ + format: "pdf"; + /** + * A unique transaction id for this request in UUID format. It is used for tracking the request. + * @format uuid + * @example "f7f1469c-29b0-4325-9dfc-c567200a70f7" + */ + txnId: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.hlipc.hlipc({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.error) { + throw result.error; + } else { + return new hasuraSdk.JSONValue(result.data); + } +} + +/** + * Insurance Policy - Two Wheeler + * @request POST :/twipc/certificate + * @allowrelaxedtypes + */ +export async function postTwipcTwipc( + /** Request body */ + data: { + certificateParameters?: { + /** + * Phone Number + * @example "10 Digits without any prefix" + */ + phoneno: string; + /** + * Policy Number + * @example "DXXXXXXXXXXXXX/XX OR AROGXXXXXXXXXX" + */ + policyno: string; + }; + consentArtifact?: ConsentArtifactSchema; + /** The format of the certificate in response. */ + format: "pdf"; + /** + * A unique transaction id for this request in UUID format. It is used for tracking the request. + * @format uuid + * @example "f7f1469c-29b0-4325-9dfc-c567200a70f7" + */ + txnId: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.twipc.twipc({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.error) { + throw result.error; + } else { + return new hasuraSdk.JSONValue(result.data); + } +} diff --git a/tests/test-data/golden-files/adobe b/tests/test-data/golden-files/adobe index 9d463b6..ed7828f 100644 --- a/tests/test-data/golden-files/adobe +++ b/tests/test-data/golden-files/adobe @@ -1,22 +1,12 @@ +import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; import { - BundleDataProp, - BundleData, - KeystoreItems, - KeystoreChainItems, - SamlConfigurationProperties, - SamlConfigurationPropertyItemsBoolean, - SamlConfigurationPropertyItemsString, - SamlConfigurationPropertyItemsLong, - SamlConfigurationPropertyItemsArray, - TruststoreItems, + Api, BundleInfo, InstallStatus, KeystoreInfo, SamlConfigurationInfo, TruststoreInfo, - Api, } from "./api"; -import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; const api = new Api({ baseUrl: "http://localhost:13191", diff --git a/tests/test-data/golden-files/amazon-workspaces b/tests/test-data/golden-files/amazon-workspaces new file mode 100644 index 0000000..505c71c --- /dev/null +++ b/tests/test-data/golden-files/amazon-workspaces @@ -0,0 +1,1791 @@ +import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; +import { + Api, + AssociateConnectionAliasRequest, + AssociateConnectionAliasResult, + AssociateIpGroupsRequest, + AssociateIpGroupsResult, + AuthorizeIpRulesRequest, + AuthorizeIpRulesResult, + CopyWorkspaceImageRequest, + CopyWorkspaceImageResult, + CreateConnectClientAddInRequest, + CreateConnectClientAddInResult, + CreateConnectionAliasRequest, + CreateConnectionAliasResult, + CreateIpGroupRequest, + CreateIpGroupResult, + CreateStandbyWorkspacesRequest, + CreateStandbyWorkspacesResult, + CreateTagsRequest, + CreateTagsResult, + CreateUpdatedWorkspaceImageRequest, + CreateUpdatedWorkspaceImageResult, + CreateWorkspaceBundleRequest, + CreateWorkspaceBundleResult, + CreateWorkspaceImageRequest, + CreateWorkspaceImageResult, + CreateWorkspacesRequest, + CreateWorkspacesResult, + DeleteClientBrandingRequest, + DeleteClientBrandingResult, + DeleteConnectClientAddInRequest, + DeleteConnectClientAddInResult, + DeleteConnectionAliasRequest, + DeleteConnectionAliasResult, + DeleteIpGroupRequest, + DeleteIpGroupResult, + DeleteTagsRequest, + DeleteTagsResult, + DeleteWorkspaceBundleRequest, + DeleteWorkspaceBundleResult, + DeleteWorkspaceImageRequest, + DeleteWorkspaceImageResult, + DeregisterWorkspaceDirectoryRequest, + DeregisterWorkspaceDirectoryResult, + DescribeAccountModificationsRequest, + DescribeAccountModificationsResult, + DescribeAccountRequest, + DescribeAccountResult, + DescribeClientBrandingRequest, + DescribeClientBrandingResult, + DescribeClientPropertiesRequest, + DescribeClientPropertiesResult, + DescribeConnectClientAddInsRequest, + DescribeConnectClientAddInsResult, + DescribeConnectionAliasPermissionsRequest, + DescribeConnectionAliasPermissionsResult, + DescribeConnectionAliasesRequest, + DescribeConnectionAliasesResult, + DescribeIpGroupsRequest, + DescribeIpGroupsResult, + DescribeTagsRequest, + DescribeTagsResult, + DescribeWorkspaceBundlesRequest, + DescribeWorkspaceBundlesResult, + DescribeWorkspaceDirectoriesRequest, + DescribeWorkspaceDirectoriesResult, + DescribeWorkspaceImagePermissionsRequest, + DescribeWorkspaceImagePermissionsResult, + DescribeWorkspaceImagesRequest, + DescribeWorkspaceImagesResult, + DescribeWorkspaceSnapshotsRequest, + DescribeWorkspaceSnapshotsResult, + DescribeWorkspacesConnectionStatusRequest, + DescribeWorkspacesConnectionStatusResult, + DescribeWorkspacesRequest, + DescribeWorkspacesResult, + DisassociateConnectionAliasRequest, + DisassociateConnectionAliasResult, + DisassociateIpGroupsRequest, + DisassociateIpGroupsResult, + ImportClientBrandingRequest, + ImportClientBrandingResult, + ImportWorkspaceImageRequest, + ImportWorkspaceImageResult, + ListAvailableManagementCidrRangesRequest, + ListAvailableManagementCidrRangesResult, + MigrateWorkspaceRequest, + MigrateWorkspaceResult, + ModifyAccountRequest, + ModifyAccountResult, + ModifyCertificateBasedAuthPropertiesRequest, + ModifyCertificateBasedAuthPropertiesResult, + ModifyClientPropertiesRequest, + ModifyClientPropertiesResult, + ModifySamlPropertiesRequest, + ModifySamlPropertiesResult, + ModifySelfservicePermissionsRequest, + ModifySelfservicePermissionsResult, + ModifyWorkspaceAccessPropertiesRequest, + ModifyWorkspaceAccessPropertiesResult, + ModifyWorkspaceCreationPropertiesRequest, + ModifyWorkspaceCreationPropertiesResult, + ModifyWorkspacePropertiesRequest, + ModifyWorkspacePropertiesResult, + ModifyWorkspaceStateRequest, + ModifyWorkspaceStateResult, + RebootWorkspacesRequest, + RebootWorkspacesResult, + RebuildWorkspacesRequest, + RebuildWorkspacesResult, + RegisterWorkspaceDirectoryRequest, + RegisterWorkspaceDirectoryResult, + RestoreWorkspaceRequest, + RestoreWorkspaceResult, + RevokeIpRulesRequest, + RevokeIpRulesResult, + StartWorkspacesRequest, + StartWorkspacesResult, + StopWorkspacesRequest, + StopWorkspacesResult, + TerminateWorkspacesRequest, + TerminateWorkspacesResult, + UpdateConnectClientAddInRequest, + UpdateConnectClientAddInResult, + UpdateConnectionAliasPermissionRequest, + UpdateConnectionAliasPermissionResult, + UpdateRulesOfIpGroupRequest, + UpdateRulesOfIpGroupResult, + UpdateWorkspaceBundleRequest, + UpdateWorkspaceBundleResult, + UpdateWorkspaceImagePermissionRequest, + UpdateWorkspaceImagePermissionResult, +} from "./api"; + +const api = new Api({ + baseUrl: "", +}); + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.AssociateConnectionAlias + */ +export async function postXAmzTargetWorkspacesServiceAssociateConnectionAliasAssociateConnectionAlias( + /** Request body */ + data: AssociateConnectionAliasRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceAssociateConnectionAlias.associateConnectionAlias( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.AssociateIpGroups + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceAssociateIpGroupsAssociateIpGroups( + /** Request body */ + data: AssociateIpGroupsRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceAssociateIpGroups.associateIpGroups({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.AuthorizeIpRules + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceAuthorizeIpRulesAuthorizeIpRules( + /** Request body */ + data: AuthorizeIpRulesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceAuthorizeIpRules.authorizeIpRules({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.CopyWorkspaceImage + */ +export async function postXAmzTargetWorkspacesServiceCopyWorkspaceImageCopyWorkspaceImage( + /** Request body */ + data: CopyWorkspaceImageRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceCopyWorkspaceImage.copyWorkspaceImage({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.CreateConnectClientAddIn + */ +export async function postXAmzTargetWorkspacesServiceCreateConnectClientAddInCreateConnectClientAddIn( + /** Request body */ + data: CreateConnectClientAddInRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceCreateConnectClientAddIn.createConnectClientAddIn( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.CreateConnectionAlias + */ +export async function postXAmzTargetWorkspacesServiceCreateConnectionAliasCreateConnectionAlias( + /** Request body */ + data: CreateConnectionAliasRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceCreateConnectionAlias.createConnectionAlias( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.CreateIpGroup + */ +export async function postXAmzTargetWorkspacesServiceCreateIpGroupCreateIpGroup( + /** Request body */ + data: CreateIpGroupRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceCreateIpGroup.createIpGroup({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.CreateStandbyWorkspaces + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceCreateStandbyWorkspacesCreateStandbyWorkspaces( + /** Request body */ + data: CreateStandbyWorkspacesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceCreateStandbyWorkspaces.createStandbyWorkspaces( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.CreateTags + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceCreateTagsCreateTags( + /** Request body */ + data: CreateTagsRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.xAmzTargetWorkspacesServiceCreateTags.createTags({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.CreateUpdatedWorkspaceImage + */ +export async function postXAmzTargetWorkspacesServiceCreateUpdatedWorkspaceImageCreateUpdatedWorkspaceImage( + /** Request body */ + data: CreateUpdatedWorkspaceImageRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceCreateUpdatedWorkspaceImage.createUpdatedWorkspaceImage( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.CreateWorkspaceBundle + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceCreateWorkspaceBundleCreateWorkspaceBundle( + /** Request body */ + data: CreateWorkspaceBundleRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceCreateWorkspaceBundle.createWorkspaceBundle( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.CreateWorkspaceImage + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceCreateWorkspaceImageCreateWorkspaceImage( + /** Request body */ + data: CreateWorkspaceImageRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceCreateWorkspaceImage.createWorkspaceImage( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.CreateWorkspaces + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceCreateWorkspacesCreateWorkspaces( + /** Request body */ + data: CreateWorkspacesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceCreateWorkspaces.createWorkspaces({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DeleteClientBranding + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceDeleteClientBrandingDeleteClientBranding( + /** Request body */ + data: DeleteClientBrandingRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDeleteClientBranding.deleteClientBranding( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DeleteConnectClientAddIn + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceDeleteConnectClientAddInDeleteConnectClientAddIn( + /** Request body */ + data: DeleteConnectClientAddInRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDeleteConnectClientAddIn.deleteConnectClientAddIn( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DeleteConnectionAlias + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceDeleteConnectionAliasDeleteConnectionAlias( + /** Request body */ + data: DeleteConnectionAliasRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDeleteConnectionAlias.deleteConnectionAlias( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DeleteIpGroup + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceDeleteIpGroupDeleteIpGroup( + /** Request body */ + data: DeleteIpGroupRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDeleteIpGroup.deleteIpGroup({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DeleteTags + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceDeleteTagsDeleteTags( + /** Request body */ + data: DeleteTagsRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.xAmzTargetWorkspacesServiceDeleteTags.deleteTags({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DeleteWorkspaceBundle + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceDeleteWorkspaceBundleDeleteWorkspaceBundle( + /** Request body */ + data: DeleteWorkspaceBundleRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDeleteWorkspaceBundle.deleteWorkspaceBundle( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DeleteWorkspaceImage + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceDeleteWorkspaceImageDeleteWorkspaceImage( + /** Request body */ + data: DeleteWorkspaceImageRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDeleteWorkspaceImage.deleteWorkspaceImage( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DeregisterWorkspaceDirectory + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceDeregisterWorkspaceDirectoryDeregisterWorkspaceDirectory( + /** Request body */ + data: DeregisterWorkspaceDirectoryRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDeregisterWorkspaceDirectory.deregisterWorkspaceDirectory( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DescribeAccount + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceDescribeAccountDescribeAccount( + /** Request body */ + data: DescribeAccountRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDescribeAccount.describeAccount({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DescribeAccountModifications + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceDescribeAccountModificationsDescribeAccountModifications( + /** Request body */ + data: DescribeAccountModificationsRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDescribeAccountModifications.describeAccountModifications( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DescribeClientBranding + */ +export async function postXAmzTargetWorkspacesServiceDescribeClientBrandingDescribeClientBranding( + /** Request body */ + data: DescribeClientBrandingRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDescribeClientBranding.describeClientBranding( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DescribeClientProperties + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceDescribeClientPropertiesDescribeClientProperties( + /** Request body */ + data: DescribeClientPropertiesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDescribeClientProperties.describeClientProperties( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DescribeConnectClientAddIns + */ +export async function postXAmzTargetWorkspacesServiceDescribeConnectClientAddInsDescribeConnectClientAddIns( + /** Request body */ + data: DescribeConnectClientAddInsRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDescribeConnectClientAddIns.describeConnectClientAddIns( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DescribeConnectionAliasPermissions + */ +export async function postXAmzTargetWorkspacesServiceDescribeConnectionAliasPermissionsDescribeConnectionAliasPermissions( + /** Request body */ + data: DescribeConnectionAliasPermissionsRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDescribeConnectionAliasPermissions.describeConnectionAliasPermissions( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DescribeConnectionAliases + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceDescribeConnectionAliasesDescribeConnectionAliases( + /** Request body */ + data: DescribeConnectionAliasesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDescribeConnectionAliases.describeConnectionAliases( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DescribeIpGroups + */ +export async function postXAmzTargetWorkspacesServiceDescribeIpGroupsDescribeIpGroups( + /** Request body */ + data: DescribeIpGroupsRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDescribeIpGroups.describeIpGroups({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DescribeTags + */ +export async function postXAmzTargetWorkspacesServiceDescribeTagsDescribeTags( + /** Request body */ + data: DescribeTagsRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.xAmzTargetWorkspacesServiceDescribeTags.describeTags( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DescribeWorkspaceBundles + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceDescribeWorkspaceBundlesDescribeWorkspaceBundles( + query: { + /** + * Pagination token + */ + NextToken?: string; + }, + /** Request body */ + data: DescribeWorkspaceBundlesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDescribeWorkspaceBundles.describeWorkspaceBundles( + { + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DescribeWorkspaceDirectories + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceDescribeWorkspaceDirectoriesDescribeWorkspaceDirectories( + query: { + /** + * Pagination token + */ + NextToken?: string; + }, + /** Request body */ + data: DescribeWorkspaceDirectoriesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDescribeWorkspaceDirectories.describeWorkspaceDirectories( + { + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DescribeWorkspaceImagePermissions + */ +export async function postXAmzTargetWorkspacesServiceDescribeWorkspaceImagePermissionsDescribeWorkspaceImagePermissions( + /** Request body */ + data: DescribeWorkspaceImagePermissionsRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDescribeWorkspaceImagePermissions.describeWorkspaceImagePermissions( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DescribeWorkspaceImages + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceDescribeWorkspaceImagesDescribeWorkspaceImages( + /** Request body */ + data: DescribeWorkspaceImagesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDescribeWorkspaceImages.describeWorkspaceImages( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DescribeWorkspaceSnapshots + */ +export async function postXAmzTargetWorkspacesServiceDescribeWorkspaceSnapshotsDescribeWorkspaceSnapshots( + /** Request body */ + data: DescribeWorkspaceSnapshotsRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDescribeWorkspaceSnapshots.describeWorkspaceSnapshots( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DescribeWorkspaces + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceDescribeWorkspacesDescribeWorkspaces( + query: { + /** + * Pagination limit + */ + Limit?: string; + /** + * Pagination token + */ + NextToken?: string; + }, + /** Request body */ + data: DescribeWorkspacesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDescribeWorkspaces.describeWorkspaces({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DescribeWorkspacesConnectionStatus + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceDescribeWorkspacesConnectionStatusDescribeWorkspacesConnectionStatus( + /** Request body */ + data: DescribeWorkspacesConnectionStatusRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDescribeWorkspacesConnectionStatus.describeWorkspacesConnectionStatus( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DisassociateConnectionAlias + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceDisassociateConnectionAliasDisassociateConnectionAlias( + /** Request body */ + data: DisassociateConnectionAliasRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDisassociateConnectionAlias.disassociateConnectionAlias( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.DisassociateIpGroups + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceDisassociateIpGroupsDisassociateIpGroups( + /** Request body */ + data: DisassociateIpGroupsRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceDisassociateIpGroups.disassociateIpGroups( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.ImportClientBranding + */ +export async function postXAmzTargetWorkspacesServiceImportClientBrandingImportClientBranding( + /** Request body */ + data: ImportClientBrandingRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceImportClientBranding.importClientBranding( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.ImportWorkspaceImage + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceImportWorkspaceImageImportWorkspaceImage( + /** Request body */ + data: ImportWorkspaceImageRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceImportWorkspaceImage.importWorkspaceImage( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.ListAvailableManagementCidrRanges + */ +export async function postXAmzTargetWorkspacesServiceListAvailableManagementCidrRangesListAvailableManagementCidrRanges( + /** Request body */ + data: ListAvailableManagementCidrRangesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceListAvailableManagementCidrRanges.listAvailableManagementCidrRanges( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.MigrateWorkspace + */ +export async function postXAmzTargetWorkspacesServiceMigrateWorkspaceMigrateWorkspace( + /** Request body */ + data: MigrateWorkspaceRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceMigrateWorkspace.migrateWorkspace({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.ModifyAccount + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceModifyAccountModifyAccount( + /** Request body */ + data: ModifyAccountRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceModifyAccount.modifyAccount({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.ModifyCertificateBasedAuthProperties + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceModifyCertificateBasedAuthPropertiesModifyCertificateBasedAuthProperties( + /** Request body */ + data: ModifyCertificateBasedAuthPropertiesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceModifyCertificateBasedAuthProperties.modifyCertificateBasedAuthProperties( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.ModifyClientProperties + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceModifyClientPropertiesModifyClientProperties( + /** Request body */ + data: ModifyClientPropertiesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceModifyClientProperties.modifyClientProperties( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.ModifySamlProperties + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceModifySamlPropertiesModifySamlProperties( + /** Request body */ + data: ModifySamlPropertiesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceModifySamlProperties.modifySamlProperties( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.ModifySelfservicePermissions + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceModifySelfservicePermissionsModifySelfservicePermissions( + /** Request body */ + data: ModifySelfservicePermissionsRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceModifySelfservicePermissions.modifySelfservicePermissions( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.ModifyWorkspaceAccessProperties + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceModifyWorkspaceAccessPropertiesModifyWorkspaceAccessProperties( + /** Request body */ + data: ModifyWorkspaceAccessPropertiesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceModifyWorkspaceAccessProperties.modifyWorkspaceAccessProperties( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.ModifyWorkspaceCreationProperties + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceModifyWorkspaceCreationPropertiesModifyWorkspaceCreationProperties( + /** Request body */ + data: ModifyWorkspaceCreationPropertiesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceModifyWorkspaceCreationProperties.modifyWorkspaceCreationProperties( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.ModifyWorkspaceProperties + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceModifyWorkspacePropertiesModifyWorkspaceProperties( + /** Request body */ + data: ModifyWorkspacePropertiesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceModifyWorkspaceProperties.modifyWorkspaceProperties( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.ModifyWorkspaceState + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceModifyWorkspaceStateModifyWorkspaceState( + /** Request body */ + data: ModifyWorkspaceStateRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceModifyWorkspaceState.modifyWorkspaceState( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.RebootWorkspaces + */ +export async function postXAmzTargetWorkspacesServiceRebootWorkspacesRebootWorkspaces( + /** Request body */ + data: RebootWorkspacesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceRebootWorkspaces.rebootWorkspaces({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.RebuildWorkspaces + */ +export async function postXAmzTargetWorkspacesServiceRebuildWorkspacesRebuildWorkspaces( + /** Request body */ + data: RebuildWorkspacesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceRebuildWorkspaces.rebuildWorkspaces({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.RegisterWorkspaceDirectory + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceRegisterWorkspaceDirectoryRegisterWorkspaceDirectory( + /** Request body */ + data: RegisterWorkspaceDirectoryRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceRegisterWorkspaceDirectory.registerWorkspaceDirectory( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.RestoreWorkspace + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceRestoreWorkspaceRestoreWorkspace( + /** Request body */ + data: RestoreWorkspaceRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceRestoreWorkspace.restoreWorkspace({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.RevokeIpRules + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceRevokeIpRulesRevokeIpRules( + /** Request body */ + data: RevokeIpRulesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceRevokeIpRules.revokeIpRules({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.StartWorkspaces + */ +export async function postXAmzTargetWorkspacesServiceStartWorkspacesStartWorkspaces( + /** Request body */ + data: StartWorkspacesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceStartWorkspaces.startWorkspaces({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.StopWorkspaces + */ +export async function postXAmzTargetWorkspacesServiceStopWorkspacesStopWorkspaces( + /** Request body */ + data: StopWorkspacesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceStopWorkspaces.stopWorkspaces({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.TerminateWorkspaces + */ +export async function postXAmzTargetWorkspacesServiceTerminateWorkspacesTerminateWorkspaces( + /** Request body */ + data: TerminateWorkspacesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceTerminateWorkspaces.terminateWorkspaces( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.UpdateConnectClientAddIn + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceUpdateConnectClientAddInUpdateConnectClientAddIn( + /** Request body */ + data: UpdateConnectClientAddInRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceUpdateConnectClientAddIn.updateConnectClientAddIn( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.UpdateConnectionAliasPermission + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceUpdateConnectionAliasPermissionUpdateConnectionAliasPermission( + /** Request body */ + data: UpdateConnectionAliasPermissionRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceUpdateConnectionAliasPermission.updateConnectionAliasPermission( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.UpdateRulesOfIpGroup + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceUpdateRulesOfIpGroupUpdateRulesOfIpGroup( + /** Request body */ + data: UpdateRulesOfIpGroupRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceUpdateRulesOfIpGroup.updateRulesOfIpGroup( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.UpdateWorkspaceBundle + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceUpdateWorkspaceBundleUpdateWorkspaceBundle( + /** Request body */ + data: UpdateWorkspaceBundleRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceUpdateWorkspaceBundle.updateWorkspaceBundle( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=WorkspacesService.UpdateWorkspaceImagePermission + * @allowrelaxedtypes + */ +export async function postXAmzTargetWorkspacesServiceUpdateWorkspaceImagePermissionUpdateWorkspaceImagePermission( + /** Request body */ + data: UpdateWorkspaceImagePermissionRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetWorkspacesServiceUpdateWorkspaceImagePermission.updateWorkspaceImagePermission( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} diff --git a/tests/test-data/golden-files/atlassian-jira b/tests/test-data/golden-files/atlassian-jira new file mode 100644 index 0000000..6da6215 --- /dev/null +++ b/tests/test-data/golden-files/atlassian-jira @@ -0,0 +1,15829 @@ +import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; +import { + ActorInputBean, + ActorsMap, + AddFieldBean, + AddGroupBean, + AddNotificationsDetails, + AnnouncementBannerConfiguration, + AnnouncementBannerConfigurationUpdate, + Api, + ApplicationProperty, + ApplicationRole, + AssociateFieldConfigurationsWithIssueTypesRequest, + Attachment, + AttachmentArchiveImpl, + AttachmentArchiveMetadataReadable, + AttachmentMetadata, + AttachmentSettings, + AuditRecords, + AutoCompleteSuggestions, + AvailableDashboardGadgetsResponse, + Avatar, + Avatars, + BulkCustomFieldOptionCreateRequest, + BulkCustomFieldOptionUpdateRequest, + BulkIssueIsWatching, + BulkIssuePropertyUpdateRequest, + BulkPermissionGrants, + BulkPermissionsRequestBean, + ChangeFilterOwner, + ChangedWorklogs, + ColumnItem, + Comment, + ComponentIssuesCount, + Configuration, + ConnectCustomFieldValues, + ConnectModule, + ConnectModules, + ContainerForProjectFeatures, + ContainerForRegisteredWebhooks, + ContainerForWebhookIDs, + ContainerOfWorkflowSchemeAssociations, + ConvertedJQLQueries, + CreateCustomFieldContext, + CreateNotificationSchemeDetails, + CreatePriorityDetails, + CreateProjectDetails, + CreateResolutionDetails, + CreateUiModificationDetails, + CreateUpdateRoleRequestBean, + CreateWorkflowDetails, + CreatedIssue, + CreatedIssues, + CustomFieldConfigurations, + CustomFieldContextDefaultValueUpdate, + CustomFieldContextUpdateDetails, + CustomFieldCreatedContextOptionsList, + CustomFieldDefinitionJsonBean, + CustomFieldOption, + CustomFieldUpdatedContextOptionsList, + CustomFieldValueUpdateDetails, + Dashboard, + DashboardDetails, + DashboardGadget, + DashboardGadgetResponse, + DashboardGadgetSettings, + DashboardGadgetUpdateRequest, + DefaultShareScope, + DefaultWorkflow, + DeleteAndReplaceVersionBean, + DeprecatedWorkflow, + EntityProperty, + EntityPropertyDetails, + ErrorCollection, + FailedWebhooks, + FieldConfiguration, + FieldConfigurationDetails, + FieldConfigurationItemsDetails, + FieldConfigurationScheme, + FieldConfigurationSchemeProjectAssociation, + FieldDetails, + Filter, + FoundGroups, + FoundUsers, + FoundUsersAndGroups, + Group, + GroupName, + IdBean, + IssueBean, + IssueChangelogIds, + IssueCommentListRequestBean, + IssueCreateMetadata, + IssueEntityProperties, + IssueEvent, + IssueFieldOption, + IssueFieldOptionCreateBean, + IssueFilterForBulkPropertyDelete, + IssueLink, + IssueLinkType, + IssueLinkTypes, + IssueList, + IssueMatches, + IssuePickerSuggestions, + IssueTypeCreateBean, + IssueTypeDetails, + IssueTypeIds, + IssueTypeIdsToRemove, + IssueTypeSchemeDetails, + IssueTypeSchemeID, + IssueTypeSchemeProjectAssociation, + IssueTypeSchemeUpdateDetails, + IssueTypeScreenSchemeDetails, + IssueTypeScreenSchemeId, + IssueTypeScreenSchemeMappingDetails, + IssueTypeScreenSchemeProjectAssociation, + IssueTypeScreenSchemeUpdateDetails, + IssueTypeUpdateBean, + IssueTypeWithStatus, + IssueTypeWorkflowMapping, + IssueTypesWorkflowMapping, + IssueUpdateDetails, + IssueUpdateMetadata, + IssuesAndJQLQueries, + IssuesUpdateBean, + JQLPersonalDataMigrationRequest, + JQLReferenceData, + JiraExpressionEvalRequestBean, + JiraExpressionForAnalysis, + JiraExpressionResult, + JiraExpressionsAnalysis, + JiraStatus, + JqlFunctionPrecomputationUpdateRequestBean, + JqlQueriesToParse, + JqlQueriesToSanitize, + License, + LicenseMetric, + LinkIssueRequestJsonBean, + Locale, + MoveFieldBean, + MultiIssueEntityProperties, + MultipleCustomFieldValuesUpdateDetails, + NewUserDetails, + Notification, + NotificationScheme, + NotificationSchemeId, + OperationMessage, + OrderOfCustomFieldOptions, + OrderOfIssueTypes, + PageBeanChangelog, + PageBeanComment, + PageBeanComponentWithIssueCount, + PageBeanContext, + PageBeanContextForProjectAndIssueType, + PageBeanContextualConfiguration, + PageBeanCustomFieldContext, + PageBeanCustomFieldContextDefaultValue, + PageBeanCustomFieldContextOption, + PageBeanCustomFieldContextProjectMapping, + PageBeanDashboard, + PageBeanField, + PageBeanFieldConfigurationDetails, + PageBeanFieldConfigurationIssueTypeItem, + PageBeanFieldConfigurationItem, + PageBeanFieldConfigurationScheme, + PageBeanFieldConfigurationSchemeProjects, + PageBeanFilterDetails, + PageBeanGroupDetails, + PageBeanIssueFieldOption, + PageBeanIssueSecurityLevelMember, + PageBeanIssueTypeScheme, + PageBeanIssueTypeSchemeMapping, + PageBeanIssueTypeSchemeProjects, + PageBeanIssueTypeScreenScheme, + PageBeanIssueTypeScreenSchemeItem, + PageBeanIssueTypeScreenSchemesProjects, + PageBeanIssueTypeToContextMapping, + PageBeanJqlFunctionPrecomputationBean, + PageBeanNotificationScheme, + PageBeanNotificationSchemeAndProjectMappingJsonBean, + PageBeanPriority, + PageBeanProject, + PageBeanProjectDetails, + PageBeanResolutionJsonBean, + PageBeanScreen, + PageBeanScreenScheme, + PageBeanScreenWithTab, + PageBeanString, + PageBeanUiModificationDetails, + PageBeanUser, + PageBeanUserDetails, + PageBeanUserKey, + PageBeanVersion, + PageBeanWebhook, + PageBeanWorkflow, + PageBeanWorkflowScheme, + PageBeanWorkflowTransitionRules, + PageOfChangelogs, + PageOfComments, + PageOfDashboards, + PageOfStatuses, + PageOfWorklogs, + ParsedJqlQueries, + PermissionGrant, + PermissionGrants, + PermissionScheme, + PermissionSchemes, + Permissions, + PermissionsKeysBean, + PermittedProjects, + Priority, + PriorityId, + Project, + ProjectAvatars, + ProjectCategory, + ProjectComponent, + ProjectEmailAddress, + ProjectFeatureState, + ProjectIdentifiers, + ProjectIds, + ProjectIssueSecurityLevels, + ProjectIssueTypeHierarchy, + ProjectIssueTypeMappings, + ProjectRole, + ProjectRoleActorsUpdateBean, + ProjectRoleDetails, + ProjectType, + PropertyKeys, + PublishDraftWorkflowScheme, + RemoteIssueLink, + RemoteIssueLinkIdentifies, + RemoteIssueLinkRequest, + ReorderIssuePriorities, + ReorderIssueResolutionsRequest, + Resolution, + ResolutionId, + SanitizedJqlQueries, + Screen, + ScreenDetails, + ScreenSchemeDetails, + ScreenSchemeId, + ScreenableField, + ScreenableTab, + SearchAutoCompleteFilter, + SearchRequestBean, + SearchResults, + SecurityLevel, + SecurityScheme, + SecuritySchemes, + ServerInformation, + SetDefaultPriorityRequest, + SetDefaultResolutionRequest, + SharePermission, + SharePermissionInputBean, + SimpleApplicationPropertyBean, + StatusCategory, + StatusCreateRequest, + StatusDetails, + StatusUpdateRequest, + StringList, + SystemAvatars, + TaskProgressBeanObject, + TimeTrackingConfiguration, + TimeTrackingProvider, + Transitions, + UiModificationIdentifiers, + UnrestrictedUserEmail, + UpdateCustomFieldDetails, + UpdateDefaultScreenScheme, + UpdateFieldConfigurationSchemeDetails, + UpdateNotificationSchemeDetails, + UpdatePriorityDetails, + UpdateProjectDetails, + UpdateResolutionDetails, + UpdateScreenDetails, + UpdateScreenSchemeDetails, + UpdateUiModificationDetails, + UpdateUserToGroupBean, + UpdatedProjectCategory, + User, + UserMigrationBean, + Version, + VersionIssueCounts, + VersionMoveBean, + VersionUnresolvedIssuesCount, + Votes, + Watchers, + WebhookRegistrationDetails, + WebhooksExpirationDate, + WorkflowIDs, + WorkflowRulesSearch, + WorkflowRulesSearchDetails, + WorkflowScheme, + WorkflowSchemeProjectAssociation, + WorkflowTransitionProperty, + WorkflowTransitionRulesUpdate, + WorkflowTransitionRulesUpdateErrors, + WorkflowsWithTransitionRulesDetails, + Worklog, + WorklogIdsRequestBean, +} from "./api"; + +const api = new Api({ + baseUrl: "", +}); + +/** + * Get announcement banner configuration + * @request GET :/rest/api/3/announcementBanner + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetBanner( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getBanner({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update announcement banner configuration + * @request PUT :/rest/api/3/announcementBanner + * @allowrelaxedtypes + */ +export async function putRestSetBanner( + /** Request body */ + data: AnnouncementBannerConfigurationUpdate, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setBanner({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update custom fields + * @request POST :/rest/api/3/app/field/value + * @allowrelaxedtypes + */ +export async function postRestUpdateMultipleCustomFieldValues( + query: { + /** + * Whether to generate a changelog for this update. + */ + generateChangelog?: boolean; + }, + /** Request body */ + data: MultipleCustomFieldValuesUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateMultipleCustomFieldValues({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get custom field configurations + * @request GET :/rest/api/3/app/field/{fieldIdOrKey}/context/configuration + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetCustomFieldConfiguration( + query: { + /** + * The list of configuration IDs. To include multiple configurations, separate IDs with an ampersand: `id=10000&id=10001`. Can't be provided with `fieldContextId`, `issueId`, `projectKeyOrId`, or `issueTypeId`. + */ + id?: number[]; + /** + * The list of field context IDs. To include multiple field contexts, separate IDs with an ampersand: `fieldContextId=10000&fieldContextId=10001`. Can't be provided with `id`, `issueId`, `projectKeyOrId`, or `issueTypeId`. + */ + fieldContextId?: number[]; + /** + * The ID of the issue to filter results by. If the issue doesn't exist, an empty list is returned. Can't be provided with `projectKeyOrId`, or `issueTypeId`. + */ + issueId?: number; + /** + * The ID or key of the project to filter results by. Must be provided with `issueTypeId`. Can't be provided with `issueId`. + */ + projectKeyOrId?: string; + /** + * The ID of the issue type to filter results by. Must be provided with `projectKeyOrId`. Can't be provided with `issueId`. + */ + issueTypeId?: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID or key of the custom field, for example `customfield_10000`. + */ + fieldIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCustomFieldConfiguration({ + query: query, + fieldIdOrKey: fieldIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update custom field configurations + * @request PUT :/rest/api/3/app/field/{fieldIdOrKey}/context/configuration + * @allowrelaxedtypes + */ +export async function putRestUpdateCustomFieldConfiguration( + /** + * The ID or key of the custom field, for example `customfield_10000`. + */ + fieldIdOrKey: string, + /** Request body */ + data: CustomFieldConfigurations, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateCustomFieldConfiguration({ + fieldIdOrKey: fieldIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update custom field value + * @request PUT :/rest/api/3/app/field/{fieldIdOrKey}/value + * @allowrelaxedtypes + */ +export async function putRestUpdateCustomFieldValue( + query: { + /** + * Whether to generate a changelog for this update. + */ + generateChangelog?: boolean; + }, + /** + * The ID or key of the custom field. For example, `customfield_10010`. + */ + fieldIdOrKey: string, + /** Request body */ + data: CustomFieldValueUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateCustomFieldValue({ + query: query, + fieldIdOrKey: fieldIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get application property + * @request GET :/rest/api/3/application-properties + * @readonly + */ +export async function getRestGetApplicationProperty( + query: { + /** + * The key of the application property. + */ + key?: string; + /** + * The permission level of all items being returned in the list. + */ + permissionLevel?: string; + /** + * When a `key` isn't provided, this filters the list of results by the application property `key` using a regular expression. For example, using `jira.lf.*` will return all application properties with keys that start with *jira.lf.*. + */ + keyFilter?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getApplicationProperty({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get advanced settings + * @request GET :/rest/api/3/application-properties/advanced-settings + * @readonly + */ +export async function getRestGetAdvancedSettings( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAdvancedSettings({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set application property + * @request PUT :/rest/api/3/application-properties/{id} + */ +export async function putRestSetApplicationProperty( + /** + * The key of the application property to update. + */ + id: string, + /** Request body */ + data: SimpleApplicationPropertyBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setApplicationProperty({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all application roles + * @request GET :/rest/api/3/applicationrole + * @readonly + */ +export async function getRestGetAllApplicationRoles( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllApplicationRoles({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get application role + * @request GET :/rest/api/3/applicationrole/{key} + * @readonly + */ +export async function getRestGetApplicationRole( + /** + * The key of the application role. Use the [Get all application roles](#api-rest-api-3-applicationrole-get) operation to get the key for each application role. + */ + key: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getApplicationRole({ + key: key, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get attachment content + * @request GET :/rest/api/3/attachment/content/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAttachmentContent( + query: { + /** + * Whether a redirect is provided for the attachment download. Clients that do not automatically follow redirects can set this to `false` to avoid making multiple requests to download the attachment. + */ + redirect?: boolean; + }, + /** + * The ID of the attachment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAttachmentContent({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get Jira attachment settings + * @request GET :/rest/api/3/attachment/meta + * @readonly + */ +export async function getRestGetAttachmentMeta( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAttachmentMeta({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get attachment thumbnail + * @request GET :/rest/api/3/attachment/thumbnail/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAttachmentThumbnail( + query: { + /** + * Whether a redirect is provided for the attachment download. Clients that do not automatically follow redirects can set this to `false` to avoid making multiple requests to download the attachment. + */ + redirect?: boolean; + /** + * Whether a default thumbnail is returned when the requested thumbnail is not found. + */ + fallbackToDefault?: boolean; + /** + * The maximum width to scale the thumbnail to. + */ + width?: number; + /** + * The maximum height to scale the thumbnail to. + */ + height?: number; + }, + /** + * The ID of the attachment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAttachmentThumbnail({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete attachment + * @request DELETE :/rest/api/3/attachment/{id} + * @allowrelaxedtypes + */ +export async function deleteRestRemoveAttachment( + /** + * The ID of the attachment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeAttachment({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get attachment metadata + * @request GET :/rest/api/3/attachment/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAttachment( + /** + * The ID of the attachment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAttachment({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all metadata for an expanded attachment + * @request GET :/rest/api/3/attachment/{id}/expand/human + * @readonly + */ +export async function getRestExpandAttachmentForHumans( + /** + * The ID of the attachment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.expandAttachmentForHumans({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get contents metadata for an expanded attachment + * @request GET :/rest/api/3/attachment/{id}/expand/raw + * @readonly + */ +export async function getRestExpandAttachmentForMachines( + /** + * The ID of the attachment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.expandAttachmentForMachines({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get audit records + * @request GET :/rest/api/3/auditing/record + * @readonly + */ +export async function getRestGetAuditRecords( + query: { + /** + * The number of records to skip before returning the first result. + */ + offset?: number; + /** + * The maximum number of results to return. + */ + limit?: number; + /** + * The strings to match with audit field content, space separated. + */ + filter?: string; + /** + * The date and time on or after which returned audit records must have been created. If `to` is provided `from` must be before `to` or no audit records are returned. + */ + from?: string; + /** + * The date and time on or before which returned audit results must have been created. If `from` is provided `to` must be after `from` or no audit records are returned. + */ + to?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAuditRecords({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get system avatars by type + * @request GET :/rest/api/3/avatar/{type}/system + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllSystemAvatars( + /** + * The avatar type. + */ + type: "issuetype" | "project" | "user", + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllSystemAvatars({ + type: type, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get comments by IDs + * @request POST :/rest/api/3/comment/list + * @allowrelaxedtypes + */ +export async function postRestGetCommentsByIds( + query: { + /** +* Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts a comma-separated list. Expand options include: + + * `renderedBody` Returns the comment body rendered in HTML. + * `properties` Returns the comment's properties. +*/ + expand?: string; + }, + /** Request body */ + data: IssueCommentListRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCommentsByIds({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get comment property keys + * @request GET :/rest/api/3/comment/{commentId}/properties + * @readonly + */ +export async function getRestGetCommentPropertyKeys( + /** + * The ID of the comment. + */ + commentId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCommentPropertyKeys({ + commentId: commentId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete comment property + * @request DELETE :/rest/api/3/comment/{commentId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteCommentProperty( + /** + * The ID of the comment. + */ + commentId: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteCommentProperty({ + commentId: commentId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get comment property + * @request GET :/rest/api/3/comment/{commentId}/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetCommentProperty( + /** + * The ID of the comment. + */ + commentId: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCommentProperty({ + commentId: commentId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set comment property + * @request PUT :/rest/api/3/comment/{commentId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestSetCommentProperty( + /** + * The ID of the comment. + */ + commentId: string, + /** + * The key of the property. The maximum length is 255 characters. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setCommentProperty({ + commentId: commentId, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Create component + * @request POST :/rest/api/3/component + * @allowrelaxedtypes + */ +export async function postRestCreateComponent( + /** Request body */ + data: ProjectComponent, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createComponent({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete component + * @request DELETE :/rest/api/3/component/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteComponent( + query: { + /** + * The ID of the component to replace the deleted component. If this value is null no replacement is made. + */ + moveIssuesTo?: string; + }, + /** + * The ID of the component. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteComponent({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get component + * @request GET :/rest/api/3/component/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetComponent( + /** + * The ID of the component. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getComponent({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update component + * @request PUT :/rest/api/3/component/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateComponent( + /** + * The ID of the component. + */ + id: string, + /** Request body */ + data: ProjectComponent, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateComponent({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get component issues count + * @request GET :/rest/api/3/component/{id}/relatedIssueCounts + * @readonly + */ +export async function getRestGetComponentRelatedIssues( + /** + * The ID of the component. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getComponentRelatedIssues({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get global settings + * @request GET :/rest/api/3/configuration + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetConfiguration( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getConfiguration({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get selected time tracking provider + * @request GET :/rest/api/3/configuration/timetracking + * @readonly + */ +export async function getRestGetSelectedTimeTrackingImplementation( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getSelectedTimeTrackingImplementation({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Select time tracking provider + * @request PUT :/rest/api/3/configuration/timetracking + * @allowrelaxedtypes + */ +export async function putRestSelectTimeTrackingImplementation( + /** Request body */ + data: TimeTrackingProvider, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.selectTimeTrackingImplementation({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all time tracking providers + * @request GET :/rest/api/3/configuration/timetracking/list + * @readonly + */ +export async function getRestGetAvailableTimeTrackingImplementations( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAvailableTimeTrackingImplementations({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get time tracking settings + * @request GET :/rest/api/3/configuration/timetracking/options + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetSharedTimeTrackingConfiguration( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getSharedTimeTrackingConfiguration({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set time tracking settings + * @request PUT :/rest/api/3/configuration/timetracking/options + * @allowrelaxedtypes + */ +export async function putRestSetSharedTimeTrackingConfiguration( + /** Request body */ + data: TimeTrackingConfiguration, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setSharedTimeTrackingConfiguration({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get custom field option + * @request GET :/rest/api/3/customFieldOption/{id} + * @readonly + */ +export async function getRestGetCustomFieldOption( + /** + * The ID of the custom field option. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCustomFieldOption({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all dashboards + * @request GET :/rest/api/3/dashboard + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllDashboards( + query: { + /** +* The filter applied to the list of dashboards. Valid values are: + + * `favourite` Returns dashboards the user has marked as favorite. + * `my` Returns dashboards owned by the user. +*/ + filter?: "my" | "favourite"; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllDashboards({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create dashboard + * @request POST :/rest/api/3/dashboard + * @allowrelaxedtypes + */ +export async function postRestCreateDashboard( + /** Request body */ + data: DashboardDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createDashboard({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get available gadgets + * @request GET :/rest/api/3/dashboard/gadgets + * @readonly + */ +export async function getRestGetAllAvailableDashboardGadgets( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllAvailableDashboardGadgets({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Search for dashboards + * @request GET :/rest/api/3/dashboard/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetDashboardsPaginated( + query: { + /** + * String used to perform a case-insensitive partial match with `name`. + */ + dashboardName?: string; + /** + * User account ID used to return dashboards with the matching `owner.accountId`. This parameter cannot be used with the `owner` parameter. + */ + accountId?: string; + /** + * This parameter is deprecated because of privacy changes. Use `accountId` instead. See the [migration guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. User name used to return dashboards with the matching `owner.name`. This parameter cannot be used with the `accountId` parameter. + */ + owner?: string; + /** + * As a group's name can change, use of `groupId` is recommended. Group name used to return dashboards that are shared with a group that matches `sharePermissions.group.name`. This parameter cannot be used with the `groupId` parameter. + */ + groupname?: string; + /** + * Group ID used to return dashboards that are shared with a group that matches `sharePermissions.group.groupId`. This parameter cannot be used with the `groupname` parameter. + */ + groupId?: string; + /** + * Project ID used to returns dashboards that are shared with a project that matches `sharePermissions.project.id`. + */ + projectId?: number; + /** +* [Order](#ordering) the results by a field: + + * `description` Sorts by dashboard description. Note that this sort works independently of whether the expand to display the description field is in use. + * `favourite_count` Sorts by dashboard popularity. + * `id` Sorts by dashboard ID. + * `is_favourite` Sorts by whether the dashboard is marked as a favorite. + * `name` Sorts by dashboard name. + * `owner` Sorts by dashboard owner name. +*/ + orderBy?: + | "description" + | "-description" + | "+description" + | "favorite_count" + | "-favorite_count" + | "+favorite_count" + | "id" + | "-id" + | "+id" + | "is_favorite" + | "-is_favorite" + | "+is_favorite" + | "name" + | "-name" + | "+name" + | "owner" + | "-owner" + | "+owner"; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The status to filter by. It may be active, archived or deleted. + */ + status?: "active" | "archived" | "deleted"; + /** +* Use [expand](#expansion) to include additional information about dashboard in the response. This parameter accepts a comma-separated list. Expand options include: + + * `description` Returns the description of the dashboard. + * `owner` Returns the owner of the dashboard. + * `viewUrl` Returns the URL that is used to view the dashboard. + * `favourite` Returns `isFavourite`, an indicator of whether the user has set the dashboard as a favorite. + * `favouritedCount` Returns `popularity`, a count of how many users have set this dashboard as a favorite. + * `sharePermissions` Returns details of the share permissions defined for the dashboard. + * `editPermissions` Returns details of the edit permissions defined for the dashboard. + * `isWritable` Returns whether the current user has permission to edit the dashboard. +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDashboardsPaginated({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get gadgets + * @request GET :/rest/api/3/dashboard/{dashboardId}/gadget + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllGadgets( + query: { + /** + * The list of gadgets module keys. To include multiple module keys, separate module keys with ampersand: `moduleKey=key:one&moduleKey=key:two`. + */ + moduleKey?: string[]; + /** + * The list of gadgets URIs. To include multiple URIs, separate URIs with ampersand: `uri=/rest/example/uri/1&uri=/rest/example/uri/2`. + */ + uri?: string[]; + /** + * The list of gadgets IDs. To include multiple IDs, separate IDs with ampersand: `gadgetId=10000&gadgetId=10001`. + */ + gadgetId?: number[]; + }, + /** + * The ID of the dashboard. + */ + dashboardId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllGadgets({ + query: query, + dashboardId: dashboardId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add gadget to dashboard + * @request POST :/rest/api/3/dashboard/{dashboardId}/gadget + * @allowrelaxedtypes + */ +export async function postRestAddGadget( + /** + * The ID of the dashboard. + */ + dashboardId: number, + /** Request body */ + data: DashboardGadgetSettings, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addGadget({ + dashboardId: dashboardId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Remove gadget from dashboard + * @request DELETE :/rest/api/3/dashboard/{dashboardId}/gadget/{gadgetId} + * @allowrelaxedtypes + */ +export async function deleteRestRemoveGadget( + /** + * The ID of the dashboard. + */ + dashboardId: number, + /** + * The ID of the gadget. + */ + gadgetId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeGadget({ + dashboardId: dashboardId, + gadgetId: gadgetId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update gadget on dashboard + * @request PUT :/rest/api/3/dashboard/{dashboardId}/gadget/{gadgetId} + * @allowrelaxedtypes + */ +export async function putRestUpdateGadget( + /** + * The ID of the dashboard. + */ + dashboardId: number, + /** + * The ID of the gadget. + */ + gadgetId: number, + /** Request body */ + data: DashboardGadgetUpdateRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateGadget({ + dashboardId: dashboardId, + gadgetId: gadgetId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get dashboard item property keys + * @request GET :/rest/api/3/dashboard/{dashboardId}/items/{itemId}/properties + * @readonly + */ +export async function getRestGetDashboardItemPropertyKeys( + /** + * The ID of the dashboard. + */ + dashboardId: string, + /** + * The ID of the dashboard item. + */ + itemId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDashboardItemPropertyKeys({ + dashboardId: dashboardId, + itemId: itemId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete dashboard item property + * @request DELETE :/rest/api/3/dashboard/{dashboardId}/items/{itemId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteDashboardItemProperty( + /** + * The ID of the dashboard. + */ + dashboardId: string, + /** + * The ID of the dashboard item. + */ + itemId: string, + /** + * The key of the dashboard item property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteDashboardItemProperty({ + dashboardId: dashboardId, + itemId: itemId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get dashboard item property + * @request GET :/rest/api/3/dashboard/{dashboardId}/items/{itemId}/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetDashboardItemProperty( + /** + * The ID of the dashboard. + */ + dashboardId: string, + /** + * The ID of the dashboard item. + */ + itemId: string, + /** + * The key of the dashboard item property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDashboardItemProperty({ + dashboardId: dashboardId, + itemId: itemId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set dashboard item property + * @request PUT :/rest/api/3/dashboard/{dashboardId}/items/{itemId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestSetDashboardItemProperty( + /** + * The ID of the dashboard. + */ + dashboardId: string, + /** + * The ID of the dashboard item. + */ + itemId: string, + /** + * The key of the dashboard item property. The maximum length is 255 characters. For dashboard items with a spec URI and no complete module key, if the provided propertyKey is equal to "config", the request body's JSON must be an object with all keys and values as strings. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setDashboardItemProperty({ + dashboardId: dashboardId, + itemId: itemId, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete dashboard + * @request DELETE :/rest/api/3/dashboard/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteDashboard( + /** + * The ID of the dashboard. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteDashboard({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.error) { + throw result.error; + } else { + return new hasuraSdk.JSONValue(result.data); + } +} + +/** + * Get dashboard + * @request GET :/rest/api/3/dashboard/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetDashboard( + /** + * The ID of the dashboard. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDashboard({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update dashboard + * @request PUT :/rest/api/3/dashboard/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateDashboard( + /** + * The ID of the dashboard to update. + */ + id: string, + /** Request body */ + data: DashboardDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateDashboard({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Copy dashboard + * @request POST :/rest/api/3/dashboard/{id}/copy + * @allowrelaxedtypes + */ +export async function postRestCopyDashboard( + id: string, + /** Request body */ + data: DashboardDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.copyDashboard({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get events + * @request GET :/rest/api/3/events + * @readonly + */ +export async function getRestGetEvents( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getEvents({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Analyse Jira expression + * @request POST :/rest/api/3/expression/analyse + * @allowrelaxedtypes + */ +export async function postRestAnalyseExpression( + query: { + /** +* The check to perform: + + * `syntax` Each expression's syntax is checked to ensure the expression can be parsed. Also, syntactic limits are validated. For example, the expression's length. + * `type` EXPERIMENTAL. Each expression is type checked and the final type of the expression inferred. Any type errors that would result in the expression failure at runtime are reported. For example, accessing properties that don't exist or passing the wrong number of arguments to functions. Also performs the syntax check. + * `complexity` EXPERIMENTAL. Determines the formulae for how many [expensive operations](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#expensive-operations) each expression may execute. +*/ + check?: "syntax" | "type" | "complexity"; + }, + /** Request body */ + data: JiraExpressionForAnalysis, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.analyseExpression({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Evaluate Jira expression + * @request POST :/rest/api/3/expression/eval + * @allowrelaxedtypes + */ +export async function postRestEvaluateJiraExpression( + query: { + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts `meta.complexity` that returns information about the expression complexity. For example, the number of expensive operations used by the expression and how close the expression is to reaching the [complexity limit](https://developer.atlassian.com/cloud/jira/platform/jira-expressions/#restrictions). Useful when designing and debugging your expressions. + */ + expand?: string; + }, + /** Request body */ + data: JiraExpressionEvalRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.evaluateJiraExpression({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get fields + * @request GET :/rest/api/3/field + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetFields( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFields({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create custom field + * @request POST :/rest/api/3/field + * @allowrelaxedtypes + */ +export async function postRestCreateCustomField( + /** Request body */ + data: CustomFieldDefinitionJsonBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createCustomField({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get fields paginated + * @request GET :/rest/api/3/field/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetFieldsPaginated( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The type of fields to search. + */ + type?: ("custom" | "system")[]; + /** + * The IDs of the custom fields to return or, where `query` is specified, filter. + */ + id?: string[]; + /** + * String used to perform a case-insensitive partial match with field names or descriptions. + */ + query?: string; + /** +* [Order](#ordering) the results by a field: + + * `contextsCount` sorts by the number of contexts related to a field + * `lastUsed` sorts by the date when the value of the field last changed + * `name` sorts by the field name + * `screensCount` sorts by the number of screens related to a field +*/ + orderBy?: + | "contextsCount" + | "-contextsCount" + | "+contextsCount" + | "lastUsed" + | "-lastUsed" + | "+lastUsed" + | "name" + | "-name" + | "+name" + | "screensCount" + | "-screensCount" + | "+screensCount" + | "projectsCount" + | "-projectsCount" + | "+projectsCount"; + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `key` returns the key for each field + * `lastUsed` returns the date when the value of the field last changed + * `screensCount` returns the number of screens related to a field + * `contextsCount` returns the number of contexts related to a field + * `isLocked` returns information about whether the field is [locked](https://confluence.atlassian.com/x/ZSN7Og) + * `searcherKey` returns the searcher key for each custom field +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFieldsPaginated({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get fields in trash paginated + * @request GET :/rest/api/3/field/search/trashed + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetTrashedFieldsPaginated( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + id?: string[]; + /** + * String used to perform a case-insensitive partial match with field names or descriptions. + */ + query?: string; + expand?: + | "name" + | "-name" + | "+name" + | "trashDate" + | "-trashDate" + | "+trashDate" + | "plannedDeletionDate" + | "-plannedDeletionDate" + | "+plannedDeletionDate" + | "projectsCount" + | "-projectsCount" + | "+projectsCount"; + /** +* [Order](#ordering) the results by a field: + + * `name` sorts by the field name + * `trashDate` sorts by the date the field was moved to the trash + * `plannedDeletionDate` sorts by the planned deletion date +*/ + orderBy?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getTrashedFieldsPaginated({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update custom field + * @request PUT :/rest/api/3/field/{fieldId} + * @allowrelaxedtypes + */ +export async function putRestUpdateCustomField( + /** + * The ID of the custom field. + */ + fieldId: string, + /** Request body */ + data: UpdateCustomFieldDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateCustomField({ + fieldId: fieldId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get custom field contexts + * @request GET :/rest/api/3/field/{fieldId}/context + * @readonly + */ +export async function getRestGetContextsForField( + query: { + /** + * Whether to return contexts that apply to all issue types. + */ + isAnyIssueType?: boolean; + /** + * Whether to return contexts that apply to all projects. + */ + isGlobalContext?: boolean; + /** + * The list of context IDs. To include multiple contexts, separate IDs with ampersand: `contextId=10000&contextId=10001`. + */ + contextId?: number[]; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the custom field. + */ + fieldId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getContextsForField({ + query: query, + fieldId: fieldId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create custom field context + * @request POST :/rest/api/3/field/{fieldId}/context + */ +export async function postRestCreateCustomFieldContext( + /** + * The ID of the custom field. + */ + fieldId: string, + /** Request body */ + data: CreateCustomFieldContext, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createCustomFieldContext({ + fieldId: fieldId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get custom field contexts default values + * @request GET :/rest/api/3/field/{fieldId}/context/defaultValue + * @readonly + */ +export async function getRestGetDefaultValues( + query: { + /** + * The IDs of the contexts. + */ + contextId?: number[]; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the custom field, for example `customfield\_10000`. + */ + fieldId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDefaultValues({ + query: query, + fieldId: fieldId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set custom field contexts default values + * @request PUT :/rest/api/3/field/{fieldId}/context/defaultValue + * @allowrelaxedtypes + */ +export async function putRestSetDefaultValues( + /** + * The ID of the custom field. + */ + fieldId: string, + /** Request body */ + data: CustomFieldContextDefaultValueUpdate, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setDefaultValues({ + fieldId: fieldId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get issue types for custom field context + * @request GET :/rest/api/3/field/{fieldId}/context/issuetypemapping + * @readonly + */ +export async function getRestGetIssueTypeMappingsForContexts( + query: { + /** + * The ID of the context. To include multiple contexts, provide an ampersand-separated list. For example, `contextId=10001&contextId=10002`. + */ + contextId?: number[]; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the custom field. + */ + fieldId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypeMappingsForContexts({ + query: query, + fieldId: fieldId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get custom field contexts for projects and issue types + * @request POST :/rest/api/3/field/{fieldId}/context/mapping + */ +export async function postRestGetCustomFieldContextsForProjectsAndIssueTypes( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the custom field. + */ + fieldId: string, + /** Request body */ + data: ProjectIssueTypeMappings, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCustomFieldContextsForProjectsAndIssueTypes({ + query: query, + fieldId: fieldId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project mappings for custom field context + * @request GET :/rest/api/3/field/{fieldId}/context/projectmapping + * @readonly + */ +export async function getRestGetProjectContextMapping( + query: { + /** + * The list of context IDs. To include multiple context, separate IDs with ampersand: `contextId=10000&contextId=10001`. + */ + contextId?: number[]; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the custom field, for example `customfield\_10000`. + */ + fieldId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectContextMapping({ + query: query, + fieldId: fieldId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete custom field context + * @request DELETE :/rest/api/3/field/{fieldId}/context/{contextId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteCustomFieldContext( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteCustomFieldContext({ + fieldId: fieldId, + contextId: contextId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update custom field context + * @request PUT :/rest/api/3/field/{fieldId}/context/{contextId} + * @allowrelaxedtypes + */ +export async function putRestUpdateCustomFieldContext( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: CustomFieldContextUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateCustomFieldContext({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Add issue types to context + * @request PUT :/rest/api/3/field/{fieldId}/context/{contextId}/issuetype + * @allowrelaxedtypes + */ +export async function putRestAddIssueTypesToContext( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: IssueTypeIds, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addIssueTypesToContext({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Remove issue types from context + * @request POST :/rest/api/3/field/{fieldId}/context/{contextId}/issuetype/remove + * @allowrelaxedtypes + */ +export async function postRestRemoveIssueTypesFromContext( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: IssueTypeIds, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeIssueTypesFromContext({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get custom field options (context) + * @request GET :/rest/api/3/field/{fieldId}/context/{contextId}/option + * @readonly + */ +export async function getRestGetOptionsForContext( + query: { + /** + * The ID of the option. + */ + optionId?: number; + /** + * Whether only options are returned. + */ + onlyOptions?: boolean; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getOptionsForContext({ + query: query, + fieldId: fieldId, + contextId: contextId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create custom field options (context) + * @request POST :/rest/api/3/field/{fieldId}/context/{contextId}/option + */ +export async function postRestCreateCustomFieldOption( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: BulkCustomFieldOptionCreateRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createCustomFieldOption({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update custom field options (context) + * @request PUT :/rest/api/3/field/{fieldId}/context/{contextId}/option + */ +export async function putRestUpdateCustomFieldOption( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: BulkCustomFieldOptionUpdateRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateCustomFieldOption({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Reorder custom field options (context) + * @request PUT :/rest/api/3/field/{fieldId}/context/{contextId}/option/move + * @allowrelaxedtypes + */ +export async function putRestReorderCustomFieldOptions( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: OrderOfCustomFieldOptions, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.reorderCustomFieldOptions({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete custom field options (context) + * @request DELETE :/rest/api/3/field/{fieldId}/context/{contextId}/option/{optionId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteCustomFieldOption( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context from which an option should be deleted. + */ + contextId: number, + /** + * The ID of the option to delete. + */ + optionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteCustomFieldOption({ + fieldId: fieldId, + contextId: contextId, + optionId: optionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Assign custom field context to projects + * @request PUT :/rest/api/3/field/{fieldId}/context/{contextId}/project + * @allowrelaxedtypes + */ +export async function putRestAssignProjectsToCustomFieldContext( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: ProjectIds, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.assignProjectsToCustomFieldContext({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Remove custom field context from projects + * @request POST :/rest/api/3/field/{fieldId}/context/{contextId}/project/remove + * @allowrelaxedtypes + */ +export async function postRestRemoveCustomFieldContextFromProjects( + /** + * The ID of the custom field. + */ + fieldId: string, + /** + * The ID of the context. + */ + contextId: number, + /** Request body */ + data: ProjectIds, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeCustomFieldContextFromProjects({ + fieldId: fieldId, + contextId: contextId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get contexts for a field + * @request GET :/rest/api/3/field/{fieldId}/contexts + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetContextsForFieldDeprecated( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the field to return contexts for. + */ + fieldId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getContextsForFieldDeprecated({ + query: query, + fieldId: fieldId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get screens for a field + * @request GET :/rest/api/3/field/{fieldId}/screens + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetScreensForField( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * Use [expand](#expansion) to include additional information about screens in the response. This parameter accepts `tab` which returns details about the screen tabs the field is used in. + */ + expand?: string; + }, + /** + * The ID of the field to return screens for. + */ + fieldId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getScreensForField({ + query: query, + fieldId: fieldId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all issue field options + * @request GET :/rest/api/3/field/{fieldKey}/option + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllIssueFieldOptions( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllIssueFieldOptions({ + query: query, + fieldKey: fieldKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create issue field option + * @request POST :/rest/api/3/field/{fieldKey}/option + * @allowrelaxedtypes + */ +export async function postRestCreateIssueFieldOption( + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + /** Request body */ + data: IssueFieldOptionCreateBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssueFieldOption({ + fieldKey: fieldKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get selectable issue field options + * @request GET :/rest/api/3/field/{fieldKey}/option/suggestions/edit + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetSelectableIssueFieldOptions( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * Filters the results to options that are only available in the specified project. + */ + projectId?: number; + }, + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getSelectableIssueFieldOptions({ + query: query, + fieldKey: fieldKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get visible issue field options + * @request GET :/rest/api/3/field/{fieldKey}/option/suggestions/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetVisibleIssueFieldOptions( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * Filters the results to options that are only available in the specified project. + */ + projectId?: number; + }, + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getVisibleIssueFieldOptions({ + query: query, + fieldKey: fieldKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete issue field option + * @request DELETE :/rest/api/3/field/{fieldKey}/option/{optionId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueFieldOption( + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + /** + * The ID of the option to be deleted. + */ + optionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueFieldOption({ + fieldKey: fieldKey, + optionId: optionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get issue field option + * @request GET :/rest/api/3/field/{fieldKey}/option/{optionId} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueFieldOption( + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + /** + * The ID of the option to be returned. + */ + optionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueFieldOption({ + fieldKey: fieldKey, + optionId: optionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update issue field option + * @request PUT :/rest/api/3/field/{fieldKey}/option/{optionId} + * @allowrelaxedtypes + */ +export async function putRestUpdateIssueFieldOption( + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + /** + * The ID of the option to be updated. + */ + optionId: number, + /** Request body */ + data: IssueFieldOption, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateIssueFieldOption({ + fieldKey: fieldKey, + optionId: optionId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Replace issue field option + * @request DELETE :/rest/api/3/field/{fieldKey}/option/{optionId}/issue + * @allowrelaxedtypes + */ +export async function deleteRestReplaceIssueFieldOption( + query: { + /** + * The ID of the option that will replace the currently selected option. + */ + replaceWith?: number; + /** + * A JQL query that specifies the issues to be updated. For example, *project=10000*. + */ + jql?: string; + /** + * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect and Forge app users with admin permission. + */ + overrideScreenSecurity?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect and Forge app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag?: boolean; + }, + /** +* The field key is specified in the following format: **$(app-key)\_\_$(field-key)**. For example, *example-add-on\_\_example-issue-field*. To determine the `fieldKey` value, do one of the following: + + * open the app's plugin descriptor, then **app-key** is the key at the top and **field-key** is the key in the `jiraIssueFields` module. **app-key** can also be found in the app listing in the Atlassian Universal Plugin Manager. + * run [Get fields](#api-rest-api-3-field-get) and in the field details the value is returned in `key`. For example, `"key": "teams-add-on__team-issue-field"` +*/ + fieldKey: string, + /** + * The ID of the option to be deselected. + */ + optionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.replaceIssueFieldOption({ + query: query, + fieldKey: fieldKey, + optionId: optionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete custom field + * @request DELETE :/rest/api/3/field/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteCustomField( + /** + * The ID of a custom field. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteCustomField({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Restore custom field from trash + * @request POST :/rest/api/3/field/{id}/restore + * @allowrelaxedtypes + */ +export async function postRestRestoreCustomField( + /** + * The ID of a custom field. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.restoreCustomField({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Move custom field to trash + * @request POST :/rest/api/3/field/{id}/trash + * @allowrelaxedtypes + */ +export async function postRestTrashCustomField( + /** + * The ID of a custom field. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.trashCustomField({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all field configurations + * @request GET :/rest/api/3/fieldconfiguration + * @readonly + */ +export async function getRestGetAllFieldConfigurations( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of field configuration IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + */ + id?: number[]; + /** + * If *true* returns default field configurations only. + */ + isDefault?: boolean; + /** + * The query string used to match against field configuration names and descriptions. + */ + query?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllFieldConfigurations({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create field configuration + * @request POST :/rest/api/3/fieldconfiguration + */ +export async function postRestCreateFieldConfiguration( + /** Request body */ + data: FieldConfigurationDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createFieldConfiguration({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete field configuration + * @request DELETE :/rest/api/3/fieldconfiguration/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteFieldConfiguration( + /** + * The ID of the field configuration. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteFieldConfiguration({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update field configuration + * @request PUT :/rest/api/3/fieldconfiguration/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateFieldConfiguration( + /** + * The ID of the field configuration. + */ + id: number, + /** Request body */ + data: FieldConfigurationDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateFieldConfiguration({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get field configuration items + * @request GET :/rest/api/3/fieldconfiguration/{id}/fields + * @readonly + */ +export async function getRestGetFieldConfigurationItems( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID of the field configuration. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFieldConfigurationItems({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update field configuration items + * @request PUT :/rest/api/3/fieldconfiguration/{id}/fields + * @allowrelaxedtypes + */ +export async function putRestUpdateFieldConfigurationItems( + /** + * The ID of the field configuration. + */ + id: number, + /** Request body */ + data: FieldConfigurationItemsDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateFieldConfigurationItems({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all field configuration schemes + * @request GET :/rest/api/3/fieldconfigurationscheme + * @readonly + */ +export async function getRestGetAllFieldConfigurationSchemes( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of field configuration scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + */ + id?: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllFieldConfigurationSchemes({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create field configuration scheme + * @request POST :/rest/api/3/fieldconfigurationscheme + */ +export async function postRestCreateFieldConfigurationScheme( + /** Request body */ + data: UpdateFieldConfigurationSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createFieldConfigurationScheme({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get field configuration issue type items + * @request GET :/rest/api/3/fieldconfigurationscheme/mapping + * @readonly + */ +export async function getRestGetFieldConfigurationSchemeMappings( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of field configuration scheme IDs. To include multiple field configuration schemes separate IDs with ampersand: `fieldConfigurationSchemeId=10000&fieldConfigurationSchemeId=10001`. + */ + fieldConfigurationSchemeId?: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFieldConfigurationSchemeMappings({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get field configuration schemes for projects + * @request GET :/rest/api/3/fieldconfigurationscheme/project + * @readonly + */ +export async function getRestGetFieldConfigurationSchemeProjectMapping( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of project IDs. To include multiple projects, separate IDs with ampersand: `projectId=10000&projectId=10001`. + */ + projectId: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFieldConfigurationSchemeProjectMapping({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Assign field configuration scheme to project + * @request PUT :/rest/api/3/fieldconfigurationscheme/project + * @allowrelaxedtypes + */ +export async function putRestAssignFieldConfigurationSchemeToProject( + /** Request body */ + data: FieldConfigurationSchemeProjectAssociation, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.assignFieldConfigurationSchemeToProject({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete field configuration scheme + * @request DELETE :/rest/api/3/fieldconfigurationscheme/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteFieldConfigurationScheme( + /** + * The ID of the field configuration scheme. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteFieldConfigurationScheme({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update field configuration scheme + * @request PUT :/rest/api/3/fieldconfigurationscheme/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateFieldConfigurationScheme( + /** + * The ID of the field configuration scheme. + */ + id: number, + /** Request body */ + data: UpdateFieldConfigurationSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateFieldConfigurationScheme({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Assign issue types to field configurations + * @request PUT :/rest/api/3/fieldconfigurationscheme/{id}/mapping + * @allowrelaxedtypes + */ +export async function putRestSetFieldConfigurationSchemeMapping( + /** + * The ID of the field configuration scheme. + */ + id: number, + /** Request body */ + data: AssociateFieldConfigurationsWithIssueTypesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setFieldConfigurationSchemeMapping({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Remove issue types from field configuration scheme + * @request POST :/rest/api/3/fieldconfigurationscheme/{id}/mapping/delete + * @allowrelaxedtypes + */ +export async function postRestRemoveIssueTypesFromGlobalFieldConfigurationScheme( + /** + * The ID of the field configuration scheme. + */ + id: number, + /** Request body */ + data: IssueTypeIdsToRemove, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.rest.removeIssueTypesFromGlobalFieldConfigurationScheme({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get filters + * @request GET :/rest/api/3/filter + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetFilters( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFilters({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create filter + * @request POST :/rest/api/3/filter + * @allowrelaxedtypes + */ +export async function postRestCreateFilter( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be created. Available to users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions?: boolean; + }, + /** Request body */ + data: Filter, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createFilter({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get default share scope + * @request GET :/rest/api/3/filter/defaultShareScope + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetDefaultShareScope( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDefaultShareScope({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set default share scope + * @request PUT :/rest/api/3/filter/defaultShareScope + * @allowrelaxedtypes + */ +export async function putRestSetDefaultShareScope( + /** Request body */ + data: DefaultShareScope, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setDefaultShareScope({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get favorite filters + * @request GET :/rest/api/3/filter/favourite + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetFavouriteFilters( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFavouriteFilters({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get my filters + * @request GET :/rest/api/3/filter/my + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetMyFilters( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + /** + * Include the user's favorite filters in the response. + */ + includeFavourites?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getMyFilters({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Search for filters + * @request GET :/rest/api/3/filter/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetFiltersPaginated( + query: { + /** + * String used to perform a case-insensitive partial match with `name`. + */ + filterName?: string; + /** + * User account ID used to return filters with the matching `owner.accountId`. This parameter cannot be used with `owner`. + */ + accountId?: string; + /** + * This parameter is deprecated because of privacy changes. Use `accountId` instead. See the [migration guide](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. User name used to return filters with the matching `owner.name`. This parameter cannot be used with `accountId`. + */ + owner?: string; + /** + * As a group's name can change, use of `groupId` is recommended to identify a group. Group name used to returns filters that are shared with a group that matches `sharePermissions.group.groupname`. This parameter cannot be used with the `groupId` parameter. + */ + groupname?: string; + /** + * Group ID used to returns filters that are shared with a group that matches `sharePermissions.group.groupId`. This parameter cannot be used with the `groupname` parameter. + */ + groupId?: string; + /** + * Project ID used to returns filters that are shared with a project that matches `sharePermissions.project.id`. + */ + projectId?: number; + /** + * The list of filter IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. Do not exceed 200 filter IDs. + */ + id?: number[]; + /** +* [Order](#ordering) the results by a field: + + * `description` Sorts by filter description. Note that this sorting works independently of whether the expand to display the description field is in use. + * `favourite_count` Sorts by the count of how many users have this filter as a favorite. + * `is_favourite` Sorts by whether the filter is marked as a favorite. + * `id` Sorts by filter ID. + * `name` Sorts by filter name. + * `owner` Sorts by the ID of the filter owner. + * `is_shared` Sorts by whether the filter is shared. +*/ + orderBy?: + | "description" + | "-description" + | "+description" + | "favourite_count" + | "-favourite_count" + | "+favourite_count" + | "id" + | "-id" + | "+id" + | "is_favourite" + | "-is_favourite" + | "+is_favourite" + | "name" + | "-name" + | "+name" + | "owner" + | "-owner" + | "+owner" + | "is_shared" + | "-is_shared" + | "+is_shared"; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `description` Returns the description of the filter. + * `favourite` Returns an indicator of whether the user has set the filter as a favorite. + * `favouritedCount` Returns a count of how many users have set this filter as a favorite. + * `jql` Returns the JQL query that the filter uses. + * `owner` Returns the owner of the filter. + * `searchUrl` Returns a URL to perform the filter's JQL query. + * `sharePermissions` Returns the share permissions defined for the filter. + * `editPermissions` Returns the edit permissions defined for the filter. + * `isWritable` Returns whether the current user has permission to edit the filter. + * `subscriptions` Returns the users that are subscribed to the filter. + * `viewUrl` Returns a URL to view the filter. +*/ + expand?: string; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be returned. Available to users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFiltersPaginated({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete filter + * @request DELETE :/rest/api/3/filter/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteFilter( + /** + * The ID of the filter to delete. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteFilter({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get filter + * @request GET :/rest/api/3/filter/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetFilter( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable filters with any share permissions to be returned. Available to users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions?: boolean; + }, + /** + * The ID of the filter to return. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFilter({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update filter + * @request PUT :/rest/api/3/filter/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateFilter( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + /** + * EXPERIMENTAL: Whether share permissions are overridden to enable the addition of any share permissions to filters. Available to users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideSharePermissions?: boolean; + }, + /** + * The ID of the filter to update. + */ + id: number, + /** Request body */ + data: Filter, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateFilter({ + query: query, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Reset columns + * @request DELETE :/rest/api/3/filter/{id}/columns + * @allowrelaxedtypes + */ +export async function deleteRestResetColumns( + /** + * The ID of the filter. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.resetColumns({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get columns + * @request GET :/rest/api/3/filter/{id}/columns + * @readonly + */ +export async function getRestGetColumns( + /** + * The ID of the filter. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getColumns({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set columns + * @request PUT :/rest/api/3/filter/{id}/columns + * @allowrelaxedtypes + */ +export async function putRestSetColumns( + /** + * The ID of the filter. + */ + id: number, + /** Request body */ + data: string[], + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setColumns({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Remove filter as favorite + * @request DELETE :/rest/api/3/filter/{id}/favourite + * @allowrelaxedtypes + */ +export async function deleteRestDeleteFavouriteForFilter( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + }, + /** + * The ID of the filter. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteFavouriteForFilter({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add filter as favorite + * @request PUT :/rest/api/3/filter/{id}/favourite + * @allowrelaxedtypes + */ +export async function putRestSetFavouriteForFilter( + query: { + /** +* Use [expand](#expansion) to include additional information about filter in the response. This parameter accepts a comma-separated list. Expand options include: + + * `sharedUsers` Returns the users that the filter is shared with. This includes users that can browse projects that the filter is shared with. If you don't specify `sharedUsers`, then the `sharedUsers` object is returned but it doesn't list any users. The list of users returned is limited to 1000, to access additional users append `[start-index:end-index]` to the expand request. For example, to access the next 1000 users, use `?expand=sharedUsers[1001:2000]`. + * `subscriptions` Returns the users that are subscribed to the filter. If you don't specify `subscriptions`, the `subscriptions` object is returned but it doesn't list any subscriptions. The list of subscriptions returned is limited to 1000, to access additional subscriptions append `[start-index:end-index]` to the expand request. For example, to access the next 1000 subscriptions, use `?expand=subscriptions[1001:2000]`. +*/ + expand?: string; + }, + /** + * The ID of the filter. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setFavouriteForFilter({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Change filter owner + * @request PUT :/rest/api/3/filter/{id}/owner + * @allowrelaxedtypes + */ +export async function putRestChangeFilterOwner( + /** + * The ID of the filter to update. + */ + id: number, + /** Request body */ + data: ChangeFilterOwner, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.changeFilterOwner({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get share permissions + * @request GET :/rest/api/3/filter/{id}/permission + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetSharePermissions( + /** + * The ID of the filter. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getSharePermissions({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add share permission + * @request POST :/rest/api/3/filter/{id}/permission + * @allowrelaxedtypes + */ +export async function postRestAddSharePermission( + /** + * The ID of the filter. + */ + id: number, + /** Request body */ + data: SharePermissionInputBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addSharePermission({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete share permission + * @request DELETE :/rest/api/3/filter/{id}/permission/{permissionId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteSharePermission( + /** + * The ID of the filter. + */ + id: number, + /** + * The ID of the share permission. + */ + permissionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteSharePermission({ + id: id, + permissionId: permissionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get share permission + * @request GET :/rest/api/3/filter/{id}/permission/{permissionId} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetSharePermission( + /** + * The ID of the filter. + */ + id: number, + /** + * The ID of the share permission. + */ + permissionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getSharePermission({ + id: id, + permissionId: permissionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Remove group + * @request DELETE :/rest/api/3/group + * @allowrelaxedtypes + */ +export async function deleteRestRemoveGroup( + query: { + groupname?: string; + /** + * The ID of the group. This parameter cannot be used with the `groupname` parameter. + */ + groupId?: string; + /** +* As a group's name can change, use of `swapGroupId` is recommended to identify a group. +The group to transfer restrictions to. Only comments and worklogs are transferred. If restrictions are not transferred, comments and worklogs are inaccessible after the deletion. This parameter cannot be used with the `swapGroupId` parameter. +*/ + swapGroup?: string; + /** + * The ID of the group to transfer restrictions to. Only comments and worklogs are transferred. If restrictions are not transferred, comments and worklogs are inaccessible after the deletion. This parameter cannot be used with the `swapGroup` parameter. + */ + swapGroupId?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeGroup({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get group + * @request GET :/rest/api/3/group + * @readonly + */ +export async function getRestGetGroup( + query: { + /** +* As a group's name can change, use of `groupId` is recommended to identify a group. +The name of the group. This parameter cannot be used with the `groupId` parameter. +*/ + groupname?: string; + /** + * The ID of the group. This parameter cannot be used with the `groupName` parameter. + */ + groupId?: string; + /** + * List of fields to expand. + */ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getGroup({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create group + * @request POST :/rest/api/3/group + */ +export async function postRestCreateGroup( + /** Request body */ + data: AddGroupBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createGroup({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Bulk get groups + * @request GET :/rest/api/3/group/bulk + * @readonly + */ +export async function getRestBulkGetGroups( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The ID of a group. To specify multiple IDs, pass multiple `groupId` parameters. For example, `groupId=5b10a2844c20165700ede21g&groupId=5b10ac8d82e05b22cc7d4ef5`. + */ + groupId?: string[]; + /** + * The name of a group. To specify multiple names, pass multiple `groupName` parameters. For example, `groupName=administrators&groupName=jira-software-users`. + */ + groupName?: string[]; + /** + * The access level of a group. Valid values: 'site-admin', 'admin', 'user'. + */ + accessType?: string; + /** + * The application key of the product user groups to search for. Valid values: 'jira-servicedesk', 'jira-software', 'jira-product-discovery', 'jira-core'. + */ + applicationKey?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.bulkGetGroups({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get users from group + * @request GET :/rest/api/3/group/member + * @readonly + */ +export async function getRestGetUsersFromGroup( + query: { + /** +* As a group's name can change, use of `groupId` is recommended to identify a group. +The name of the group. This parameter cannot be used with the `groupId` parameter. +*/ + groupname?: string; + /** + * The ID of the group. This parameter cannot be used with the `groupName` parameter. + */ + groupId?: string; + /** + * Include inactive users. + */ + includeInactiveUsers?: boolean; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUsersFromGroup({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Remove user from group + * @request DELETE :/rest/api/3/group/user + * @allowrelaxedtypes + */ +export async function deleteRestRemoveUserFromGroup( + query: { + /** +* As a group's name can change, use of `groupId` is recommended to identify a group. +The name of the group. This parameter cannot be used with the `groupId` parameter. +*/ + groupname?: string; + /** + * The ID of the group. This parameter cannot be used with the `groupName` parameter. + */ + groupId?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeUserFromGroup({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Add user to group + * @request POST :/rest/api/3/group/user + */ +export async function postRestAddUserToGroup( + query: { + /** +* As a group's name can change, use of `groupId` is recommended to identify a group. +The name of the group. This parameter cannot be used with the `groupId` parameter. +*/ + groupname?: string; + /** + * The ID of the group. This parameter cannot be used with the `groupName` parameter. + */ + groupId?: string; + }, + /** Request body */ + data: UpdateUserToGroupBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addUserToGroup({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find groups + * @request GET :/rest/api/3/groups/picker + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindGroups( + query: { + /** + * This parameter is deprecated, setting it does not affect the results. To find groups containing a particular user, use [Get user groups](#api-rest-api-3-user-groups-get). + */ + accountId?: string; + /** + * The string to find in group names. + */ + query?: string; + /** +* As a group's name can change, use of `excludeGroupIds` is recommended to identify a group. +A group to exclude from the result. To exclude multiple groups, provide an ampersand-separated list. For example, `exclude=group1&exclude=group2`. This parameter cannot be used with the `excludeGroupIds` parameter. +*/ + exclude?: string[]; + /** + * A group ID to exclude from the result. To exclude multiple groups, provide an ampersand-separated list. For example, `excludeId=group1-id&excludeId=group2-id`. This parameter cannot be used with the `excludeGroups` parameter. + */ + excludeId?: string[]; + /** + * The maximum number of groups to return. The maximum number of groups that can be returned is limited by the system property `jira.ajax.autocomplete.limit`. + */ + maxResults?: number; + /** + * Whether the search for groups should be case insensitive. + */ + caseInsensitive?: boolean; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + userName?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findGroups({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find users and groups + * @request GET :/rest/api/3/groupuserpicker + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindUsersAndGroups( + query: { + /** + * The search string. + */ + query: string; + /** + * The maximum number of items to return in each list. + */ + maxResults?: number; + /** + * Whether the user avatar should be returned. If an invalid value is provided, the default value is used. + */ + showAvatar?: boolean; + /** + * The custom field ID of the field this request is for. + */ + fieldId?: string; + /** + * The ID of a project that returned users and groups must have permission to view. To include multiple projects, provide an ampersand-separated list. For example, `projectId=10000&projectId=10001`. This parameter is only used when `fieldId` is present. + */ + projectId?: string[]; + /** + * The ID of an issue type that returned users and groups must have permission to view. To include multiple issue types, provide an ampersand-separated list. For example, `issueTypeId=10000&issueTypeId=10001`. Special values, such as `-1` (all standard issue types) and `-2` (all subtask issue types), are supported. This parameter is only used when `fieldId` is present. + */ + issueTypeId?: string[]; + /** + * The size of the avatar to return. If an invalid value is provided, the default value is used. + */ + avatarSize?: + | "xsmall" + | "xsmall@2x" + | "xsmall@3x" + | "small" + | "small@2x" + | "small@3x" + | "medium" + | "medium@2x" + | "medium@3x" + | "large" + | "large@2x" + | "large@3x" + | "xlarge" + | "xlarge@2x" + | "xlarge@3x" + | "xxlarge" + | "xxlarge@2x" + | "xxlarge@3x" + | "xxxlarge" + | "xxxlarge@2x" + | "xxxlarge@3x"; + /** + * Whether the search for groups should be case insensitive. + */ + caseInsensitive?: boolean; + /** + * Whether Connect app users and groups should be excluded from the search results. If an invalid value is provided, the default value is used. + */ + excludeConnectAddons?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findUsersAndGroups({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get license + * @request GET :/rest/api/3/instance/license + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetLicense( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getLicense({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create issue + * @request POST :/rest/api/3/issue + * @allowrelaxedtypes + */ +export async function postRestCreateIssue( + query: { + /** + * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown under **Projects** in Jira. When provided, the issue type and request type are added to the user's history for a project. These values are then used to provide defaults on the issue create screen. + */ + updateHistory?: boolean; + }, + /** Request body */ + data: IssueUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssue({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Bulk create issue + * @request POST :/rest/api/3/issue/bulk + * @allowrelaxedtypes + */ +export async function postRestCreateIssues( + /** Request body */ + data: IssuesUpdateBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssues({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get create issue metadata + * @request GET :/rest/api/3/issue/createmeta + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetCreateIssueMeta( + query: { + /** + * List of project IDs. This parameter accepts a comma-separated list. Multiple project IDs can also be provided using an ampersand-separated list. For example, `projectIds=10000,10001&projectIds=10020,10021`. This parameter may be provided with `projectKeys`. + */ + projectIds?: string[]; + /** + * List of project keys. This parameter accepts a comma-separated list. Multiple project keys can also be provided using an ampersand-separated list. For example, `projectKeys=proj1,proj2&projectKeys=proj3`. This parameter may be provided with `projectIds`. + */ + projectKeys?: string[]; + /** + * List of issue type IDs. This parameter accepts a comma-separated list. Multiple issue type IDs can also be provided using an ampersand-separated list. For example, `issuetypeIds=10000,10001&issuetypeIds=10020,10021`. This parameter may be provided with `issuetypeNames`. + */ + issuetypeIds?: string[]; + /** + * List of issue type names. This parameter accepts a comma-separated list. Multiple issue type names can also be provided using an ampersand-separated list. For example, `issuetypeNames=name1,name2&issuetypeNames=name3`. This parameter may be provided with `issuetypeIds`. + */ + issuetypeNames?: string[]; + /** + * Use [expand](#expansion) to include additional information about issue metadata in the response. This parameter accepts `projects.issuetypes.fields`, which returns information about the fields in the issue creation screen for each issue type. Fields hidden from the screen are not returned. Use the information to populate the `fields` and `update` fields in [Create issue](#api-rest-api-3-issue-post) and [Create issues](#api-rest-api-3-issue-bulk-post). + */ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCreateIssueMeta({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue picker suggestions + * @request GET :/rest/api/3/issue/picker + * @readonly + */ +export async function getRestGetIssuePickerResource( + query: { + /** + * A string to match against text fields in the issue such as title, description, or comments. + */ + query?: string; + /** + * A JQL query defining a list of issues to search for the query term. Note that `username` and `userkey` cannot be used as search terms for this parameter, due to privacy reasons. Use `accountId` instead. + */ + currentJQL?: string; + /** + * The key of an issue to exclude from search results. For example, the issue the user is viewing when they perform this query. + */ + currentIssueKey?: string; + /** + * The ID of a project that suggested issues must belong to. + */ + currentProjectId?: string; + /** + * Indicate whether to include subtasks in the suggestions list. + */ + showSubTasks?: boolean; + /** + * When `currentIssueKey` is a subtask, whether to include the parent issue in the suggestions if it matches the query. + */ + showSubTaskParent?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssuePickerResource({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Bulk set issues properties by list + * @request POST :/rest/api/3/issue/properties + * @allowrelaxedtypes + */ +export async function postRestBulkSetIssuesPropertiesList( + /** Request body */ + data: IssueEntityProperties, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.bulkSetIssuesPropertiesList({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Bulk set issue properties by issue + * @request POST :/rest/api/3/issue/properties/multi + * @allowrelaxedtypes + */ +export async function postRestBulkSetIssuePropertiesByIssue( + /** Request body */ + data: MultiIssueEntityProperties, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.bulkSetIssuePropertiesByIssue({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Bulk delete issue property + * @request DELETE :/rest/api/3/issue/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestBulkDeleteIssueProperty( + /** + * The key of the property. + */ + propertyKey: string, + /** Request body */ + data: IssueFilterForBulkPropertyDelete, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.bulkDeleteIssueProperty({ + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Bulk set issue property + * @request PUT :/rest/api/3/issue/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestBulkSetIssueProperty( + /** + * The key of the property. The maximum length is 255 characters. + */ + propertyKey: string, + /** Request body */ + data: BulkIssuePropertyUpdateRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.bulkSetIssueProperty({ + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get is watching issue bulk + * @request POST :/rest/api/3/issue/watching + */ +export async function postRestGetIsWatchingIssueBulk( + /** Request body */ + data: IssueList, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIsWatchingIssueBulk({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete issue + * @request DELETE :/rest/api/3/issue/{issueIdOrKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssue( + query: { + /** + * Whether the issue's subtasks are deleted when the issue is deleted. + */ + deleteSubtasks?: "true" | "false"; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssue({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue + * @request GET :/rest/api/3/issue/{issueIdOrKey} + * @readonly + */ +export async function getRestGetIssue( + query: { + /** +* A list of fields to return for the issue. This parameter accepts a comma-separated list. Use it to retrieve a subset of fields. Allowed values: + + * `*all` Returns all fields. + * `*navigable` Returns navigable fields. + * Any issue field, prefixed with a minus to exclude. + +Examples: + + * `summary,comment` Returns only the summary and comments fields. + * `-description` Returns all (default) fields except description. + * `*navigable,-comment` Returns all navigable fields except comment. + +This parameter may be specified multiple times. For example, `fields=field1,field2& fields=field3`. + +Note: All fields are returned by default. This differs from [Search for issues using JQL (GET)](#api-rest-api-3-search-get) and [Search for issues using JQL (POST)](#api-rest-api-3-search-post) where the default is all navigable fields. +*/ + fields?: string[]; + /** + * Whether fields in `fields` are referenced by keys rather than IDs. This parameter is useful where fields have been added by a connect app and a field's key may differ from its ID. + */ + fieldsByKeys?: boolean; + /** +* Use [expand](#expansion) to include additional information about the issues in the response. This parameter accepts a comma-separated list. Expand options include: + + * `renderedFields` Returns field values rendered in HTML format. + * `names` Returns the display name of each field. + * `schema` Returns the schema describing a field type. + * `transitions` Returns all possible transitions for the issue. + * `editmeta` Returns information about how each field can be edited. + * `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * `versionedRepresentations` Returns a JSON array for each version of a field's value, with the highest number representing the most recent version. Note: When included in the request, the `fields` parameter is ignored. +*/ + expand?: string; + /** +* A list of issue properties to return for the issue. This parameter accepts a comma-separated list. Allowed values: + + * `*all` Returns all issue properties. + * Any issue property key, prefixed with a minus to exclude. + +Examples: + + * `*all` Returns all properties. + * `*all,-prop1` Returns all properties except `prop1`. + * `prop1,prop2` Returns `prop1` and `prop2` properties. + +This parameter may be specified multiple times. For example, `properties=prop1,prop2& properties=prop3`. +*/ + properties?: string[]; + /** + * Whether the project in which the issue is created is added to the user's **Recently viewed** project list, as shown under **Projects** in Jira. This also populates the [JQL issues search](#api-rest-api-3-search-get) `lastViewed` field. + */ + updateHistory?: boolean; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssue({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Edit issue + * @request PUT :/rest/api/3/issue/{issueIdOrKey} + * @allowrelaxedtypes + */ +export async function putRestEditIssue( + query: { + /** + * Whether a notification email about the issue update is sent to all watchers. To disable the notification, administer Jira or administer project permissions are required. If the user doesn't have the necessary permission the request is ignored. + */ + notifyUsers?: boolean; + /** + * Whether screen security is overridden to enable hidden fields to be edited. Available to Connect app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideScreenSecurity?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag?: boolean; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** Request body */ + data: IssueUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.editIssue({ + query: query, + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Assign issue + * @request PUT :/rest/api/3/issue/{issueIdOrKey}/assignee + * @allowrelaxedtypes + */ +export async function putRestAssignIssue( + /** + * The ID or key of the issue to be assigned. + */ + issueIdOrKey: string, + /** Request body */ + data: User, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.assignIssue({ + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Add attachment + * @request POST :/rest/api/3/issue/{issueIdOrKey}/attachments + */ +export async function postRestAddAttachment( + /** + * The ID or key of the issue that attachments are added to. + */ + issueIdOrKey: string, + /** Request body */ + data: File, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addAttachment({ + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get changelogs + * @request GET :/rest/api/3/issue/{issueIdOrKey}/changelog + * @readonly + */ +export async function getRestGetChangeLogs( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getChangeLogs({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get changelogs by IDs + * @request POST :/rest/api/3/issue/{issueIdOrKey}/changelog/list + */ +export async function postRestGetChangeLogsByIds( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** Request body */ + data: IssueChangelogIds, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getChangeLogsByIds({ + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get comments + * @request GET :/rest/api/3/issue/{issueIdOrKey}/comment + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetComments( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * [Order](#ordering) the results by a field. Accepts *created* to sort comments by their created date. + */ + orderBy?: "created" | "-created" | "+created"; + /** + * Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. + */ + expand?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getComments({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add comment + * @request POST :/rest/api/3/issue/{issueIdOrKey}/comment + * @allowrelaxedtypes + */ +export async function postRestAddComment( + query: { + /** + * Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. + */ + expand?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** Request body */ + data: Comment, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addComment({ + query: query, + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete comment + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/comment/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteComment( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the comment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteComment({ + issueIdOrKey: issueIdOrKey, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get comment + * @request GET :/rest/api/3/issue/{issueIdOrKey}/comment/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetComment( + query: { + /** + * Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. + */ + expand?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the comment. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getComment({ + query: query, + issueIdOrKey: issueIdOrKey, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update comment + * @request PUT :/rest/api/3/issue/{issueIdOrKey}/comment/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateComment( + query: { + /** + * Whether users are notified when a comment is updated. + */ + notifyUsers?: boolean; + /** + * Whether screen security is overridden to enable uneditable fields to be edited. Available to Connect app users with the *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag?: boolean; + /** + * Use [expand](#expansion) to include additional information about comments in the response. This parameter accepts `renderedBody`, which returns the comment body rendered in HTML. + */ + expand?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the comment. + */ + id: string, + /** Request body */ + data: Comment, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateComment({ + query: query, + issueIdOrKey: issueIdOrKey, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get edit issue metadata + * @request GET :/rest/api/3/issue/{issueIdOrKey}/editmeta + * @readonly + */ +export async function getRestGetEditIssueMeta( + query: { + /** + * Whether hidden fields are returned. Available to Connect app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideScreenSecurity?: boolean; + /** + * Whether non-editable fields are returned. Available to Connect app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) and Forge apps acting on behalf of users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + */ + overrideEditableFlag?: boolean; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getEditIssueMeta({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Send notification for issue + * @request POST :/rest/api/3/issue/{issueIdOrKey}/notify + * @allowrelaxedtypes + */ +export async function postRestNotify( + /** + * ID or key of the issue that the notification is sent for. + */ + issueIdOrKey: string, + /** Request body */ + data: Notification, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.notify({ + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get issue property keys + * @request GET :/rest/api/3/issue/{issueIdOrKey}/properties + * @readonly + */ +export async function getRestGetIssuePropertyKeys( + /** + * The key or ID of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssuePropertyKeys({ + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete issue property + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueProperty( + /** + * The key or ID of the issue. + */ + issueIdOrKey: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueProperty({ + issueIdOrKey: issueIdOrKey, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue property + * @request GET :/rest/api/3/issue/{issueIdOrKey}/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueProperty( + /** + * The key or ID of the issue. + */ + issueIdOrKey: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueProperty({ + issueIdOrKey: issueIdOrKey, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set issue property + * @request PUT :/rest/api/3/issue/{issueIdOrKey}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestSetIssueProperty( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The key of the issue property. The maximum length is 255 characters. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setIssueProperty({ + issueIdOrKey: issueIdOrKey, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete remote issue link by global ID + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/remotelink + * @allowrelaxedtypes + */ +export async function deleteRestDeleteRemoteIssueLinkByGlobalId( + query: { + /** + * The global ID of a remote issue link. + */ + globalId: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteRemoteIssueLinkByGlobalId({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get remote issue links + * @request GET :/rest/api/3/issue/{issueIdOrKey}/remotelink + * @readonly + */ +export async function getRestGetRemoteIssueLinks( + query: { + /** + * The global ID of the remote issue link. + */ + globalId?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getRemoteIssueLinks({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create or update remote issue link + * @request POST :/rest/api/3/issue/{issueIdOrKey}/remotelink + */ +export async function postRestCreateOrUpdateRemoteIssueLink( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** Request body */ + data: RemoteIssueLinkRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createOrUpdateRemoteIssueLink({ + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete remote issue link by ID + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/remotelink/{linkId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteRemoteIssueLinkById( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of a remote issue link. + */ + linkId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteRemoteIssueLinkById({ + issueIdOrKey: issueIdOrKey, + linkId: linkId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get remote issue link by ID + * @request GET :/rest/api/3/issue/{issueIdOrKey}/remotelink/{linkId} + * @readonly + */ +export async function getRestGetRemoteIssueLinkById( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the remote issue link. + */ + linkId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getRemoteIssueLinkById({ + issueIdOrKey: issueIdOrKey, + linkId: linkId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update remote issue link by ID + * @request PUT :/rest/api/3/issue/{issueIdOrKey}/remotelink/{linkId} + * @allowrelaxedtypes + */ +export async function putRestUpdateRemoteIssueLink( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the remote issue link. + */ + linkId: string, + /** Request body */ + data: RemoteIssueLinkRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateRemoteIssueLink({ + issueIdOrKey: issueIdOrKey, + linkId: linkId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get transitions + * @request GET :/rest/api/3/issue/{issueIdOrKey}/transitions + * @readonly + */ +export async function getRestGetTransitions( + query: { + /** + * Use [expand](#expansion) to include additional information about transitions in the response. This parameter accepts `transitions.fields`, which returns information about the fields in the transition screen for each transition. Fields hidden from the screen are not returned. Use this information to populate the `fields` and `update` fields in [Transition issue](#api-rest-api-3-issue-issueIdOrKey-transitions-post). + */ + expand?: string; + /** + * The ID of the transition. + */ + transitionId?: string; + /** + * Whether transitions with the condition *Hide From User Condition* are included in the response. + */ + skipRemoteOnlyCondition?: boolean; + /** + * Whether details of transitions that fail a condition are included in the response + */ + includeUnavailableTransitions?: boolean; + /** + * Whether the transitions are sorted by ops-bar sequence value first then category order (Todo, In Progress, Done) or only by ops-bar sequence value. + */ + sortByOpsBarAndStatus?: boolean; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getTransitions({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Transition issue + * @request POST :/rest/api/3/issue/{issueIdOrKey}/transitions + * @allowrelaxedtypes + */ +export async function postRestDoTransition( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** Request body */ + data: IssueUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.doTransition({ + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete vote + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/votes + * @allowrelaxedtypes + */ +export async function deleteRestRemoveVote( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeVote({ + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get votes + * @request GET :/rest/api/3/issue/{issueIdOrKey}/votes + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetVotes( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getVotes({ + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add vote + * @request POST :/rest/api/3/issue/{issueIdOrKey}/votes + * @allowrelaxedtypes + */ +export async function postRestAddVote( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addVote({ + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete watcher + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/watchers + * @allowrelaxedtypes + */ +export async function deleteRestRemoveWatcher( + query: { + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. Required. + */ + accountId?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeWatcher({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue watchers + * @request GET :/rest/api/3/issue/{issueIdOrKey}/watchers + * @readonly + */ +export async function getRestGetIssueWatchers( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueWatchers({ + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add watcher + * @request POST :/rest/api/3/issue/{issueIdOrKey}/watchers + * @allowrelaxedtypes + */ +export async function postRestAddWatcher( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** Request body */ + data: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addWatcher({ + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get issue worklogs + * @request GET :/rest/api/3/issue/{issueIdOrKey}/worklog + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueWorklog( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The worklog start date and time, as a UNIX timestamp in milliseconds, after which worklogs are returned. + */ + startedAfter?: number; + /** + * The worklog start date and time, as a UNIX timestamp in milliseconds, before which worklogs are returned. + */ + startedBefore?: number; + /** + * Use [expand](#expansion) to include additional information about worklogs in the response. This parameter accepts`properties`, which returns worklog properties. + */ + expand?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueWorklog({ + query: query, + issueIdOrKey: issueIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add worklog + * @request POST :/rest/api/3/issue/{issueIdOrKey}/worklog + * @allowrelaxedtypes + */ +export async function postRestAddWorklog( + query: { + /** + * Whether users watching the issue are notified by email. + */ + notifyUsers?: boolean; + /** +* Defines how to update the issue's time estimate, the options are: + + * `new` Sets the estimate to a specific value, defined in `newEstimate`. + * `leave` Leaves the estimate unchanged. + * `manual` Reduces the estimate by amount specified in `reduceBy`. + * `auto` Reduces the estimate by the value of `timeSpent` in the worklog. +*/ + adjustEstimate?: "new" | "leave" | "manual" | "auto"; + /** + * The value to set as the issue's remaining time estimate, as days (\#d), hours (\#h), or minutes (\#m or \#). For example, *2d*. Required when `adjustEstimate` is `new`. + */ + newEstimate?: string; + /** + * The amount to reduce the issue's remaining estimate by, as days (\#d), hours (\#h), or minutes (\#m). For example, *2d*. Required when `adjustEstimate` is `manual`. + */ + reduceBy?: string; + /** + * Use [expand](#expansion) to include additional information about work logs in the response. This parameter accepts `properties`, which returns worklog properties. + */ + expand?: string; + /** + * Whether the worklog entry should be added to the issue even if the issue is not editable, because jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. + */ + overrideEditableFlag?: boolean; + }, + /** + * The ID or key the issue. + */ + issueIdOrKey: string, + /** Request body */ + data: Worklog, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addWorklog({ + query: query, + issueIdOrKey: issueIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete worklog + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/worklog/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorklog( + query: { + /** + * Whether users watching the issue are notified by email. + */ + notifyUsers?: boolean; + /** +* Defines how to update the issue's time estimate, the options are: + + * `new` Sets the estimate to a specific value, defined in `newEstimate`. + * `leave` Leaves the estimate unchanged. + * `manual` Increases the estimate by amount specified in `increaseBy`. + * `auto` Reduces the estimate by the value of `timeSpent` in the worklog. +*/ + adjustEstimate?: "new" | "leave" | "manual" | "auto"; + /** + * The value to set as the issue's remaining time estimate, as days (\#d), hours (\#h), or minutes (\#m or \#). For example, *2d*. Required when `adjustEstimate` is `new`. + */ + newEstimate?: string; + /** + * The amount to increase the issue's remaining estimate by, as days (\#d), hours (\#h), or minutes (\#m or \#). For example, *2d*. Required when `adjustEstimate` is `manual`. + */ + increaseBy?: string; + /** + * Whether the work log entry should be added to the issue even if the issue is not editable, because jira.issue.editable set to false or missing. For example, the issue is closed. Connect and Forge app users with admin permission can use this flag. + */ + overrideEditableFlag?: boolean; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the worklog. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorklog({ + query: query, + issueIdOrKey: issueIdOrKey, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get worklog + * @request GET :/rest/api/3/issue/{issueIdOrKey}/worklog/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorklog( + query: { + /** +* Use [expand](#expansion) to include additional information about work logs in the response. This parameter accepts + +`properties`, which returns worklog properties. +*/ + expand?: string; + }, + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the worklog. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorklog({ + query: query, + issueIdOrKey: issueIdOrKey, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update worklog + * @request PUT :/rest/api/3/issue/{issueIdOrKey}/worklog/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateWorklog( + query: { + /** + * Whether users watching the issue are notified by email. + */ + notifyUsers?: boolean; + /** +* Defines how to update the issue's time estimate, the options are: + + * `new` Sets the estimate to a specific value, defined in `newEstimate`. + * `leave` Leaves the estimate unchanged. + * `auto` Updates the estimate by the difference between the original and updated value of `timeSpent` or `timeSpentSeconds`. +*/ + adjustEstimate?: "new" | "leave" | "manual" | "auto"; + /** + * The value to set as the issue's remaining time estimate, as days (\#d), hours (\#h), or minutes (\#m or \#). For example, *2d*. Required when `adjustEstimate` is `new`. + */ + newEstimate?: string; + /** + * Use [expand](#expansion) to include additional information about worklogs in the response. This parameter accepts `properties`, which returns worklog properties. + */ + expand?: string; + /** + * Whether the worklog should be added to the issue even if the issue is not editable. For example, because the issue is closed. Connect and Forge app users with *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg) can use this flag. + */ + overrideEditableFlag?: boolean; + }, + /** + * The ID or key the issue. + */ + issueIdOrKey: string, + /** + * The ID of the worklog. + */ + id: string, + /** Request body */ + data: Worklog, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateWorklog({ + query: query, + issueIdOrKey: issueIdOrKey, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get worklog property keys + * @request GET :/rest/api/3/issue/{issueIdOrKey}/worklog/{worklogId}/properties + * @readonly + */ +export async function getRestGetWorklogPropertyKeys( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the worklog. + */ + worklogId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorklogPropertyKeys({ + issueIdOrKey: issueIdOrKey, + worklogId: worklogId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete worklog property + * @request DELETE :/rest/api/3/issue/{issueIdOrKey}/worklog/{worklogId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorklogProperty( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the worklog. + */ + worklogId: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorklogProperty({ + issueIdOrKey: issueIdOrKey, + worklogId: worklogId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get worklog property + * @request GET :/rest/api/3/issue/{issueIdOrKey}/worklog/{worklogId}/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorklogProperty( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the worklog. + */ + worklogId: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorklogProperty({ + issueIdOrKey: issueIdOrKey, + worklogId: worklogId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set worklog property + * @request PUT :/rest/api/3/issue/{issueIdOrKey}/worklog/{worklogId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestSetWorklogProperty( + /** + * The ID or key of the issue. + */ + issueIdOrKey: string, + /** + * The ID of the worklog. + */ + worklogId: string, + /** + * The key of the issue property. The maximum length is 255 characters. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setWorklogProperty({ + issueIdOrKey: issueIdOrKey, + worklogId: worklogId, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Create issue link + * @request POST :/rest/api/3/issueLink + * @allowrelaxedtypes + */ +export async function postRestLinkIssues( + /** Request body */ + data: LinkIssueRequestJsonBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.linkIssues({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete issue link + * @request DELETE :/rest/api/3/issueLink/{linkId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueLink( + /** + * The ID of the issue link. + */ + linkId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueLink({ + linkId: linkId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue link + * @request GET :/rest/api/3/issueLink/{linkId} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueLink( + /** + * The ID of the issue link. + */ + linkId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueLink({ + linkId: linkId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue link types + * @request GET :/rest/api/3/issueLinkType + * @readonly + */ +export async function getRestGetIssueLinkTypes( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueLinkTypes({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create issue link type + * @request POST :/rest/api/3/issueLinkType + */ +export async function postRestCreateIssueLinkType( + /** Request body */ + data: IssueLinkType, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssueLinkType({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete issue link type + * @request DELETE :/rest/api/3/issueLinkType/{issueLinkTypeId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueLinkType( + /** + * The ID of the issue link type. + */ + issueLinkTypeId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueLinkType({ + issueLinkTypeId: issueLinkTypeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue link type + * @request GET :/rest/api/3/issueLinkType/{issueLinkTypeId} + * @readonly + */ +export async function getRestGetIssueLinkType( + /** + * The ID of the issue link type. + */ + issueLinkTypeId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueLinkType({ + issueLinkTypeId: issueLinkTypeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update issue link type + * @request PUT :/rest/api/3/issueLinkType/{issueLinkTypeId} + */ +export async function putRestUpdateIssueLinkType( + /** + * The ID of the issue link type. + */ + issueLinkTypeId: string, + /** Request body */ + data: IssueLinkType, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateIssueLinkType({ + issueLinkTypeId: issueLinkTypeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue security schemes + * @request GET :/rest/api/3/issuesecurityschemes + * @readonly + */ +export async function getRestGetIssueSecuritySchemes( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueSecuritySchemes({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue security scheme + * @request GET :/rest/api/3/issuesecurityschemes/{id} + * @readonly + */ +export async function getRestGetIssueSecurityScheme( + /** + * The ID of the issue security scheme. Use the [Get issue security schemes](#api-rest-api-3-issuesecurityschemes-get) operation to get a list of issue security scheme IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueSecurityScheme({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue security level members + * @request GET :/rest/api/3/issuesecurityschemes/{issueSecuritySchemeId}/members + * @readonly + */ +export async function getRestGetIssueSecurityLevelMembers( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of issue security level IDs. To include multiple issue security levels separate IDs with ampersand: `issueSecurityLevelId=10000&issueSecurityLevelId=10001`. + */ + issueSecurityLevelId?: number[]; + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + /** + * The ID of the issue security scheme. Use the [Get issue security schemes](#api-rest-api-3-issuesecurityschemes-get) operation to get a list of issue security scheme IDs. + */ + issueSecuritySchemeId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueSecurityLevelMembers({ + query: query, + issueSecuritySchemeId: issueSecuritySchemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all issue types for user + * @request GET :/rest/api/3/issuetype + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueAllTypes( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueAllTypes({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create issue type + * @request POST :/rest/api/3/issuetype + * @allowrelaxedtypes + */ +export async function postRestCreateIssueType( + /** Request body */ + data: IssueTypeCreateBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssueType({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue types for project + * @request GET :/rest/api/3/issuetype/project + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueTypesForProject( + query: { + /** + * The ID of the project. + */ + projectId: number; + /** +* The level of the issue type to filter by. Use: + + * `-1` for Subtask. + * `0` for Base. + * `1` for Epic. +*/ + level?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypesForProject({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete issue type + * @request DELETE :/rest/api/3/issuetype/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueType( + query: { + /** + * The ID of the replacement issue type. + */ + alternativeIssueTypeId?: string; + }, + /** + * The ID of the issue type. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueType({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue type + * @request GET :/rest/api/3/issuetype/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueType( + /** + * The ID of the issue type. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueType({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update issue type + * @request PUT :/rest/api/3/issuetype/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateIssueType( + /** + * The ID of the issue type. + */ + id: string, + /** Request body */ + data: IssueTypeUpdateBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateIssueType({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get alternative issue types + * @request GET :/rest/api/3/issuetype/{id}/alternatives + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAlternativeIssueTypes( + /** + * The ID of the issue type. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAlternativeIssueTypes({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Load issue type avatar + * @request POST :/rest/api/3/issuetype/{id}/avatar2 + */ +export async function postRestCreateIssueTypeAvatar( + query: { + /** + * The X coordinate of the top-left corner of the crop region. + */ + x?: number; + /** + * The Y coordinate of the top-left corner of the crop region. + */ + y?: number; + /** + * The length of each side of the crop region. + */ + size: number; + }, + /** + * The ID of the issue type. + */ + id: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssueTypeAvatar({ + query: query, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue type property keys + * @request GET :/rest/api/3/issuetype/{issueTypeId}/properties + * @readonly + */ +export async function getRestGetIssueTypePropertyKeys( + /** + * The ID of the issue type. + */ + issueTypeId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypePropertyKeys({ + issueTypeId: issueTypeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete issue type property + * @request DELETE :/rest/api/3/issuetype/{issueTypeId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueTypeProperty( + /** + * The ID of the issue type. + */ + issueTypeId: string, + /** + * The key of the property. Use [Get issue type property keys](#api-rest-api-3-issuetype-issueTypeId-properties-get) to get a list of all issue type property keys. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueTypeProperty({ + issueTypeId: issueTypeId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue type property + * @request GET :/rest/api/3/issuetype/{issueTypeId}/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueTypeProperty( + /** + * The ID of the issue type. + */ + issueTypeId: string, + /** + * The key of the property. Use [Get issue type property keys](#api-rest-api-3-issuetype-issueTypeId-properties-get) to get a list of all issue type property keys. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypeProperty({ + issueTypeId: issueTypeId, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set issue type property + * @request PUT :/rest/api/3/issuetype/{issueTypeId}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestSetIssueTypeProperty( + /** + * The ID of the issue type. + */ + issueTypeId: string, + /** + * The key of the issue type property. The maximum length is 255 characters. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setIssueTypeProperty({ + issueTypeId: issueTypeId, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all issue type schemes + * @request GET :/rest/api/3/issuetypescheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllIssueTypeSchemes( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of issue type schemes IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + */ + id?: number[]; + /** +* [Order](#ordering) the results by a field: + + * `name` Sorts by issue type scheme name. + * `id` Sorts by issue type scheme ID. +*/ + orderBy?: "name" | "-name" | "+name" | "id" | "-id" | "+id"; + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `projects` For each issue type schemes, returns information about the projects the issue type scheme is assigned to. + * `issueTypes` For each issue type schemes, returns information about the issueTypes the issue type scheme have. +*/ + expand?: string; + /** + * String used to perform a case-insensitive partial match with issue type scheme name. + */ + queryString?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllIssueTypeSchemes({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create issue type scheme + * @request POST :/rest/api/3/issuetypescheme + */ +export async function postRestCreateIssueTypeScheme( + /** Request body */ + data: IssueTypeSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssueTypeScheme({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue type scheme items + * @request GET :/rest/api/3/issuetypescheme/mapping + * @readonly + */ +export async function getRestGetIssueTypeSchemesMapping( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of issue type scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, `issueTypeSchemeId=10000&issueTypeSchemeId=10001`. + */ + issueTypeSchemeId?: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypeSchemesMapping({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue type schemes for projects + * @request GET :/rest/api/3/issuetypescheme/project + * @readonly + */ +export async function getRestGetIssueTypeSchemeForProjects( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of project IDs. To include multiple project IDs, provide an ampersand-separated list. For example, `projectId=10000&projectId=10001`. + */ + projectId: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypeSchemeForProjects({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Assign issue type scheme to project + * @request PUT :/rest/api/3/issuetypescheme/project + * @allowrelaxedtypes + */ +export async function putRestAssignIssueTypeSchemeToProject( + /** Request body */ + data: IssueTypeSchemeProjectAssociation, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.assignIssueTypeSchemeToProject({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete issue type scheme + * @request DELETE :/rest/api/3/issuetypescheme/{issueTypeSchemeId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueTypeScheme( + /** + * The ID of the issue type scheme. + */ + issueTypeSchemeId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueTypeScheme({ + issueTypeSchemeId: issueTypeSchemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update issue type scheme + * @request PUT :/rest/api/3/issuetypescheme/{issueTypeSchemeId} + * @allowrelaxedtypes + */ +export async function putRestUpdateIssueTypeScheme( + /** + * The ID of the issue type scheme. + */ + issueTypeSchemeId: number, + /** Request body */ + data: IssueTypeSchemeUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateIssueTypeScheme({ + issueTypeSchemeId: issueTypeSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Add issue types to issue type scheme + * @request PUT :/rest/api/3/issuetypescheme/{issueTypeSchemeId}/issuetype + * @allowrelaxedtypes + */ +export async function putRestAddIssueTypesToIssueTypeScheme( + /** + * The ID of the issue type scheme. + */ + issueTypeSchemeId: number, + /** Request body */ + data: IssueTypeIds, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addIssueTypesToIssueTypeScheme({ + issueTypeSchemeId: issueTypeSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Change order of issue types + * @request PUT :/rest/api/3/issuetypescheme/{issueTypeSchemeId}/issuetype/move + * @allowrelaxedtypes + */ +export async function putRestReorderIssueTypesInIssueTypeScheme( + /** + * The ID of the issue type scheme. + */ + issueTypeSchemeId: number, + /** Request body */ + data: OrderOfIssueTypes, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.reorderIssueTypesInIssueTypeScheme({ + issueTypeSchemeId: issueTypeSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Remove issue type from issue type scheme + * @request DELETE :/rest/api/3/issuetypescheme/{issueTypeSchemeId}/issuetype/{issueTypeId} + * @allowrelaxedtypes + */ +export async function deleteRestRemoveIssueTypeFromIssueTypeScheme( + /** + * The ID of the issue type scheme. + */ + issueTypeSchemeId: number, + /** + * The ID of the issue type. + */ + issueTypeId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeIssueTypeFromIssueTypeScheme({ + issueTypeSchemeId: issueTypeSchemeId, + issueTypeId: issueTypeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get issue type screen schemes + * @request GET :/rest/api/3/issuetypescreenscheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIssueTypeScreenSchemes( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of issue type screen scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + */ + id?: number[]; + /** + * String used to perform a case-insensitive partial match with issue type screen scheme name. + */ + queryString?: string; + /** +* [Order](#ordering) the results by a field: + + * `name` Sorts by issue type screen scheme name. + * `id` Sorts by issue type screen scheme ID. +*/ + orderBy?: "name" | "-name" | "+name" | "id" | "-id" | "+id"; + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts `projects` that, for each issue type screen schemes, returns information about the projects the issue type screen scheme is assigned to. + */ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypeScreenSchemes({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create issue type screen scheme + * @request POST :/rest/api/3/issuetypescreenscheme + */ +export async function postRestCreateIssueTypeScreenScheme( + /** Request body */ + data: IssueTypeScreenSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createIssueTypeScreenScheme({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue type screen scheme items + * @request GET :/rest/api/3/issuetypescreenscheme/mapping + * @readonly + */ +export async function getRestGetIssueTypeScreenSchemeMappings( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of issue type screen scheme IDs. To include multiple issue type screen schemes, separate IDs with ampersand: `issueTypeScreenSchemeId=10000&issueTypeScreenSchemeId=10001`. + */ + issueTypeScreenSchemeId?: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypeScreenSchemeMappings({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue type screen schemes for projects + * @request GET :/rest/api/3/issuetypescreenscheme/project + * @readonly + */ +export async function getRestGetIssueTypeScreenSchemeProjectAssociations( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of project IDs. To include multiple projects, separate IDs with ampersand: `projectId=10000&projectId=10001`. + */ + projectId: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueTypeScreenSchemeProjectAssociations({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Assign issue type screen scheme to project + * @request PUT :/rest/api/3/issuetypescreenscheme/project + * @allowrelaxedtypes + */ +export async function putRestAssignIssueTypeScreenSchemeToProject( + /** Request body */ + data: IssueTypeScreenSchemeProjectAssociation, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.assignIssueTypeScreenSchemeToProject({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete issue type screen scheme + * @request DELETE :/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteIssueTypeScreenScheme( + /** + * The ID of the issue type screen scheme. + */ + issueTypeScreenSchemeId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteIssueTypeScreenScheme({ + issueTypeScreenSchemeId: issueTypeScreenSchemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update issue type screen scheme + * @request PUT :/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId} + * @allowrelaxedtypes + */ +export async function putRestUpdateIssueTypeScreenScheme( + /** + * The ID of the issue type screen scheme. + */ + issueTypeScreenSchemeId: string, + /** Request body */ + data: IssueTypeScreenSchemeUpdateDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateIssueTypeScreenScheme({ + issueTypeScreenSchemeId: issueTypeScreenSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Append mappings to issue type screen scheme + * @request PUT :/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId}/mapping + * @allowrelaxedtypes + */ +export async function putRestAppendMappingsForIssueTypeScreenScheme( + /** + * The ID of the issue type screen scheme. + */ + issueTypeScreenSchemeId: string, + /** Request body */ + data: IssueTypeScreenSchemeMappingDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.appendMappingsForIssueTypeScreenScheme({ + issueTypeScreenSchemeId: issueTypeScreenSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update issue type screen scheme default screen scheme + * @request PUT :/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId}/mapping/default + * @allowrelaxedtypes + */ +export async function putRestUpdateDefaultScreenScheme( + /** + * The ID of the issue type screen scheme. + */ + issueTypeScreenSchemeId: string, + /** Request body */ + data: UpdateDefaultScreenScheme, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateDefaultScreenScheme({ + issueTypeScreenSchemeId: issueTypeScreenSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Remove mappings from issue type screen scheme + * @request POST :/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId}/mapping/remove + * @allowrelaxedtypes + */ +export async function postRestRemoveMappingsFromIssueTypeScreenScheme( + /** + * The ID of the issue type screen scheme. + */ + issueTypeScreenSchemeId: string, + /** Request body */ + data: IssueTypeIds, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeMappingsFromIssueTypeScreenScheme({ + issueTypeScreenSchemeId: issueTypeScreenSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get issue type screen scheme projects + * @request GET :/rest/api/3/issuetypescreenscheme/{issueTypeScreenSchemeId}/project + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectsForIssueTypeScreenScheme( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + query?: string; + }, + /** + * The ID of the issue type screen scheme. + */ + issueTypeScreenSchemeId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectsForIssueTypeScreenScheme({ + query: query, + issueTypeScreenSchemeId: issueTypeScreenSchemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get field reference data (GET) + * @request GET :/rest/api/3/jql/autocompletedata + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAutoComplete( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAutoComplete({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get field reference data (POST) + * @request POST :/rest/api/3/jql/autocompletedata + * @allowrelaxedtypes + */ +export async function postRestGetAutoCompletePost( + /** Request body */ + data: SearchAutoCompleteFilter, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAutoCompletePost({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get field auto complete suggestions + * @request GET :/rest/api/3/jql/autocompletedata/suggestions + * @readonly + */ +export async function getRestGetFieldAutoCompleteForQueryString( + query: { + /** + * The name of the field. + */ + fieldName?: string; + /** + * The partial field item name entered by the user. + */ + fieldValue?: string; + /** + * The name of the [ CHANGED operator predicate](https://confluence.atlassian.com/x/hQORLQ#Advancedsearching-operatorsreference-CHANGEDCHANGED) for which the suggestions are generated. The valid predicate operators are *by*, *from*, and *to*. + */ + predicateName?: string; + /** + * The partial predicate item name entered by the user. + */ + predicateValue?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFieldAutoCompleteForQueryString({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get precomputation + * @request GET :/rest/api/3/jql/function/computation + * @readonly + */ +export async function getRestGetPrecomputations( + query: { + functionKey?: string[]; + startAt?: number; + maxResults?: number; + orderBy?: string; + filter?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPrecomputations({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update precomputations + * @request POST :/rest/api/3/jql/function/computation + * @allowrelaxedtypes + */ +export async function postRestUpdatePrecomputations( + /** Request body */ + data: JqlFunctionPrecomputationUpdateRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updatePrecomputations({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Check issues against JQL + * @request POST :/rest/api/3/jql/match + */ +export async function postRestMatchIssues( + /** Request body */ + data: IssuesAndJQLQueries, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.matchIssues({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Parse JQL query + * @request POST :/rest/api/3/jql/parse + * @allowrelaxedtypes + */ +export async function postRestParseJqlQueries( + query: { + /** +* How to validate the JQL query and treat the validation results. Validation options include: + + * `strict` Returns all errors. If validation fails, the query structure is not returned. + * `warn` Returns all errors. If validation fails but the JQL query is correctly formed, the query structure is returned. + * `none` No validation is performed. If JQL query is correctly formed, the query structure is returned. +*/ + validation?: "strict" | "warn" | "none"; + }, + /** Request body */ + data: JqlQueriesToParse, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.parseJqlQueries({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Convert user identifiers to account IDs in JQL queries + * @request POST :/rest/api/3/jql/pdcleaner + */ +export async function postRestMigrateQueries( + /** Request body */ + data: JQLPersonalDataMigrationRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.migrateQueries({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Sanitize JQL queries + * @request POST :/rest/api/3/jql/sanitize + */ +export async function postRestSanitiseJqlQueries( + /** Request body */ + data: JqlQueriesToSanitize, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.sanitiseJqlQueries({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all labels + * @request GET :/rest/api/3/label + * @readonly + */ +export async function getRestGetAllLabels( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllLabels({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get approximate license count + * @request GET :/rest/api/3/license/approximateLicenseCount + * @readonly + */ +export async function getRestGetApproximateLicenseCount( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getApproximateLicenseCount({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get approximate application license count + * @request GET :/rest/api/3/license/approximateLicenseCount/product/{applicationKey} + * @readonly + */ +export async function getRestGetApproximateApplicationLicenseCount( + applicationKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getApproximateApplicationLicenseCount({ + applicationKey: applicationKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get my permissions + * @request GET :/rest/api/3/mypermissions + * @readonly + */ +export async function getRestGetMyPermissions( + query: { + /** + * The key of project. Ignored if `projectId` is provided. + */ + projectKey?: string; + /** + * The ID of project. + */ + projectId?: string; + /** + * The key of the issue. Ignored if `issueId` is provided. + */ + issueKey?: string; + /** + * The ID of the issue. + */ + issueId?: string; + /** + * A list of permission keys. (Required) This parameter accepts a comma-separated list. To get the list of available permissions, use [Get all permissions](#api-rest-api-3-permissions-get). + */ + permissions?: string; + projectUuid?: string; + projectConfigurationUuid?: string; + /** + * The ID of the comment. + */ + commentId?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getMyPermissions({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete preference + * @request DELETE :/rest/api/3/mypreferences + * @allowrelaxedtypes + */ +export async function deleteRestRemovePreference( + query: { + /** + * The key of the preference. + */ + key: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removePreference({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get preference + * @request GET :/rest/api/3/mypreferences + * @readonly + */ +export async function getRestGetPreference( + query: { + /** + * The key of the preference. + */ + key: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPreference({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set preference + * @request PUT :/rest/api/3/mypreferences + * @allowrelaxedtypes + */ +export async function putRestSetPreference( + query: { + /** + * The key of the preference. The maximum length is 255 characters. + */ + key: string; + }, + /** Request body */ + data: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setPreference({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete locale + * @request DELETE :/rest/api/3/mypreferences/locale + * @allowrelaxedtypes + */ +export async function deleteRestDeleteLocale( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteLocale({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get locale + * @request GET :/rest/api/3/mypreferences/locale + * @readonly + */ +export async function getRestGetLocale( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getLocale({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set locale + * @request PUT :/rest/api/3/mypreferences/locale + * @allowrelaxedtypes + */ +export async function putRestSetLocale( + /** Request body */ + data: Locale, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setLocale({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get current user + * @request GET :/rest/api/3/myself + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetCurrentUser( + query: { + /** +* Use [expand](#expansion) to include additional information about user in the response. This parameter accepts a comma-separated list. Expand options include: + + * `groups` Returns all groups, including nested groups, the user belongs to. + * `applicationRoles` Returns the application roles the user is assigned to. +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getCurrentUser({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get notification schemes paginated + * @request GET :/rest/api/3/notificationscheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetNotificationSchemes( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: string; + /** + * The maximum number of items to return per page. + */ + maxResults?: string; + /** + * The list of notification schemes IDs to be filtered by + */ + id?: string[]; + /** + * The list of projects IDs to be filtered by + */ + projectId?: string[]; + /** + * When set to true, returns only the default notification scheme. If you provide project IDs not associated with the default, returns an empty page. The default value is false. + */ + onlyDefault?: boolean; + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `all` Returns all expandable information + * `field` Returns information about any custom fields assigned to receive an event + * `group` Returns information about any groups assigned to receive an event + * `notificationSchemeEvents` Returns a list of event associations. This list is returned for all expandable information + * `projectRole` Returns information about any project roles assigned to receive an event + * `user` Returns information about any users assigned to receive an event +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getNotificationSchemes({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create notification scheme + * @request POST :/rest/api/3/notificationscheme + */ +export async function postRestCreateNotificationScheme( + /** Request body */ + data: CreateNotificationSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createNotificationScheme({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get projects using notification schemes paginated + * @request GET :/rest/api/3/notificationscheme/project + * @readonly + */ +export async function getRestGetNotificationSchemeToProjectMappings( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: string; + /** + * The maximum number of items to return per page. + */ + maxResults?: string; + /** + * The list of notifications scheme IDs to be filtered out + */ + notificationSchemeId?: string[]; + /** + * The list of project IDs to be filtered out + */ + projectId?: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getNotificationSchemeToProjectMappings({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get notification scheme + * @request GET :/rest/api/3/notificationscheme/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetNotificationScheme( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `all` Returns all expandable information + * `field` Returns information about any custom fields assigned to receive an event + * `group` Returns information about any groups assigned to receive an event + * `notificationSchemeEvents` Returns a list of event associations. This list is returned for all expandable information + * `projectRole` Returns information about any project roles assigned to receive an event + * `user` Returns information about any users assigned to receive an event +*/ + expand?: string; + }, + /** + * The ID of the notification scheme. Use [Get notification schemes paginated](#api-rest-api-3-notificationscheme-get) to get a list of notification scheme IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getNotificationScheme({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update notification scheme + * @request PUT :/rest/api/3/notificationscheme/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateNotificationScheme( + /** + * The ID of the notification scheme. + */ + id: string, + /** Request body */ + data: UpdateNotificationSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateNotificationScheme({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Add notifications to notification scheme + * @request PUT :/rest/api/3/notificationscheme/{id}/notification + * @allowrelaxedtypes + */ +export async function putRestAddNotifications( + /** + * The ID of the notification scheme. + */ + id: string, + /** Request body */ + data: AddNotificationsDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addNotifications({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete notification scheme + * @request DELETE :/rest/api/3/notificationscheme/{notificationSchemeId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteNotificationScheme( + /** + * The ID of the notification scheme. + */ + notificationSchemeId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteNotificationScheme({ + notificationSchemeId: notificationSchemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Remove notification from notification scheme + * @request DELETE :/rest/api/3/notificationscheme/{notificationSchemeId}/notification/{notificationId} + * @allowrelaxedtypes + */ +export async function deleteRestRemoveNotificationFromNotificationScheme( + /** + * The ID of the notification scheme. + */ + notificationSchemeId: string, + /** + * The ID of the notification. + */ + notificationId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeNotificationFromNotificationScheme({ + notificationSchemeId: notificationSchemeId, + notificationId: notificationId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all permissions + * @request GET :/rest/api/3/permissions + * @readonly + */ +export async function getRestGetAllPermissions( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllPermissions({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get bulk permissions + * @request POST :/rest/api/3/permissions/check + */ +export async function postRestGetBulkPermissions( + /** Request body */ + data: BulkPermissionsRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getBulkPermissions({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get permitted projects + * @request POST :/rest/api/3/permissions/project + */ +export async function postRestGetPermittedProjects( + /** Request body */ + data: PermissionsKeysBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPermittedProjects({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all permission schemes + * @request GET :/rest/api/3/permissionscheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllPermissionSchemes( + query: { + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are included when you specify any value. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `permissions` Returns all permission grants for each permission scheme. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllPermissionSchemes({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create permission scheme + * @request POST :/rest/api/3/permissionscheme + * @allowrelaxedtypes + */ +export async function postRestCreatePermissionScheme( + query: { + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are always included when you specify any value. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `permissions` Returns all permission grants for each permission scheme. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + /** Request body */ + data: PermissionScheme, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createPermissionScheme({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete permission scheme + * @request DELETE :/rest/api/3/permissionscheme/{schemeId} + * @allowrelaxedtypes + */ +export async function deleteRestDeletePermissionScheme( + /** + * The ID of the permission scheme being deleted. + */ + schemeId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deletePermissionScheme({ + schemeId: schemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get permission scheme + * @request GET :/rest/api/3/permissionscheme/{schemeId} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetPermissionScheme( + query: { + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are included when you specify any value. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `permissions` Returns all permission grants for each permission scheme. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + /** + * The ID of the permission scheme to return. + */ + schemeId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPermissionScheme({ + query: query, + schemeId: schemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update permission scheme + * @request PUT :/rest/api/3/permissionscheme/{schemeId} + * @allowrelaxedtypes + */ +export async function putRestUpdatePermissionScheme( + query: { + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are always included when you specify any value. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `permissions` Returns all permission grants for each permission scheme. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + /** + * The ID of the permission scheme to update. + */ + schemeId: number, + /** Request body */ + data: PermissionScheme, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updatePermissionScheme({ + query: query, + schemeId: schemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get permission scheme grants + * @request GET :/rest/api/3/permissionscheme/{schemeId}/permission + * @readonly + */ +export async function getRestGetPermissionSchemeGrants( + query: { + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are always included when you specify any value. Expand options include: + + * `permissions` Returns all permission grants for each permission scheme. + * `user` Returns information about the user who is granted the permission. + * `group` Returns information about the group that is granted the permission. + * `projectRole` Returns information about the project role granted the permission. + * `field` Returns information about the custom field granted the permission. + * `all` Returns all expandable information. +*/ + expand?: string; + }, + /** + * The ID of the permission scheme. + */ + schemeId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPermissionSchemeGrants({ + query: query, + schemeId: schemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create permission grant + * @request POST :/rest/api/3/permissionscheme/{schemeId}/permission + */ +export async function postRestCreatePermissionGrant( + query: { + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are always included when you specify any value. Expand options include: + + * `permissions` Returns all permission grants for each permission scheme. + * `user` Returns information about the user who is granted the permission. + * `group` Returns information about the group that is granted the permission. + * `projectRole` Returns information about the project role granted the permission. + * `field` Returns information about the custom field granted the permission. + * `all` Returns all expandable information. +*/ + expand?: string; + }, + /** + * The ID of the permission scheme in which to create a new permission grant. + */ + schemeId: number, + /** Request body */ + data: PermissionGrant, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createPermissionGrant({ + query: query, + schemeId: schemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete permission scheme grant + * @request DELETE :/rest/api/3/permissionscheme/{schemeId}/permission/{permissionId} + * @allowrelaxedtypes + */ +export async function deleteRestDeletePermissionSchemeEntity( + /** + * The ID of the permission scheme to delete the permission grant from. + */ + schemeId: number, + /** + * The ID of the permission grant to delete. + */ + permissionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deletePermissionSchemeEntity({ + schemeId: schemeId, + permissionId: permissionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get permission scheme grant + * @request GET :/rest/api/3/permissionscheme/{schemeId}/permission/{permissionId} + * @readonly + */ +export async function getRestGetPermissionSchemeGrant( + query: { + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are always included when you specify any value. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `permissions` Returns all permission grants for each permission scheme. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + /** + * The ID of the permission scheme. + */ + schemeId: number, + /** + * The ID of the permission grant. + */ + permissionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPermissionSchemeGrant({ + query: query, + schemeId: schemeId, + permissionId: permissionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get priorities + * @request GET :/rest/api/3/priority + * @readonly + */ +export async function getRestGetPriorities( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPriorities({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create priority + * @request POST :/rest/api/3/priority + * @allowrelaxedtypes + */ +export async function postRestCreatePriority( + /** Request body */ + data: CreatePriorityDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createPriority({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set default priority + * @request PUT :/rest/api/3/priority/default + * @allowrelaxedtypes + */ +export async function putRestSetDefaultPriority( + /** Request body */ + data: SetDefaultPriorityRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setDefaultPriority({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Move priorities + * @request PUT :/rest/api/3/priority/move + * @allowrelaxedtypes + */ +export async function putRestMovePriorities( + /** Request body */ + data: ReorderIssuePriorities, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.movePriorities({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Search priorities + * @request GET :/rest/api/3/priority/search + * @readonly + */ +export async function getRestSearchPriorities( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: string; + /** + * The maximum number of items to return per page. + */ + maxResults?: string; + /** + * The list of priority IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=2&id=3`. + */ + id?: string[]; + /** + * Whether only the default priority is returned. + */ + onlyDefault?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.searchPriorities({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete priority + * @request DELETE :/rest/api/3/priority/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeletePriority( + query: { + /** + * The ID of the issue priority that will replace the currently selected resolution. + */ + replaceWith: string; + }, + /** + * The ID of the issue priority. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deletePriority({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get priority + * @request GET :/rest/api/3/priority/{id} + * @readonly + */ +export async function getRestGetPriority( + /** + * The ID of the issue priority. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getPriority({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update priority + * @request PUT :/rest/api/3/priority/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdatePriority( + /** + * The ID of the issue priority. + */ + id: string, + /** Request body */ + data: UpdatePriorityDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updatePriority({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all projects + * @request GET :/rest/api/3/project + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllProjects( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expanded options include: + + * `description` Returns the project description. + * `issueTypes` Returns all issue types associated with the project. + * `lead` Returns information about the project lead. + * `projectKeys` Returns all project keys associated with the project. +*/ + expand?: string; + /** + * Returns the user's most recently accessed projects. You may specify the number of results to return up to a maximum of 20. If access is anonymous, then the recently accessed projects are based on the current HTTP session. + */ + recent?: number; + /** + * A list of project properties to return for the project. This parameter accepts a comma-separated list. + */ + properties?: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllProjects({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create project + * @request POST :/rest/api/3/project + * @allowrelaxedtypes + */ +export async function postRestCreateProject( + /** Request body */ + data: CreateProjectDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createProject({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get recent projects + * @request GET :/rest/api/3/project/recent + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetRecent( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expanded options include: + + * `description` Returns the project description. + * `projectKeys` Returns all project keys associated with a project. + * `lead` Returns information about the project lead. + * `issueTypes` Returns all issue types associated with the project. + * `url` Returns the URL associated with the project. + * `permissions` Returns the permissions associated with the project. + * `insight` EXPERIMENTAL. Returns the insight details of total issue count and last issue update time for the project. + * `*` Returns the project with all available expand options. +*/ + expand?: string; + /** + * EXPERIMENTAL. A list of project properties to return for the project. This parameter accepts a comma-separated list. Invalid property names are ignored. + */ + properties?: StringList[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getRecent({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get projects paginated + * @request GET :/rest/api/3/project/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestSearchProjects( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** +* [Order](#ordering) the results by a field. + + * `category` Sorts by project category. A complete list of category IDs is found using [Get all project categories](#api-rest-api-3-projectCategory-get). + * `issueCount` Sorts by the total number of issues in each project. + * `key` Sorts by project key. + * `lastIssueUpdatedTime` Sorts by the last issue update time. + * `name` Sorts by project name. + * `owner` Sorts by project lead. + * `archivedDate` EXPERIMENTAL. Sorts by project archived date. + * `deletedDate` EXPERIMENTAL. Sorts by project deleted date. +*/ + orderBy?: + | "category" + | "-category" + | "+category" + | "key" + | "-key" + | "+key" + | "name" + | "-name" + | "+name" + | "owner" + | "-owner" + | "+owner" + | "issueCount" + | "-issueCount" + | "+issueCount" + | "lastIssueUpdatedDate" + | "-lastIssueUpdatedDate" + | "+lastIssueUpdatedDate" + | "archivedDate" + | "+archivedDate" + | "-archivedDate" + | "deletedDate" + | "+deletedDate" + | "-deletedDate"; + /** + * The project IDs to filter the results by. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. Up to 50 project IDs can be provided. + */ + id?: number[]; + /** + * The project keys to filter the results by. To include multiple keys, provide an ampersand-separated list. For example, `keys=PA&keys=PB`. Up to 50 project keys can be provided. + */ + keys?: string[]; + /** + * Filter the results using a literal string. Projects with a matching `key` or `name` are returned (case insensitive). + */ + query?: string; + /** + * Orders results by the [project type](https://confluence.atlassian.com/x/GwiiLQ#Jiraapplicationsoverview-Productfeaturesandprojecttypes). This parameter accepts a comma-separated list. Valid values are `business`, `service_desk`, and `software`. + */ + typeKey?: string; + /** + * The ID of the project's category. A complete list of category IDs is found using the [Get all project categories](#api-rest-api-3-projectCategory-get) operation. + */ + categoryId?: number; + /** +* Filter results by projects for which the user can: + + * `view` the project, meaning that they have one of the following permissions: + + * *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). + * `browse` the project, meaning that they have the *Browse projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * `edit` the project, meaning that they have one of the following permissions: + + * *Administer projects* [project permission](https://confluence.atlassian.com/x/yodKLg) for the project. + * *Administer Jira* [global permission](https://confluence.atlassian.com/x/x4dKLg). +*/ + action?: "view" | "browse" | "edit"; + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expanded options include: + + * `description` Returns the project description. + * `projectKeys` Returns all project keys associated with a project. + * `lead` Returns information about the project lead. + * `issueTypes` Returns all issue types associated with the project. + * `url` Returns the URL associated with the project. + * `insight` EXPERIMENTAL. Returns the insight details of total issue count and last issue update time for the project. +*/ + expand?: string; + /** +* EXPERIMENTAL. Filter results by project status: + + * `live` Search live projects. + * `archived` Search archived projects. + * `deleted` Search deleted projects, those in the recycle bin. +*/ + status?: ("live" | "archived" | "deleted")[]; + /** + * EXPERIMENTAL. A list of project properties to return for the project. This parameter accepts a comma-separated list. + */ + properties?: StringList[]; + /** + * EXPERIMENTAL. A query string used to search properties. The query string cannot be specified using a JSON object. For example, to search for the value of `nested` from `{"something":{"nested":1,"other":2}}` use `[thepropertykey].something.nested=1`. Note that the propertyQuery key is enclosed in square brackets to enable searching where the propertyQuery key includes dot (.) or equals (=) characters. Note that `thepropertykey` is only returned when included in `properties`. + */ + propertyQuery?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.searchProjects({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all project types + * @request GET :/rest/api/3/project/type + * @readonly + */ +export async function getRestGetAllProjectTypes( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllProjectTypes({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get licensed project types + * @request GET :/rest/api/3/project/type/accessible + * @readonly + */ +export async function getRestGetAllAccessibleProjectTypes( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllAccessibleProjectTypes({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project type by key + * @request GET :/rest/api/3/project/type/{projectTypeKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectTypeByKey( + /** + * The key of the project type. + */ + projectTypeKey: + | "software" + | "service_desk" + | "business" + | "product_discovery", + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectTypeByKey({ + projectTypeKey: projectTypeKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get accessible project type by key + * @request GET :/rest/api/3/project/type/{projectTypeKey}/accessible + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAccessibleProjectTypeByKey( + /** + * The key of the project type. + */ + projectTypeKey: + | "software" + | "service_desk" + | "business" + | "product_discovery", + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAccessibleProjectTypeByKey({ + projectTypeKey: projectTypeKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete project + * @request DELETE :/rest/api/3/project/{projectIdOrKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteProject( + query: { + /** + * Whether this project is placed in the Jira recycle bin where it will be available for restoration. + */ + enableUndo?: boolean; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteProject({ + query: query, + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get project + * @request GET :/rest/api/3/project/{projectIdOrKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProject( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Note that the project description, issue types, and project lead are included in all responses by default. Expand options include: + + * `description` The project description. + * `issueTypes` The issue types associated with the project. + * `lead` The project lead. + * `projectKeys` All project keys associated with the project. + * `issueTypeHierarchy` The project issue type hierarchy. +*/ + expand?: string; + /** + * A list of project properties to return for the project. This parameter accepts a comma-separated list. + */ + properties?: string[]; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProject({ + query: query, + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update project + * @request PUT :/rest/api/3/project/{projectIdOrKey} + * @allowrelaxedtypes + */ +export async function putRestUpdateProject( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Note that the project description, issue types, and project lead are included in all responses by default. Expand options include: + + * `description` The project description. + * `issueTypes` The issue types associated with the project. + * `lead` The project lead. + * `projectKeys` All project keys associated with the project. +*/ + expand?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** Request body */ + data: UpdateProjectDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateProject({ + query: query, + projectIdOrKey: projectIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Archive project + * @request POST :/rest/api/3/project/{projectIdOrKey}/archive + * @allowrelaxedtypes + */ +export async function postRestArchiveProject( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.archiveProject({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Set project avatar + * @request PUT :/rest/api/3/project/{projectIdOrKey}/avatar + * @allowrelaxedtypes + */ +export async function putRestUpdateProjectAvatar( + /** + * The ID or (case-sensitive) key of the project. + */ + projectIdOrKey: string, + /** Request body */ + data: Avatar, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateProjectAvatar({ + projectIdOrKey: projectIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete project avatar + * @request DELETE :/rest/api/3/project/{projectIdOrKey}/avatar/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteProjectAvatar( + /** + * The project ID or (case-sensitive) key. + */ + projectIdOrKey: string, + /** + * The ID of the avatar. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteProjectAvatar({ + projectIdOrKey: projectIdOrKey, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Load project avatar + * @request POST :/rest/api/3/project/{projectIdOrKey}/avatar2 + */ +export async function postRestCreateProjectAvatar( + query: { + /** + * The X coordinate of the top-left corner of the crop region. + */ + x?: number; + /** + * The Y coordinate of the top-left corner of the crop region. + */ + y?: number; + /** + * The length of each side of the crop region. + */ + size?: number; + }, + /** + * The ID or (case-sensitive) key of the project. + */ + projectIdOrKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createProjectAvatar({ + query: query, + projectIdOrKey: projectIdOrKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all project avatars + * @request GET :/rest/api/3/project/{projectIdOrKey}/avatars + * @readonly + */ +export async function getRestGetAllProjectAvatars( + /** + * The ID or (case-sensitive) key of the project. + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllProjectAvatars({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project components paginated + * @request GET :/rest/api/3/project/{projectIdOrKey}/component + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectComponentsPaginated( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** +* [Order](#ordering) the results by a field: + + * `description` Sorts by the component description. + * `issueCount` Sorts by the count of issues associated with the component. + * `lead` Sorts by the user key of the component's project lead. + * `name` Sorts by component name. +*/ + orderBy?: + | "description" + | "-description" + | "+description" + | "issueCount" + | "-issueCount" + | "+issueCount" + | "lead" + | "-lead" + | "+lead" + | "name" + | "-name" + | "+name"; + /** + * Filter the results using a literal string. Components with a matching `name` or `description` are returned (case insensitive). + */ + query?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectComponentsPaginated({ + query: query, + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project components + * @request GET :/rest/api/3/project/{projectIdOrKey}/components + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectComponents( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectComponents({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete project asynchronously + * @request POST :/rest/api/3/project/{projectIdOrKey}/delete + * @allowrelaxedtypes + */ +export async function postRestDeleteProjectAsynchronously( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteProjectAsynchronously({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get project features + * @request GET :/rest/api/3/project/{projectIdOrKey}/features + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetFeaturesForProject( + /** + * The ID or (case-sensitive) key of the project. + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFeaturesForProject({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set project feature state + * @request PUT :/rest/api/3/project/{projectIdOrKey}/features/{featureKey} + * @allowrelaxedtypes + */ +export async function putRestToggleFeatureForProject( + /** + * The ID or (case-sensitive) key of the project. + */ + projectIdOrKey: string, + /** + * The key of the feature. + */ + featureKey: string, + /** Request body */ + data: ProjectFeatureState, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.toggleFeatureForProject({ + projectIdOrKey: projectIdOrKey, + featureKey: featureKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project property keys + * @request GET :/rest/api/3/project/{projectIdOrKey}/properties + * @readonly + */ +export async function getRestGetProjectPropertyKeys( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectPropertyKeys({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete project property + * @request DELETE :/rest/api/3/project/{projectIdOrKey}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteProjectProperty( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The project property key. Use [Get project property keys](#api-rest-api-3-project-projectIdOrKey-properties-get) to get a list of all project property keys. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteProjectProperty({ + projectIdOrKey: projectIdOrKey, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get project property + * @request GET :/rest/api/3/project/{projectIdOrKey}/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectProperty( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The project property key. Use [Get project property keys](#api-rest-api-3-project-projectIdOrKey-properties-get) to get a list of all project property keys. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectProperty({ + projectIdOrKey: projectIdOrKey, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set project property + * @request PUT :/rest/api/3/project/{projectIdOrKey}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestSetProjectProperty( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The key of the project property. The maximum length is 255 characters. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setProjectProperty({ + projectIdOrKey: projectIdOrKey, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Restore deleted or archived project + * @request POST :/rest/api/3/project/{projectIdOrKey}/restore + * @allowrelaxedtypes + */ +export async function postRestRestore( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.restore({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project roles for project + * @request GET :/rest/api/3/project/{projectIdOrKey}/role + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectRoles( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectRoles({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete actors from project role + * @request DELETE :/rest/api/3/project/{projectIdOrKey}/role/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteActor( + query: { + /** + * The user account ID of the user to remove from the project role. + */ + user?: string; + /** + * The name of the group to remove from the project role. This parameter cannot be used with the `groupId` parameter. As a group's name can change, use of `groupId` is recommended. + */ + group?: string; + /** + * The ID of the group to remove from the project role. This parameter cannot be used with the `group` parameter. + */ + groupId?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteActor({ + query: query, + projectIdOrKey: projectIdOrKey, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get project role for project + * @request GET :/rest/api/3/project/{projectIdOrKey}/role/{id} + * @readonly + */ +export async function getRestGetProjectRole( + query: { + /** + * Exclude inactive users. + */ + excludeInactiveUsers?: boolean; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectRole({ + query: query, + projectIdOrKey: projectIdOrKey, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add actors to project role + * @request POST :/rest/api/3/project/{projectIdOrKey}/role/{id} + */ +export async function postRestAddActorUsers( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + /** Request body */ + data: ActorsMap, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addActorUsers({ + projectIdOrKey: projectIdOrKey, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set actors for project role + * @request PUT :/rest/api/3/project/{projectIdOrKey}/role/{id} + */ +export async function putRestSetActors( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + /** Request body */ + data: ProjectRoleActorsUpdateBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setActors({ + projectIdOrKey: projectIdOrKey, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project role details + * @request GET :/rest/api/3/project/{projectIdOrKey}/roledetails + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectRoleDetails( + query: { + /** + * Whether the roles should be filtered to include only those the user is assigned to. + */ + currentMember?: boolean; + excludeConnectAddons?: boolean; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectRoleDetails({ + query: query, + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all statuses for project + * @request GET :/rest/api/3/project/{projectIdOrKey}/statuses + * @readonly + */ +export async function getRestGetAllStatuses( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllStatuses({ + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update project type + * @request PUT :/rest/api/3/project/{projectIdOrKey}/type/{newProjectTypeKey} + * @allowrelaxedtypes + */ +export async function putRestUpdateProjectType( + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + /** + * The key of the new project type. + */ + newProjectTypeKey: "software" | "service_desk" | "business", + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateProjectType({ + projectIdOrKey: projectIdOrKey, + newProjectTypeKey: newProjectTypeKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project versions paginated + * @request GET :/rest/api/3/project/{projectIdOrKey}/version + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetProjectVersionsPaginated( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** +* [Order](#ordering) the results by a field: + + * `description` Sorts by version description. + * `name` Sorts by version name. + * `releaseDate` Sorts by release date, starting with the oldest date. Versions with no release date are listed last. + * `sequence` Sorts by the order of appearance in the user interface. + * `startDate` Sorts by start date, starting with the oldest date. Versions with no start date are listed last. +*/ + orderBy?: + | "description" + | "-description" + | "+description" + | "name" + | "-name" + | "+name" + | "releaseDate" + | "-releaseDate" + | "+releaseDate" + | "sequence" + | "-sequence" + | "+sequence" + | "startDate" + | "-startDate" + | "+startDate"; + /** + * Filter the results using a literal string. Versions with matching `name` or `description` are returned (case insensitive). + */ + query?: string; + /** + * A list of status values used to filter the results by version status. This parameter accepts a comma-separated list. The status values are `released`, `unreleased`, and `archived`. + */ + status?: string; + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `issuesstatus` Returns the number of issues in each status category for each version. + * `operations` Returns actions that can be performed on the specified version. +*/ + expand?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectVersionsPaginated({ + query: query, + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project versions + * @request GET :/rest/api/3/project/{projectIdOrKey}/versions + * @readonly + */ +export async function getRestGetProjectVersions( + query: { + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts `operations`, which returns actions that can be performed on the version. + */ + expand?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectIdOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectVersions({ + query: query, + projectIdOrKey: projectIdOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project's sender email + * @request GET :/rest/api/3/project/{projectId}/email + * @readonly + */ +export async function getRestGetProjectEmail( + /** + * The project ID. + */ + projectId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectEmail({ + projectId: projectId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set project's sender email + * @request PUT :/rest/api/3/project/{projectId}/email + * @allowrelaxedtypes + */ +export async function putRestUpdateProjectEmail( + /** + * The project ID. + */ + projectId: number, + /** Request body */ + data: ProjectEmailAddress, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateProjectEmail({ + projectId: projectId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get project issue type hierarchy + * @request GET :/rest/api/3/project/{projectId}/hierarchy + * @readonly + */ +export async function getRestGetHierarchy( + /** + * The ID of the project. + */ + projectId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getHierarchy({ + projectId: projectId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project issue security scheme + * @request GET :/rest/api/3/project/{projectKeyOrId}/issuesecuritylevelscheme + * @readonly + */ +export async function getRestGetProjectIssueSecurityScheme( + /** + * The project ID or project key (case sensitive). + */ + projectKeyOrId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectIssueSecurityScheme({ + projectKeyOrId: projectKeyOrId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project notification scheme + * @request GET :/rest/api/3/project/{projectKeyOrId}/notificationscheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetNotificationSchemeForProject( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `all` Returns all expandable information + * `field` Returns information about any custom fields assigned to receive an event + * `group` Returns information about any groups assigned to receive an event + * `notificationSchemeEvents` Returns a list of event associations. This list is returned for all expandable information + * `projectRole` Returns information about any project roles assigned to receive an event + * `user` Returns information about any users assigned to receive an event +*/ + expand?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectKeyOrId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getNotificationSchemeForProject({ + query: query, + projectKeyOrId: projectKeyOrId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get assigned permission scheme + * @request GET :/rest/api/3/project/{projectKeyOrId}/permissionscheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAssignedPermissionScheme( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are included when you specify any value. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `permissions` Returns all permission grants for each permission scheme. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectKeyOrId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAssignedPermissionScheme({ + query: query, + projectKeyOrId: projectKeyOrId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Assign permission scheme + * @request PUT :/rest/api/3/project/{projectKeyOrId}/permissionscheme + * @allowrelaxedtypes + */ +export async function putRestAssignPermissionScheme( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Note that permissions are included when you specify any value. Expand options include: + + * `all` Returns all expandable information. + * `field` Returns information about the custom field granted the permission. + * `group` Returns information about the group that is granted the permission. + * `permissions` Returns all permission grants for each permission scheme. + * `projectRole` Returns information about the project role granted the permission. + * `user` Returns information about the user who is granted the permission. +*/ + expand?: string; + }, + /** + * The project ID or project key (case sensitive). + */ + projectKeyOrId: string, + /** Request body */ + data: IdBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.assignPermissionScheme({ + query: query, + projectKeyOrId: projectKeyOrId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get project issue security levels + * @request GET :/rest/api/3/project/{projectKeyOrId}/securitylevel + * @readonly + */ +export async function getRestGetSecurityLevelsForProject( + /** + * The project ID or project key (case sensitive). + */ + projectKeyOrId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getSecurityLevelsForProject({ + projectKeyOrId: projectKeyOrId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all project categories + * @request GET :/rest/api/3/projectCategory + * @readonly + */ +export async function getRestGetAllProjectCategories( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllProjectCategories({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create project category + * @request POST :/rest/api/3/projectCategory + */ +export async function postRestCreateProjectCategory( + /** Request body */ + data: ProjectCategory, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createProjectCategory({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete project category + * @request DELETE :/rest/api/3/projectCategory/{id} + * @allowrelaxedtypes + */ +export async function deleteRestRemoveProjectCategory( + /** + * ID of the project category to delete. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeProjectCategory({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get project category by ID + * @request GET :/rest/api/3/projectCategory/{id} + * @readonly + */ +export async function getRestGetProjectCategoryById( + /** + * The ID of the project category. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectCategoryById({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update project category + * @request PUT :/rest/api/3/projectCategory/{id} + */ +export async function putRestUpdateProjectCategory( + id: number, + /** Request body */ + data: ProjectCategory, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateProjectCategory({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Validate project key + * @request GET :/rest/api/3/projectvalidate/key + * @readonly + */ +export async function getRestValidateProjectKey( + query: { + /** + * The project key. + */ + key?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.validateProjectKey({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get valid project key + * @request GET :/rest/api/3/projectvalidate/validProjectKey + * @readonly + */ +export async function getRestGetValidProjectKey( + query: { + /** + * The project key. + */ + key?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getValidProjectKey({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get valid project name + * @request GET :/rest/api/3/projectvalidate/validProjectName + * @readonly + */ +export async function getRestGetValidProjectName( + query: { + /** + * The project name. + */ + name: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getValidProjectName({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get resolutions + * @request GET :/rest/api/3/resolution + * @readonly + */ +export async function getRestGetResolutions( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getResolutions({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create resolution + * @request POST :/rest/api/3/resolution + */ +export async function postRestCreateResolution( + /** Request body */ + data: CreateResolutionDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createResolution({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set default resolution + * @request PUT :/rest/api/3/resolution/default + * @allowrelaxedtypes + */ +export async function putRestSetDefaultResolution( + /** Request body */ + data: SetDefaultResolutionRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setDefaultResolution({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Move resolutions + * @request PUT :/rest/api/3/resolution/move + * @allowrelaxedtypes + */ +export async function putRestMoveResolutions( + /** Request body */ + data: ReorderIssueResolutionsRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.moveResolutions({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Search resolutions + * @request GET :/rest/api/3/resolution/search + * @readonly + */ +export async function getRestSearchResolutions( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: string; + /** + * The maximum number of items to return per page. + */ + maxResults?: string; + /** + * The list of resolutions IDs to be filtered out + */ + id?: string[]; + /** + * When set to true, return default only, when IDs provided, if none of them is default, return empty page. Default value is false + */ + onlyDefault?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.searchResolutions({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete resolution + * @request DELETE :/rest/api/3/resolution/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteResolution( + query: { + /** + * The ID of the issue resolution that will replace the currently selected resolution. + */ + replaceWith: string; + }, + /** + * The ID of the issue resolution. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteResolution({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get resolution + * @request GET :/rest/api/3/resolution/{id} + * @readonly + */ +export async function getRestGetResolution( + /** + * The ID of the issue resolution value. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getResolution({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update resolution + * @request PUT :/rest/api/3/resolution/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateResolution( + /** + * The ID of the issue resolution. + */ + id: string, + /** Request body */ + data: UpdateResolutionDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateResolution({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all project roles + * @request GET :/rest/api/3/role + * @readonly + */ +export async function getRestGetAllProjectRoles( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllProjectRoles({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create project role + * @request POST :/rest/api/3/role + */ +export async function postRestCreateProjectRole( + /** Request body */ + data: CreateUpdateRoleRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createProjectRole({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete project role + * @request DELETE :/rest/api/3/role/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteProjectRole( + query: { + /** + * The ID of the project role that will replace the one being deleted. + */ + swap?: number; + }, + /** + * The ID of the project role to delete. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteProjectRole({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get project role by ID + * @request GET :/rest/api/3/role/{id} + * @readonly + */ +export async function getRestGetProjectRoleById( + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectRoleById({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Partial update project role + * @request POST :/rest/api/3/role/{id} + */ +export async function postRestPartialUpdateProjectRole( + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + /** Request body */ + data: CreateUpdateRoleRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.partialUpdateProjectRole({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Fully update project role + * @request PUT :/rest/api/3/role/{id} + */ +export async function putRestFullyUpdateProjectRole( + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + /** Request body */ + data: CreateUpdateRoleRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.fullyUpdateProjectRole({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete default actors from project role + * @request DELETE :/rest/api/3/role/{id}/actors + */ +export async function deleteRestDeleteProjectRoleActorsFromRole( + query: { + /** + * The user account ID of the user to remove as a default actor. + */ + user?: string; + /** + * The group ID of the group to be removed as a default actor. This parameter cannot be used with the `group` parameter. + */ + groupId?: string; + /** + * The group name of the group to be removed as a default actor.This parameter cannot be used with the `groupId` parameter. As a group's name can change, use of `groupId` is recommended. + */ + group?: string; + }, + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteProjectRoleActorsFromRole({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get default actors for project role + * @request GET :/rest/api/3/role/{id}/actors + * @readonly + */ +export async function getRestGetProjectRoleActorsForRole( + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getProjectRoleActorsForRole({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add default actors to project role + * @request POST :/rest/api/3/role/{id}/actors + */ +export async function postRestAddProjectRoleActorsToRole( + /** + * The ID of the project role. Use [Get all project roles](#api-rest-api-3-role-get) to get a list of project role IDs. + */ + id: number, + /** Request body */ + data: ActorInputBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addProjectRoleActorsToRole({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get screens + * @request GET :/rest/api/3/screens + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetScreens( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of screen IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + */ + id?: number[]; + /** + * String used to perform a case-insensitive partial match with screen name. + */ + queryString?: string; + /** + * The scope filter string. To filter by multiple scope, provide an ampersand-separated list. For example, `scope=GLOBAL&scope=PROJECT`. + */ + scope?: ("GLOBAL" | "TEMPLATE" | "PROJECT")[]; + /** +* [Order](#ordering) the results by a field: + + * `id` Sorts by screen ID. + * `name` Sorts by screen name. +*/ + orderBy?: "name" | "-name" | "+name" | "id" | "-id" | "+id"; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getScreens({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create screen + * @request POST :/rest/api/3/screens + * @allowrelaxedtypes + */ +export async function postRestCreateScreen( + /** Request body */ + data: ScreenDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createScreen({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add field to default screen + * @request POST :/rest/api/3/screens/addToDefault/{fieldId} + * @allowrelaxedtypes + */ +export async function postRestAddFieldToDefaultScreen( + /** + * The ID of the field. + */ + fieldId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addFieldToDefaultScreen({ + fieldId: fieldId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete screen + * @request DELETE :/rest/api/3/screens/{screenId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteScreen( + /** + * The ID of the screen. + */ + screenId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteScreen({ + screenId: screenId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Update screen + * @request PUT :/rest/api/3/screens/{screenId} + * @allowrelaxedtypes + */ +export async function putRestUpdateScreen( + /** + * The ID of the screen. + */ + screenId: number, + /** Request body */ + data: UpdateScreenDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateScreen({ + screenId: screenId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get available screen fields + * @request GET :/rest/api/3/screens/{screenId}/availableFields + * @readonly + */ +export async function getRestGetAvailableScreenFields( + /** + * The ID of the screen. + */ + screenId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAvailableScreenFields({ + screenId: screenId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all screen tabs + * @request GET :/rest/api/3/screens/{screenId}/tabs + * @readonly + */ +export async function getRestGetAllScreenTabs( + query: { + /** + * The key of the project. + */ + projectKey?: string; + }, + /** + * The ID of the screen. + */ + screenId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllScreenTabs({ + query: query, + screenId: screenId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create screen tab + * @request POST :/rest/api/3/screens/{screenId}/tabs + */ +export async function postRestAddScreenTab( + /** + * The ID of the screen. + */ + screenId: number, + /** Request body */ + data: ScreenableTab, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addScreenTab({ + screenId: screenId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete screen tab + * @request DELETE :/rest/api/3/screens/{screenId}/tabs/{tabId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteScreenTab( + /** + * The ID of the screen. + */ + screenId: number, + /** + * The ID of the screen tab. + */ + tabId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteScreenTab({ + screenId: screenId, + tabId: tabId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Update screen tab + * @request PUT :/rest/api/3/screens/{screenId}/tabs/{tabId} + */ +export async function putRestRenameScreenTab( + /** + * The ID of the screen. + */ + screenId: number, + /** + * The ID of the screen tab. + */ + tabId: number, + /** Request body */ + data: ScreenableTab, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.renameScreenTab({ + screenId: screenId, + tabId: tabId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all screen tab fields + * @request GET :/rest/api/3/screens/{screenId}/tabs/{tabId}/fields + * @readonly + */ +export async function getRestGetAllScreenTabFields( + query: { + /** + * The key of the project. + */ + projectKey?: string; + }, + /** + * The ID of the screen. + */ + screenId: number, + /** + * The ID of the screen tab. + */ + tabId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllScreenTabFields({ + query: query, + screenId: screenId, + tabId: tabId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Add screen tab field + * @request POST :/rest/api/3/screens/{screenId}/tabs/{tabId}/fields + */ +export async function postRestAddScreenTabField( + /** + * The ID of the screen. + */ + screenId: number, + /** + * The ID of the screen tab. + */ + tabId: number, + /** Request body */ + data: AddFieldBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addScreenTabField({ + screenId: screenId, + tabId: tabId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Remove screen tab field + * @request DELETE :/rest/api/3/screens/{screenId}/tabs/{tabId}/fields/{id} + * @allowrelaxedtypes + */ +export async function deleteRestRemoveScreenTabField( + /** + * The ID of the screen. + */ + screenId: number, + /** + * The ID of the screen tab. + */ + tabId: number, + /** + * The ID of the field. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeScreenTabField({ + screenId: screenId, + tabId: tabId, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Move screen tab field + * @request POST :/rest/api/3/screens/{screenId}/tabs/{tabId}/fields/{id}/move + * @allowrelaxedtypes + */ +export async function postRestMoveScreenTabField( + /** + * The ID of the screen. + */ + screenId: number, + /** + * The ID of the screen tab. + */ + tabId: number, + /** + * The ID of the field. + */ + id: string, + /** Request body */ + data: MoveFieldBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.moveScreenTabField({ + screenId: screenId, + tabId: tabId, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Move screen tab + * @request POST :/rest/api/3/screens/{screenId}/tabs/{tabId}/move/{pos} + * @allowrelaxedtypes + */ +export async function postRestMoveScreenTab( + /** + * The ID of the screen. + */ + screenId: number, + /** + * The ID of the screen tab. + */ + tabId: number, + /** + * The position of tab. The base index is 0. + */ + pos: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.moveScreenTab({ + screenId: screenId, + tabId: tabId, + pos: pos, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get screen schemes + * @request GET :/rest/api/3/screenscheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetScreenSchemes( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The list of screen scheme IDs. To include multiple IDs, provide an ampersand-separated list. For example, `id=10000&id=10001`. + */ + id?: number[]; + /** + * Use [expand](#expansion) include additional information in the response. This parameter accepts `issueTypeScreenSchemes` that, for each screen schemes, returns information about the issue type screen scheme the screen scheme is assigned to. + */ + expand?: string; + /** + * String used to perform a case-insensitive partial match with screen scheme name. + */ + queryString?: string; + /** +* [Order](#ordering) the results by a field: + + * `id` Sorts by screen scheme ID. + * `name` Sorts by screen scheme name. +*/ + orderBy?: "name" | "-name" | "+name" | "id" | "-id" | "+id"; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getScreenSchemes({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create screen scheme + * @request POST :/rest/api/3/screenscheme + */ +export async function postRestCreateScreenScheme( + /** Request body */ + data: ScreenSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createScreenScheme({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete screen scheme + * @request DELETE :/rest/api/3/screenscheme/{screenSchemeId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteScreenScheme( + /** + * The ID of the screen scheme. + */ + screenSchemeId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteScreenScheme({ + screenSchemeId: screenSchemeId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Update screen scheme + * @request PUT :/rest/api/3/screenscheme/{screenSchemeId} + * @allowrelaxedtypes + */ +export async function putRestUpdateScreenScheme( + /** + * The ID of the screen scheme. + */ + screenSchemeId: string, + /** Request body */ + data: UpdateScreenSchemeDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateScreenScheme({ + screenSchemeId: screenSchemeId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Search for issues using JQL (GET) + * @request GET :/rest/api/3/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestSearchForIssuesUsingJql( + query: { + /** +* The [JQL](https://confluence.atlassian.com/x/egORLQ) that defines the search. Note: + + * If no JQL expression is provided, all issues are returned. + * `username` and `userkey` cannot be used as search terms due to privacy reasons. Use `accountId` instead. + * If a user has hidden their email address in their user profile, partial matches of the email address will not find the user. An exact match is required. +*/ + jql?: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. To manage page size, Jira may return fewer items per page where a large number of fields are requested. The greatest number of items returned per page is achieved when requesting `id` or `key` only. + */ + maxResults?: number; + /** +* Determines how to validate the JQL query and treat the validation results. Supported values are: + + * `strict` Returns a 400 response code if any errors are found, along with a list of all errors (and warnings). + * `warn` Returns all errors as warnings. + * `none` No validation is performed. + * `true` *Deprecated* A legacy synonym for `strict`. + * `false` *Deprecated* A legacy synonym for `warn`. + +Note: If the JQL is not correctly formed a 400 response code is returned, regardless of the `validateQuery` value. +*/ + validateQuery?: "strict" | "warn" | "none" | "true" | "false"; + /** +* A list of fields to return for each issue, use it to retrieve a subset of fields. This parameter accepts a comma-separated list. Expand options include: + + * `*all` Returns all fields. + * `*navigable` Returns navigable fields. + * Any issue field, prefixed with a minus to exclude. + +Examples: + + * `summary,comment` Returns only the summary and comments fields. + * `-description` Returns all navigable (default) fields except description. + * `*all,-comment` Returns all fields except comments. + +This parameter may be specified multiple times. For example, `fields=field1,field2&fields=field3`. + +Note: All navigable fields are returned by default. This differs from [GET issue](#api-rest-api-3-issue-issueIdOrKey-get) where the default is all fields. +*/ + fields?: string[]; + /** +* Use [expand](#expansion) to include additional information about issues in the response. This parameter accepts a comma-separated list. Expand options include: + + * `renderedFields` Returns field values rendered in HTML format. + * `names` Returns the display name of each field. + * `schema` Returns the schema describing a field type. + * `transitions` Returns all possible transitions for the issue. + * `operations` Returns all possible operations for the issue. + * `editmeta` Returns information about how each field can be edited. + * `changelog` Returns a list of recent updates to an issue, sorted by date, starting from the most recent. + * `versionedRepresentations` Instead of `fields`, returns `versionedRepresentations` a JSON array containing each version of a field's value, with the highest numbered item representing the most recent version. +*/ + expand?: string; + /** + * A list of issue property keys for issue properties to include in the results. This parameter accepts a comma-separated list. Multiple properties can also be provided using an ampersand separated list. For example, `properties=prop1,prop2&properties=prop3`. A maximum of 5 issue property keys can be specified. + */ + properties?: string[]; + /** + * Reference fields by their key (rather than ID). + */ + fieldsByKeys?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.searchForIssuesUsingJql({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Search for issues using JQL (POST) + * @request POST :/rest/api/3/search + * @allowrelaxedtypes + */ +export async function postRestSearchForIssuesUsingJqlPost( + /** Request body */ + data: SearchRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.searchForIssuesUsingJqlPost({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue security level + * @request GET :/rest/api/3/securitylevel/{id} + * @readonly + */ +export async function getRestGetIssueSecurityLevel( + /** + * The ID of the issue security level. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueSecurityLevel({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get Jira instance info + * @request GET :/rest/api/3/serverInfo + * @readonly + */ +export async function getRestGetServerInfo( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getServerInfo({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get issue navigator default columns + * @request GET :/rest/api/3/settings/columns + * @readonly + */ +export async function getRestGetIssueNavigatorDefaultColumns( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIssueNavigatorDefaultColumns({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set issue navigator default columns + * @request PUT :/rest/api/3/settings/columns + * @allowrelaxedtypes + */ +export async function putRestSetIssueNavigatorDefaultColumns( + /** Request body */ + data: string[], + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setIssueNavigatorDefaultColumns({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get all statuses + * @request GET :/rest/api/3/status + * @readonly + */ +export async function getRestGetStatuses( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getStatuses({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get status + * @request GET :/rest/api/3/status/{idOrName} + * @readonly + */ +export async function getRestGetStatus( + /** + * The ID or name of the status. + */ + idOrName: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getStatus({ + idOrName: idOrName, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all status categories + * @request GET :/rest/api/3/statuscategory + * @readonly + */ +export async function getRestGetStatusCategories( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getStatusCategories({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get status category + * @request GET :/rest/api/3/statuscategory/{idOrKey} + * @readonly + */ +export async function getRestGetStatusCategory( + /** + * The ID or key of the status category. + */ + idOrKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getStatusCategory({ + idOrKey: idOrKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Bulk delete Statuses + * @request DELETE :/rest/api/3/statuses + * @allowrelaxedtypes + */ +export async function deleteRestDeleteStatusesById( + query: { + /** +* The list of status IDs. To include multiple IDs, provide an ampersand-separated list. For example, id=10000&id=10001. + +Min items `1`, Max items `50` +*/ + id?: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteStatusesById({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Bulk get statuses + * @request GET :/rest/api/3/statuses + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetStatusesById( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `usages` Returns the project and issue types that use the status in their workflow. +*/ + expand?: string; + /** +* The list of status IDs. To include multiple IDs, provide an ampersand-separated list. For example, id=10000&id=10001. + +Min items `1`, Max items `50` +*/ + id?: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getStatusesById({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Bulk create statuses + * @request POST :/rest/api/3/statuses + * @allowrelaxedtypes + */ +export async function postRestCreateStatuses( + /** Request body */ + data: StatusCreateRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createStatuses({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Bulk update statuses + * @request PUT :/rest/api/3/statuses + * @allowrelaxedtypes + */ +export async function putRestUpdateStatuses( + /** Request body */ + data: StatusUpdateRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateStatuses({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Search statuses paginated + * @request GET :/rest/api/3/statuses/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestSearch( + query: { + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `usages` Returns the project and issue types that use the status in their workflow. +*/ + expand?: string; + /** + * The project the status is part of or null for global statuses. + */ + projectId?: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * Term to match status names against or null to search for all statuses in the search scope. + */ + searchString?: string; + /** + * Category of the status to filter by. The supported values are: `TODO`, `IN_PROGRESS`, and `DONE`. + */ + statusCategory?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.search({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get task + * @request GET :/rest/api/3/task/{taskId} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetTask( + /** + * The ID of the task. + */ + taskId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getTask({ + taskId: taskId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Cancel task + * @request POST :/rest/api/3/task/{taskId}/cancel + * @allowrelaxedtypes + */ +export async function postRestCancelTask( + /** + * The ID of the task. + */ + taskId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.cancelTask({ + taskId: taskId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get UI modifications + * @request GET :/rest/api/3/uiModifications + * @readonly + */ +export async function getRestGetUiModifications( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** +* Use expand to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `data` Returns UI modification data. + * `contexts` Returns UI modification contexts. +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUiModifications({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create UI modification + * @request POST :/rest/api/3/uiModifications + */ +export async function postRestCreateUiModification( + /** Request body */ + data: CreateUiModificationDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createUiModification({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete UI modification + * @request DELETE :/rest/api/3/uiModifications/{uiModificationId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteUiModification( + /** + * The ID of the UI modification. + */ + uiModificationId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteUiModification({ + uiModificationId: uiModificationId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Update UI modification + * @request PUT :/rest/api/3/uiModifications/{uiModificationId} + * @allowrelaxedtypes + */ +export async function putRestUpdateUiModification( + /** + * The ID of the UI modification. + */ + uiModificationId: string, + /** Request body */ + data: UpdateUiModificationDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateUiModification({ + uiModificationId: uiModificationId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get avatars + * @request GET :/rest/api/3/universal_avatar/type/{type}/owner/{entityId} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAvatars( + /** + * The avatar type. + */ + type: "project" | "issuetype", + /** + * The ID of the item the avatar is associated with. + */ + entityId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAvatars({ + type: type, + entityId: entityId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Load avatar + * @request POST :/rest/api/3/universal_avatar/type/{type}/owner/{entityId} + * @allowrelaxedtypes + */ +export async function postRestStoreAvatar( + query: { + /** + * The X coordinate of the top-left corner of the crop region. + */ + x?: number; + /** + * The Y coordinate of the top-left corner of the crop region. + */ + y?: number; + /** + * The length of each side of the crop region. + */ + size: number; + }, + /** + * The avatar type. + */ + type: "project" | "issuetype", + /** + * The ID of the item the avatar is associated with. + */ + entityId: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.storeAvatar({ + query: query, + type: type, + entityId: entityId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete avatar + * @request DELETE :/rest/api/3/universal_avatar/type/{type}/owner/{owningObjectId}/avatar/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteAvatar( + /** + * The avatar type. + */ + type: "project" | "issuetype", + /** + * The ID of the item the avatar is associated with. + */ + owningObjectId: string, + /** + * The ID of the avatar. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteAvatar({ + type: type, + owningObjectId: owningObjectId, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get avatar image by type + * @request GET :/rest/api/3/universal_avatar/view/type/{type} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAvatarImageByType( + query: { + /** + * The size of the avatar image. If not provided the default size is returned. + */ + size?: "xsmall" | "small" | "medium" | "large" | "xlarge"; + /** + * The format to return the avatar image in. If not provided the original content format is returned. + */ + format?: "png" | "svg"; + }, + /** + * The icon type of the avatar. + */ + type: "issuetype" | "project", + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAvatarImageByType({ + query: query, + type: type, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get avatar image by ID + * @request GET :/rest/api/3/universal_avatar/view/type/{type}/avatar/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAvatarImageById( + query: { + /** + * The size of the avatar image. If not provided the default size is returned. + */ + size?: "xsmall" | "small" | "medium" | "large" | "xlarge"; + /** + * The format to return the avatar image in. If not provided the original content format is returned. + */ + format?: "png" | "svg"; + }, + /** + * The icon type of the avatar. + */ + type: "issuetype" | "project", + /** + * The ID of the avatar. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAvatarImageById({ + query: query, + type: type, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get avatar image by owner + * @request GET :/rest/api/3/universal_avatar/view/type/{type}/owner/{entityId} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAvatarImageByOwner( + query: { + /** + * The size of the avatar image. If not provided the default size is returned. + */ + size?: "xsmall" | "small" | "medium" | "large" | "xlarge"; + /** + * The format to return the avatar image in. If not provided the original content format is returned. + */ + format?: "png" | "svg"; + }, + /** + * The icon type of the avatar. + */ + type: "issuetype" | "project", + /** + * The ID of the project or issue type the avatar belongs to. + */ + entityId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAvatarImageByOwner({ + query: query, + type: type, + entityId: entityId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete user + * @request DELETE :/rest/api/3/user + * @allowrelaxedtypes + */ +export async function deleteRestRemoveUser( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + key?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.removeUser({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get user + * @request GET :/rest/api/3/user + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetUser( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. Required. + */ + accountId?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide) for details. + */ + username?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide) for details. + */ + key?: string; + /** +* Use [expand](#expansion) to include additional information about users in the response. This parameter accepts a comma-separated list. Expand options include: + + * `groups` includes all groups and nested groups to which the user belongs. + * `applicationRoles` includes details of all the applications to which the user has access. +*/ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUser({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create user + * @request POST :/rest/api/3/user + * @allowrelaxedtypes + */ +export async function postRestCreateUser( + /** Request body */ + data: NewUserDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createUser({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find users assignable to projects + * @request GET :/rest/api/3/user/assignable/multiProjectSearch + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindBulkAssignableUsers( + query: { + /** + * A query string that is matched against user attributes, such as `displayName` and `emailAddress`, to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. Required, unless `accountId` is specified. + */ + query?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. + */ + accountId?: string; + /** + * A list of project keys (case sensitive). This parameter accepts a comma-separated list. + */ + projectKeys: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findBulkAssignableUsers({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find users assignable to issues + * @request GET :/rest/api/3/user/assignable/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindAssignableUsers( + query: { + /** + * A query string that is matched against user attributes, such as `displayName`, and `emailAddress`, to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. Required, unless `username` or `accountId` is specified. + */ + query?: string; + /** + * The sessionId of this request. SessionId is the same until the assignee is set. + */ + sessionId?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. + */ + accountId?: string; + /** + * The project ID or project key (case sensitive). Required, unless `issueKey` is specified. + */ + project?: string; + /** + * The key of the issue. Required, unless `project` is specified. + */ + issueKey?: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return. This operation may return less than the maximum number of items even if more are available. The operation fetches users up to the maximum and then, from the fetched users, returns only the users that can be assigned to the issue. + */ + maxResults?: number; + /** + * The ID of the transition. + */ + actionDescriptorId?: number; + recommend?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findAssignableUsers({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Bulk get users + * @request GET :/rest/api/3/user/bulk + * @allowrelaxedtypes + * @readonly + */ +export async function getRestBulkGetUsers( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string[]; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + key?: string[]; + /** + * The account ID of a user. To specify multiple users, pass multiple `accountId` parameters. For example, `accountId=5b10a2844c20165700ede21g&accountId=5b10ac8d82e05b22cc7d4ef5`. + */ + accountId: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.bulkGetUsers({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get account IDs for users + * @request GET :/rest/api/3/user/bulk/migration + * @readonly + */ +export async function getRestBulkGetUsersMigration( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * Username of a user. To specify multiple users, pass multiple copies of this parameter. For example, `username=fred&username=barney`. Required if `key` isn't provided. Cannot be provided if `key` is present. + */ + username?: string[]; + /** + * Key of a user. To specify multiple users, pass multiple copies of this parameter. For example, `key=fred&key=barney`. Required if `username` isn't provided. Cannot be provided if `username` is present. + */ + key?: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.bulkGetUsersMigration({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Reset user default columns + * @request DELETE :/rest/api/3/user/columns + * @allowrelaxedtypes + */ +export async function deleteRestResetUserColumns( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.resetUserColumns({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get user default columns + * @request GET :/rest/api/3/user/columns + * @readonly + */ +export async function getRestGetUserDefaultColumns( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId?: string; + /** + * This parameter is no longer available See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUserDefaultColumns({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set user default columns + * @request PUT :/rest/api/3/user/columns + * @allowrelaxedtypes + */ +export async function putRestSetUserColumns( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId?: string; + }, + /** Request body */ + data: string[], + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setUserColumns({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get user email + * @request GET :/rest/api/3/user/email + * @readonly + */ +export async function getRestGetUserEmail( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, `5b10ac8d82e05b22cc7d4ef5`. + */ + accountId: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUserEmail({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get user email bulk + * @request GET :/rest/api/3/user/email/bulk + * @readonly + */ +export async function getRestGetUserEmailBulk( + query: { + /** + * The account IDs of the users for which emails are required. An `accountId` is an identifier that uniquely identifies the user across all Atlassian products. For example, `5b10ac8d82e05b22cc7d4ef5`. Note, this should be treated as an opaque identifier (that is, do not assume any structure in the value). + */ + accountId: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUserEmailBulk({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get user groups + * @request GET :/rest/api/3/user/groups + * @readonly + */ +export async function getRestGetUserGroups( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + key?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUserGroups({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find users with permissions + * @request GET :/rest/api/3/user/permission/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindUsersWithAllPermissions( + query: { + /** + * A query string that is matched against user attributes, such as `displayName` and `emailAddress`, to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. Required, unless `accountId` is specified. + */ + query?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. + */ + accountId?: string; + /** +* A comma separated list of permissions. Permissions can be specified as any: + + * permission returned by [Get all permissions](#api-rest-api-3-permissions-get). + * custom project permission added by Connect apps. + * (deprecated) one of the following: + + * ASSIGNABLE\_USER + * ASSIGN\_ISSUE + * ATTACHMENT\_DELETE\_ALL + * ATTACHMENT\_DELETE\_OWN + * BROWSE + * CLOSE\_ISSUE + * COMMENT\_DELETE\_ALL + * COMMENT\_DELETE\_OWN + * COMMENT\_EDIT\_ALL + * COMMENT\_EDIT\_OWN + * COMMENT\_ISSUE + * CREATE\_ATTACHMENT + * CREATE\_ISSUE + * DELETE\_ISSUE + * EDIT\_ISSUE + * LINK\_ISSUE + * MANAGE\_WATCHER\_LIST + * MODIFY\_REPORTER + * MOVE\_ISSUE + * PROJECT\_ADMIN + * RESOLVE\_ISSUE + * SCHEDULE\_ISSUE + * SET\_ISSUE\_SECURITY + * TRANSITION\_ISSUE + * VIEW\_VERSION\_CONTROL + * VIEW\_VOTERS\_AND\_WATCHERS + * VIEW\_WORKFLOW\_READONLY + * WORKLOG\_DELETE\_ALL + * WORKLOG\_DELETE\_OWN + * WORKLOG\_EDIT\_ALL + * WORKLOG\_EDIT\_OWN + * WORK\_ISSUE +*/ + permissions: string; + /** + * The issue key for the issue. + */ + issueKey?: string; + /** + * The project key for the project (case sensitive). + */ + projectKey?: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findUsersWithAllPermissions({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find users for picker + * @request GET :/rest/api/3/user/picker + * @readonly + */ +export async function getRestFindUsersForPicker( + query: { + /** + * A query string that is matched against user attributes, such as `displayName`, and `emailAddress`, to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. + */ + query: string; + /** + * The maximum number of items to return. The total number of matched users is returned in `total`. + */ + maxResults?: number; + /** + * Include the URI to the user's avatar. + */ + showAvatar?: boolean; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + exclude?: string[]; + /** + * A list of account IDs to exclude from the search results. This parameter accepts a comma-separated list. Multiple account IDs can also be provided using an ampersand-separated list. For example, `excludeAccountIds=5b10a2844c20165700ede21g,5b10a0effa615349cb016cd8&excludeAccountIds=5b10ac8d82e05b22cc7d4ef5`. Cannot be provided with `exclude`. + */ + excludeAccountIds?: string[]; + avatarSize?: string; + excludeConnectUsers?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findUsersForPicker({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get user property keys + * @request GET :/rest/api/3/user/properties + * @readonly + */ +export async function getRestGetUserPropertyKeys( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + userKey?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUserPropertyKeys({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete user property + * @request DELETE :/rest/api/3/user/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteUserProperty( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + userKey?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + }, + /** + * The key of the user's property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteUserProperty({ + query: query, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get user property + * @request GET :/rest/api/3/user/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetUserProperty( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + userKey?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + }, + /** + * The key of the user's property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getUserProperty({ + query: query, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set user property + * @request PUT :/rest/api/3/user/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function putRestSetUserProperty( + query: { + /** + * The account ID of the user, which uniquely identifies the user across all Atlassian products. For example, *5b10ac8d82e05b22cc7d4ef5*. + */ + accountId?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + userKey?: string; + /** + * This parameter is no longer available and will be removed from the documentation soon. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + }, + /** + * The key of the user's property. The maximum length is 255 characters. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setUserProperty({ + query: query, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Find users + * @request GET :/rest/api/3/user/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindUsers( + query: { + /** + * A query string that is matched against user attributes ( `displayName`, and `emailAddress`) to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. Required, unless `accountId` or `property` is specified. + */ + query?: string; + username?: string; + /** + * A query string that is matched exactly against a user `accountId`. Required, unless `query` or `property` is specified. + */ + accountId?: string; + /** + * The index of the first item to return in a page of filtered results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * A query string used to search properties. Property keys are specified by path, so property keys containing dot (.) or equals (=) characters cannot be used. The query string cannot be specified using a JSON object. Example: To search for the value of `nested` from `{"something":{"nested":1,"other":2}}` use `thepropertykey.something.nested=1`. Required, unless `accountId` or `query` is specified. + */ + property?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findUsers({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find users by query + * @request GET :/rest/api/3/user/search/query + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindUsersByQuery( + query: { + /** + * The search query. + */ + query: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findUsersByQuery({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find user keys by query + * @request GET :/rest/api/3/user/search/query/key + * @readonly + */ +export async function getRestFindUserKeysByQuery( + query: { + /** + * The search query. + */ + query: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findUserKeysByQuery({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Find users with browse permission + * @request GET :/rest/api/3/user/viewissue/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestFindUsersWithBrowsePermission( + query: { + /** + * A query string that is matched against user attributes, such as `displayName` and `emailAddress`, to find relevant users. The string can match the prefix of the attribute's value. For example, *query=john* matches a user with a `displayName` of *John Smith* and a user with an `emailAddress` of *johnson@example.com*. Required, unless `accountId` is specified. + */ + query?: string; + /** + * This parameter is no longer available. See the [deprecation notice](https://developer.atlassian.com/cloud/jira/platform/deprecation-notice-user-privacy-api-migration-guide/) for details. + */ + username?: string; + /** + * A query string that is matched exactly against user `accountId`. Required, unless `query` is specified. + */ + accountId?: string; + /** + * The issue key for the issue. Required, unless `projectKey` is specified. + */ + issueKey?: string; + /** + * The project key for the project (case sensitive). Required, unless `issueKey` is specified. + */ + projectKey?: string; + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.findUsersWithBrowsePermission({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all users default + * @request GET :/rest/api/3/users + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllUsersDefault( + query: { + /** + * The index of the first item to return. + */ + startAt?: number; + /** + * The maximum number of items to return. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllUsersDefault({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all users + * @request GET :/rest/api/3/users/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllUsers( + query: { + /** + * The index of the first item to return. + */ + startAt?: number; + /** + * The maximum number of items to return. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllUsers({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create version + * @request POST :/rest/api/3/version + */ +export async function postRestCreateVersion( + /** Request body */ + data: Version, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createVersion({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete version + * @request DELETE :/rest/api/3/version/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteVersion( + query: { + /** + * The ID of the version to update `fixVersion` to when the field contains the deleted version. The replacement version must be in the same project as the version being deleted and cannot be the version being deleted. + */ + moveFixIssuesTo?: string; + /** + * The ID of the version to update `affectedVersion` to when the field contains the deleted version. The replacement version must be in the same project as the version being deleted and cannot be the version being deleted. + */ + moveAffectedIssuesTo?: string; + }, + /** + * The ID of the version. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteVersion({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get version + * @request GET :/rest/api/3/version/{id} + * @readonly + */ +export async function getRestGetVersion( + query: { + /** +* Use [expand](#expansion) to include additional information about version in the response. This parameter accepts a comma-separated list. Expand options include: + + * `operations` Returns the list of operations available for this version. + * `issuesstatus` Returns the count of issues in this version for each of the status categories *to do*, *in progress*, *done*, and *unmapped*. The *unmapped* property represents the number of issues with a status other than *to do*, *in progress*, and *done*. +*/ + expand?: string; + }, + /** + * The ID of the version. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getVersion({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update version + * @request PUT :/rest/api/3/version/{id} + */ +export async function putRestUpdateVersion( + /** + * The ID of the version. + */ + id: string, + /** Request body */ + data: Version, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateVersion({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Merge versions + * @request PUT :/rest/api/3/version/{id}/mergeto/{moveIssuesTo} + * @allowrelaxedtypes + */ +export async function putRestMergeVersions( + /** + * The ID of the version to delete. + */ + id: string, + /** + * The ID of the version to merge into. + */ + moveIssuesTo: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.mergeVersions({ + id: id, + moveIssuesTo: moveIssuesTo, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Move version + * @request POST :/rest/api/3/version/{id}/move + * @allowrelaxedtypes + */ +export async function postRestMoveVersion( + /** + * The ID of the version to be moved. + */ + id: string, + /** Request body */ + data: VersionMoveBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.moveVersion({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get version's related issues count + * @request GET :/rest/api/3/version/{id}/relatedIssueCounts + * @readonly + */ +export async function getRestGetVersionRelatedIssues( + /** + * The ID of the version. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getVersionRelatedIssues({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete and replace version + * @request POST :/rest/api/3/version/{id}/removeAndSwap + * @allowrelaxedtypes + */ +export async function postRestDeleteAndReplaceVersion( + /** + * The ID of the version. + */ + id: string, + /** Request body */ + data: DeleteAndReplaceVersionBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteAndReplaceVersion({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get version's unresolved issues count + * @request GET :/rest/api/3/version/{id}/unresolvedIssueCount + * @readonly + */ +export async function getRestGetVersionUnresolvedIssues( + /** + * The ID of the version. + */ + id: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getVersionUnresolvedIssues({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete webhooks by ID + * @request DELETE :/rest/api/3/webhook + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWebhookById( + /** Request body */ + data: ContainerForWebhookIDs, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWebhookById({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.error) { + throw result.error; + } else { + return new hasuraSdk.JSONValue(result.data); + } +} + +/** + * Get dynamic webhooks for app + * @request GET :/rest/api/3/webhook + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetDynamicWebhooksForApp( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDynamicWebhooksForApp({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Register dynamic webhooks + * @request POST :/rest/api/3/webhook + * @allowrelaxedtypes + */ +export async function postRestRegisterDynamicWebhooks( + /** Request body */ + data: WebhookRegistrationDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.registerDynamicWebhooks({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get failed webhooks + * @request GET :/rest/api/3/webhook/failed + * @readonly + */ +export async function getRestGetFailedWebhooks( + query: { + /** + * The maximum number of webhooks to return per page. If obeying the maxResults directive would result in records with the same failure time being split across pages, the directive is ignored and all records with the same failure time included on the page. + */ + maxResults?: number; + /** + * The time after which any webhook failure must have occurred for the record to be returned, expressed as milliseconds since the UNIX epoch. + */ + after?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getFailedWebhooks({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Extend webhook life + * @request PUT :/rest/api/3/webhook/refresh + */ +export async function putRestRefreshWebhooks( + /** Request body */ + data: ContainerForWebhookIDs, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.refreshWebhooks({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get all workflows + * @request GET :/rest/api/3/workflow + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllWorkflows( + query: { + /** + * The name of the workflow to be returned. Only one workflow can be specified. + */ + workflowName?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllWorkflows({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create workflow + * @request POST :/rest/api/3/workflow + * @allowrelaxedtypes + */ +export async function postRestCreateWorkflow( + /** Request body */ + data: CreateWorkflowDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createWorkflow({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get workflow transition rule configurations + * @request GET :/rest/api/3/workflow/rule/config + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorkflowTransitionRuleConfigurations( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The types of the transition rules to return. + */ + types: ("postfunction" | "condition" | "validator")[]; + /** + * The transition rule class keys, as defined in the Connect app descriptor, of the transition rules to return. + */ + keys?: string[]; + /** + * EXPERIMENTAL: The list of workflow names to filter by. + */ + workflowNames?: string[]; + /** + * EXPERIMENTAL: The list of `tags` to filter by. + */ + withTags?: string[]; + /** + * EXPERIMENTAL: Whether draft or published workflows are returned. If not provided, both workflow types are returned. + */ + draft?: boolean; + /** + * Use [expand](#expansion) to include additional information in the response. This parameter accepts `transition`, which, for each rule, returns information about the transition the rule is assigned to. + */ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowTransitionRuleConfigurations({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update workflow transition rule configurations + * @request PUT :/rest/api/3/workflow/rule/config + */ +export async function putRestUpdateWorkflowTransitionRuleConfigurations( + /** Request body */ + data: WorkflowTransitionRulesUpdate, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateWorkflowTransitionRuleConfigurations({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete workflow transition rule configurations + * @request PUT :/rest/api/3/workflow/rule/config/delete + */ +export async function putRestDeleteWorkflowTransitionRuleConfigurations( + /** Request body */ + data: WorkflowsWithTransitionRulesDetails, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorkflowTransitionRuleConfigurations({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get workflows paginated + * @request GET :/rest/api/3/workflow/search + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorkflowsPaginated( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + /** + * The name of a workflow to return. To include multiple workflows, provide an ampersand-separated list. For example, `workflowName=name1&workflowName=name2`. + */ + workflowName?: string[]; + /** +* Use [expand](#expansion) to include additional information in the response. This parameter accepts a comma-separated list. Expand options include: + + * `transitions` For each workflow, returns information about the transitions inside the workflow. + * `transitions.rules` For each workflow transition, returns information about its rules. Transitions are included automatically if this expand is requested. + * `transitions.properties` For each workflow transition, returns information about its properties. Transitions are included automatically if this expand is requested. + * `statuses` For each workflow, returns information about the statuses inside the workflow. + * `statuses.properties` For each workflow status, returns information about its properties. Statuses are included automatically if this expand is requested. + * `default` For each workflow, returns information about whether this is the default workflow. + * `schemes` For each workflow, returns information about the workflow schemes the workflow is assigned to. + * `projects` For each workflow, returns information about the projects the workflow is assigned to, through workflow schemes. + * `hasDraftWorkflow` For each workflow, returns information about whether the workflow has a draft version. + * `operations` For each workflow, returns information about the actions that can be undertaken on the workflow. +*/ + expand?: string; + /** + * String used to perform a case-insensitive partial match with workflow name. + */ + queryString?: string; + /** +* [Order](#ordering) the results by a field: + + * `name` Sorts by workflow name. + * `created` Sorts by create time. + * `updated` Sorts by update time. +*/ + orderBy?: + | "name" + | "-name" + | "+name" + | "created" + | "-created" + | "+created" + | "updated" + | "+updated" + | "-updated"; + /** + * Filters active and inactive workflows. + */ + isActive?: boolean; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowsPaginated({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete workflow transition property + * @request DELETE :/rest/api/3/workflow/transitions/{transitionId}/properties + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorkflowTransitionProperty( + query: { + /** + * The name of the transition property to delete, also known as the name of the property. + */ + key: string; + /** + * The name of the workflow that the transition belongs to. + */ + workflowName: string; + /** + * The workflow status. Set to `live` for inactive workflows or `draft` for draft workflows. Active workflows cannot be edited. + */ + workflowMode?: "live" | "draft"; + }, + /** + * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown next to the transition. + */ + transitionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorkflowTransitionProperty({ + query: query, + transitionId: transitionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get workflow transition properties + * @request GET :/rest/api/3/workflow/transitions/{transitionId}/properties + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorkflowTransitionProperties( + query: { + /** + * Some properties with keys that have the *jira.* prefix are reserved, which means they are not editable. To include these properties in the results, set this parameter to *true*. + */ + includeReservedKeys?: boolean; + /** + * The key of the property being returned, also known as the name of the property. If this parameter is not specified, all properties on the transition are returned. + */ + key?: string; + /** + * The name of the workflow that the transition belongs to. + */ + workflowName: string; + /** + * The workflow status. Set to *live* for active and inactive workflows, or *draft* for draft workflows. + */ + workflowMode?: "live" | "draft"; + }, + /** + * The ID of the transition. To get the ID, view the workflow in text mode in the Jira administration console. The ID is shown next to the transition. + */ + transitionId: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowTransitionProperties({ + query: query, + transitionId: transitionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create workflow transition property + * @request POST :/rest/api/3/workflow/transitions/{transitionId}/properties + * @allowrelaxedtypes + */ +export async function postRestCreateWorkflowTransitionProperty( + query: { + /** + * The key of the property being added, also known as the name of the property. Set this to the same value as the `key` defined in the request body. + */ + key: string; + /** + * The name of the workflow that the transition belongs to. + */ + workflowName: string; + /** + * The workflow status. Set to *live* for inactive workflows or *draft* for draft workflows. Active workflows cannot be edited. + */ + workflowMode?: "live" | "draft"; + }, + /** + * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown next to the transition. + */ + transitionId: number, + /** Request body */ + data: WorkflowTransitionProperty, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createWorkflowTransitionProperty({ + query: query, + transitionId: transitionId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update workflow transition property + * @request PUT :/rest/api/3/workflow/transitions/{transitionId}/properties + * @allowrelaxedtypes + */ +export async function putRestUpdateWorkflowTransitionProperty( + query: { + /** + * The key of the property being updated, also known as the name of the property. Set this to the same value as the `key` defined in the request body. + */ + key: string; + /** + * The name of the workflow that the transition belongs to. + */ + workflowName: string; + /** + * The workflow status. Set to `live` for inactive workflows or `draft` for draft workflows. Active workflows cannot be edited. + */ + workflowMode?: "live" | "draft"; + }, + /** + * The ID of the transition. To get the ID, view the workflow in text mode in the Jira admin settings. The ID is shown next to the transition. + */ + transitionId: number, + /** Request body */ + data: WorkflowTransitionProperty, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateWorkflowTransitionProperty({ + query: query, + transitionId: transitionId, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete inactive workflow + * @request DELETE :/rest/api/3/workflow/{entityId} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteInactiveWorkflow( + /** + * The entity ID of the workflow. + */ + entityId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteInactiveWorkflow({ + entityId: entityId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get all workflow schemes + * @request GET :/rest/api/3/workflowscheme + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetAllWorkflowSchemes( + query: { + /** + * The index of the first item to return in a page of results (page offset). + */ + startAt?: number; + /** + * The maximum number of items to return per page. + */ + maxResults?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getAllWorkflowSchemes({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create workflow scheme + * @request POST :/rest/api/3/workflowscheme + * @allowrelaxedtypes + */ +export async function postRestCreateWorkflowScheme( + /** Request body */ + data: WorkflowScheme, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createWorkflowScheme({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get workflow scheme project associations + * @request GET :/rest/api/3/workflowscheme/project + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorkflowSchemeProjectAssociations( + query: { + /** + * The ID of a project to return the workflow schemes for. To include multiple projects, provide an ampersand-Jim: oneseparated list. For example, `projectId=10000&projectId=10001`. + */ + projectId: number[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowSchemeProjectAssociations({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Assign workflow scheme to project + * @request PUT :/rest/api/3/workflowscheme/project + * @allowrelaxedtypes + */ +export async function putRestAssignSchemeToProject( + /** Request body */ + data: WorkflowSchemeProjectAssociation, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.assignSchemeToProject({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Delete workflow scheme + * @request DELETE :/rest/api/3/workflowscheme/{id} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorkflowScheme( + /** + * The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the URL as `schemeId`. For example, *schemeId=10301*. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorkflowScheme({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Get workflow scheme + * @request GET :/rest/api/3/workflowscheme/{id} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorkflowScheme( + query: { + /** + * Returns the workflow scheme's draft rather than scheme itself, if set to true. If the workflow scheme does not have a draft, then the workflow scheme is returned. + */ + returnDraftIfExists?: boolean; + }, + /** + * The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the URL as `schemeId`. For example, *schemeId=10301*. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowScheme({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update workflow scheme + * @request PUT :/rest/api/3/workflowscheme/{id} + * @allowrelaxedtypes + */ +export async function putRestUpdateWorkflowScheme( + /** + * The ID of the workflow scheme. Find this ID by editing the desired workflow scheme in Jira. The ID is shown in the URL as `schemeId`. For example, *schemeId=10301*. + */ + id: number, + /** Request body */ + data: WorkflowScheme, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateWorkflowScheme({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Create draft workflow scheme + * @request POST :/rest/api/3/workflowscheme/{id}/createdraft + * @allowrelaxedtypes + */ +export async function postRestCreateWorkflowSchemeDraftFromParent( + /** + * The ID of the active workflow scheme that the draft is created from. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.createWorkflowSchemeDraftFromParent({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete default workflow + * @request DELETE :/rest/api/3/workflowscheme/{id}/default + * @allowrelaxedtypes + */ +export async function deleteRestDeleteDefaultWorkflow( + query: { + /** + * Set to true to create or update the draft of a workflow scheme and delete the mapping from the draft, when the workflow scheme cannot be edited. Defaults to `false`. + */ + updateDraftIfNeeded?: boolean; + }, + /** + * The ID of the workflow scheme. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteDefaultWorkflow({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get default workflow + * @request GET :/rest/api/3/workflowscheme/{id}/default + * @readonly + */ +export async function getRestGetDefaultWorkflow( + query: { + /** + * Set to `true` to return the default workflow for the workflow scheme's draft rather than scheme itself. If the workflow scheme does not have a draft, then the default workflow for the workflow scheme is returned. + */ + returnDraftIfExists?: boolean; + }, + /** + * The ID of the workflow scheme. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDefaultWorkflow({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update default workflow + * @request PUT :/rest/api/3/workflowscheme/{id}/default + * @allowrelaxedtypes + */ +export async function putRestUpdateDefaultWorkflow( + /** + * The ID of the workflow scheme. + */ + id: number, + /** Request body */ + data: DefaultWorkflow, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateDefaultWorkflow({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete draft workflow scheme + * @request DELETE :/rest/api/3/workflowscheme/{id}/draft + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorkflowSchemeDraft( + /** + * The ID of the active workflow scheme that the draft was created from. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorkflowSchemeDraft({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get draft workflow scheme + * @request GET :/rest/api/3/workflowscheme/{id}/draft + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetWorkflowSchemeDraft( + /** + * The ID of the active workflow scheme that the draft was created from. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowSchemeDraft({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update draft workflow scheme + * @request PUT :/rest/api/3/workflowscheme/{id}/draft + * @allowrelaxedtypes + */ +export async function putRestUpdateWorkflowSchemeDraft( + /** + * The ID of the active workflow scheme that the draft was created from. + */ + id: number, + /** Request body */ + data: WorkflowScheme, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateWorkflowSchemeDraft({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete draft default workflow + * @request DELETE :/rest/api/3/workflowscheme/{id}/draft/default + * @allowrelaxedtypes + */ +export async function deleteRestDeleteDraftDefaultWorkflow( + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteDraftDefaultWorkflow({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get draft default workflow + * @request GET :/rest/api/3/workflowscheme/{id}/draft/default + * @readonly + */ +export async function getRestGetDraftDefaultWorkflow( + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDraftDefaultWorkflow({ + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update draft default workflow + * @request PUT :/rest/api/3/workflowscheme/{id}/draft/default + * @allowrelaxedtypes + */ +export async function putRestUpdateDraftDefaultWorkflow( + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + /** Request body */ + data: DefaultWorkflow, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateDraftDefaultWorkflow({ + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete workflow for issue type in draft workflow scheme + * @request DELETE :/rest/api/3/workflowscheme/{id}/draft/issuetype/{issueType} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorkflowSchemeDraftIssueType( + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + /** + * The ID of the issue type. + */ + issueType: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorkflowSchemeDraftIssueType({ + id: id, + issueType: issueType, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get workflow for issue type in draft workflow scheme + * @request GET :/rest/api/3/workflowscheme/{id}/draft/issuetype/{issueType} + * @readonly + */ +export async function getRestGetWorkflowSchemeDraftIssueType( + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + /** + * The ID of the issue type. + */ + issueType: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowSchemeDraftIssueType({ + id: id, + issueType: issueType, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set workflow for issue type in draft workflow scheme + * @request PUT :/rest/api/3/workflowscheme/{id}/draft/issuetype/{issueType} + * @allowrelaxedtypes + */ +export async function putRestSetWorkflowSchemeDraftIssueType( + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + /** + * The ID of the issue type. + */ + issueType: string, + /** Request body */ + data: IssueTypeWorkflowMapping, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setWorkflowSchemeDraftIssueType({ + id: id, + issueType: issueType, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Publish draft workflow scheme + * @request POST :/rest/api/3/workflowscheme/{id}/draft/publish + * @allowrelaxedtypes + */ +export async function postRestPublishDraftWorkflowScheme( + query: { + /** + * Whether the request only performs a validation. + */ + validateOnly?: boolean; + }, + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + /** Request body */ + data: PublishDraftWorkflowScheme, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.publishDraftWorkflowScheme({ + query: query, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.error) { + throw result.error; + } else { + return new hasuraSdk.JSONValue(result.data); + } +} + +/** + * Delete issue types for workflow in draft workflow scheme + * @request DELETE :/rest/api/3/workflowscheme/{id}/draft/workflow + * @allowrelaxedtypes + */ +export async function deleteRestDeleteDraftWorkflowMapping( + query: { + /** + * The name of the workflow. + */ + workflowName: string; + }, + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteDraftWorkflowMapping({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue types for workflows in draft workflow scheme + * @request GET :/rest/api/3/workflowscheme/{id}/draft/workflow + * @readonly + */ +export async function getRestGetDraftWorkflow( + query: { + /** + * The name of a workflow in the scheme. Limits the results to the workflow-issue type mapping for the specified workflow. + */ + workflowName?: string; + }, + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getDraftWorkflow({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set issue types for workflow in workflow scheme + * @request PUT :/rest/api/3/workflowscheme/{id}/draft/workflow + * @allowrelaxedtypes + */ +export async function putRestUpdateDraftWorkflowMapping( + query: { + /** + * The name of the workflow. + */ + workflowName: string; + }, + /** + * The ID of the workflow scheme that the draft belongs to. + */ + id: number, + /** Request body */ + data: IssueTypesWorkflowMapping, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateDraftWorkflowMapping({ + query: query, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete workflow for issue type in workflow scheme + * @request DELETE :/rest/api/3/workflowscheme/{id}/issuetype/{issueType} + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorkflowSchemeIssueType( + query: { + /** + * Set to true to create or update the draft of a workflow scheme and update the mapping in the draft, when the workflow scheme cannot be edited. Defaults to `false`. + */ + updateDraftIfNeeded?: boolean; + }, + /** + * The ID of the workflow scheme. + */ + id: number, + /** + * The ID of the issue type. + */ + issueType: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorkflowSchemeIssueType({ + query: query, + id: id, + issueType: issueType, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get workflow for issue type in workflow scheme + * @request GET :/rest/api/3/workflowscheme/{id}/issuetype/{issueType} + * @readonly + */ +export async function getRestGetWorkflowSchemeIssueType( + query: { + /** + * Returns the mapping from the workflow scheme's draft rather than the workflow scheme, if set to true. If no draft exists, the mapping from the workflow scheme is returned. + */ + returnDraftIfExists?: boolean; + }, + /** + * The ID of the workflow scheme. + */ + id: number, + /** + * The ID of the issue type. + */ + issueType: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflowSchemeIssueType({ + query: query, + id: id, + issueType: issueType, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set workflow for issue type in workflow scheme + * @request PUT :/rest/api/3/workflowscheme/{id}/issuetype/{issueType} + * @allowrelaxedtypes + */ +export async function putRestSetWorkflowSchemeIssueType( + /** + * The ID of the workflow scheme. + */ + id: number, + /** + * The ID of the issue type. + */ + issueType: string, + /** Request body */ + data: IssueTypeWorkflowMapping, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.setWorkflowSchemeIssueType({ + id: id, + issueType: issueType, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete issue types for workflow in workflow scheme + * @request DELETE :/rest/api/3/workflowscheme/{id}/workflow + * @allowrelaxedtypes + */ +export async function deleteRestDeleteWorkflowMapping( + query: { + /** + * The name of the workflow. + */ + workflowName: string; + /** + * Set to true to create or update the draft of a workflow scheme and delete the mapping from the draft, when the workflow scheme cannot be edited. Defaults to `false`. + */ + updateDraftIfNeeded?: boolean; + }, + /** + * The ID of the workflow scheme. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.deleteWorkflowMapping({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get issue types for workflows in workflow scheme + * @request GET :/rest/api/3/workflowscheme/{id}/workflow + * @readonly + */ +export async function getRestGetWorkflow( + query: { + /** + * The name of a workflow in the scheme. Limits the results to the workflow-issue type mapping for the specified workflow. + */ + workflowName?: string; + /** + * Returns the mapping from the workflow scheme's draft rather than the workflow scheme, if set to true. If no draft exists, the mapping from the workflow scheme is returned. + */ + returnDraftIfExists?: boolean; + }, + /** + * The ID of the workflow scheme. + */ + id: number, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorkflow({ + query: query, + id: id, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set issue types for workflow in workflow scheme + * @request PUT :/rest/api/3/workflowscheme/{id}/workflow + * @allowrelaxedtypes + */ +export async function putRestUpdateWorkflowMapping( + query: { + /** + * The name of the workflow. + */ + workflowName: string; + }, + /** + * The ID of the workflow scheme. + */ + id: number, + /** Request body */ + data: IssueTypesWorkflowMapping, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.updateWorkflowMapping({ + query: query, + id: id, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get IDs of deleted worklogs + * @request GET :/rest/api/3/worklog/deleted + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIdsOfWorklogsDeletedSince( + query: { + /** + * The date and time, as a UNIX timestamp in milliseconds, after which deleted worklogs are returned. + */ + since?: number; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIdsOfWorklogsDeletedSince({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get worklogs + * @request POST :/rest/api/3/worklog/list + * @allowrelaxedtypes + */ +export async function postRestGetWorklogsForIds( + query: { + /** + * Use [expand](#expansion) to include additional information about worklogs in the response. This parameter accepts `properties` that returns the properties of each worklog. + */ + expand?: string; + }, + /** Request body */ + data: WorklogIdsRequestBean, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getWorklogsForIds({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get IDs of updated worklogs + * @request GET :/rest/api/3/worklog/updated + * @allowrelaxedtypes + * @readonly + */ +export async function getRestGetIdsOfWorklogsModifiedSince( + query: { + /** + * The date and time, as a UNIX timestamp in milliseconds, after which updated worklogs are returned. + */ + since?: number; + /** + * Use [expand](#expansion) to include additional information about worklogs in the response. This parameter accepts `properties` that returns the properties of each worklog. + */ + expand?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.getIdsOfWorklogsModifiedSince({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get app properties + * @request GET :/rest/atlassian-connect/1/addons/{addonKey}/properties + * @readonly + */ +export async function getRestAddonPropertiesResourceGetAddonPropertiesGet( + /** + * The key of the app, as defined in its descriptor. + */ + addonKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addonPropertiesResourceGetAddonPropertiesGet({ + addonKey: addonKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Delete app property + * @request DELETE :/rest/atlassian-connect/1/addons/{addonKey}/properties/{propertyKey} + * @allowrelaxedtypes + */ +export async function deleteRestAddonPropertiesResourceDeleteAddonPropertyDelete( + /** + * The key of the app, as defined in its descriptor. + */ + addonKey: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.rest.addonPropertiesResourceDeleteAddonPropertyDelete({ + addonKey: addonKey, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.error) { + throw result.error; + } else { + return new hasuraSdk.JSONValue(result.data); + } +} + +/** + * Get app property + * @request GET :/rest/atlassian-connect/1/addons/{addonKey}/properties/{propertyKey} + * @allowrelaxedtypes + * @readonly + */ +export async function getRestAddonPropertiesResourceGetAddonPropertyGet( + /** + * The key of the app, as defined in its descriptor. + */ + addonKey: string, + /** + * The key of the property. + */ + propertyKey: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addonPropertiesResourceGetAddonPropertyGet({ + addonKey: addonKey, + propertyKey: propertyKey, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Set app property + * @request PUT :/rest/atlassian-connect/1/addons/{addonKey}/properties/{propertyKey} + */ +export async function putRestAddonPropertiesResourcePutAddonPropertyPut( + /** + * The key of the app, as defined in its descriptor. + */ + addonKey: string, + /** + * The key of the property. + */ + propertyKey: string, + /** Request body */ + data: any, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.addonPropertiesResourcePutAddonPropertyPut({ + addonKey: addonKey, + propertyKey: propertyKey, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Remove modules + * @request DELETE :/rest/atlassian-connect/1/app/module/dynamic + * @allowrelaxedtypes + */ +export async function deleteRestDynamicModulesResourceRemoveModulesDelete( + query: { + /** +* The key of the module to remove. To include multiple module keys, provide multiple copies of this parameter. +For example, `moduleKey=dynamic-attachment-entity-property&moduleKey=dynamic-select-field`. +Nonexistent keys are ignored. +*/ + moduleKey?: string[]; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.dynamicModulesResourceRemoveModulesDelete({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.error) { + throw result.error; + } else { + return new hasuraSdk.JSONValue(result.data); + } +} + +/** + * Get modules + * @request GET :/rest/atlassian-connect/1/app/module/dynamic + * @allowrelaxedtypes + * @readonly + */ +export async function getRestDynamicModulesResourceGetModulesGet( + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.dynamicModulesResourceGetModulesGet({ + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Register modules + * @request POST :/rest/atlassian-connect/1/app/module/dynamic + * @allowrelaxedtypes + */ +export async function postRestDynamicModulesResourceRegisterModulesPost( + /** Request body */ + data: ConnectModules, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.dynamicModulesResourceRegisterModulesPost({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.error) { + throw result.error; + } else { + return new hasuraSdk.JSONValue(result.data); + } +} + +/** + * Bulk update custom field value + * @request PUT :/rest/atlassian-connect/1/migration/field + * @allowrelaxedtypes + */ +export async function putRestAppIssueFieldValueUpdateResourceUpdateIssueFieldsPut( + /** Request body */ + data: ConnectCustomFieldValues, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.rest.appIssueFieldValueUpdateResourceUpdateIssueFieldsPut({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return new hasuraSdk.JSONValue(result.data); + } else { + throw result.error; + } +} + +/** + * Bulk update entity properties + * @request PUT :/rest/atlassian-connect/1/migration/properties/{entityType} + * @allowrelaxedtypes + */ +export async function putRestMigrationResourceUpdateEntityPropertiesValuePut( + /** + * The type indicating the object that contains the entity properties. + */ + entityType: + | "IssueProperty" + | "CommentProperty" + | "DashboardItemProperty" + | "IssueTypeProperty" + | "ProjectProperty" + | "UserProperty" + | "WorklogProperty" + | "BoardProperty" + | "SprintProperty", + /** Request body */ + data: EntityPropertyDetails[], + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.migrationResourceUpdateEntityPropertiesValuePut( + { + entityType: entityType, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + return new hasuraSdk.JSONValue(result); +} + +/** + * Get workflow transition rule configurations + * @request POST :/rest/atlassian-connect/1/migration/workflow/rule/search + */ +export async function postRestMigrationResourceWorkflowRuleSearchPost( + /** Request body */ + data: WorkflowRulesSearch, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.rest.migrationResourceWorkflowRuleSearchPost({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} diff --git a/tests/test-data/golden-files/aws-autoscaling b/tests/test-data/golden-files/aws-autoscaling index 5f1f23e..9360025 100644 --- a/tests/test-data/golden-files/aws-autoscaling +++ b/tests/test-data/golden-files/aws-autoscaling @@ -1,380 +1,151 @@ +import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; import { - XmlStringMaxLen511, - FailedScheduledUpdateGroupActionRequests, - XmlStringMaxLen255, - TimestampType, - AutoScalingGroupMinSize, - AutoScalingGroupMaxSize, - AutoScalingGroupDesiredCapacity, - LaunchTemplateSpecification, - Overrides, - XmlString, - OnDemandBaseCapacity, - OnDemandPercentageAboveBaseCapacity, - SpotInstancePools, - MixedInstanceSpotPrice, + ActivitiesType, + ActivityType, + Api, AsciiStringMaxLen255, - LifecycleTransition, - XmlStringMaxLen1023, - HeartbeatTimeout, - LifecycleActionResult, - NotificationTargetResourceName, - TagKey, - TagValue, - PropagateAtLaunch, - Ebs, - NoDevice, - MaxNumberOfAutoScalingGroups, - MaxNumberOfLaunchConfigurations, - NumberOfAutoScalingGroups, - NumberOfLaunchConfigurations, - AdjustmentTypes, - AutoScalingGroups, - Values, - AutoScalingInstances, - AutoScalingNotificationTypes, - InstanceRefreshes, - LaunchConfigurations, - LifecycleHooks, - LoadBalancerTargetGroupStates, - LoadBalancerStates, - MetricCollectionTypes, - MetricGranularityTypes, - NotificationConfigurations, - ScalingPolicies, - Activities, - Processes, - ScheduledUpdateGroupActions, - TagDescriptionList, - TerminationPolicies, - TrafficSourceStates, - WarmPoolConfiguration, - Instances, - LoadForecasts, - CapacityForecast, - ResourceName, - Alarms, - MetricScale, - PolicyIncrement, - MetricType, - MetricName, - MetricNamespace, - MetricDimensions, - MetricStatistic, - MetricUnit, - TargetTrackingMetricDataQueries, - PredictiveScalingMetricSpecification, - LaunchTemplateName, - LaunchTemplate, - InstancesDistribution, - NonZeroIntPercent, - Activity, - NullablePositiveInteger, - AcceleratorManufacturer, - AcceleratorName, - AcceleratorType, - ScalingActivityStatusCode, - Progress, - AutoScalingGroupState, - AdjustmentType, - Alarm, - AllowedInstanceType, - XmlStringMaxLen19, - InstanceIds, - TargetGroupARNs, - LoadBalancerNames, - TrafficSourceIdentifier, - TrafficSources, - Instance, - SuspendedProcess, - EnabledMetric, - TagDescription, - XmlStringMaxLen1600, - MaxGroupPreparedCapacity, - WarmPoolMinSize, - WarmPoolState, - WarmPoolStatus, - InstanceReusePolicy, - MixedInstancesPolicy, - AutoScalingGroupPredictedCapacity, - Cooldown, - AvailabilityZones, - XmlStringMaxLen32, - HealthCheckGracePeriod, - SuspendedProcesses, - XmlStringMaxLen2047, - EnabledMetrics, - InstanceProtected, - MaxInstanceLifetime, - CapacityRebalanceEnabled, - WarmPoolSize, - Context, - DefaultInstanceWarmup, - Filter, - AutoScalingGroupNames, - MaxRecords, - Filters, - AutoScalingGroup, - AutoScalingInstanceDetails, - FailedScheduledUpdateGroupActionRequest, - ScheduledActionNames, - ScheduledUpdateGroupActionRequest, - ScheduledUpdateGroupActionRequests, - BlockDeviceEbsVolumeSize, - BlockDeviceEbsVolumeType, - BlockDeviceEbsDeleteOnTermination, - BlockDeviceEbsIops, - BlockDeviceEbsEncrypted, - BlockDeviceEbsThroughput, - BlockDeviceMapping, - PredictiveScalingForecastTimestamps, - PredictiveScalingForecastValues, - LifecycleActionToken, - CpuManufacturer, - LifecycleHookSpecification, - Tag, - LifecycleHookSpecifications, - Tags, - MonitoringEnabled, - InstanceMetadataHttpTokensState, - InstanceMetadataHttpPutResponseHopLimit, - InstanceMetadataEndpointState, - SecurityGroups, - ClassicLinkVPCSecurityGroups, - XmlStringUserData, - BlockDeviceMappings, - InstanceMonitoring, - SpotPrice, - EbsOptimized, - AssociatePublicIpAddress, - XmlStringMaxLen64, - InstanceMetadataOptions, - MetricDimension, - TargetTrackingMetricDataQuery, - ForceDelete, - InstanceRefresh, - InstanceRefreshIds, - LifecycleHook, - LifecycleHookNames, - LoadBalancerTargetGroupState, - LoadBalancerState, - MetricCollectionType, - MetricGranularityType, - NotificationConfiguration, - PolicyNames, - PolicyTypes, - ActivityIds, - IncludeDeletedGroups, - TrafficSourceState, - ShouldDecrementDesiredCapacity, - Metrics, - ExcludedInstance, - HonorCooldown, - LoadForecast, - LifecycleState, - InstanceGeneration, - InstanceRefreshLivePoolProgress, - InstanceRefreshWarmPoolProgress, - IntPercent, - RefreshInstanceWarmup, - CheckpointPercentages, - CheckpointDelay, - SkipMatching, - AutoRollback, - ScaleInProtectedInstances, - StandbyInstances, - InstancesToUpdate, - InstanceRefreshProgressDetails, - InstanceRefreshStatus, - RefreshPreferences, - DesiredConfiguration, - RollbackDetails, - NullablePositiveDouble, - LocalStorageType, - VCpuCountRequest, - MemoryMiBRequest, - CpuManufacturers, - MemoryGiBPerVCpuRequest, - ExcludedInstanceTypes, - InstanceGenerations, - BareMetal, - BurstablePerformance, - NullableBoolean, - NetworkInterfaceCountRequest, - LocalStorage, - LocalStorageTypes, - TotalLocalStorageGBRequest, - BaselineEbsBandwidthMbpsRequest, - AcceleratorTypes, - AcceleratorCountRequest, - AcceleratorManufacturers, - AcceleratorNames, - AcceleratorTotalMemoryMiBRequest, - NetworkBandwidthGbpsRequest, - AllowedInstanceTypes, - ReuseOnScaleIn, - LaunchConfigurationNames, - LaunchConfiguration, - LaunchTemplateOverrides, - InstanceRequirements, - GlobalTimeout, - PredictiveScalingPredefinedMetricPair, - PredictiveScalingPredefinedScalingMetric, - PredictiveScalingPredefinedLoadMetric, - PredictiveScalingCustomizedScalingMetric, - PredictiveScalingCustomizedLoadMetric, - PredictiveScalingCustomizedCapacityMetric, - MetricStat, - XmlStringMetricLabel, - ReturnData, - MetricDataQuery, - Metric, - XmlStringMetricStat, - MetricDimensionName, - MetricDimensionValue, - ScalingPolicy, - PredictiveScalingMetricSpecifications, - PredictiveScalingMode, - PredictiveScalingSchedulingBufferTime, - PredictiveScalingMaxCapacityBreachBehavior, - PredictiveScalingMaxCapacityBuffer, - MetricDataQueries, - PredefinedMetricPairType, - PredefinedScalingMetricType, - PredefinedLoadMetricType, - ProcessType, - StepAdjustment, - PredefinedMetricSpecification, - CustomizedMetricSpecification, - DisableScaleIn, - MinAdjustmentStep, - MinAdjustmentMagnitude, - StepAdjustments, - EstimatedInstanceWarmup, - TargetTrackingConfiguration, - ScalingPolicyEnabled, - PredictiveScalingConfiguration, - ProcessNames, - ScheduledUpdateGroupAction, - ShouldRespectGracePeriod, - ProtectedFromScaleIn, - RefreshStrategy, - TargetTrackingMetricStat, - ResourceContentionFault, - ServiceLinkedRoleFailure, AttachInstancesQuery, AttachLoadBalancerTargetGroupsResultType, + AttachLoadBalancerTargetGroupsType, AttachLoadBalancersResultType, + AttachLoadBalancersType, AttachTrafficSourcesResultType, - BatchDeleteScheduledActionAnswer, - BatchPutScheduledUpdateGroupActionAnswer, - AlreadyExistsFault, - LimitExceededFault, - CancelInstanceRefreshAnswer, - ActiveInstanceRefreshNotFoundFault, - CompleteLifecycleActionAnswer, - ResourceInUseFault, - ScalingActivityInProgressFault, - DeleteLifecycleHookAnswer, - DeleteWarmPoolAnswer, - DescribeAccountLimitsAnswer, - DescribeAdjustmentTypesAnswer, + AttachTrafficSourcesType, + AutoRollback, + AutoScalingGroupNamesType, AutoScalingGroupsType, - InvalidNextToken, AutoScalingInstancesType, - DescribeAutoScalingNotificationTypesAnswer, - DescribeInstanceRefreshesAnswer, - LaunchConfigurationsType, - DescribeLifecycleHookTypesAnswer, - DescribeLifecycleHooksAnswer, - DescribeLoadBalancerTargetGroupsResponse, - DescribeLoadBalancersResponse, - DescribeMetricCollectionTypesAnswer, - DescribeNotificationConfigurationsAnswer, - PoliciesType, - ActivitiesType, - ProcessesType, - ScheduledActionsType, - TagsType, - DescribeTerminationPolicyTypesAnswer, - DescribeTrafficSourcesResponse, - DescribeWarmPoolAnswer, - DetachInstancesAnswer, - DetachLoadBalancerTargetGroupsResultType, - DetachLoadBalancersResultType, - DetachTrafficSourcesResultType, - EnterStandbyAnswer, - ExitStandbyAnswer, - GetPredictiveScalingForecastAnswer, - PutLifecycleHookAnswer, - PolicyARNType, - PutWarmPoolAnswer, - RecordLifecycleActionHeartbeatAnswer, - RollbackInstanceRefreshAnswer, - IrreversibleInstanceRefreshFault, - SetInstanceProtectionAnswer, - StartInstanceRefreshAnswer, - InstanceRefreshInProgressFault, - ActivityType, - AttachLoadBalancerTargetGroupsType, - AttachLoadBalancersType, - AttachTrafficSourcesType, + BatchDeleteScheduledActionAnswer, BatchDeleteScheduledActionType, - AutoScalingGroupNamesType, + BatchPutScheduledUpdateGroupActionAnswer, BatchPutScheduledUpdateGroupActionType, + BlockDeviceMapping, + CancelInstanceRefreshAnswer, CancelInstanceRefreshType, + CheckpointDelay, + CheckpointPercentages, + CompleteLifecycleActionAnswer, CompleteLifecycleActionType, CreateAutoScalingGroupType, CreateLaunchConfigurationType, CreateOrUpdateTagsType, + CustomizedMetricSpecification, DeleteAutoScalingGroupType, - LaunchConfigurationNameType, + DeleteLifecycleHookAnswer, DeleteLifecycleHookType, DeleteNotificationConfigurationType, DeletePolicyType, DeleteScheduledActionType, DeleteTagsType, + DeleteWarmPoolAnswer, DeleteWarmPoolType, + DescribeAccountLimitsAnswer, + DescribeAdjustmentTypesAnswer, DescribeAutoScalingInstancesType, + DescribeAutoScalingNotificationTypesAnswer, + DescribeInstanceRefreshesAnswer, DescribeInstanceRefreshesType, + DescribeLifecycleHookTypesAnswer, + DescribeLifecycleHooksAnswer, DescribeLifecycleHooksType, DescribeLoadBalancerTargetGroupsRequest, + DescribeLoadBalancerTargetGroupsResponse, DescribeLoadBalancersRequest, + DescribeLoadBalancersResponse, + DescribeMetricCollectionTypesAnswer, + DescribeNotificationConfigurationsAnswer, DescribeNotificationConfigurationsType, DescribePoliciesType, DescribeScalingActivitiesType, DescribeScheduledActionsType, DescribeTagsType, + DescribeTerminationPolicyTypesAnswer, DescribeTrafficSourcesRequest, + DescribeTrafficSourcesResponse, + DescribeWarmPoolAnswer, DescribeWarmPoolType, + DetachInstancesAnswer, DetachInstancesQuery, + DetachLoadBalancerTargetGroupsResultType, DetachLoadBalancerTargetGroupsType, + DetachLoadBalancersResultType, DetachLoadBalancersType, + DetachTrafficSourcesResultType, DetachTrafficSourcesType, DisableMetricsCollectionQuery, + DisableScaleIn, EnableMetricsCollectionQuery, + EnterStandbyAnswer, EnterStandbyQuery, ExecutePolicyType, + ExitStandbyAnswer, ExitStandbyQuery, + Filter, + GetPredictiveScalingForecastAnswer, GetPredictiveScalingForecastType, + InstanceMetadataEndpointState, + InstanceMetadataHttpPutResponseHopLimit, + InstanceMetadataHttpTokensState, + InstancesDistribution, + IntPercent, + LaunchConfigurationNameType, LaunchConfigurationNamesType, + LaunchConfigurationsType, + LaunchTemplate, + LaunchTemplateName, + LaunchTemplateSpecification, + LifecycleHookSpecification, + MetricScale, + MixedInstancesPolicy, + MonitoringEnabled, + PoliciesType, + PolicyARNType, + PredefinedMetricSpecification, + PredictiveScalingMaxCapacityBreachBehavior, + PredictiveScalingMaxCapacityBuffer, + PredictiveScalingMetricSpecifications, + PredictiveScalingMode, + PredictiveScalingSchedulingBufferTime, + ProcessesType, + PutLifecycleHookAnswer, PutLifecycleHookType, PutNotificationConfigurationType, PutScalingPolicyType, PutScheduledUpdateGroupActionType, + PutWarmPoolAnswer, PutWarmPoolType, + RecordLifecycleActionHeartbeatAnswer, RecordLifecycleActionHeartbeatType, - ScalingProcessQuery, + RefreshInstanceWarmup, + ResourceName, + ReuseOnScaleIn, + RollbackInstanceRefreshAnswer, RollbackInstanceRefreshType, + ScaleInProtectedInstances, + ScalingProcessQuery, + ScheduledActionsType, + ScheduledUpdateGroupActionRequest, SetDesiredCapacityType, SetInstanceHealthQuery, + SetInstanceProtectionAnswer, SetInstanceProtectionQuery, + SkipMatching, + StandbyInstances, + StartInstanceRefreshAnswer, StartInstanceRefreshType, + StepAdjustment, + Tag, + TagsType, TerminateInstanceInAutoScalingGroupType, + TrafficSourceIdentifier, UpdateAutoScalingGroupType, - Api, + XmlString, + XmlStringMaxLen1600, + XmlStringMaxLen19, + XmlStringMaxLen255, + XmlStringMaxLen511, + XmlStringMaxLen64, } from "./api"; -import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; const api = new Api({ baseUrl: "http://localhost:13191", diff --git a/tests/test-data/golden-files/aws-cloud-map b/tests/test-data/golden-files/aws-cloud-map new file mode 100644 index 0000000..2d95058 --- /dev/null +++ b/tests/test-data/golden-files/aws-cloud-map @@ -0,0 +1,755 @@ +import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; +import { + Api, + CreateHttpNamespaceRequest, + CreateHttpNamespaceResponse, + CreatePrivateDnsNamespaceRequest, + CreatePrivateDnsNamespaceResponse, + CreatePublicDnsNamespaceRequest, + CreatePublicDnsNamespaceResponse, + CreateServiceRequest, + CreateServiceResponse, + DeleteNamespaceRequest, + DeleteNamespaceResponse, + DeleteServiceRequest, + DeleteServiceResponse, + DeregisterInstanceRequest, + DeregisterInstanceResponse, + DiscoverInstancesRequest, + DiscoverInstancesResponse, + GetInstanceRequest, + GetInstanceResponse, + GetInstancesHealthStatusRequest, + GetInstancesHealthStatusResponse, + GetNamespaceRequest, + GetNamespaceResponse, + GetOperationRequest, + GetOperationResponse, + GetServiceRequest, + GetServiceResponse, + ListInstancesRequest, + ListInstancesResponse, + ListNamespacesRequest, + ListNamespacesResponse, + ListOperationsRequest, + ListOperationsResponse, + ListServicesRequest, + ListServicesResponse, + ListTagsForResourceRequest, + ListTagsForResourceResponse, + RegisterInstanceRequest, + RegisterInstanceResponse, + TagResourceRequest, + TagResourceResponse, + UntagResourceRequest, + UntagResourceResponse, + UpdateHttpNamespaceRequest, + UpdateHttpNamespaceResponse, + UpdateInstanceCustomHealthStatusRequest, + UpdatePrivateDnsNamespaceRequest, + UpdatePrivateDnsNamespaceResponse, + UpdatePublicDnsNamespaceRequest, + UpdatePublicDnsNamespaceResponse, + UpdateServiceRequest, + UpdateServiceResponse, +} from "./api"; + +const api = new Api({ + baseUrl: "", +}); + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.CreateHttpNamespace + */ +export async function postXAmzTargetRoute53AutoNamingV20170314CreateHttpNamespaceCreateHttpNamespace( + /** Request body */ + data: CreateHttpNamespaceRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314CreateHttpNamespace.createHttpNamespace( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.CreatePrivateDnsNamespace + */ +export async function postXAmzTargetRoute53AutoNamingV20170314CreatePrivateDnsNamespaceCreatePrivateDnsNamespace( + /** Request body */ + data: CreatePrivateDnsNamespaceRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314CreatePrivateDnsNamespace.createPrivateDnsNamespace( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.CreatePublicDnsNamespace + */ +export async function postXAmzTargetRoute53AutoNamingV20170314CreatePublicDnsNamespaceCreatePublicDnsNamespace( + /** Request body */ + data: CreatePublicDnsNamespaceRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314CreatePublicDnsNamespace.createPublicDnsNamespace( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.CreateService + * @allowrelaxedtypes + */ +export async function postXAmzTargetRoute53AutoNamingV20170314CreateServiceCreateService( + /** Request body */ + data: CreateServiceRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314CreateService.createService({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.DeleteNamespace + */ +export async function postXAmzTargetRoute53AutoNamingV20170314DeleteNamespaceDeleteNamespace( + /** Request body */ + data: DeleteNamespaceRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314DeleteNamespace.deleteNamespace( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.DeleteService + * @allowrelaxedtypes + */ +export async function postXAmzTargetRoute53AutoNamingV20170314DeleteServiceDeleteService( + /** Request body */ + data: DeleteServiceRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314DeleteService.deleteService({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.DeregisterInstance + */ +export async function postXAmzTargetRoute53AutoNamingV20170314DeregisterInstanceDeregisterInstance( + /** Request body */ + data: DeregisterInstanceRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314DeregisterInstance.deregisterInstance( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.DiscoverInstances + * @allowrelaxedtypes + */ +export async function postXAmzTargetRoute53AutoNamingV20170314DiscoverInstancesDiscoverInstances( + /** Request body */ + data: DiscoverInstancesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314DiscoverInstances.discoverInstances( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.GetInstance + */ +export async function postXAmzTargetRoute53AutoNamingV20170314GetInstanceGetInstance( + /** Request body */ + data: GetInstanceRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314GetInstance.getInstance({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.GetInstancesHealthStatus + */ +export async function postXAmzTargetRoute53AutoNamingV20170314GetInstancesHealthStatusGetInstancesHealthStatus( + query: { + /** + * Pagination limit + */ + MaxResults?: string; + /** + * Pagination token + */ + NextToken?: string; + }, + /** Request body */ + data: GetInstancesHealthStatusRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314GetInstancesHealthStatus.getInstancesHealthStatus( + { + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.GetNamespace + * @allowrelaxedtypes + */ +export async function postXAmzTargetRoute53AutoNamingV20170314GetNamespaceGetNamespace( + /** Request body */ + data: GetNamespaceRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314GetNamespace.getNamespace({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.GetOperation + * @allowrelaxedtypes + */ +export async function postXAmzTargetRoute53AutoNamingV20170314GetOperationGetOperation( + /** Request body */ + data: GetOperationRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314GetOperation.getOperation({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.GetService + * @allowrelaxedtypes + */ +export async function postXAmzTargetRoute53AutoNamingV20170314GetServiceGetService( + /** Request body */ + data: GetServiceRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314GetService.getService({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.ListInstances + */ +export async function postXAmzTargetRoute53AutoNamingV20170314ListInstancesListInstances( + query: { + /** + * Pagination limit + */ + MaxResults?: string; + /** + * Pagination token + */ + NextToken?: string; + }, + /** Request body */ + data: ListInstancesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314ListInstances.listInstances({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.ListNamespaces + * @allowrelaxedtypes + */ +export async function postXAmzTargetRoute53AutoNamingV20170314ListNamespacesListNamespaces( + query: { + /** + * Pagination limit + */ + MaxResults?: string; + /** + * Pagination token + */ + NextToken?: string; + }, + /** Request body */ + data: ListNamespacesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314ListNamespaces.listNamespaces( + { + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.ListOperations + * @allowrelaxedtypes + */ +export async function postXAmzTargetRoute53AutoNamingV20170314ListOperationsListOperations( + query: { + /** + * Pagination limit + */ + MaxResults?: string; + /** + * Pagination token + */ + NextToken?: string; + }, + /** Request body */ + data: ListOperationsRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314ListOperations.listOperations( + { + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.ListServices + * @allowrelaxedtypes + */ +export async function postXAmzTargetRoute53AutoNamingV20170314ListServicesListServices( + query: { + /** + * Pagination limit + */ + MaxResults?: string; + /** + * Pagination token + */ + NextToken?: string; + }, + /** Request body */ + data: ListServicesRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314ListServices.listServices({ + query: query, + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.ListTagsForResource + */ +export async function postXAmzTargetRoute53AutoNamingV20170314ListTagsForResourceListTagsForResource( + /** Request body */ + data: ListTagsForResourceRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314ListTagsForResource.listTagsForResource( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.RegisterInstance + */ +export async function postXAmzTargetRoute53AutoNamingV20170314RegisterInstanceRegisterInstance( + /** Request body */ + data: RegisterInstanceRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314RegisterInstance.registerInstance( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.TagResource + * @allowrelaxedtypes + */ +export async function postXAmzTargetRoute53AutoNamingV20170314TagResourceTagResource( + /** Request body */ + data: TagResourceRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314TagResource.tagResource({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.UntagResource + * @allowrelaxedtypes + */ +export async function postXAmzTargetRoute53AutoNamingV20170314UntagResourceUntagResource( + /** Request body */ + data: UntagResourceRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314UntagResource.untagResource({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.UpdateHttpNamespace + */ +export async function postXAmzTargetRoute53AutoNamingV20170314UpdateHttpNamespaceUpdateHttpNamespace( + /** Request body */ + data: UpdateHttpNamespaceRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314UpdateHttpNamespace.updateHttpNamespace( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.UpdateInstanceCustomHealthStatus + * @allowrelaxedtypes + */ +export async function postXAmzTargetRoute53AutoNamingV20170314UpdateInstanceCustomHealthStatusUpdateInstanceCustomHealthStatus( + /** Request body */ + data: UpdateInstanceCustomHealthStatusRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314UpdateInstanceCustomHealthStatus.updateInstanceCustomHealthStatus( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.error) { + throw result.error; + } else { + return new hasuraSdk.JSONValue(result.data); + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.UpdatePrivateDnsNamespace + */ +export async function postXAmzTargetRoute53AutoNamingV20170314UpdatePrivateDnsNamespaceUpdatePrivateDnsNamespace( + /** Request body */ + data: UpdatePrivateDnsNamespaceRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314UpdatePrivateDnsNamespace.updatePrivateDnsNamespace( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.UpdatePublicDnsNamespace + */ +export async function postXAmzTargetRoute53AutoNamingV20170314UpdatePublicDnsNamespaceUpdatePublicDnsNamespace( + /** Request body */ + data: UpdatePublicDnsNamespaceRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314UpdatePublicDnsNamespace.updatePublicDnsNamespace( + { + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }, + ); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * undefined + * @request POST :/#X-Amz-Target=Route53AutoNaming_v20170314.UpdateService + * @allowrelaxedtypes + */ +export async function postXAmzTargetRoute53AutoNamingV20170314UpdateServiceUpdateService( + /** Request body */ + data: UpdateServiceRequest, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = + await api.xAmzTargetRoute53AutoNamingV20170314UpdateService.updateService({ + data: data, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} diff --git a/tests/test-data/golden-files/circleci b/tests/test-data/golden-files/circleci index 3fd083a..142b465 100644 --- a/tests/test-data/golden-files/circleci +++ b/tests/test-data/golden-files/circleci @@ -1,35 +1,23 @@ +import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; import { - Artifact, - Lifecycle, - PreviousBuild, - CommitDetails, - User, - Outcome, - Status, - Sha1, - Build, - CommitDetail, - Envvar, - Key, - Aws, - StringOrNull, - Scope, - Project, + Api, Artifacts, + Build, BuildDetail, BuildParameters, BuildSummary, Builds, + Envvar, Envvars, + Key, Keys, Parallel, Projects, Revision, Tag, Tests, - Api, + User, } from "./api"; -import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; const api = new Api({ baseUrl: "http://localhost:13191", diff --git a/tests/test-data/golden-files/demo-blog-api b/tests/test-data/golden-files/demo-blog-api index e0f5152..6c00d4f 100644 --- a/tests/test-data/golden-files/demo-blog-api +++ b/tests/test-data/golden-files/demo-blog-api @@ -1,5 +1,5 @@ -import { MainAuthor, MainBlog, MainBlogRequestDto, Api } from "./api"; import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; +import { Api, MainAuthor, MainBlog, MainBlogRequestDto } from "./api"; const api = new Api({ baseUrl: "http://localhost:9191", diff --git a/tests/test-data/golden-files/geomag b/tests/test-data/golden-files/geomag index c30c5fc..8414b1f 100644 --- a/tests/test-data/golden-files/geomag +++ b/tests/test-data/golden-files/geomag @@ -1,5 +1,5 @@ -import { Api } from "./api"; import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; +import { Api } from "./api"; const api = new Api({ baseUrl: "", diff --git a/tests/test-data/golden-files/gitlab b/tests/test-data/golden-files/gitlab index a43066e..2b5851f 100644 --- a/tests/test-data/golden-files/gitlab +++ b/tests/test-data/golden-files/gitlab @@ -1,29 +1,12 @@ +import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; import { - UserBasic, - List, - BuildArtifactFile, - RepoCommit, - PipelineBasic, - Runner, - User, - RepoDiff, - Build, - EnvironmentBasic, - Project, - Note, - Milestone, - LabelBasic, - BasicProjectDetails, - Namespace, - ProjectStatistics, - RepoCommitStats, - Release, - UserPublic, - Identity, - ApplicationSetting, AccessRequester, + Api, + ApplicationSetting, AwardEmoji, + BasicProjectDetails, Board, + Build, CommitNote, CommitStatus, Compare, @@ -38,25 +21,33 @@ import { Hook, Issue, Label, + List, MRNote, Member, MergeRequest, MergeRequestChanges, MergeRequestDiff, MergeRequestDiffFull, + Milestone, + Namespace, + Note, NotificationSetting, PersonalSnippet, Pipeline, + Project, ProjectGroupLink, ProjectHook, ProjectService, ProjectSnippet, ProjectWithAccess, + Release, RepoBranch, + RepoCommit, RepoCommitDetail, RepoLicense, RepoTag, RepoTreeObject, + Runner, RunnerDetails, SSHKey, SSHKeyWithUser, @@ -65,11 +56,11 @@ import { Todo, Trigger, TriggerRequest, + UserBasic, + UserPublic, UserWithPrivateToken, Variable, - Api, } from "./api"; -import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; const api = new Api({ baseUrl: "", diff --git a/tests/test-data/golden-files/google-adsense b/tests/test-data/golden-files/google-adsense index 2ee255b..6431ba9 100644 --- a/tests/test-data/golden-files/google-adsense +++ b/tests/test-data/golden-files/google-adsense @@ -1,30 +1,23 @@ +import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; import { Account, - AdClient, - AdStyle, - AdUnit, - Alert, - CustomChannel, - ReportingMetadataEntry, - Payment, - SavedAdStyle, - SavedReport, - UrlChannel, Accounts, AdClients, AdCode, + AdUnit, AdUnits, - CustomChannels, AdsenseReportsGenerateResponse, Alerts, - UrlChannels, + Api, + CustomChannel, + CustomChannels, Metadata, Payments, + SavedAdStyle, SavedAdStyles, SavedReports, - Api, + UrlChannels, } from "./api"; -import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; const api = new Api({ baseUrl: "http://localhost:13191", diff --git a/tests/test-data/golden-files/google-home b/tests/test-data/golden-files/google-home index 4836641..cd53f34 100644 --- a/tests/test-data/golden-files/google-home +++ b/tests/test-data/golden-files/google-home @@ -1,42 +1,8 @@ +import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; import { - DatePattern, - TimePattern, - Device, - IconList, - Locale, - Timezone, - Capabilities, - Aogh, - Audio, - BuildInfo, - Detail, - DeviceInfo, - Multizone, - Net, - NightModeParams, - Opencast, - OptIn, - Proxy, - Settings, - Setup, - Sign, - UserEq, - Wifi, - ConnectedDevice, - RemoteSink, - Window2, - Alarm, - Timer, - Window, - HighShelf1, - LowShelf1, - OptIn1, - Settings1, - Stats, - HighShelf, - LowShelf, AccessibilityRequest, AlarmVolumeRequest, + Api, AppDeviceIDRequest, ChangeDiscoverabilityRequest, CheckReadyStatusRequest, @@ -69,9 +35,7 @@ import { SetEqualizerValuesRequest, SetEurekaInfoRequest, TestInternetDownloadSpeedRequest, - Api, } from "./api"; -import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; const api = new Api({ baseUrl: "http://localhost:13191", diff --git a/tests/test-data/golden-files/instagram b/tests/test-data/golden-files/instagram index de3bb31..e701020 100644 --- a/tests/test-data/golden-files/instagram +++ b/tests/test-data/golden-files/instagram @@ -1,43 +1,22 @@ +import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; import { - UserShortInfo, - CommentEntry, - MetaData, - ImageInfo, - LocationInfo, - CaptionData, - CommentsCollection, - ImagesData, - LikesCollection, - UserInPhoto, - VideosData, - MediaEntry, - IdPaginationInfo, - RelationshipStatus, - RelationshipInfo, - TagInfo, - TagPaginationInfo, - Position, - UserCounts, - UserInfo, - CursorPaginationInfo, - MediaListResponse, + Api, CommentsResponse, LocationInfoResponse, LocationSearchResponse, MediaEntryResponse, + MediaListResponse, MediaSearchResponse, - StatusResponse, RelationshipPostResponse, RelationshipResponse, - UsersInfoResponse, + StatusResponse, TagInfoResponse, TagMediaListResponse, TagSearchResponse, UserResponse, + UsersInfoResponse, UsersPagingResponse, - Api, } from "./api"; -import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; const api = new Api({ baseUrl: "", diff --git a/tests/test-data/golden-files/kubernetes b/tests/test-data/golden-files/kubernetes index 2c5386b..1d5858b 100644 --- a/tests/test-data/golden-files/kubernetes +++ b/tests/test-data/golden-files/kubernetes @@ -1,540 +1,149 @@ +import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; import { - IoK8SApiAdmissionregistrationV1WebhookClientConfig, - IoK8SApimachineryPkgApisMetaV1LabelSelector, - IoK8SApiAdmissionregistrationV1RuleWithOperations, - IoK8SApimachineryPkgApisMetaV1ObjectMeta, - IoK8SApiAdmissionregistrationV1MutatingWebhook, - IoK8SApiAdmissionregistrationV1MutatingWebhookConfiguration, - IoK8SApimachineryPkgApisMetaV1ListMeta, - IoK8SApiAdmissionregistrationV1ValidatingWebhook, - IoK8SApiAdmissionregistrationV1ValidatingWebhookConfiguration, - IoK8SApiAdmissionregistrationV1ServiceReference, - IoK8SApiAdmissionregistrationV1Alpha1NamedRuleWithOperations, - IoK8SApiAdmissionregistrationV1Alpha1ValidatingAdmissionPolicySpec, - IoK8SApiAdmissionregistrationV1Alpha1ValidatingAdmissionPolicyBindingSpec, - IoK8SApiAdmissionregistrationV1Alpha1ValidatingAdmissionPolicyBinding, - IoK8SApiAdmissionregistrationV1Alpha1MatchResources, - IoK8SApiAdmissionregistrationV1Alpha1ParamRef, + Api, IoK8SApiAdmissionregistrationV1Alpha1ValidatingAdmissionPolicy, - IoK8SApiAdmissionregistrationV1Alpha1ParamKind, - IoK8SApiAdmissionregistrationV1Alpha1Validation, - IoK8SApiApiserverinternalV1Alpha1StorageVersionSpec, - IoK8SApiApiserverinternalV1Alpha1StorageVersionStatus, - IoK8SApimachineryPkgApisMetaV1Time, - IoK8SApiApiserverinternalV1Alpha1StorageVersion, - IoK8SApiApiserverinternalV1Alpha1StorageVersionCondition, - IoK8SApiApiserverinternalV1Alpha1ServerStorageVersion, - IoK8SApimachineryPkgRuntimeRawExtension, - IoK8SApiAppsV1ControllerRevision, - IoK8SApiAppsV1DaemonSetSpec, - IoK8SApiAppsV1DaemonSetStatus, - IoK8SApiAppsV1DaemonSet, - IoK8SApiCoreV1PodTemplateSpec, - IoK8SApiAppsV1DaemonSetUpdateStrategy, - IoK8SApiAppsV1DaemonSetCondition, - IoK8SApiAppsV1RollingUpdateDaemonSet, - IoK8SApiAppsV1DeploymentSpec, - IoK8SApiAppsV1DeploymentStatus, - IoK8SApiAppsV1Deployment, - IoK8SApiAppsV1DeploymentStrategy, - IoK8SApiAppsV1DeploymentCondition, - IoK8SApiAppsV1RollingUpdateDeployment, - IoK8SApiAppsV1ReplicaSetSpec, - IoK8SApiAppsV1ReplicaSetStatus, - IoK8SApiAppsV1ReplicaSet, - IoK8SApiAppsV1ReplicaSetCondition, - IoK8SApimachineryPkgUtilIntstrIntOrString, - IoK8SApiAppsV1StatefulSetSpec, - IoK8SApiAppsV1StatefulSetStatus, - IoK8SApiAppsV1StatefulSet, - IoK8SApiAppsV1StatefulSetOrdinals, - IoK8SApiAppsV1StatefulSetPersistentVolumeClaimRetentionPolicy, - IoK8SApiAppsV1StatefulSetUpdateStrategy, - IoK8SApiCoreV1PersistentVolumeClaim, - IoK8SApiAppsV1StatefulSetCondition, - IoK8SApiAppsV1RollingUpdateStatefulSetStrategy, - IoK8SApiAuthenticationV1TokenRequestSpec, - IoK8SApiAuthenticationV1TokenRequestStatus, - IoK8SApiAuthenticationV1BoundObjectReference, - IoK8SApiAuthenticationV1TokenReviewSpec, - IoK8SApiAuthenticationV1TokenReviewStatus, - IoK8SApiAuthenticationV1UserInfo, - IoK8SApiAuthenticationV1Alpha1SelfSubjectReviewStatus, - IoK8SApiAuthorizationV1SubjectAccessReviewSpec, - IoK8SApiAuthorizationV1SubjectAccessReviewStatus, - IoK8SApiAuthorizationV1SelfSubjectAccessReviewSpec, - IoK8SApiAuthorizationV1NonResourceAttributes, - IoK8SApiAuthorizationV1ResourceAttributes, - IoK8SApiAuthorizationV1SelfSubjectRulesReviewSpec, - IoK8SApiAuthorizationV1SubjectRulesReviewStatus, - IoK8SApiAuthorizationV1NonResourceRule, - IoK8SApiAuthorizationV1ResourceRule, - IoK8SApiAutoscalingV1HorizontalPodAutoscalerSpec, - IoK8SApiAutoscalingV1HorizontalPodAutoscalerStatus, - IoK8SApiAutoscalingV1HorizontalPodAutoscaler, - IoK8SApiAutoscalingV1CrossVersionObjectReference, - IoK8SApiAutoscalingV1ScaleSpec, - IoK8SApiAutoscalingV1ScaleStatus, - IoK8SApiAutoscalingV2MetricTarget, - IoK8SApiAutoscalingV2MetricValueStatus, - IoK8SApiAutoscalingV2MetricIdentifier, - IoK8SApiAutoscalingV2HPAScalingPolicy, - IoK8SApiAutoscalingV2HorizontalPodAutoscalerSpec, - IoK8SApiAutoscalingV2HorizontalPodAutoscalerStatus, - IoK8SApiAutoscalingV2HPAScalingRules, - IoK8SApiAutoscalingV2HorizontalPodAutoscaler, - IoK8SApiAutoscalingV2HorizontalPodAutoscalerBehavior, - IoK8SApiAutoscalingV2MetricSpec, - IoK8SApiAutoscalingV2CrossVersionObjectReference, - IoK8SApiAutoscalingV2HorizontalPodAutoscalerCondition, - IoK8SApiAutoscalingV2MetricStatus, - IoK8SApiAutoscalingV2ContainerResourceMetricSource, - IoK8SApiAutoscalingV2ExternalMetricSource, - IoK8SApiAutoscalingV2ObjectMetricSource, - IoK8SApiAutoscalingV2PodsMetricSource, - IoK8SApiAutoscalingV2ResourceMetricSource, - IoK8SApiAutoscalingV2ContainerResourceMetricStatus, - IoK8SApiAutoscalingV2ExternalMetricStatus, - IoK8SApiAutoscalingV2ObjectMetricStatus, - IoK8SApiAutoscalingV2PodsMetricStatus, - IoK8SApiAutoscalingV2ResourceMetricStatus, - IoK8SApimachineryPkgApiResourceQuantity, - IoK8SApiBatchV1CronJobSpec, - IoK8SApiBatchV1CronJobStatus, - IoK8SApiBatchV1CronJob, - IoK8SApiBatchV1JobTemplateSpec, - IoK8SApiCoreV1ObjectReference, - IoK8SApiBatchV1JobSpec, - IoK8SApiBatchV1JobStatus, - IoK8SApiBatchV1Job, - IoK8SApiBatchV1PodFailurePolicy, - IoK8SApiBatchV1JobCondition, - IoK8SApiBatchV1UncountedTerminatedPods, - IoK8SApiBatchV1PodFailurePolicyRule, - IoK8SApiBatchV1PodFailurePolicyOnExitCodesRequirement, - IoK8SApiBatchV1PodFailurePolicyOnPodConditionsPattern, - IoK8SApiCertificatesV1CertificateSigningRequestSpec, - IoK8SApiCertificatesV1CertificateSigningRequestStatus, - IoK8SApiCertificatesV1CertificateSigningRequest, - IoK8SApiCertificatesV1CertificateSigningRequestCondition, - IoK8SApiCoordinationV1LeaseSpec, - IoK8SApiCoordinationV1Lease, - IoK8SApimachineryPkgApisMetaV1MicroTime, - IoK8SApiCoreV1NodeAffinity, - IoK8SApiCoreV1PodAffinity, - IoK8SApiCoreV1PodAntiAffinity, - IoK8SApiCoreV1SecretReference, - IoK8SApiCoreV1LocalObjectReference, - IoK8SApiCoreV1ComponentCondition, - IoK8SApiCoreV1ComponentStatus, - IoK8SApiCoreV1ConfigMap, - IoK8SApiCoreV1KeyToPath, - IoK8SApiCoreV1EnvVar, - IoK8SApiCoreV1EnvFromSource, - IoK8SApiCoreV1Lifecycle, - IoK8SApiCoreV1Probe, - IoK8SApiCoreV1ContainerPort, - IoK8SApiCoreV1ContainerResizePolicy, - IoK8SApiCoreV1ResourceRequirements, - IoK8SApiCoreV1SecurityContext, - IoK8SApiCoreV1VolumeDevice, - IoK8SApiCoreV1VolumeMount, - IoK8SApiCoreV1ContainerStateRunning, - IoK8SApiCoreV1ContainerStateTerminated, - IoK8SApiCoreV1ContainerStateWaiting, - IoK8SApiCoreV1ContainerState, - IoK8SApiCoreV1DownwardAPIVolumeFile, - IoK8SApiCoreV1ObjectFieldSelector, - IoK8SApiCoreV1ResourceFieldSelector, - IoK8SApiCoreV1EndpointAddress, - IoK8SApiCoreV1EndpointPort, - IoK8SApiCoreV1EndpointSubset, - IoK8SApiCoreV1Endpoints, - IoK8SApiCoreV1ConfigMapEnvSource, - IoK8SApiCoreV1SecretEnvSource, - IoK8SApiCoreV1EnvVarSource, - IoK8SApiCoreV1ConfigMapKeySelector, - IoK8SApiCoreV1SecretKeySelector, - IoK8SApiCoreV1PersistentVolumeClaimTemplate, - IoK8SApiCoreV1EventSeries, - IoK8SApiCoreV1EventSource, - IoK8SApiCoreV1Event, - IoK8SApiCoreV1HTTPHeader, - IoK8SApiCoreV1LifecycleHandler, - IoK8SApiCoreV1ExecAction, - IoK8SApiCoreV1HTTPGetAction, - IoK8SApiCoreV1TCPSocketAction, - IoK8SApiCoreV1LimitRangeSpec, - IoK8SApiCoreV1LimitRange, - IoK8SApiCoreV1LimitRangeItem, - IoK8SApiCoreV1PortStatus, - IoK8SApiCoreV1LoadBalancerIngress, - IoK8SApiCoreV1NamespaceSpec, - IoK8SApiCoreV1NamespaceStatus, - IoK8SApiCoreV1Namespace, - IoK8SApiCoreV1NamespaceCondition, - IoK8SApiCoreV1NodeSpec, - IoK8SApiCoreV1NodeStatus, - IoK8SApiCoreV1PreferredSchedulingTerm, - IoK8SApiCoreV1NodeSelector, - IoK8SApiCoreV1ConfigMapNodeConfigSource, - IoK8SApiCoreV1NodeConfigSource, - IoK8SApiCoreV1DaemonEndpoint, - IoK8SApiCoreV1Node, - IoK8SApiCoreV1NodeSelectorTerm, - IoK8SApiCoreV1NodeSelectorRequirement, - IoK8SApiCoreV1Taint, - IoK8SApiCoreV1NodeAddress, - IoK8SApiCoreV1NodeCondition, - IoK8SApiCoreV1NodeConfigStatus, - IoK8SApiCoreV1NodeDaemonEndpoints, - IoK8SApiCoreV1ContainerImage, - IoK8SApiCoreV1NodeSystemInfo, - IoK8SApiCoreV1AttachedVolume, - IoK8SApiCoreV1PersistentVolumeSpec, - IoK8SApiCoreV1PersistentVolumeStatus, - IoK8SApiCoreV1PersistentVolumeClaimSpec, - IoK8SApiCoreV1PersistentVolumeClaimStatus, - IoK8SApiCoreV1TypedLocalObjectReference, - IoK8SApiCoreV1TypedObjectReference, - IoK8SApiCoreV1PersistentVolumeClaimCondition, - IoK8SApiCoreV1PersistentVolume, - IoK8SApiCoreV1AWSElasticBlockStoreVolumeSource, - IoK8SApiCoreV1AzureDiskVolumeSource, - IoK8SApiCoreV1AzureFilePersistentVolumeSource, - IoK8SApiCoreV1CephFSPersistentVolumeSource, - IoK8SApiCoreV1CinderPersistentVolumeSource, - IoK8SApiCoreV1CSIPersistentVolumeSource, - IoK8SApiCoreV1FCVolumeSource, - IoK8SApiCoreV1FlexPersistentVolumeSource, - IoK8SApiCoreV1FlockerVolumeSource, - IoK8SApiCoreV1GCEPersistentDiskVolumeSource, - IoK8SApiCoreV1GlusterfsPersistentVolumeSource, - IoK8SApiCoreV1HostPathVolumeSource, - IoK8SApiCoreV1ISCSIPersistentVolumeSource, - IoK8SApiCoreV1LocalVolumeSource, - IoK8SApiCoreV1NFSVolumeSource, - IoK8SApiCoreV1VolumeNodeAffinity, - IoK8SApiCoreV1PhotonPersistentDiskVolumeSource, - IoK8SApiCoreV1PortworxVolumeSource, - IoK8SApiCoreV1QuobyteVolumeSource, - IoK8SApiCoreV1RBDPersistentVolumeSource, - IoK8SApiCoreV1ScaleIOPersistentVolumeSource, - IoK8SApiCoreV1StorageOSPersistentVolumeSource, - IoK8SApiCoreV1VsphereVirtualDiskVolumeSource, - IoK8SApiCoreV1PodSpec, - IoK8SApiCoreV1PodStatus, - IoK8SApiCoreV1WeightedPodAffinityTerm, - IoK8SApiCoreV1PodAffinityTerm, - IoK8SApiCoreV1PodDNSConfigOption, - IoK8SApiCoreV1Pod, - IoK8SApiCoreV1ClaimSource, - IoK8SApiCoreV1SELinuxOptions, - IoK8SApiCoreV1SeccompProfile, - IoK8SApiCoreV1Sysctl, - IoK8SApiCoreV1WindowsSecurityContextOptions, - IoK8SApiCoreV1Affinity, - IoK8SApiCoreV1Container, - IoK8SApiCoreV1PodDNSConfig, - IoK8SApiCoreV1EphemeralContainer, - IoK8SApiCoreV1HostAlias, - IoK8SApiCoreV1PodOS, - IoK8SApiCoreV1PodReadinessGate, - IoK8SApiCoreV1PodResourceClaim, - IoK8SApiCoreV1PodSchedulingGate, - IoK8SApiCoreV1PodSecurityContext, - IoK8SApiCoreV1Toleration, - IoK8SApiCoreV1TopologySpreadConstraint, - IoK8SApiCoreV1Volume, - IoK8SApiCoreV1PodCondition, - IoK8SApiCoreV1ContainerStatus, - IoK8SApiCoreV1PodIP, - IoK8SApiCoreV1PodTemplate, - IoK8SApiCoreV1GRPCAction, - IoK8SApiCoreV1VolumeProjection, - IoK8SApiCoreV1ReplicationControllerSpec, - IoK8SApiCoreV1ReplicationControllerStatus, - IoK8SApiCoreV1ReplicationController, - IoK8SApiCoreV1ReplicationControllerCondition, - IoK8SApiCoreV1ResourceQuotaSpec, - IoK8SApiCoreV1ResourceQuotaStatus, - IoK8SApiCoreV1ResourceQuota, - IoK8SApiCoreV1ScopeSelector, - IoK8SApiCoreV1ResourceClaim, - IoK8SApiCoreV1ScopedResourceSelectorRequirement, - IoK8SApiCoreV1Secret, - IoK8SApiCoreV1Capabilities, - IoK8SApiCoreV1ServiceSpec, - IoK8SApiCoreV1ServiceStatus, - IoK8SApiCoreV1ServiceAccount, - IoK8SApiCoreV1Service, - IoK8SApiCoreV1ServicePort, - IoK8SApiCoreV1SessionAffinityConfig, - IoK8SApimachineryPkgApisMetaV1Condition, - IoK8SApiCoreV1LoadBalancerStatus, - IoK8SApiCoreV1ClientIPConfig, - IoK8SApiCoreV1TopologySelectorLabelRequirement, - IoK8SApiCoreV1AzureFileVolumeSource, - IoK8SApiCoreV1CephFSVolumeSource, - IoK8SApiCoreV1CinderVolumeSource, - IoK8SApiCoreV1ConfigMapVolumeSource, - IoK8SApiCoreV1CSIVolumeSource, - IoK8SApiCoreV1DownwardAPIVolumeSource, - IoK8SApiCoreV1EmptyDirVolumeSource, - IoK8SApiCoreV1EphemeralVolumeSource, - IoK8SApiCoreV1FlexVolumeSource, - IoK8SApiCoreV1GitRepoVolumeSource, - IoK8SApiCoreV1GlusterfsVolumeSource, - IoK8SApiCoreV1ISCSIVolumeSource, - IoK8SApiCoreV1PersistentVolumeClaimVolumeSource, - IoK8SApiCoreV1ProjectedVolumeSource, - IoK8SApiCoreV1RBDVolumeSource, - IoK8SApiCoreV1ScaleIOVolumeSource, - IoK8SApiCoreV1SecretVolumeSource, - IoK8SApiCoreV1StorageOSVolumeSource, - IoK8SApiCoreV1ConfigMapProjection, - IoK8SApiCoreV1DownwardAPIProjection, - IoK8SApiCoreV1SecretProjection, - IoK8SApiCoreV1ServiceAccountTokenProjection, - IoK8SApiDiscoveryV1EndpointConditions, - IoK8SApiDiscoveryV1EndpointHints, - IoK8SApiDiscoveryV1ForZone, - IoK8SApiDiscoveryV1Endpoint, - IoK8SApiDiscoveryV1EndpointPort, - IoK8SApiDiscoveryV1EndpointSlice, - IoK8SApiEventsV1EventSeries, - IoK8SApiEventsV1Event, - IoK8SApiFlowcontrolV1Beta2FlowSchemaSpec, - IoK8SApiFlowcontrolV1Beta2FlowSchemaStatus, - IoK8SApiFlowcontrolV1Beta2FlowSchema, - IoK8SApiFlowcontrolV1Beta2FlowDistinguisherMethod, - IoK8SApiFlowcontrolV1Beta2PriorityLevelConfigurationReference, - IoK8SApiFlowcontrolV1Beta2PolicyRulesWithSubjects, - IoK8SApiFlowcontrolV1Beta2FlowSchemaCondition, - IoK8SApiFlowcontrolV1Beta2QueuingConfiguration, - IoK8SApiFlowcontrolV1Beta2LimitResponse, - IoK8SApiFlowcontrolV1Beta2NonResourcePolicyRule, - IoK8SApiFlowcontrolV1Beta2ResourcePolicyRule, - IoK8SApiFlowcontrolV1Beta2Subject, - IoK8SApiFlowcontrolV1Beta2PriorityLevelConfigurationSpec, - IoK8SApiFlowcontrolV1Beta2PriorityLevelConfigurationStatus, - IoK8SApiFlowcontrolV1Beta2PriorityLevelConfiguration, - IoK8SApiFlowcontrolV1Beta2LimitedPriorityLevelConfiguration, - IoK8SApiFlowcontrolV1Beta2PriorityLevelConfigurationCondition, - IoK8SApiFlowcontrolV1Beta2GroupSubject, - IoK8SApiFlowcontrolV1Beta2ServiceAccountSubject, - IoK8SApiFlowcontrolV1Beta2UserSubject, - IoK8SApiFlowcontrolV1Beta3FlowSchemaSpec, - IoK8SApiFlowcontrolV1Beta3FlowSchemaStatus, - IoK8SApiFlowcontrolV1Beta3FlowSchema, - IoK8SApiFlowcontrolV1Beta3FlowDistinguisherMethod, - IoK8SApiFlowcontrolV1Beta3PriorityLevelConfigurationReference, - IoK8SApiFlowcontrolV1Beta3PolicyRulesWithSubjects, - IoK8SApiFlowcontrolV1Beta3FlowSchemaCondition, - IoK8SApiFlowcontrolV1Beta3QueuingConfiguration, - IoK8SApiFlowcontrolV1Beta3LimitResponse, - IoK8SApiFlowcontrolV1Beta3NonResourcePolicyRule, - IoK8SApiFlowcontrolV1Beta3ResourcePolicyRule, - IoK8SApiFlowcontrolV1Beta3Subject, - IoK8SApiFlowcontrolV1Beta3PriorityLevelConfigurationSpec, - IoK8SApiFlowcontrolV1Beta3PriorityLevelConfigurationStatus, - IoK8SApiFlowcontrolV1Beta3PriorityLevelConfiguration, - IoK8SApiFlowcontrolV1Beta3LimitedPriorityLevelConfiguration, - IoK8SApiFlowcontrolV1Beta3PriorityLevelConfigurationCondition, - IoK8SApiFlowcontrolV1Beta3GroupSubject, - IoK8SApiFlowcontrolV1Beta3ServiceAccountSubject, - IoK8SApiFlowcontrolV1Beta3UserSubject, - IoK8SApiNetworkingV1IngressBackend, - IoK8SApiNetworkingV1HTTPIngressPath, - IoK8SApiNetworkingV1IngressSpec, - IoK8SApiNetworkingV1IngressStatus, - IoK8SApiNetworkingV1IngressServiceBackend, - IoK8SApiNetworkingV1IngressClassSpec, - IoK8SApiNetworkingV1IngressClass, - IoK8SApiNetworkingV1IngressClassParametersReference, - IoK8SApiNetworkingV1Ingress, - IoK8SApiNetworkingV1IngressPortStatus, - IoK8SApiNetworkingV1IngressLoadBalancerIngress, - IoK8SApiNetworkingV1HTTPIngressRuleValue, - IoK8SApiNetworkingV1ServiceBackendPort, - IoK8SApiNetworkingV1IngressRule, - IoK8SApiNetworkingV1IngressTLS, - IoK8SApiNetworkingV1IngressLoadBalancerStatus, - IoK8SApiNetworkingV1NetworkPolicySpec, - IoK8SApiNetworkingV1NetworkPolicyStatus, - IoK8SApiNetworkingV1NetworkPolicyPort, - IoK8SApiNetworkingV1NetworkPolicyPeer, - IoK8SApiNetworkingV1NetworkPolicy, - IoK8SApiNetworkingV1IPBlock, - IoK8SApiNetworkingV1NetworkPolicyEgressRule, - IoK8SApiNetworkingV1NetworkPolicyIngressRule, - IoK8SApiNetworkingV1Alpha1ClusterCIDRSpec, - IoK8SApiNetworkingV1Alpha1ClusterCIDR, - IoK8SApiNodeV1Overhead, - IoK8SApiNodeV1Scheduling, - IoK8SApiNodeV1RuntimeClass, - IoK8SApimachineryPkgApisMetaV1DeleteOptions, - IoK8SApiPolicyV1PodDisruptionBudgetSpec, - IoK8SApiPolicyV1PodDisruptionBudgetStatus, - IoK8SApiPolicyV1PodDisruptionBudget, - IoK8SApiRbacV1AggregationRule, - IoK8SApiRbacV1PolicyRule, - IoK8SApiRbacV1RoleRef, - IoK8SApiRbacV1Subject, - IoK8SApiRbacV1ClusterRoleBinding, - IoK8SApiRbacV1ClusterRole, - IoK8SApiRbacV1RoleBinding, - IoK8SApiRbacV1Role, - IoK8SApiResourceV1Alpha1PodSchedulingSpec, - IoK8SApiResourceV1Alpha1PodSchedulingStatus, - IoK8SApiResourceV1Alpha1PodScheduling, - IoK8SApiResourceV1Alpha1ResourceClaimSchedulingStatus, - IoK8SApiResourceV1Alpha1ResourceClaimSpec, - IoK8SApiResourceV1Alpha1ResourceClaimStatus, - IoK8SApiResourceV1Alpha1ResourceClaim, - IoK8SApiResourceV1Alpha1ResourceClaimParametersReference, - IoK8SApiResourceV1Alpha1AllocationResult, - IoK8SApiResourceV1Alpha1ResourceClaimConsumerReference, - IoK8SApiResourceV1Alpha1ResourceClaimTemplateSpec, - IoK8SApiResourceV1Alpha1ResourceClaimTemplate, - IoK8SApiResourceV1Alpha1ResourceClassParametersReference, - IoK8SApiResourceV1Alpha1ResourceClass, - IoK8SApiSchedulingV1PriorityClass, - IoK8SApiStorageV1CSIDriverSpec, - IoK8SApiStorageV1CSIDriver, - IoK8SApiStorageV1TokenRequest, - IoK8SApiStorageV1CSINodeSpec, - IoK8SApiStorageV1VolumeNodeResources, - IoK8SApiStorageV1CSINode, - IoK8SApiStorageV1CSINodeDriver, - IoK8SApiStorageV1CSIStorageCapacity, - IoK8SApiCoreV1TopologySelectorTerm, - IoK8SApiStorageV1StorageClass, - IoK8SApiStorageV1VolumeAttachmentSpec, - IoK8SApiStorageV1VolumeAttachmentStatus, - IoK8SApiStorageV1VolumeAttachment, - IoK8SApiStorageV1VolumeAttachmentSource, - IoK8SApiStorageV1VolumeError, - IoK8SApiStorageV1Beta1CSIStorageCapacity, - IoK8SApiextensionsApiserverPkgApisApiextensionsV1WebhookConversion, - IoK8SApiextensionsApiserverPkgApisApiextensionsV1CustomResourceDefinitionSpec, - IoK8SApiextensionsApiserverPkgApisApiextensionsV1CustomResourceDefinitionStatus, - IoK8SApiextensionsApiserverPkgApisApiextensionsV1CustomResourceDefinition, - IoK8SApiextensionsApiserverPkgApisApiextensionsV1CustomResourceConversion, - IoK8SApiextensionsApiserverPkgApisApiextensionsV1CustomResourceDefinitionNames, - IoK8SApiextensionsApiserverPkgApisApiextensionsV1CustomResourceDefinitionVersion, - IoK8SApiextensionsApiserverPkgApisApiextensionsV1CustomResourceDefinitionCondition, - IoK8SApiextensionsApiserverPkgApisApiextensionsV1CustomResourceColumnDefinition, - IoK8SApiextensionsApiserverPkgApisApiextensionsV1CustomResourceValidation, - IoK8SApiextensionsApiserverPkgApisApiextensionsV1CustomResourceSubresources, - IoK8SApiextensionsApiserverPkgApisApiextensionsV1CustomResourceSubresourceScale, - IoK8SApiextensionsApiserverPkgApisApiextensionsV1CustomResourceSubresourceStatus, - IoK8SApiextensionsApiserverPkgApisApiextensionsV1JSONSchemaProps, - IoK8SApiextensionsApiserverPkgApisApiextensionsV1JSONSchemaPropsOrBool, - IoK8SApiextensionsApiserverPkgApisApiextensionsV1JSON, - IoK8SApiextensionsApiserverPkgApisApiextensionsV1JSONSchemaPropsOrStringArray, - IoK8SApiextensionsApiserverPkgApisApiextensionsV1ExternalDocumentation, - IoK8SApiextensionsApiserverPkgApisApiextensionsV1JSONSchemaPropsOrArray, - IoK8SApiextensionsApiserverPkgApisApiextensionsV1ValidationRule, - IoK8SApiextensionsApiserverPkgApisApiextensionsV1ServiceReference, - IoK8SApiextensionsApiserverPkgApisApiextensionsV1WebhookClientConfig, - IoK8SApimachineryPkgApisMetaV1GroupVersionForDiscovery, - IoK8SApimachineryPkgApisMetaV1ServerAddressByClientCIDR, - IoK8SApimachineryPkgApisMetaV1APIGroup, - IoK8SApimachineryPkgApisMetaV1APIResource, - IoK8SApimachineryPkgApisMetaV1Preconditions, - IoK8SApimachineryPkgApisMetaV1LabelSelectorRequirement, - IoK8SApimachineryPkgApisMetaV1FieldsV1, - IoK8SApimachineryPkgApisMetaV1ManagedFieldsEntry, - IoK8SApimachineryPkgApisMetaV1OwnerReference, - IoK8SApimachineryPkgApisMetaV1StatusDetails, - IoK8SApimachineryPkgApisMetaV1StatusCause, - IoK8SKubeAggregatorPkgApisApiregistrationV1APIServiceSpec, - IoK8SKubeAggregatorPkgApisApiregistrationV1APIServiceStatus, - IoK8SKubeAggregatorPkgApisApiregistrationV1APIService, - IoK8SKubeAggregatorPkgApisApiregistrationV1ServiceReference, - IoK8SKubeAggregatorPkgApisApiregistrationV1APIServiceCondition, - IoK8SApiAdmissionregistrationV1MutatingWebhookConfigurationList, - IoK8SApiAdmissionregistrationV1ValidatingWebhookConfigurationList, + IoK8SApiAdmissionregistrationV1Alpha1ValidatingAdmissionPolicyBinding, IoK8SApiAdmissionregistrationV1Alpha1ValidatingAdmissionPolicyBindingList, IoK8SApiAdmissionregistrationV1Alpha1ValidatingAdmissionPolicyList, + IoK8SApiAdmissionregistrationV1MutatingWebhookConfiguration, + IoK8SApiAdmissionregistrationV1MutatingWebhookConfigurationList, + IoK8SApiAdmissionregistrationV1ValidatingWebhookConfiguration, + IoK8SApiAdmissionregistrationV1ValidatingWebhookConfigurationList, + IoK8SApiApiserverinternalV1Alpha1StorageVersion, IoK8SApiApiserverinternalV1Alpha1StorageVersionList, + IoK8SApiAppsV1ControllerRevision, IoK8SApiAppsV1ControllerRevisionList, + IoK8SApiAppsV1DaemonSet, IoK8SApiAppsV1DaemonSetList, + IoK8SApiAppsV1Deployment, IoK8SApiAppsV1DeploymentList, + IoK8SApiAppsV1ReplicaSet, IoK8SApiAppsV1ReplicaSetList, + IoK8SApiAppsV1StatefulSet, IoK8SApiAppsV1StatefulSetList, + IoK8SApiAuthenticationV1Alpha1SelfSubjectReview, IoK8SApiAuthenticationV1TokenRequest, IoK8SApiAuthenticationV1TokenReview, - IoK8SApiAuthenticationV1Alpha1SelfSubjectReview, IoK8SApiAuthorizationV1LocalSubjectAccessReview, IoK8SApiAuthorizationV1SelfSubjectAccessReview, IoK8SApiAuthorizationV1SelfSubjectRulesReview, IoK8SApiAuthorizationV1SubjectAccessReview, + IoK8SApiAutoscalingV1HorizontalPodAutoscaler, IoK8SApiAutoscalingV1HorizontalPodAutoscalerList, IoK8SApiAutoscalingV1Scale, + IoK8SApiAutoscalingV2HorizontalPodAutoscaler, IoK8SApiAutoscalingV2HorizontalPodAutoscalerList, + IoK8SApiBatchV1CronJob, IoK8SApiBatchV1CronJobList, + IoK8SApiBatchV1Job, IoK8SApiBatchV1JobList, + IoK8SApiCertificatesV1CertificateSigningRequest, IoK8SApiCertificatesV1CertificateSigningRequestList, + IoK8SApiCoordinationV1Lease, IoK8SApiCoordinationV1LeaseList, IoK8SApiCoreV1Binding, + IoK8SApiCoreV1ComponentStatus, IoK8SApiCoreV1ComponentStatusList, + IoK8SApiCoreV1ConfigMap, IoK8SApiCoreV1ConfigMapList, + IoK8SApiCoreV1Endpoints, IoK8SApiCoreV1EndpointsList, + IoK8SApiCoreV1Event, IoK8SApiCoreV1EventList, + IoK8SApiCoreV1LimitRange, IoK8SApiCoreV1LimitRangeList, + IoK8SApiCoreV1Namespace, IoK8SApiCoreV1NamespaceList, + IoK8SApiCoreV1Node, IoK8SApiCoreV1NodeList, + IoK8SApiCoreV1PersistentVolume, + IoK8SApiCoreV1PersistentVolumeClaim, IoK8SApiCoreV1PersistentVolumeClaimList, IoK8SApiCoreV1PersistentVolumeList, + IoK8SApiCoreV1Pod, IoK8SApiCoreV1PodList, + IoK8SApiCoreV1PodTemplate, IoK8SApiCoreV1PodTemplateList, + IoK8SApiCoreV1ReplicationController, IoK8SApiCoreV1ReplicationControllerList, + IoK8SApiCoreV1ResourceQuota, IoK8SApiCoreV1ResourceQuotaList, + IoK8SApiCoreV1Secret, IoK8SApiCoreV1SecretList, + IoK8SApiCoreV1Service, + IoK8SApiCoreV1ServiceAccount, IoK8SApiCoreV1ServiceAccountList, IoK8SApiCoreV1ServiceList, + IoK8SApiDiscoveryV1EndpointSlice, IoK8SApiDiscoveryV1EndpointSliceList, + IoK8SApiEventsV1Event, IoK8SApiEventsV1EventList, + IoK8SApiFlowcontrolV1Beta2FlowSchema, IoK8SApiFlowcontrolV1Beta2FlowSchemaList, + IoK8SApiFlowcontrolV1Beta2PriorityLevelConfiguration, IoK8SApiFlowcontrolV1Beta2PriorityLevelConfigurationList, + IoK8SApiFlowcontrolV1Beta3FlowSchema, IoK8SApiFlowcontrolV1Beta3FlowSchemaList, + IoK8SApiFlowcontrolV1Beta3PriorityLevelConfiguration, IoK8SApiFlowcontrolV1Beta3PriorityLevelConfigurationList, + IoK8SApiNetworkingV1Alpha1ClusterCIDR, + IoK8SApiNetworkingV1Alpha1ClusterCIDRList, + IoK8SApiNetworkingV1Ingress, + IoK8SApiNetworkingV1IngressClass, IoK8SApiNetworkingV1IngressClassList, IoK8SApiNetworkingV1IngressList, + IoK8SApiNetworkingV1NetworkPolicy, IoK8SApiNetworkingV1NetworkPolicyList, - IoK8SApiNetworkingV1Alpha1ClusterCIDRList, + IoK8SApiNodeV1RuntimeClass, IoK8SApiNodeV1RuntimeClassList, IoK8SApiPolicyV1Eviction, + IoK8SApiPolicyV1PodDisruptionBudget, IoK8SApiPolicyV1PodDisruptionBudgetList, + IoK8SApiRbacV1ClusterRole, + IoK8SApiRbacV1ClusterRoleBinding, IoK8SApiRbacV1ClusterRoleBindingList, IoK8SApiRbacV1ClusterRoleList, + IoK8SApiRbacV1Role, + IoK8SApiRbacV1RoleBinding, IoK8SApiRbacV1RoleBindingList, IoK8SApiRbacV1RoleList, + IoK8SApiResourceV1Alpha1PodScheduling, IoK8SApiResourceV1Alpha1PodSchedulingList, + IoK8SApiResourceV1Alpha1ResourceClaim, IoK8SApiResourceV1Alpha1ResourceClaimList, + IoK8SApiResourceV1Alpha1ResourceClaimTemplate, IoK8SApiResourceV1Alpha1ResourceClaimTemplateList, + IoK8SApiResourceV1Alpha1ResourceClass, IoK8SApiResourceV1Alpha1ResourceClassList, + IoK8SApiSchedulingV1PriorityClass, IoK8SApiSchedulingV1PriorityClassList, + IoK8SApiStorageV1Beta1CSIStorageCapacity, + IoK8SApiStorageV1Beta1CSIStorageCapacityList, + IoK8SApiStorageV1CSIDriver, IoK8SApiStorageV1CSIDriverList, + IoK8SApiStorageV1CSINode, IoK8SApiStorageV1CSINodeList, + IoK8SApiStorageV1CSIStorageCapacity, IoK8SApiStorageV1CSIStorageCapacityList, + IoK8SApiStorageV1StorageClass, IoK8SApiStorageV1StorageClassList, + IoK8SApiStorageV1VolumeAttachment, IoK8SApiStorageV1VolumeAttachmentList, - IoK8SApiStorageV1Beta1CSIStorageCapacityList, + IoK8SApiextensionsApiserverPkgApisApiextensionsV1CustomResourceDefinition, IoK8SApiextensionsApiserverPkgApisApiextensionsV1CustomResourceDefinitionList, + IoK8SApimachineryPkgApiResourceQuantity, + IoK8SApimachineryPkgApisMetaV1APIGroup, IoK8SApimachineryPkgApisMetaV1APIGroupList, IoK8SApimachineryPkgApisMetaV1APIResourceList, IoK8SApimachineryPkgApisMetaV1APIVersions, + IoK8SApimachineryPkgApisMetaV1DeleteOptions, IoK8SApimachineryPkgApisMetaV1Patch, IoK8SApimachineryPkgApisMetaV1Status, IoK8SApimachineryPkgApisMetaV1WatchEvent, IoK8SApimachineryPkgVersionInfo, + IoK8SKubeAggregatorPkgApisApiregistrationV1APIService, IoK8SKubeAggregatorPkgApisApiregistrationV1APIServiceList, - Api, } from "./api"; -import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; const api = new Api({ baseUrl: "http://localhost:9191", diff --git a/tests/test-data/golden-files/microsoft-workload-monitor b/tests/test-data/golden-files/microsoft-workload-monitor new file mode 100644 index 0000000..f01f0c9 --- /dev/null +++ b/tests/test-data/golden-files/microsoft-workload-monitor @@ -0,0 +1,816 @@ +import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; +import { + Api, + Component, + ComponentsCollection, + Monitor, + MonitorInstance, + MonitorInstancesCollection, + MonitorsCollection, + NotificationSetting, + NotificationSettingsCollection, + OperationListResult, +} from "./api"; + +const api = new Api({ + baseUrl: "", +}); + +/** + * Gets the details of all operations possible on the resource provider. + * @request GET :/providers/Microsoft.WorkloadMonitor/operations + * @allowrelaxedtypes + * @readonly + */ +export async function getProvidersOperationsList( + query: { + /** + * The API version to use for this operation. + */ + "api-version": "2018-08-31-preview"; + /** + * The page-continuation token to use with a paged version of this API. + */ + $skiptoken?: string; + }, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.providers.operationsList({ + query: query, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get subscription wide details of components. + * @request GET :/subscriptions/{subscriptionId}/providers/Microsoft.WorkloadMonitor/componentsSummary + * @allowrelaxedtypes + * @readonly + */ +export async function getSubscriptionsComponentsSummaryList( + query: { + /** + * The API version to use for this operation. + */ + "api-version": "2018-08-31-preview"; + /** + * Properties to be returned in the response. + */ + $select?: string; + /** + * Filter to be applied on the operation. + */ + $filter?: string; + /** + * Apply aggregation. + */ + $apply?: string; + /** + * Sort the result on one or more properties. + */ + $orderby?: string; + /** + * Include properties inline in the response. + */ + $expand?: string; + /** + * Limit the result to the specified number of rows. + */ + $top?: string; + /** + * The page-continuation token to use with a paged version of this API. + */ + $skiptoken?: string; + }, + /** + * The ID of the target subscription. + */ + subscriptionId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.subscriptions.componentsSummaryList({ + query: query, + subscriptionId: subscriptionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get subscription wide health instances. + * @request GET :/subscriptions/{subscriptionId}/providers/Microsoft.WorkloadMonitor/monitorInstancesSummary + * @allowrelaxedtypes + * @readonly + */ +export async function getSubscriptionsMonitorInstancesSummaryList( + query: { + /** + * The API version to use for this operation. + */ + "api-version": "2018-08-31-preview"; + /** + * Properties to be returned in the response. + */ + $select?: string; + /** + * Filter to be applied on the operation. + */ + $filter?: string; + /** + * Apply aggregation. + */ + $apply?: string; + /** + * Sort the result on one or more properties. + */ + $orderby?: string; + /** + * Include properties inline in the response. + */ + $expand?: string; + /** + * Limit the result to the specified number of rows. + */ + $top?: string; + /** + * The page-continuation token to use with a paged version of this API. + */ + $skiptoken?: string; + }, + /** + * The ID of the target subscription. + */ + subscriptionId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.subscriptions.monitorInstancesSummaryList({ + query: query, + subscriptionId: subscriptionId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get list of components for a resource. + * @request GET :/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/components + * @allowrelaxedtypes + * @readonly + */ +export async function getSubscriptionsComponentsListByResource( + query: { + /** + * The API version to use for this operation. + */ + "api-version": "2018-08-31-preview"; + /** + * Properties to be returned in the response. + */ + $select?: string; + /** + * Filter to be applied on the operation. + */ + $filter?: string; + /** + * Apply aggregation. + */ + $apply?: string; + /** + * Sort the result on one or more properties. + */ + $orderby?: string; + /** + * Include properties inline in the response. + */ + $expand?: string; + /** + * Limit the result to the specified number of rows. + */ + $top?: string; + /** + * The page-continuation token to use with a paged version of this API. + */ + $skiptoken?: string; + }, + /** + * The ID of the target subscription. + */ + subscriptionId: string, + /** + * The name of the resource group. The name is case insensitive. + */ + resourceGroupName: string, + /** + * The Namespace of the resource. + */ + resourceNamespace: string, + /** + * The type of the resource. + */ + resourceType: string, + /** + * Name of the resource. + */ + resourceName: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.subscriptions.componentsListByResource({ + query: query, + subscriptionId: subscriptionId, + resourceGroupName: resourceGroupName, + resourceNamespace: resourceNamespace, + resourceType: resourceType, + resourceName: resourceName, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get details of a component. + * @request GET :/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/components/{componentId} + * @allowrelaxedtypes + * @readonly + */ +export async function getSubscriptionsComponentsGet( + query: { + /** + * The API version to use for this operation. + */ + "api-version": "2018-08-31-preview"; + /** + * Properties to be returned in the response. + */ + $select?: string; + /** + * Include properties inline in the response. + */ + $expand?: string; + }, + /** + * The ID of the target subscription. + */ + subscriptionId: string, + /** + * The name of the resource group. The name is case insensitive. + */ + resourceGroupName: string, + /** + * The Namespace of the resource. + */ + resourceNamespace: string, + /** + * The type of the resource. + */ + resourceType: string, + /** + * Name of the resource. + */ + resourceName: string, + /** + * Component Id. + */ + componentId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.subscriptions.componentsGet({ + query: query, + subscriptionId: subscriptionId, + resourceGroupName: resourceGroupName, + resourceNamespace: resourceNamespace, + resourceType: resourceType, + resourceName: resourceName, + componentId: componentId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get list of monitor instances for a resource. + * @request GET :/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/monitorInstances + * @allowrelaxedtypes + * @readonly + */ +export async function getSubscriptionsMonitorInstancesListByResource( + query: { + /** + * The API version to use for this operation. + */ + "api-version": "2018-08-31-preview"; + /** + * Properties to be returned in the response. + */ + $select?: string; + /** + * Filter to be applied on the operation. + */ + $filter?: string; + /** + * Apply aggregation. + */ + $apply?: string; + /** + * Sort the result on one or more properties. + */ + $orderby?: string; + /** + * Include properties inline in the response. + */ + $expand?: string; + /** + * Limit the result to the specified number of rows. + */ + $top?: string; + /** + * The page-continuation token to use with a paged version of this API. + */ + $skiptoken?: string; + }, + /** + * The ID of the target subscription. + */ + subscriptionId: string, + /** + * The name of the resource group. The name is case insensitive. + */ + resourceGroupName: string, + /** + * The Namespace of the resource. + */ + resourceNamespace: string, + /** + * The type of the resource. + */ + resourceType: string, + /** + * Name of the resource. + */ + resourceName: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.subscriptions.monitorInstancesListByResource({ + query: query, + subscriptionId: subscriptionId, + resourceGroupName: resourceGroupName, + resourceNamespace: resourceNamespace, + resourceType: resourceType, + resourceName: resourceName, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get details of a monitorInstance. + * @request GET :/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/monitorInstances/{monitorInstanceId} + * @allowrelaxedtypes + * @readonly + */ +export async function getSubscriptionsMonitorInstancesGet( + query: { + /** + * The API version to use for this operation. + */ + "api-version": "2018-08-31-preview"; + /** + * Properties to be returned in the response. + */ + $select?: string; + /** + * Include properties inline in the response. + */ + $expand?: string; + }, + /** + * The ID of the target subscription. + */ + subscriptionId: string, + /** + * The name of the resource group. The name is case insensitive. + */ + resourceGroupName: string, + /** + * The Namespace of the resource. + */ + resourceNamespace: string, + /** + * The type of the resource. + */ + resourceType: string, + /** + * Name of the resource. + */ + resourceName: string, + /** + * MonitorInstance Id. + */ + monitorInstanceId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.subscriptions.monitorInstancesGet({ + query: query, + subscriptionId: subscriptionId, + resourceGroupName: resourceGroupName, + resourceNamespace: resourceNamespace, + resourceType: resourceType, + resourceName: resourceName, + monitorInstanceId: monitorInstanceId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get list of a monitors of a resource. + * @request GET :/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/monitors + * @allowrelaxedtypes + * @readonly + */ +export async function getSubscriptionsMonitorsListByResource( + query: { + /** + * The API version to use for this operation. + */ + "api-version": "2018-08-31-preview"; + /** + * Filter to be applied on the operation. + */ + $filter?: string; + /** + * The page-continuation token to use with a paged version of this API. + */ + $skiptoken?: string; + }, + /** + * The ID of the target subscription. + */ + subscriptionId: string, + /** + * The name of the resource group. The name is case insensitive. + */ + resourceGroupName: string, + /** + * The Namespace of the resource. + */ + resourceNamespace: string, + /** + * The type of the resource. + */ + resourceType: string, + /** + * Name of the resource. + */ + resourceName: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.subscriptions.monitorsListByResource({ + query: query, + subscriptionId: subscriptionId, + resourceGroupName: resourceGroupName, + resourceNamespace: resourceNamespace, + resourceType: resourceType, + resourceName: resourceName, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get details of a single monitor. + * @request GET :/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/monitors/{monitorId} + * @allowrelaxedtypes + * @readonly + */ +export async function getSubscriptionsMonitorsGet( + query: { + /** + * The API version to use for this operation. + */ + "api-version": "2018-08-31-preview"; + }, + /** + * The ID of the target subscription. + */ + subscriptionId: string, + /** + * The name of the resource group. The name is case insensitive. + */ + resourceGroupName: string, + /** + * The Namespace of the resource. + */ + resourceNamespace: string, + /** + * The type of the resource. + */ + resourceType: string, + /** + * Name of the resource. + */ + resourceName: string, + /** + * Monitor Id. + */ + monitorId: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.subscriptions.monitorsGet({ + query: query, + subscriptionId: subscriptionId, + resourceGroupName: resourceGroupName, + resourceNamespace: resourceNamespace, + resourceType: resourceType, + resourceName: resourceName, + monitorId: monitorId, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update a Monitor's configuration. + * @request PATCH :/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/monitors/{monitorId} + * @allowrelaxedtypes + */ +export async function patchSubscriptionsMonitorsUpdate( + query: { + /** + * The API version to use for this operation. + */ + "api-version": "2018-08-31-preview"; + }, + /** + * The ID of the target subscription. + */ + subscriptionId: string, + /** + * The name of the resource group. The name is case insensitive. + */ + resourceGroupName: string, + /** + * The Namespace of the resource. + */ + resourceNamespace: string, + /** + * The type of the resource. + */ + resourceType: string, + /** + * Name of the resource. + */ + resourceName: string, + /** + * Monitor Id. + */ + monitorId: string, + /** Request body */ + body: Monitor, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.subscriptions.monitorsUpdate({ + query: query, + subscriptionId: subscriptionId, + resourceGroupName: resourceGroupName, + resourceNamespace: resourceNamespace, + resourceType: resourceType, + resourceName: resourceName, + monitorId: monitorId, + body: body, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get list of notification settings for a resource. + * @request GET :/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/notificationSettings + * @allowrelaxedtypes + * @readonly + */ +export async function getSubscriptionsNotificationSettingsListByResource( + query: { + /** + * The API version to use for this operation. + */ + "api-version": "2018-08-31-preview"; + /** + * The page-continuation token to use with a paged version of this API. + */ + $skiptoken?: string; + }, + /** + * The ID of the target subscription. + */ + subscriptionId: string, + /** + * The name of the resource group. The name is case insensitive. + */ + resourceGroupName: string, + /** + * The Namespace of the resource. + */ + resourceNamespace: string, + /** + * The type of the resource. + */ + resourceType: string, + /** + * Name of the resource. + */ + resourceName: string, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.subscriptions.notificationSettingsListByResource({ + query: query, + subscriptionId: subscriptionId, + resourceGroupName: resourceGroupName, + resourceNamespace: resourceNamespace, + resourceType: resourceType, + resourceName: resourceName, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Get a of notification setting for a resource. + * @request GET :/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/notificationSettings/{notificationSettingName} + * @allowrelaxedtypes + * @readonly + */ +export async function getSubscriptionsNotificationSettingsGet( + query: { + /** + * The API version to use for this operation. + */ + "api-version": "2018-08-31-preview"; + }, + /** + * The ID of the target subscription. + */ + subscriptionId: string, + /** + * The name of the resource group. The name is case insensitive. + */ + resourceGroupName: string, + /** + * The Namespace of the resource. + */ + resourceNamespace: string, + /** + * The type of the resource. + */ + resourceType: string, + /** + * Name of the resource. + */ + resourceName: string, + /** + * Default string modeled as parameter for URL to work correctly. + */ + notificationSettingName: "default", + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.subscriptions.notificationSettingsGet({ + query: query, + subscriptionId: subscriptionId, + resourceGroupName: resourceGroupName, + resourceNamespace: resourceNamespace, + resourceType: resourceType, + resourceName: resourceName, + notificationSettingName: notificationSettingName, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} + +/** + * Update notification settings for a resource. + * @request PUT :/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/{resourceNamespace}/{resourceType}/{resourceName}/providers/Microsoft.WorkloadMonitor/notificationSettings/{notificationSettingName} + * @allowrelaxedtypes + */ +export async function putSubscriptionsNotificationSettingsUpdate( + query: { + /** + * The API version to use for this operation. + */ + "api-version": "2018-08-31-preview"; + }, + /** + * The ID of the target subscription. + */ + subscriptionId: string, + /** + * The name of the resource group. The name is case insensitive. + */ + resourceGroupName: string, + /** + * The Namespace of the resource. + */ + resourceNamespace: string, + /** + * The type of the resource. + */ + resourceType: string, + /** + * Name of the resource. + */ + resourceName: string, + notificationSettingName: "default", + /** Request body */ + body: NotificationSetting, + headers?: hasuraSdk.JSONValue, +): Promise { + const result = await api.subscriptions.notificationSettingsUpdate({ + query: query, + subscriptionId: subscriptionId, + resourceGroupName: resourceGroupName, + resourceNamespace: resourceNamespace, + resourceType: resourceType, + resourceName: resourceName, + notificationSettingName: notificationSettingName, + body: body, + params: { + headers: (headers?.value as Record) ?? undefined, + }, + }); + if (result.data) { + return result.data; + } else { + throw result.error; + } +} diff --git a/tests/test-data/golden-files/petstore b/tests/test-data/golden-files/petstore index 4f152dc..1090f0c 100644 --- a/tests/test-data/golden-files/petstore +++ b/tests/test-data/golden-files/petstore @@ -1,15 +1,5 @@ -import { - Address, - Category, - Tag, - Pet, - Order, - Customer, - User, - ApiResponse, - Api, -} from "./api"; import * as hasuraSdk from "@hasura/ndc-lambda-sdk"; +import { Api, ApiResponse, Order, Pet, User } from "./api"; const api = new Api({ baseUrl: "http://localhost:13191",