diff --git a/openapi.properties b/openapi.properties index d78caaa9f..fef17b428 100644 --- a/openapi.properties +++ b/openapi.properties @@ -33,7 +33,6 @@ openapi/extpose=26b387d8169915097d175a3b7fccefaf openapi/godaddy.orders=feb25f404cd5b8c6ccaf08626049a7f8 openapi/googleapis.youtube.reporting=74725d9612d0fb409947b9bf460f7704 openapi/nytimes.articlesearch=6d2a6ed66920a97018247ae96832bb2b -openapi/zendesk.support=1d5d357e72e904c50655bb7fa20b2734 openapi/powertoolsdeveloper.weather=8eb3bd7e52c7a578753798073f734c55 openapi/power.bi=122c0c3c77deb0f3e5a1ff0acd31ace8 openapi/servicenow=c0977642967081ed18c1de146956cbdc @@ -323,7 +322,6 @@ openapi/mft=3fc19770bbb5cbfe55a36dc668c892a5 openapi/zoho.books=b607884cfff8653a7d59fd32c503e5de openapi/jira=09718b2b5cac5415045ff5984224228c openapi/workday.expense=9b24f7ffb9ec9957153f24f4b8d8315f -openapi/zendesk.voice=f915ba10ded56a74d5576f30080d34fb openapi/docusign.monitor=43ac06c3bc242a429b231e1657cf12c4 openapi/stripe=99288df115272fbf0794e644b6abc523 openapi/isbndb=324b0a589805e43fa3577dc37fb2a269 @@ -343,7 +341,6 @@ openapi/googleapis.bigquery=8d1bb0824855e002c48a2a3ec2e7eee2 openapi/vonage.verify=072f1571081133fcbb8e01cf7ada83b8 openapi/dropbox=b21ca7cdb6d583a47acf7969e1b51d70 openapi/avatax=ee99f2cd297458a6a46df96317c0bcb6 -openapi/asana=7b30eb0e352724136cf171a736898283 openapi/saps4hana.itcm.organizationaldata=8f793f0e27c6688c4902c243967190c1 openapi/optimizely=a93ebb9e5fa3c88b7c3ecffbcf74bdcd openapi/godaddy.abuse=ca6a47989e7a74f3c27f3f940f127c0a diff --git a/openapi/asana/.gitignore b/openapi/asana/.gitignore deleted file mode 100644 index eb5a316cb..000000000 --- a/openapi/asana/.gitignore +++ /dev/null @@ -1 +0,0 @@ -target diff --git a/openapi/asana/Ballerina.toml b/openapi/asana/Ballerina.toml deleted file mode 100644 index 061b87a50..000000000 --- a/openapi/asana/Ballerina.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -license = ["Apache-2.0"] -keywords = ["Productivity/Project Management", "Cost/Freemium"] -org = "ballerinax" -name = "asana" -icon = "icon.png" -distribution = "2201.4.1" -repository = "https://github.com/ballerina-platform/openapi-connectors/tree/main/openapi/asana" -version = "1.6.1" -authors = ["Ballerina"] -[build-options] -observabilityIncluded = true diff --git a/openapi/asana/Module.md b/openapi/asana/Module.md deleted file mode 100644 index 7147a8cbc..000000000 --- a/openapi/asana/Module.md +++ /dev/null @@ -1,39 +0,0 @@ -## Overview - -This is a generated connector for [Asana API v1.0](https://developers.asana.com/docs) OpenAPI specification. - -This API enables you to help teams organize, track and manage their work. For additional help getting started with the API, visit [Asana API](https://developers.asana.com). - -## Prerequisites -Before using this connector in your Ballerina application, complete the following: -* Create [Asana Account](https://asana.com/create-account) -* Obtaining tokens - 1. Log into [Asana Account](https://app.asana.com/-/login) - 2. Token can be obtained from [Developer app console](https://app.asana.com/0/developer-console) by creating an app and get an access token. - -## Quickstart - -To use the Asana connector in your Ballerina application, update the .bal file as follows: - -### Step 1: Import connector -Import the ballerinax/asana module into the Ballerina project. -```ballerina -import ballerinax/asana; -``` -### Step 2: Create a new connector instance -```ballerina -configurable http:BearerTokenConfig & readonly auth = ?; - -asana:ClientConfig clientConfig = { - auth : auth - }; - -asana:Client myclient = check new asana:Client(clientConfig, "https://app.asana.com/api/1.0"); -``` -### Step 3: Invoke connector operation -1. You can get tasks related to a specific project. - ```ballerina - asana:InlineResponse20018 result = check myclient->getTasks(completedSince="2021-07-16T01:25:40+05:30", project="1200611263773935"); - ``` -2. Use `bal run` command to compile and run the Ballerina program. - diff --git a/openapi/asana/Package.md b/openapi/asana/Package.md deleted file mode 100644 index 5c898e377..000000000 --- a/openapi/asana/Package.md +++ /dev/null @@ -1,19 +0,0 @@ -Connects to [Asana API](https://developers.asana.com/docs) from Ballerina - -## Package overview -The `ballerinax/asana` is a [Ballerina](https://ballerina.io/) connector for Asana API. -This package provides the capability to help teams organize, track and manage their work using Asana API. - -### Compatibility -| | Version | -|--------------------|---------------------------| -| Ballerina Language | Ballerina Swan Lake 2201.4.1| -| Asana API | V1.0 | - -## Report issues -To report bugs, request new features, start new discussions, view project boards, etc., go to the [Ballerina Extended Library repository](https://github.com/ballerina-platform/ballerina-extended-library) - -## Useful links -- Discuss code changes of the Ballerina project via [ballerina-dev@googlegroups.com](mailto:ballerina-dev@googlegroups.com). -- Chat live with us via our [Discord server](https://discord.gg/ballerinalang). -- Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag diff --git a/openapi/asana/client.bal b/openapi/asana/client.bal deleted file mode 100644 index 6fb642054..000000000 --- a/openapi/asana/client.bal +++ /dev/null @@ -1,2335 +0,0 @@ -// Copyright (c) 2022 WSO2 LLC. (http://www.wso2.org) All Rights Reserved. -// -// WSO2 Inc. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/http; -import ballerina/mime; - -# This is a generated connector for [Asana API v1.0](https://developers.asana.com/docs) OpenAPI specification. -# This API enables you to help teams organize, track and manage their work. -# For additional help getting started with the API, visit [Asana API](https://developers.asana.com). -@display {label: "Asana", iconPath: "icon.png"} -public isolated client class Client { - final http:Client clientEp; - # Gets invoked to initialize the `connector`. - # The connector initialization requires setting the API credentials. - # Create an [Asana API Account](https://asana.com/create-account) and obtain tokens following [this guide](https://developers.asana.com/docs/authentication). - # - # + config - The configurations to be used when initializing the `connector` - # + serviceUrl - URL of the target service - # + return - An error if connector initialization failed - public isolated function init(ConnectionConfig config, string serviceUrl = "https://app.asana.com/api/1.0") returns error? { - http:ClientConfiguration httpClientConfig = {auth: config.auth, httpVersion: config.httpVersion, timeout: config.timeout, forwarded: config.forwarded, poolConfig: config.poolConfig, compression: config.compression, circuitBreaker: config.circuitBreaker, retryConfig: config.retryConfig, validation: config.validation}; - do { - if config.http1Settings is ClientHttp1Settings { - ClientHttp1Settings settings = check config.http1Settings.ensureType(ClientHttp1Settings); - httpClientConfig.http1Settings = {...settings}; - } - if config.http2Settings is http:ClientHttp2Settings { - httpClientConfig.http2Settings = check config.http2Settings.ensureType(http:ClientHttp2Settings); - } - if config.cache is http:CacheConfig { - httpClientConfig.cache = check config.cache.ensureType(http:CacheConfig); - } - if config.responseLimits is http:ResponseLimitConfigs { - httpClientConfig.responseLimits = check config.responseLimits.ensureType(http:ResponseLimitConfigs); - } - if config.secureSocket is http:ClientSecureSocket { - httpClientConfig.secureSocket = check config.secureSocket.ensureType(http:ClientSecureSocket); - } - if config.proxy is http:ProxyConfig { - httpClientConfig.proxy = check config.proxy.ensureType(http:ProxyConfig); - } - } - http:Client httpEp = check new (serviceUrl, httpClientConfig); - self.clientEp = httpEp; - return; - } - # Get an attachment - # - # + attachmentGid - Globally unique identifier for the attachment. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully retrieved the record for a single attachment. - remote isolated function getAttachment(string attachmentGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse200|error { - string resourcePath = string `/attachments/${getEncodedUri(attachmentGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse200 response = check self.clientEp->get(resourcePath); - return response; - } - # Delete an attachment - # - # + attachmentGid - Globally unique identifier for the attachment. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully deleted the specified attachment. - remote isolated function deleteAttachment(string attachmentGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/attachments/${getEncodedUri(attachmentGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2001 response = check self.clientEp-> delete(resourcePath); - return response; - } - # Submit parallel requests - # - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The requests to batch together via the Batch API. - # + return - Successfully completed the requested batch API operations. - remote isolated function createBatchRequest(BatchBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2002|error { - string resourcePath = string `/batch`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2002 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Create a custom field - # - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + payload - The custom field object to create. - # + return - Custom field successfully created. - remote isolated function createCustomField(CustomFieldsBody payload, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse201|error { - string resourcePath = string `/custom_fields`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse201 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get a custom field - # - # + customFieldGid - Globally unique identifier for the custom field. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully retrieved the complete definition of a custom field’s metadata. - remote isolated function getCustomField(string customFieldGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse201|error { - string resourcePath = string `/custom_fields/${getEncodedUri(customFieldGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse201 response = check self.clientEp->get(resourcePath); - return response; - } - # Update a custom field - # - # + customFieldGid - Globally unique identifier for the custom field. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The custom field object with all updated properties. - # + return - The custom field was successfully updated. - remote isolated function updateCustomField(string customFieldGid, CustomFieldsCustomFieldGidBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse201|error { - string resourcePath = string `/custom_fields/${getEncodedUri(customFieldGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse201 response = check self.clientEp->put(resourcePath, request); - return response; - } - # Delete a custom field - # - # + customFieldGid - Globally unique identifier for the custom field. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - The custom field was successfully deleted. - remote isolated function deleteCustomField(string customFieldGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/custom_fields/${getEncodedUri(customFieldGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2001 response = check self.clientEp-> delete(resourcePath); - return response; - } - # Create an enum option - # - # + customFieldGid - Globally unique identifier for the custom field. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + payload - The enum option object to create. - # + return - Custom field enum option successfully created. - remote isolated function createEnumOptionForCustomField(string customFieldGid, CustomFieldGidEnumOptionsBody payload, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse2011|error { - string resourcePath = string `/custom_fields/${getEncodedUri(customFieldGid)}/enum_options`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2011 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Reorder a custom field's enum - # - # + customFieldGid - Globally unique identifier for the custom field. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The enum option object to create. - # + return - Custom field enum option successfully reordered. - remote isolated function insertEnumOptionForCustomField(string customFieldGid, EnumOptionsInsertBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2011|error { - string resourcePath = string `/custom_fields/${getEncodedUri(customFieldGid)}/enum_options/insert`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2011 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Update an enum option - # - # + enumOptionGid - Globally unique identifier for the enum option. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The enum option object to update - # + return - Successfully updated the specified custom field enum. - remote isolated function updateEnumOption(string enumOptionGid, EnumOptionsEnumOptionGidBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2011|error { - string resourcePath = string `/enum_options/${getEncodedUri(enumOptionGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2011 response = check self.clientEp->put(resourcePath, request); - return response; - } - # Get events on a resource - # - # + 'resource - A resource ID to subscribe to. The resource can be a task or project. - # + sync - A sync token received from the last request, or none on first sync. Events will be returned from the point in time that the sync token was generated. *Note: On your first request, omit the sync token. The response will be the same as for an expired sync token, and will include a new valid sync token.If the sync token is too old (which may happen from time to time) the API will return a `412 Precondition Failed` error, and include a fresh sync token in the response.* - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully retrieved events. - remote isolated function getEvents(string 'resource, string? sync = (), boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2003|error { - string resourcePath = string `/events`; - map queryParam = {"resource": 'resource, "sync": sync, "opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2003 response = check self.clientEp->get(resourcePath); - return response; - } - # Get a job by id - # - # + jobGid - Globally unique identifier for the job. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully retrieved Job. - remote isolated function getJob(string jobGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2004|error { - string resourcePath = string `/jobs/${getEncodedUri(jobGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2004 response = check self.clientEp->get(resourcePath); - return response; - } - # Create an organization export request - # - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + payload - The organization to export. - # + return - Successfully created organization export request. - remote isolated function createOrganizationExport(OrganizationExportsBody payload, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse2012|error { - string resourcePath = string `/organization_exports`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2012 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get details on an org export request - # - # + organizationExportGid - Globally unique identifier for the organization export. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully retrieved organization export object. - remote isolated function getOrganizationExport(string organizationExportGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2012|error { - string resourcePath = string `/organization_exports/${getEncodedUri(organizationExportGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2012 response = check self.clientEp->get(resourcePath); - return response; - } - # Get teams in an organization - # - # + workspaceGid - Globally unique identifier for the workspace or organization. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Returns the team records for all teams in the organization or workspace accessible to the authenticated user. - remote isolated function getTeamsForOrganization(string workspaceGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse2005|error { - string resourcePath = string `/organizations/${getEncodedUri(workspaceGid)}/teams`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2005 response = check self.clientEp->get(resourcePath); - return response; - } - # Get multiple portfolio memberships - # - # + portfolio - The portfolio to filter results on. - # + workspace - The workspace to filter results on. - # + user - A string identifying a user. This can either be the string "me", an email, or the gid of a user. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved portfolio memberships. - remote isolated function getPortfolioMemberships(string? portfolio = (), string? workspace = (), string? user = (), boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse2006|error { - string resourcePath = string `/portfolio_memberships`; - map queryParam = {"portfolio": portfolio, "workspace": workspace, "user": user, "opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2006 response = check self.clientEp->get(resourcePath); - return response; - } - # Get a portfolio membership - # - # + portfolioMembershipGid - Globally unique identifier for the portfolio membership - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully retrieved the requested portfolio membership. - remote isolated function getPortfolioMembership(string portfolioMembershipGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2007|error { - string resourcePath = string `/portfolio_memberships/${getEncodedUri(portfolioMembershipGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2007 response = check self.clientEp->get(resourcePath); - return response; - } - # Get multiple portfolios - # - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + workspace - The workspace or organization to filter portfolios on. - # + owner - The user who owns the portfolio. Currently, API users can only get a list of portfolios that they themselves own. - # + return - Successfully retrieved portfolios. - remote isolated function getPortfolios(string workspace, string owner, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse2008|error { - string resourcePath = string `/portfolios`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset, "workspace": workspace, "owner": owner}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2008 response = check self.clientEp->get(resourcePath); - return response; - } - # Create a portfolio - # - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The portfolio to create. - # + return - Successfully created portfolio. - remote isolated function createPortfolio(PortfoliosBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2013|error { - string resourcePath = string `/portfolios`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2013 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get a portfolio - # - # + portfolioGid - Globally unique identifier for the portfolio. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully retrieved the requested portfolio. - remote isolated function getPortfolio(string portfolioGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2013|error { - string resourcePath = string `/portfolios/${getEncodedUri(portfolioGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2013 response = check self.clientEp->get(resourcePath); - return response; - } - # Update a portfolio - # - # + portfolioGid - Globally unique identifier for the portfolio. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The updated fields for the portfolio. - # + return - Successfully updated the portfolio. - remote isolated function updatePortfolio(string portfolioGid, PortfoliosPortfolioGidBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2013|error { - string resourcePath = string `/portfolios/${getEncodedUri(portfolioGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2013 response = check self.clientEp->put(resourcePath, request); - return response; - } - # Delete a portfolio - # - # + portfolioGid - Globally unique identifier for the portfolio. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully deleted the specified portfolio. - remote isolated function deletePortfolio(string portfolioGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/portfolios/${getEncodedUri(portfolioGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2001 response = check self.clientEp-> delete(resourcePath); - return response; - } - # Add a custom field to a portfolio - # - # + portfolioGid - Globally unique identifier for the portfolio. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + payload - Information about the custom field setting. - # + return - Successfully added the custom field to the portfolio. - remote isolated function addCustomFieldSettingForPortfolio(string portfolioGid, PortfolioGidAddcustomfieldsettingBody payload, boolean? optPretty = ()) returns InlineResponse2001|error { - string resourcePath = string `/portfolios/${getEncodedUri(portfolioGid)}/addCustomFieldSetting`; - map queryParam = {"opt_pretty": optPretty}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2001 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Add a portfolio item - # - # + portfolioGid - Globally unique identifier for the portfolio. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - Information about the item being inserted. - # + return - Successfully added the item to the portfolio. - remote isolated function addItemForPortfolio(string portfolioGid, PortfolioGidAdditemBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/portfolios/${getEncodedUri(portfolioGid)}/addItem`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2001 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Add users to a portfolio - # - # + portfolioGid - Globally unique identifier for the portfolio. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - Information about the members being added. - # + return - Successfully added members to the portfolio. - remote isolated function addMembersForPortfolio(string portfolioGid, PortfolioGidAddmembersBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/portfolios/${getEncodedUri(portfolioGid)}/addMembers`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2001 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get a portfolio's custom fields - # - # + portfolioGid - Globally unique identifier for the portfolio. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved custom field settings objects for a portfolio. - remote isolated function getCustomFieldSettingsForPortfolio(string portfolioGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse2009|error { - string resourcePath = string `/portfolios/${getEncodedUri(portfolioGid)}/custom_field_settings`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2009 response = check self.clientEp->get(resourcePath); - return response; - } - # Get portfolio items - # - # + portfolioGid - Globally unique identifier for the portfolio. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved the requested portfolio's items. - remote isolated function getItemsForPortfolio(string portfolioGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20010|error { - string resourcePath = string `/portfolios/${getEncodedUri(portfolioGid)}/items`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20010 response = check self.clientEp->get(resourcePath); - return response; - } - # Get memberships from a portfolio - # - # + portfolioGid - Globally unique identifier for the portfolio. - # + user - A string identifying a user. This can either be the string "me", an email, or the gid of a user. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved the requested portfolio's memberships. - remote isolated function getPortfolioMembershipsForPortfolio(string portfolioGid, string? user = (), boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse2006|error { - string resourcePath = string `/portfolios/${getEncodedUri(portfolioGid)}/portfolio_memberships`; - map queryParam = {"user": user, "opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2006 response = check self.clientEp->get(resourcePath); - return response; - } - # Remove a custom field from a portfolio - # - # + portfolioGid - Globally unique identifier for the portfolio. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + payload - Information about the custom field setting being removed. - # + return - Successfully removed the custom field from the portfolio. - remote isolated function removeCustomFieldSettingForPortfolio(string portfolioGid, PortfolioGidRemovecustomfieldsettingBody payload, boolean? optPretty = ()) returns InlineResponse2001|error { - string resourcePath = string `/portfolios/${getEncodedUri(portfolioGid)}/removeCustomFieldSetting`; - map queryParam = {"opt_pretty": optPretty}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2001 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Remove a portfolio item - # - # + portfolioGid - Globally unique identifier for the portfolio. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - Information about the item being removed. - # + return - Successfully removed the item from the portfolio. - remote isolated function removeItemForPortfolio(string portfolioGid, PortfolioGidRemoveitemBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/portfolios/${getEncodedUri(portfolioGid)}/removeItem`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2001 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Remove users from a portfolio - # - # + portfolioGid - Globally unique identifier for the portfolio. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - Information about the members being removed. - # + return - Successfully removed the members from the portfolio. - remote isolated function removeMembersForPortfolio(string portfolioGid, PortfolioGidRemovemembersBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/portfolios/${getEncodedUri(portfolioGid)}/removeMembers`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2001 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get a project membership - # - # + projectMembershipGid - Globally unique identifier for the project membership. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully retrieved the requested project membership. - remote isolated function getProjectMembership(string projectMembershipGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse20011|error { - string resourcePath = string `/project_memberships/${getEncodedUri(projectMembershipGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20011 response = check self.clientEp->get(resourcePath); - return response; - } - # Get a project status - # - # + projectStatusGid - The project status update to get. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully retrieved the specified project's status updates. - remote isolated function getProjectStatus(string projectStatusGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse20012|error { - string resourcePath = string `/project_statuses/${getEncodedUri(projectStatusGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20012 response = check self.clientEp->get(resourcePath); - return response; - } - # Delete a project status - # - # + projectStatusGid - The project status update to get. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully deleted the specified project status. - remote isolated function deleteProjectStatus(string projectStatusGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/project_statuses/${getEncodedUri(projectStatusGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2001 response = check self.clientEp-> delete(resourcePath); - return response; - } - # Get multiple projects - # - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + workspace - The workspace or organization to filter projects on. - # + team - The team to filter projects on. - # + archived - Only return projects whose `archived` field takes on the value of this parameter. - # + return - Successfully retrieved projects. - remote isolated function getProjects(boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = (), string? workspace = (), string? team = (), boolean? archived = ()) returns InlineResponse20010|error { - string resourcePath = string `/projects`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset, "workspace": workspace, "team": team, "archived": archived}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20010 response = check self.clientEp->get(resourcePath); - return response; - } - # Create a project - # - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The project to create. - # + return - Successfully retrieved projects. - remote isolated function createProject(ProjectsBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2014|error { - string resourcePath = string `/projects`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2014 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get a project - # - # + projectGid - Globally unique identifier for the project. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully retrieved the requested project. - remote isolated function getProject(string projectGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2014|error { - string resourcePath = string `/projects/${getEncodedUri(projectGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2014 response = check self.clientEp->get(resourcePath); - return response; - } - # Update a project - # - # + projectGid - Globally unique identifier for the project. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The updated fields for the project. - # + return - Successfully updated the project. - remote isolated function updateProject(string projectGid, ProjectsProjectGidBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2014|error { - string resourcePath = string `/projects/${getEncodedUri(projectGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2014 response = check self.clientEp->put(resourcePath, request); - return response; - } - # Delete a project - # - # + projectGid - Globally unique identifier for the project. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully deleted the specified project. - remote isolated function deleteProject(string projectGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/projects/${getEncodedUri(projectGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2001 response = check self.clientEp-> delete(resourcePath); - return response; - } - # Add a custom field to a project - # - # + projectGid - Globally unique identifier for the project. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + payload - Information about the custom field setting. - # + return - Successfully added the custom field to the project. - remote isolated function addCustomFieldSettingForProject(string projectGid, ProjectGidAddcustomfieldsettingBody payload, boolean? optPretty = ()) returns InlineResponse20013|error { - string resourcePath = string `/projects/${getEncodedUri(projectGid)}/addCustomFieldSetting`; - map queryParam = {"opt_pretty": optPretty}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse20013 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Add followers to a project - # - # + projectGid - Globally unique identifier for the project. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - Information about the followers being added. - # + return - Successfully added followers to the project. - remote isolated function addFollowersForProject(string projectGid, ProjectGidAddfollowersBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/projects/${getEncodedUri(projectGid)}/addFollowers`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2001 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Add users to a project - # - # + projectGid - Globally unique identifier for the project. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - Information about the members being added. - # + return - Successfully added members to the project. - remote isolated function addMembersForProject(string projectGid, ProjectGidAddmembersBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/projects/${getEncodedUri(projectGid)}/addMembers`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2001 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get a project's custom fields - # - # + projectGid - Globally unique identifier for the project. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved custom field settings objects for a project. - remote isolated function getCustomFieldSettingsForProject(string projectGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse2009|error { - string resourcePath = string `/projects/${getEncodedUri(projectGid)}/custom_field_settings`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2009 response = check self.clientEp->get(resourcePath); - return response; - } - # Duplicate a project - # - # + projectGid - Globally unique identifier for the project. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - Describes the duplicate's name and the elements that will be duplicated. - # + return - Successfully created the job to handle duplication. - remote isolated function duplicateProject(string projectGid, ProjectGidDuplicateBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2004|error { - string resourcePath = string `/projects/${getEncodedUri(projectGid)}/duplicate`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2004 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get memberships from a project - # - # + projectGid - Globally unique identifier for the project. - # + user - A string identifying a user. This can either be the string "me", an email, or the gid of a user. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved the requested project's memberships. - remote isolated function getProjectMembershipsForProject(string projectGid, string? user = (), boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20014|error { - string resourcePath = string `/projects/${getEncodedUri(projectGid)}/project_memberships`; - map queryParam = {"user": user, "opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20014 response = check self.clientEp->get(resourcePath); - return response; - } - # Get statuses from a project - # - # + projectGid - Globally unique identifier for the project. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved the specified project's status updates. - remote isolated function getProjectStatusesForProject(string projectGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20015|error { - string resourcePath = string `/projects/${getEncodedUri(projectGid)}/project_statuses`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20015 response = check self.clientEp->get(resourcePath); - return response; - } - # Create a project status - # - # + projectGid - Globally unique identifier for the project. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The project status to create. - # + return - Successfully created a new story. - remote isolated function createProjectStatusForProject(string projectGid, ProjectGidProjectStatusesBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse20012|error { - string resourcePath = string `/projects/${getEncodedUri(projectGid)}/project_statuses`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse20012 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Remove a custom field from a project - # - # + projectGid - Globally unique identifier for the project. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + payload - Information about the custom field setting being removed. - # + return - Successfully removed the custom field from the project. - remote isolated function removeCustomFieldSettingForProject(string projectGid, ProjectGidRemovecustomfieldsettingBody payload, boolean? optPretty = ()) returns InlineResponse2001|error { - string resourcePath = string `/projects/${getEncodedUri(projectGid)}/removeCustomFieldSetting`; - map queryParam = {"opt_pretty": optPretty}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2001 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Remove followers from a project - # - # + projectGid - Globally unique identifier for the project. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - Information about the followers being removed. - # + return - Successfully removed followers from the project. - remote isolated function removeFollowersForProject(string projectGid, ProjectGidRemovefollowersBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/projects/${getEncodedUri(projectGid)}/removeFollowers`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2001 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Remove users from a project - # - # + projectGid - Globally unique identifier for the project. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - Information about the members being removed. - # + return - Successfully removed the members from the project. - remote isolated function removeMembersForProject(string projectGid, ProjectGidRemovemembersBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/projects/${getEncodedUri(projectGid)}/removeMembers`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2001 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get sections in a project - # - # + projectGid - Globally unique identifier for the project. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved sections in project. - remote isolated function getSectionsForProject(string projectGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20016|error { - string resourcePath = string `/projects/${getEncodedUri(projectGid)}/sections`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20016 response = check self.clientEp->get(resourcePath); - return response; - } - # Create a section in a project - # - # + projectGid - Globally unique identifier for the project. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The section to create. - # + return - Successfully created the specified section. - remote isolated function createSectionForProject(string projectGid, ProjectGidSectionsBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2015|error { - string resourcePath = string `/projects/${getEncodedUri(projectGid)}/sections`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2015 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Move or Insert sections - # - # + projectGid - Globally unique identifier for the project. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The section's move action. - # + return - Successfully moved the specified section. - remote isolated function insertSectionForProject(string projectGid, SectionsInsertBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/projects/${getEncodedUri(projectGid)}/sections/insert`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2001 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get task count of a project - # - # + projectGid - Globally unique identifier for the project. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved the requested project's task counts. - remote isolated function getTaskCountsForProject(string projectGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20017|error { - string resourcePath = string `/projects/${getEncodedUri(projectGid)}/task_counts`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20017 response = check self.clientEp->get(resourcePath); - return response; - } - # Get tasks from a project - # - # + projectGid - Globally unique identifier for the project. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved the requested project's tasks. - remote isolated function getTasksForProject(string projectGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20018|error { - string resourcePath = string `/projects/${getEncodedUri(projectGid)}/tasks`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20018 response = check self.clientEp->get(resourcePath); - return response; - } - # Get a section - # - # + sectionGid - The globally unique identifier for the section. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully retrieved section. - remote isolated function getSection(string sectionGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2015|error { - string resourcePath = string `/sections/${getEncodedUri(sectionGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2015 response = check self.clientEp->get(resourcePath); - return response; - } - # Update a section - # - # + sectionGid - The globally unique identifier for the section. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The section to create. - # + return - Successfully updated the specified section. - remote isolated function updateSection(string sectionGid, SectionsSectionGidBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2015|error { - string resourcePath = string `/sections/${getEncodedUri(sectionGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2015 response = check self.clientEp->put(resourcePath, request); - return response; - } - # Delete a section - # - # + sectionGid - The globally unique identifier for the section. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully deleted the specified section. - remote isolated function deleteSection(string sectionGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/sections/${getEncodedUri(sectionGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2001 response = check self.clientEp-> delete(resourcePath); - return response; - } - # Add task to section - # - # + sectionGid - The globally unique identifier for the section. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The task and optionally the insert location. - # + return - Successfully added the task. - remote isolated function addTaskForSection(string sectionGid, SectionGidAddtaskBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/sections/${getEncodedUri(sectionGid)}/addTask`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2001 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get tasks from a section - # - # + sectionGid - The globally unique identifier for the section. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved the section's tasks. - remote isolated function getTasksForSection(string sectionGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20018|error { - string resourcePath = string `/sections/${getEncodedUri(sectionGid)}/tasks`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20018 response = check self.clientEp->get(resourcePath); - return response; - } - # Get a story - # - # + storyGid - Globally unique identifier for the story. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved the specified story. - remote isolated function getStory(string storyGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20019|error { - string resourcePath = string `/stories/${getEncodedUri(storyGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20019 response = check self.clientEp->get(resourcePath); - return response; - } - # Update a story - # - # + storyGid - Globally unique identifier for the story. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The comment story to update. - # + return - Successfully retrieved the specified story. - remote isolated function updateStory(string storyGid, StoriesStoryGidBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse20019|error { - string resourcePath = string `/stories/${getEncodedUri(storyGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse20019 response = check self.clientEp->put(resourcePath, request); - return response; - } - # Delete a story - # - # + storyGid - Globally unique identifier for the story. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully deleted the specified story. - remote isolated function deleteStory(string storyGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/stories/${getEncodedUri(storyGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2001 response = check self.clientEp-> delete(resourcePath); - return response; - } - # Get multiple tags - # - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + workspace - The workspace to filter tags on. - # + return - Successfully retrieved the specified set of tags. - remote isolated function getTags(boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = (), string? workspace = ()) returns InlineResponse20020|error { - string resourcePath = string `/tags`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset, "workspace": workspace}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20020 response = check self.clientEp->get(resourcePath); - return response; - } - # Create a tag - # - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The tag to create. - # + return - Successfully created the newly specified tag. - remote isolated function createTag(TagsBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2016|error { - string resourcePath = string `/tags`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2016 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get a tag - # - # + tagGid - Globally unique identifier for the tag. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved the specified tag. - remote isolated function getTag(string tagGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse2016|error { - string resourcePath = string `/tags/${getEncodedUri(tagGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2016 response = check self.clientEp->get(resourcePath); - return response; - } - # Update a tag - # - # + tagGid - Globally unique identifier for the tag. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully updated the specified tag. - remote isolated function updateTag(string tagGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse2016|error { - string resourcePath = string `/tags/${getEncodedUri(tagGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - //TODO: Update the request as needed; - InlineResponse2016 response = check self.clientEp-> put(resourcePath, request); - return response; - } - # Delete a tag - # - # + tagGid - Globally unique identifier for the tag. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully deleted the specified tag. - remote isolated function deleteTag(string tagGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse2001|error { - string resourcePath = string `/tags/${getEncodedUri(tagGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2001 response = check self.clientEp-> delete(resourcePath); - return response; - } - # Get tasks from a tag - # - # + tagGid - Globally unique identifier for the tag. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved the tasks associated with the specified tag. - remote isolated function getTasksForTag(string tagGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20018|error { - string resourcePath = string `/tags/${getEncodedUri(tagGid)}/tasks`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20018 response = check self.clientEp->get(resourcePath); - return response; - } - # Get multiple tasks - # - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + assignee - The assignee to filter tasks on. *Note: If you specify `assignee`, you must also specify the `workspace` to filter on.* - # + project - The project to filter tasks on. - # + section - The section to filter tasks on. *Note: Currently, this is only supported in board views.* - # + workspace - The workspace to filter tasks on. *Note: If you specify `workspace`, you must also specify the `assignee` to filter on.* - # + completedSince - Only return tasks that are either incomplete or that have been completed since this time. - # + modifiedSince - Only return tasks that have been modified since the given time. *Note: A task is considered “modified” if any of its properties change, or associations between it and other objects are modified (e.g. a task being added to a project). A task is not considered modified just because another object it is associated with (e.g. a subtask) is modified. Actions that count as modifying the task include assigning, renaming, completing, and adding stories.* - # + return - Successfully retrieved requested tasks. - remote isolated function getTasks(boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = (), string? assignee = (), string? project = (), string? section = (), string? workspace = (), string? completedSince = (), string? modifiedSince = ()) returns InlineResponse20018|error { - string resourcePath = string `/tasks`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset, "assignee": assignee, "project": project, "section": section, "workspace": workspace, "completed_since": completedSince, "modified_since": modifiedSince}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20018 response = check self.clientEp->get(resourcePath); - return response; - } - # Create a task - # - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - Create Task Request - # + return - Successfully created a new task. - remote isolated function createTask(TasksBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2017|error { - string resourcePath = string `/tasks`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2017 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get a task - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully retrieved the specified task. - remote isolated function getTask(string taskGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2017|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2017 response = check self.clientEp->get(resourcePath); - return response; - } - # Update a task - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The task to update. - # + return - Successfully updated the specified task. - remote isolated function updateTask(string taskGid, TasksTaskGidBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2017|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2017 response = check self.clientEp->put(resourcePath, request); - return response; - } - # Delete a task - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully deleted the specified task. - remote isolated function deleteTask(string taskGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2001 response = check self.clientEp-> delete(resourcePath); - return response; - } - # Set dependencies for a task - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The list of tasks to set as dependencies. - # + return - Successfully set the specified dependencies on the task. - remote isolated function addDependenciesForTask(string taskGid, TaskGidAdddependenciesBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}/addDependencies`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2001 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Set dependents for a task - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The list of tasks to add as dependents. - # + return - Successfully set the specified dependents on the given task. - remote isolated function addDependentsForTask(string taskGid, TaskGidAdddependentsBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse20018|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}/addDependents`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse20018 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Add followers to a task - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The followers to add to the task. - # + return - Successfully added the specified followers to the task. - remote isolated function addFollowersForTask(string taskGid, TaskGidAddfollowersBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}/addFollowers`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2001 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Add a project to a task - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The project to add the task to. - # + return - Successfully added the specified project to the task. - remote isolated function addProjectForTask(string taskGid, TaskGidAddprojectBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}/addProject`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2001 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Add a tag to a task - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The tag to add to the task. - # + return - Successfully added the specified tag to the task. - remote isolated function addTagForTask(string taskGid, TaskGidAddtagBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}/addTag`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2001 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get attachments for a task - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved the compact records for all attachments on the task. - remote isolated function getAttachmentsForTask(string taskGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20021|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}/attachments`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20021 response = check self.clientEp->get(resourcePath); - return response; - } - # Upload an attachment - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + payload - The file you want to upload. - # + return - Successfully uploaded the attachment to the task. - remote isolated function createAttachmentForTask(string taskGid, AttachmentRequest payload, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse200|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}/attachments`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - mime:Entity[] bodyParts = check createBodyParts(payload); - request.setBodyParts(bodyParts); - InlineResponse200 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get dependencies from a task - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved the specified task's dependencies. - remote isolated function getDependenciesForTask(string taskGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20018|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}/dependencies`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20018 response = check self.clientEp->get(resourcePath); - return response; - } - # Get dependents from a task - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved the specified dependents of the task. - remote isolated function getDependentsForTask(string taskGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20018|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}/dependents`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20018 response = check self.clientEp->get(resourcePath); - return response; - } - # Duplicate a task - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - Describes the duplicate's name and the fields that will be duplicated. - # + return - Successfully created the job to handle duplication. - remote isolated function duplicateTask(string taskGid, TaskGidDuplicateBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2004|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}/duplicate`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2004 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get projects a task is in - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved the projects for the given task. - remote isolated function getProjectsForTask(string taskGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20010|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}/projects`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20010 response = check self.clientEp->get(resourcePath); - return response; - } - # Unlink dependencies from a task - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The list of tasks to unlink as dependencies. - # + return - Successfully unlinked the dependencies from the specified task. - remote isolated function removeDependenciesForTask(string taskGid, TaskGidRemovedependenciesBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse20022|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}/removeDependencies`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse20022 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Unlink dependents from a task - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The list of tasks to remove as dependents. - # + return - Successfully unlinked the specified tasks as dependents. - remote isolated function removeDependentsForTask(string taskGid, TaskGidRemovedependentsBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse20022|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}/removeDependents`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse20022 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Remove followers from a task - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The followers to remove from the task. - # + return - Successfully removed the specified followers from the task. - remote isolated function removeFollowerForTask(string taskGid, TaskGidRemovefollowersBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}/removeFollowers`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2001 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Remove a project from a task - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The project to remove the task from. - # + return - Successfully removed the specified project from the task. - remote isolated function removeProjectForTask(string taskGid, TaskGidRemoveprojectBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}/removeProject`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2001 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Remove a tag from a task - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The tag to remove from the task. - # + return - Successfully removed the specified tag from the task. - remote isolated function removeTagForTask(string taskGid, TaskGidRemovetagBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}/removeTag`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2001 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Set the parent of a task - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The new parent of the subtask. - # + return - Successfully changed the parent of the specified subtask. - remote isolated function setParentForTask(string taskGid, TaskGidSetparentBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2017|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}/setParent`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2017 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get stories from a task - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved the specified task's stories. - remote isolated function getStoriesForTask(string taskGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20023|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}/stories`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20023 response = check self.clientEp->get(resourcePath); - return response; - } - # Create a story on a task - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The story to create. - # + return - Successfully created a new story. - remote isolated function createStoryForTask(string taskGid, TaskGidStoriesBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse20019|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}/stories`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse20019 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get subtasks from a task - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved the specified task's subtasks. - remote isolated function getSubtasksForTask(string taskGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20018|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}/subtasks`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20018 response = check self.clientEp->get(resourcePath); - return response; - } - # Create a subtask - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The new subtask to create. - # + return - Successfully created the specified subtask. - remote isolated function createSubtaskForTask(string taskGid, TaskGidSubtasksBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2017|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}/subtasks`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2017 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get a task's tags - # - # + taskGid - Globally unique identifier for the task. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved the tags for the given task. - remote isolated function getTagsForTask(string taskGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20020|error { - string resourcePath = string `/tasks/${getEncodedUri(taskGid)}/tags`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20020 response = check self.clientEp->get(resourcePath); - return response; - } - # Get team memberships - # - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + team - Globally unique identifier for the team. - # + user - A string identifying a user. This can either be the string "me", an email, or the gid of a user. This parameter must be used with the workspace parameter. - # + workspace - Globally unique identifier for the workspace. This parameter must be used with the user parameter. - # + return - Successfully retrieved the requested team memberships. - remote isolated function getTeamMemberships(boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = (), string? team = (), string? user = (), string? workspace = ()) returns InlineResponse20024|error { - string resourcePath = string `/team_memberships`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset, "team": team, "user": user, "workspace": workspace}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20024 response = check self.clientEp->get(resourcePath); - return response; - } - # Get a team membership - # - # + teamMembershipGid - Globally unique identifier for the team membership. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully retrieved the requested team membership. - remote isolated function getTeamMembership(string teamMembershipGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse20025|error { - string resourcePath = string `/team_memberships/${getEncodedUri(teamMembershipGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20025 response = check self.clientEp->get(resourcePath); - return response; - } - # Create a team - # - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + payload - The team to create. - # + return - Successfully created a new team. - remote isolated function createTeam(TeamsBody payload, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse2018|error { - string resourcePath = string `/teams`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2018 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get a team - # - # + teamGid - Globally unique identifier for the team. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successsfully retrieved the record for a single team. - remote isolated function getTeam(string teamGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse2018|error { - string resourcePath = string `/teams/${getEncodedUri(teamGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2018 response = check self.clientEp->get(resourcePath); - return response; - } - # Add a user to a team - # - # + teamGid - Globally unique identifier for the team. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The user to add to the team. - # + return - Returns the full user record for the added user. - remote isolated function addUserForTeam(string teamGid, TeamGidAdduserBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse20026|error { - string resourcePath = string `/teams/${getEncodedUri(teamGid)}/addUser`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse20026 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get a team's projects - # - # + teamGid - Globally unique identifier for the team. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + archived - Only return projects whose `archived` field takes on the value of this parameter. - # + return - Successfully retrieved the requested team's projects. - remote isolated function getProjectsForTeam(string teamGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = (), boolean? archived = ()) returns InlineResponse20010|error { - string resourcePath = string `/teams/${getEncodedUri(teamGid)}/projects`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset, "archived": archived}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20010 response = check self.clientEp->get(resourcePath); - return response; - } - # Create a project in a team - # - # + teamGid - Globally unique identifier for the team. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The new project to create. - # + return - Successfully created the specified project. - remote isolated function createProjectForTeam(string teamGid, TeamGidProjectsBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2014|error { - string resourcePath = string `/teams/${getEncodedUri(teamGid)}/projects`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2014 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Remove a user from a team - # - # + teamGid - Globally unique identifier for the team. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The user to remove from the team. - # + return - Returns an empty data record - remote isolated function removeUserForTeam(string teamGid, TeamGidRemoveuserBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/teams/${getEncodedUri(teamGid)}/removeUser`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2001 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get memberships from a team - # - # + teamGid - Globally unique identifier for the team. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved the requested team's memberships. - remote isolated function getTeamMembershipsForTeam(string teamGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20024|error { - string resourcePath = string `/teams/${getEncodedUri(teamGid)}/team_memberships`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20024 response = check self.clientEp->get(resourcePath); - return response; - } - # Get users in a team - # - # + teamGid - Globally unique identifier for the team. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Returns the user records for all the members of the team, including guests and limited access users - remote isolated function getUsersForTeam(string teamGid, boolean? optPretty = (), string[]? optFields = (), string? offset = ()) returns InlineResponse20027|error { - string resourcePath = string `/teams/${getEncodedUri(teamGid)}/users`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20027 response = check self.clientEp->get(resourcePath); - return response; - } - # Get a user task list - # - # + userTaskListGid - Globally unique identifier for the user task list. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully retrieved the user task list. - remote isolated function getUserTaskList(string userTaskListGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse20028|error { - string resourcePath = string `/user_task_lists/${getEncodedUri(userTaskListGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20028 response = check self.clientEp->get(resourcePath); - return response; - } - # Get tasks from a user task list - # - # + completedSince - Only return tasks that are either incomplete or that have been completed since this time. Accepts a date-time string or the keyword *now*. - # + userTaskListGid - Globally unique identifier for the user task list. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved the user task list's tasks. - remote isolated function getTasksForUserTaskList(string userTaskListGid, string? completedSince = (), boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20018|error { - string resourcePath = string `/user_task_lists/${getEncodedUri(userTaskListGid)}/tasks`; - map queryParam = {"completed_since": completedSince, "opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20018 response = check self.clientEp->get(resourcePath); - return response; - } - # Get multiple users - # - # + workspace - The workspace or organization ID to filter users on. - # + team - The team ID to filter users on. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved the requested user records. - remote isolated function getUsers(string? workspace = (), string? team = (), boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20027|error { - string resourcePath = string `/users`; - map queryParam = {"workspace": workspace, "team": team, "opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20027 response = check self.clientEp->get(resourcePath); - return response; - } - # Get a user - # - # + userGid - A string identifying a user. This can either be the string "me", an email, or the gid of a user. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Returns the user specified. - remote isolated function getUser(string userGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse20026|error { - string resourcePath = string `/users/${getEncodedUri(userGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20026 response = check self.clientEp->get(resourcePath); - return response; - } - # Get a user's favorites - # - # + userGid - A string identifying a user. This can either be the string "me", an email, or the gid of a user. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + resourceType - The resource type of favorites to be returned. - # + workspace - The workspace in which to get favorites. - # + return - Returns the specified user's favorites. - remote isolated function getFavoritesForUser(string userGid, string resourceType, string workspace, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse20029|error { - string resourcePath = string `/users/${getEncodedUri(userGid)}/favorites`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "resource_type": resourceType, "workspace": workspace}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20029 response = check self.clientEp->get(resourcePath); - return response; - } - # Get memberships from a user - # - # + userGid - A string identifying a user. This can either be the string "me", an email, or the gid of a user. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + workspace - Globally unique identifier for the workspace. - # + return - Successfully retrieved the requested users's memberships. - remote isolated function getTeamMembershipsForUser(string userGid, string workspace, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20024|error { - string resourcePath = string `/users/${getEncodedUri(userGid)}/team_memberships`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset, "workspace": workspace}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20024 response = check self.clientEp->get(resourcePath); - return response; - } - # Get teams for a user - # - # + userGid - A string identifying a user. This can either be the string "me", an email, or the gid of a user. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + organization - The workspace or organization to filter teams on. - # + return - Returns the team records for all teams in the organization or workspace to which the given user is assigned. - remote isolated function getTeamsForUser(string userGid, string organization, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse2005|error { - string resourcePath = string `/users/${getEncodedUri(userGid)}/teams`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset, "organization": organization}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2005 response = check self.clientEp->get(resourcePath); - return response; - } - # Get a user's task list - # - # + userGid - A string identifying a user. This can either be the string "me", an email, or the gid of a user. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + workspace - The workspace in which to get the user task list. - # + return - Successfully retrieved the user's task list. - remote isolated function getUserTaskListForUser(string userGid, string workspace, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse20028|error { - string resourcePath = string `/users/${getEncodedUri(userGid)}/user_task_list`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "workspace": workspace}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20028 response = check self.clientEp->get(resourcePath); - return response; - } - # Get workspace memberships for a user - # - # + userGid - A string identifying a user. This can either be the string "me", an email, or the gid of a user. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved the requested user's workspace memberships. - remote isolated function getWorkspaceMembershipsForUser(string userGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20030|error { - string resourcePath = string `/users/${getEncodedUri(userGid)}/workspace_memberships`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20030 response = check self.clientEp->get(resourcePath); - return response; - } - # Get multiple webhooks - # - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + workspace - The workspace to query for webhooks in. - # + 'resource - Only return webhooks for the given resource. - # + return - Successfully retrieved the requested webhooks. - remote isolated function getWebhooks(string workspace, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = (), string? 'resource = ()) returns InlineResponse20031|error { - string resourcePath = string `/webhooks`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset, "workspace": workspace, "resource": 'resource}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20031 response = check self.clientEp->get(resourcePath); - return response; - } - # Establish a webhook - # - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The webhook workspace and target. - # + return - Successfully created the requested webhook. - remote isolated function createWebhook(WebhooksBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2019|error { - string resourcePath = string `/webhooks`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2019 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get a webhook - # - # + webhookGid - Globally unique identifier for the webhook. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully retrieved the requested webhook. - remote isolated function getWebhook(string webhookGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2019|error { - string resourcePath = string `/webhooks/${getEncodedUri(webhookGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2019 response = check self.clientEp->get(resourcePath); - return response; - } - # Delete a webhook - # - # + webhookGid - Globally unique identifier for the webhook. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully retrieved the requested webhook. - remote isolated function deleteWebhook(string webhookGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/webhooks/${getEncodedUri(webhookGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse2001 response = check self.clientEp-> delete(resourcePath); - return response; - } - # Get a workspace membership - # - # + workspaceMembershipGid - Globally unique identifier for the workspace membership - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully retrieved the requested workspace membership. - remote isolated function getWorkspaceMembership(string workspaceMembershipGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse20032|error { - string resourcePath = string `/workspace_memberships/${getEncodedUri(workspaceMembershipGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20032 response = check self.clientEp->get(resourcePath); - return response; - } - # Get multiple workspaces - # - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Return all workspaces visible to the authorized user. - remote isolated function getWorkspaces(boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20033|error { - string resourcePath = string `/workspaces`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20033 response = check self.clientEp->get(resourcePath); - return response; - } - # Get a workspace - # - # + workspaceGid - Globally unique identifier for the workspace or organization. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Return the full workspace record. - remote isolated function getWorkspace(string workspaceGid, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse20034|error { - string resourcePath = string `/workspaces/${getEncodedUri(workspaceGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20034 response = check self.clientEp->get(resourcePath); - return response; - } - # Update a workspace - # - # + workspaceGid - Globally unique identifier for the workspace or organization. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The workspace object with all updated properties. - # + return - Update for the workspace was successful. - remote isolated function updateWorkspace(string workspaceGid, WorkspacesWorkspaceGidBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse20034|error { - string resourcePath = string `/workspaces/${getEncodedUri(workspaceGid)}`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse20034 response = check self.clientEp->put(resourcePath, request); - return response; - } - # Add a user to a workspace or organization - # - # + workspaceGid - Globally unique identifier for the workspace or organization. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The user to add to the workspace. - # + return - The user was added successfully to the workspace or organization. - remote isolated function addUserForWorkspace(string workspaceGid, WorkspaceGidAdduserBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse20026|error { - string resourcePath = string `/workspaces/${getEncodedUri(workspaceGid)}/addUser`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse20026 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get a workspace's custom fields - # - # + workspaceGid - Globally unique identifier for the workspace or organization. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved all custom fields for the given workspace. - remote isolated function getCustomFieldsForWorkspace(string workspaceGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20035|error { - string resourcePath = string `/workspaces/${getEncodedUri(workspaceGid)}/custom_fields`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20035 response = check self.clientEp->get(resourcePath); - return response; - } - # Get all projects in a workspace - # - # + workspaceGid - Globally unique identifier for the workspace or organization. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + archived - Only return projects whose `archived` field takes on the value of this parameter. - # + return - Successfully retrieved the requested workspace's projects. - remote isolated function getProjectsForWorkspace(string workspaceGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = (), boolean? archived = ()) returns InlineResponse20010|error { - string resourcePath = string `/workspaces/${getEncodedUri(workspaceGid)}/projects`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset, "archived": archived}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20010 response = check self.clientEp->get(resourcePath); - return response; - } - # Create a project in a workspace - # - # + workspaceGid - Globally unique identifier for the workspace or organization. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The new project to create. - # + return - Successfully created a new project in the specified workspace. - remote isolated function createProjectForWorkspace(string workspaceGid, WorkspaceGidProjectsBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2014|error { - string resourcePath = string `/workspaces/${getEncodedUri(workspaceGid)}/projects`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2014 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Remove a user from a workspace or organization - # - # + workspaceGid - Globally unique identifier for the workspace or organization. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The user to remove from the workspace. - # + return - The user was removed successfully to the workspace or organization. - remote isolated function removeUserForWorkspace(string workspaceGid, WorkspaceGidRemoveuserBody payload, boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse2001|error { - string resourcePath = string `/workspaces/${getEncodedUri(workspaceGid)}/removeUser`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - InlineResponse2001 response = check self.clientEp->post(resourcePath, request); - return response; - } - # Get tags in a workspace - # - # + workspaceGid - Globally unique identifier for the workspace or organization. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved the specified set of tags. - remote isolated function getTagsForWorkspace(string workspaceGid, boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20020|error { - string resourcePath = string `/workspaces/${getEncodedUri(workspaceGid)}/tags`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20020 response = check self.clientEp->get(resourcePath); - return response; - } - # Create a tag in a workspace - # - # + workspaceGid - Globally unique identifier for the workspace or organization. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + payload - The tag to create. - # + return - Successfully created the newly specified tag. - remote isolated function createTagForWorkspace(string workspaceGid, WorkspaceGidTagsBody payload, boolean? optPretty = (), string[]? optFields = ()) returns WorkspaceGidTagsBody|error { - string resourcePath = string `/workspaces/${getEncodedUri(workspaceGid)}/tags`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - WorkspaceGidTagsBody response = check self.clientEp->post(resourcePath, request); - return response; - } - # Search tasks in a workspace - # - # + workspaceGid - Globally unique identifier for the workspace or organization. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + text - Performs full-text search on both task name and description - # + resourceSubtype - Filters results by the task's resource_subtype - # + assigneeAny - Comma-separated list of user identifiers - # + assigneeNot - Comma-separated list of user identifiers - # + portfoliosAny - Comma-separated list of portfolio IDs - # + projectsAny - Comma-separated list of project IDs - # + projectsNot - Comma-separated list of project IDs - # + projectsAll - Comma-separated list of project IDs - # + sectionsAny - Comma-separated list of section or column IDs - # + sectionsNot - Comma-separated list of section or column IDs - # + sectionsAll - Comma-separated list of section or column IDs - # + tagsAny - Comma-separated list of tag IDs - # + tagsNot - Comma-separated list of tag IDs - # + tagsAll - Comma-separated list of tag IDs - # + teamsAny - Comma-separated list of team IDs - # + followersAny - Comma-separated list of user identifiers - # + followersNot - Comma-separated list of user identifiers - # + createdByAny - Comma-separated list of user identifiers - # + createdByNot - Comma-separated list of user identifiers - # + assignedByAny - Comma-separated list of user identifiers - # + assignedByNot - Comma-separated list of user identifiers - # + likedByAny - Comma-separated list of user identifiers - # + likedByNot - Comma-separated list of user identifiers - # + commentedOnByAny - Comma-separated list of user identifiers - # + commentedOnByNot - Comma-separated list of user identifiers - # + dueOnBefore - ISO 8601 date string - # + dueOnAfter - ISO 8601 date string - # + dueOn - ISO 8601 date string or `null` - # + dueAtBefore - ISO 8601 datetime string - # + dueAtAfter - ISO 8601 datetime string - # + startOnBefore - ISO 8601 date string - # + startOnAfter - ISO 8601 date string - # + startOn - ISO 8601 date string or `null` - # + createdOnBefore - ISO 8601 date string - # + createdOnAfter - ISO 8601 date string - # + createdOn - ISO 8601 date string or `null` - # + createdAtBefore - ISO 8601 datetime string - # + createdAtAfter - ISO 8601 datetime string - # + completedOnBefore - ISO 8601 date string - # + completedOnAfter - ISO 8601 date string - # + completedOn - ISO 8601 date string or `null` - # + completedAtBefore - ISO 8601 datetime string - # + completedAtAfter - ISO 8601 datetime string - # + modifiedOnBefore - ISO 8601 date string - # + modifiedOnAfter - ISO 8601 date string - # + modifiedOn - ISO 8601 date string or `null` - # + modifiedAtBefore - ISO 8601 datetime string - # + modifiedAtAfter - ISO 8601 datetime string - # + isBlocking - Filter to incomplete tasks with dependents - # + isBlocked - Filter to tasks with incomplete dependencies - # + hasAttachment - Filter to tasks with attachments - # + completed - Filter to completed tasks - # + isSubtask - Filter to subtasks - # + sortBy - One of `due_date`, `created_at`, `completed_at`, `likes`, or `modified_at`, defaults to `modified_at` - # + sortAscending - Default `false` - # + return - Successfully retrieved the section's tasks. - remote isolated function searchTasksForWorkspace(string workspaceGid, boolean? optPretty = (), string[]? optFields = (), string? text = (), string resourceSubtype = "milestone", string? assigneeAny = (), string? assigneeNot = (), string? portfoliosAny = (), string? projectsAny = (), string? projectsNot = (), string? projectsAll = (), string? sectionsAny = (), string? sectionsNot = (), string? sectionsAll = (), string? tagsAny = (), string? tagsNot = (), string? tagsAll = (), string? teamsAny = (), string? followersAny = (), string? followersNot = (), string? createdByAny = (), string? createdByNot = (), string? assignedByAny = (), string? assignedByNot = (), string? likedByAny = (), string? likedByNot = (), string? commentedOnByAny = (), string? commentedOnByNot = (), string? dueOnBefore = (), string? dueOnAfter = (), string? dueOn = (), string? dueAtBefore = (), string? dueAtAfter = (), string? startOnBefore = (), string? startOnAfter = (), string? startOn = (), string? createdOnBefore = (), string? createdOnAfter = (), string? createdOn = (), string? createdAtBefore = (), string? createdAtAfter = (), string? completedOnBefore = (), string? completedOnAfter = (), string? completedOn = (), string? completedAtBefore = (), string? completedAtAfter = (), string? modifiedOnBefore = (), string? modifiedOnAfter = (), string? modifiedOn = (), string? modifiedAtBefore = (), string? modifiedAtAfter = (), boolean? isBlocking = (), boolean? isBlocked = (), boolean? hasAttachment = (), boolean? completed = (), boolean? isSubtask = (), string sortBy = "modified_at", boolean sortAscending = false) returns InlineResponse20018|error { - string resourcePath = string `/workspaces/${getEncodedUri(workspaceGid)}/tasks/search`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "text": text, "resource_subtype": resourceSubtype, "assignee.any": assigneeAny, "assignee.not": assigneeNot, "portfolios.any": portfoliosAny, "projects.any": projectsAny, "projects.not": projectsNot, "projects.all": projectsAll, "sections.any": sectionsAny, "sections.not": sectionsNot, "sections.all": sectionsAll, "tags.any": tagsAny, "tags.not": tagsNot, "tags.all": tagsAll, "teams.any": teamsAny, "followers.any": followersAny, "followers.not": followersNot, "created_by.any": createdByAny, "created_by.not": createdByNot, "assigned_by.any": assignedByAny, "assigned_by.not": assignedByNot, "liked_by.any": likedByAny, "liked_by.not": likedByNot, "commented_on_by.any": commentedOnByAny, "commented_on_by.not": commentedOnByNot, "due_on.before": dueOnBefore, "due_on.after": dueOnAfter, "due_on": dueOn, "due_at.before": dueAtBefore, "due_at.after": dueAtAfter, "start_on.before": startOnBefore, "start_on.after": startOnAfter, "start_on": startOn, "created_on.before": createdOnBefore, "created_on.after": createdOnAfter, "created_on": createdOn, "created_at.before": createdAtBefore, "created_at.after": createdAtAfter, "completed_on.before": completedOnBefore, "completed_on.after": completedOnAfter, "completed_on": completedOn, "completed_at.before": completedAtBefore, "completed_at.after": completedAtAfter, "modified_on.before": modifiedOnBefore, "modified_on.after": modifiedOnAfter, "modified_on": modifiedOn, "modified_at.before": modifiedAtBefore, "modified_at.after": modifiedAtAfter, "is_blocking": isBlocking, "is_blocked": isBlocked, "has_attachment": hasAttachment, "completed": completed, "is_subtask": isSubtask, "sort_by": sortBy, "sort_ascending": sortAscending}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20018 response = check self.clientEp->get(resourcePath); - return response; - } - # Get objects via typeahead - # - # + workspaceGid - Globally unique identifier for the workspace or organization. - # + resourceType - The type of values the typeahead should return. You can choose from one of the following: `custom_field`, `project`, `portfolio`, `tag`, `task`, and `user`. Note that unlike in the names of endpoints, the types listed here are in singular form (e.g. `task`). Using multiple types is not yet supported. - # + 'type - *Deprecated: new integrations should prefer the resource_type field.* - # + query - The string that will be used to search for relevant objects. If an empty string is passed in, the API will currently return an empty result set. - # + count - The number of results to return. The default is 20 if this parameter is omitted, with a minimum of 1 and a maximum of 100. If there are fewer results found than requested, all will be returned. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + return - Successfully retrieved objects via a typeahead search algorithm. - remote isolated function typeaheadForWorkspace(string workspaceGid, string resourceType, string 'type = "user", string? query = (), int? count = (), boolean? optPretty = (), string[]? optFields = ()) returns InlineResponse20036|error { - string resourcePath = string `/workspaces/${getEncodedUri(workspaceGid)}/typeahead`; - map queryParam = {"resource_type": resourceType, "type": 'type, "query": query, "count": count, "opt_pretty": optPretty, "opt_fields": optFields}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20036 response = check self.clientEp->get(resourcePath); - return response; - } - # Get users in a workspace or organization - # - # + workspaceGid - Globally unique identifier for the workspace or organization. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Return the users in the specified workspace or org. - remote isolated function getUsersForWorkspace(string workspaceGid, boolean? optPretty = (), string[]? optFields = (), string? offset = ()) returns InlineResponse20027|error { - string resourcePath = string `/workspaces/${getEncodedUri(workspaceGid)}/users`; - map queryParam = {"opt_pretty": optPretty, "opt_fields": optFields, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20027 response = check self.clientEp->get(resourcePath); - return response; - } - # Get the workspace memberships for a workspace - # - # + workspaceGid - Globally unique identifier for the workspace or organization. - # + user - A string identifying a user. This can either be the string "me", an email, or the gid of a user. - # + optPretty - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - # + optFields - Defines fields to return. Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. The id of included objects will always be returned, regardless of the field options. - # + 'limit - Results per page. The number of objects to return per page. The value must be between 1 and 100. - # + offset - Offset token. An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - # + return - Successfully retrieved the requested workspace's memberships. - remote isolated function getWorkspaceMembershipsForWorkspace(string workspaceGid, string? user = (), boolean? optPretty = (), string[]? optFields = (), int? 'limit = (), string? offset = ()) returns InlineResponse20030|error { - string resourcePath = string `/workspaces/${getEncodedUri(workspaceGid)}/workspace_memberships`; - map queryParam = {"user": user, "opt_pretty": optPretty, "opt_fields": optFields, "limit": 'limit, "offset": offset}; - map queryParamEncoding = {"opt_fields": {style: FORM, explode: false}}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam, queryParamEncoding); - InlineResponse20030 response = check self.clientEp->get(resourcePath); - return response; - } -} diff --git a/openapi/asana/icon.png b/openapi/asana/icon.png deleted file mode 100644 index e0f8cf0fb..000000000 Binary files a/openapi/asana/icon.png and /dev/null differ diff --git a/openapi/asana/openapi.yaml b/openapi/asana/openapi.yaml deleted file mode 100644 index 3c23ca5bd..000000000 --- a/openapi/asana/openapi.yaml +++ /dev/null @@ -1,9140 +0,0 @@ -openapi: 3.0.0 -servers: - - description: Asana API endpoint. - url: https://app.asana.com/api/1.0 -info: - x-ballerina-display: - label: Asana - iconPath: "icon.png" - contact: - name: Asana Support - url: https://asana.com/support - description: >- - This is a generated connector for [Asana API v1.0](https://developers.asana.com/docs) OpenAPI specification. - - This API enables you to help teams organize, track and manage their work. - - For additional help getting started with the API, visit [Asana API](https://developers.asana.com). - x-ballerina-init-description: > - The connector initialization requires setting the API credentials. - - Create an [Asana API Account](https://asana.com/create-account) and obtain tokens following [this guide](https://developers.asana.com/docs/authentication). - license: - name: Apache 2.0 - url: https://www.apache.org/licenses/LICENSE-2.0 - termsOfService: https://asana.com/terms - title: Asana - version: "1.0" - x-apisguru-categories: - - developer_tools - x-docs-schema-whitelist: - - AsanaResource - - AsanaNamedResource - - AttachmentResponse - - AttachmentCompact - - BatchResponse - - CustomFieldSettingResponse - - CustomFieldSettingCompact - - CustomFieldResponse - - CustomFieldCompact - - EnumOption - - EventResponse - - ErrorResponse - - GoalResponse - - GoalCompact - - JobResponse - - JobCompact - - OrganiztaionExportResponse - - OrganiztaionExportCompact - - PortfolioMembershipResponse - - PortfolioMembershipCompact - - PortfolioResponse - - PortfolioCompact - - ProjectMembershipResponse - - ProjectMembershipCompact - - ProjectResponse - - ProjectCompact - - ProjectStatusResponse - - ProjectStatusCompact - - SectionResponse - - SectionCompact - - StoryResponse - - StoryCompact - - TagResponse - - TagCompact - - TaskResponse - - TaskCompact - - TeamMembershipResponse - - TeamMembershipCompact - - TeamResponse - - TeamCompact - - UserTaskListResponse - - UserTaskListCompact - - UserResponse - - UserCompact - - WebhookFilter - - WebhookResponse - - WebhookCompact - - WorkspaceMembershipResponse - - WorkspaceMembershipCompact - - WorkspaceResponse - - WorkspaceCompact - x-logo: - url: https://d1gwm4cf8hecp4.cloudfront.net/images/favicons/apple-touch-icon-57x57.png - x-origin: - - format: openapi - url: https://raw.githubusercontent.com/Asana/developer-docs/master/defs/asana_oas.yaml - version: "3.0" - x-providerName: asana.com - x-public-description: This is the interface for interacting with the [Asana Platform](https://developers.asana.com). Our API reference is generated from our [OpenAPI spec] (https://raw.githubusercontent.com/Asana/developer-docs/master/defs/asana_oas.yaml). -security: - - personalAccessToken: [] - - oauth2: [] -tags: - - description: An *attachment* object represents any file attached to a task in Asana, whether it’s an uploaded file or one associated via a third-party service such as Dropbox or Google Drive. - name: Attachments - - description: |- - There are many cases where you want to accomplish a variety of work in the Asana API but want to minimize the number of HTTP requests you make. For example: - - * Modern browsers limit the number of requests that a single web page can - make at once. - * Mobile apps will use more battery life to keep the cellular radio on - when making a series of requests. - * There is an overhead cost to developing software that can make multiple - requests in parallel. - * Some cloud platforms handle parallelism poorly, or disallow it - entirely. - - - To make development easier in these use cases, Asana provides a **batch API** that enables developers to perform multiple “actions” by making only a single HTTP request. - - #### Making a Batch Request - - To make a batch request, send a `POST` request to `/batch`. Like other `POST` endpoints, the body should contain a `data` envelope. Inside this envelope should be a single `actions` field, containing a list of “action” objects. Each action represents a standard request to an existing endpoint in the Asana API. - - **The maximum number of actions allowed in a single batch request is 10**. Making a batch request with no actions in it will result in a `400 Bad Request`. - - When the batch API receives the list of actions to execute, it will dispatch those actions to the already-implemented endpoints specified by the `relative_path` and `method` for each action. This happens in parallel, so all actions in the request will be processed simultaneously. There is no guarantee of the execution order for these actions, nor is there a way to use the output of one action as the input of another action (such as creating a task and then commenting on it). - - The response to the batch request will contain (within the `data` envelope) a list of result objects, one for each action. The results are guaranteed to be in the same order as the actions in the request, e.g., the first result in the response corresponds to the first action in the request. - - The batch API will always attempt to return a `200 Success` response with individual result objects for each individual action in the request. Only in certain cases (such as missing authorization or malformed JSON in the body) will the entire request fail with another status code. Even if every individual action in the request fails, the batch API will still return a `200 Success` response, and each result object in the response will contain the errors encountered with each action. - - #### Rate Limiting - - The batch API fully respects all of our rate limiting. This means that a batch request counts against *both* the standard rate limiter and the concurrent request limiter as though you had made a separate HTTP request for every individual action. For example, a batch request with five actions counts as five separate requests in the standard rate limiter, and counts as five concurrent requests in the concurrent request limiter. The batch request itself incurs no cost. - - If any of the actions in a batch request would exceed any of the enforced limits, the *entire* request will fail with a `429 Too Many Requests` error. This is to prevent the unpredictability of which actions might succeed if not all of them could succeed. - - #### Restrictions - - Not every endpoint can be accessed through the batch API. Specifically, the following actions cannot be taken and will result in a `400 Bad Request` for that action: - - * Uploading attachments - * Creating, getting, or deleting organization exports - * Any SCIM operations - * Nested calls to the batch API - name: Batch API - - description: |- - In the Asana application, Tasks, Projects, and Portfolios can hold user-specified Custom Fields which provide extra information; for example, a priority value or a number representing the time required to complete a Task. This lets a user define the type of information that each Item within a Project or Portfolio can contain in addition to the built-in fields that Asana provides. - - **Note:** Custom Fields are a premium feature. Integrations which work with Custom Fields need to handle an assortment of use cases for free and premium users in context of free and premium organizations. For a detailed examination of to what data users will have access in different circumstances, read the section below on access control. - - `display_value` is a read-only field that will always be a string. For apps that use custom fields, this is a great way to safely display/export the value of a custom field, regardless of its type. We suggest apps use this field in order to future-proof for changes to Custom Fields. - - The characteristics of Custom Fields are: - - * There is metadata that defines the Custom Field. This metadata can be shared across an entire workspace, or be specific to a Project or Portfolio. - * Creating a Custom Field Setting on a Project or Portfolio means each direct child will have the custom field. This is conceptually akin to adding columns in a database or a spreadsheet: every Task (row) in the Project (table) can contain information for that field, including "blank" values, i.e. `null` data. For Portfolio custom fields, every Project (row) in the Portfolio (table) will contain information for the custom field. - * Custom Field Settings only go one child deep. Meaning a custom field setting on a portfolio will give each project the custom field, but not each task within those projects. - * Tasks have Custom Field _values_ assigned to them. - - A brief example: let's imagine that an organization has defined a Custom Field for "Priority". This field is of `enum` type and can have user-defined values of `Low`, `Medium`, or `High`. This is the field metadata, and it is visible within, and shared across, the entire organization. - - A Project is then created in the organization, called "Bugs", and the "Priority" Custom Field is associated with that Project. This will allow all Tasks within the "Bugs" Project to have an associated "Priority". - - A new Task is created within "Bugs". This Task, then, has a field named "Priority" which can take on the Custom Field value of one of `[null]`, `Low`, `Medium`, and `High`. - - These Custom Fields are accessible via the API through a number of endpoints at the top level (e.g. `/custom_fields` and `/custom_field_settings`) and through calls on Workspaces, Portfolios, Projects, and Tasks resources. The API also provides a way to fetch both the metadata and data which define each particular Custom Field, so that a client application may render proper UI to display or edit the values. - - Custom Field aware integrations need to be aware of the basic types that Custom Fields can adopt. These types are: - - * `text` - an arbitrary, relatively short string of text - * `number` - a number with a defined level of precision - * `enum` - a selection from a defined list of options - - Text fields are currently limited to 1024 characters. On Tasks, their Custom Field value will have a `text_value` property to represent this field. - - Number fields can have an arbitrary `precision` associated with them; for example, a precision of `2` would round its value to the second (hundredths) place, i.e. 1.2345 would round to 1.23. On Tasks, the Custom Field value will have a `number_value` property to represent this field. - - Enum fields represent a selection from a list of options. On the metadata, they will contain all of the options in an array. Each option has 4 properties: - - * `gid` - the gid of this enum option. Note that this is the gid of the _option_ - the Custom Field itself has a separate `gid`. - * `name` - the name of the option, e.g. "Choice #1" - * `enabled` - whether this field is enabled. Disabled fields are not available to choose from when disabled, and are visually hidden in the Asana application, but they remain in the metadata for Custom Field values which were set to the option before the option was disabled. - * `color` - a color associated with this choice. - - On the Task's Custom Field value, the enum will have an `enum_value` property which will be the same as one of the choices from the list defined in the Custom Field metadata. - - #### Querying an organization for its Custom Fields - - For Custom Fields shared across the workspace or organization, the Workspace [can be queried](/docs/get-a-workspace-39-s-custom-fields) for its list of defined Custom Fields. Like other collection queries, the fields will be returned as a compact record; slightly different from most other compact records is the fact that the compact record for Custom Fields includes `type` as well as `gid` and `name`. - - #### Accessing Custom Field definitions - - The [Custom Fields](/docs/get-a-custom-field) reference describes how the metadata which defines a Custom Field is accessed. A GET request with a `gid` can be issued on the `/custom_fields` endpoint to fetch the full definition of a single Custom Field given its `gid` from (for instance) listing all Custom Fields on a Workspace, or getting the `gid` from a Custom Field Settings object or a Task. - - #### Associating Custom Fields with a Project or Portfolio - - A mapping between a Custom Field and a Project or Portfolio is handled with a [Custom Field Settings](/docs/asana-custom-field-settings) object. This object contains a reference for each of the Custom Field and the Project or Porfolio, as well as additional information about the status of that particular Custom Field. For instance, `is_important`, which defines whether or not the custom field will appear in the list/grid on the Asana application. - - #### Accessing Custom Field values on Tasks or Projects - - The [Tasks](/docs/get-a-task) reference has information on how Custom Fields look on Tasks. Custom Fields will return as an array on the property `custom_fields`, and each entry will contain, side-by-side, the compact representation of the Custom Field metadata and a `{typename}_value` property that stores the value set for the Custom Field. - - Of particular note is that the top-level `gid` of each entry in the `custom_fields` array is the `gid` of the Custom Field metadata, as it is the compact representation of this metadata. This can be used to refer to the full metadata by making a request to the `/custom_fields/{custom_fields_id}` endpoint as described above. - - Custom Fields can be set just as in the Asana-defined fields on a task via POST or PUT requests. You can see an example on the [update a task](/docs/update-a-task) endpoint. - - Custom Fields on projects follow this same pattern. - - #### Warning: Program defensively with regards to Custom Field definitions - - Asana application users have the ability to change the definitions of Custom Field metadata. This means that as you write scripts or applications to work with them, it's possible for the definitions to change at any time, which may cause an application using them to break or malfunction if it makes assumptions about the metadata for a particular Custom Field. When using Custom Fields, it is a good idea to program *defensively*, meaning you your application should double-check that the Custom Field metadata is what it expects. - - Storing the state of the Custom Field metadata for too long if you dynamically create a model for it can cause your model to become unsynchronized with the model stored in Asana. If you encounter (for example) an `enum` value on a Task that does not match any option in your metadata model, your metadata model has become out of date with the Custom Field metadata. - - **Note:** We are currently studying proposals for future implementations to more elegantly handle the modification of Custom Field metadata for application integrations. - - #### Enabled and Disabled Values - - When information that is contained in a Custom Field value loses a logical association with its metadata definition, the value becomes disabled. This can happen in a couple of simple ways, for example, if you remove the Custom Field metadata from a Project, or move a Task with a Custom Field to a different Project which does not have the Custom Field metadata associated with it. The value remains on the Task, and the Custom Field metadata can still be found and examined, but as the context in which the Custom Field makes sense is gone, the Custom Field cannot change its value; it can only be cleared. - - Note: Tasks that are associated with multiple Projects do not become disabled, so long as at least one of the Projects is still associated with the Custom Field metadata. In other words, Tasks with multiple Projects will retain logically associated to the set of Custom Field metadata represented by all of their Projects. - - Moving the Task back under a Project with that Custom Field applied to it or applying the Custom Field metadata to the current Project will return the Custom Field value to an enabled state. In this scenario, the Custom Field will be re-enabled and editable again. - - In the Asana application, disabled fields are grayed out and not allowed to change, other than to be discarded. In the API, we return a property `enabled: false` to inform the external application that the value has been disabled. - - Note that the API enforces the same operations on disabled Custom Field values as hold in the Asana application: they may not have their values changed, since the lack of context for the values of a custom field in general doesn't provide enough information to know what new values should be. Setting the Custom Field value to `null` will clear and remove the Custom Field value from the Task. - - #### Custom Field access control - - Custom Fields are a complex feature of the Asana platform, and their access in the Asana application and in the API vary based on the status of the user and project. When building your application, it's best to be defensive and not assume the given user will have read or write access to a custom field, and fail gracefully when this occurs. - name: Custom Fields - - description: Custom fields are attached to a particular project with the Custom Field Settings resource. This resource both represents the many-to-many join of the Custom Field and Project as well as stores information that is relevant to that particular pairing; for instance, the `is_important` property determines some possible application-specific handling of that custom field. - name: Custom Field Settings - - description: |- - An *event* is an object representing a change to a resource that was observed by an event subscription. - - In general, requesting events on a resource is faster and subject to higher rate limits than requesting the resource itself. Additionally, change events bubble up - listening to events on a project would include when stories are added to tasks in the project, even on subtasks. - - Establish an initial sync token by making a request with no sync token. The response will be a `412` error - the same as if the sync token had expired. - - Subsequent requests should always provide the sync token from the immediately preceding call. - - Sync tokens may not be valid if you attempt to go ‘backward’ in the history by requesting previous tokens, though re-requesting the current sync token is generally safe, and will always return the same results. - - When you receive a `412 Precondition Failed` error, it means that the sync token is either invalid or expired. If you are attempting to keep a set of data in sync, this signals you may need to re-crawl the data. - - Sync tokens always expire after 24 hours, but may expire sooner, depending on load on the service. - name: Events - - description: |- - Jobs represent processes that handle asynchronous work. - Jobs are created when an endpoint requests an action that will be handled asynchronously. Such as project or task duplication. - Only the creator of the duplication process can access the duplication status of the new object. - name: Jobs - - description: |- - An *organization_export* object represents a request to export the complete data of an Organization in JSON format. - - To export an Organization using this API: - - * Create an `organization_export` - [request](/docs/create-an-organization-export-request) - and store the id that is returned. - * Request the `organization_export` every few minutes, until the - `state` field contains ‘finished’. - * Download the file located at the URL in the `download_url` field. * Exports can take a long time, from several minutes to a few hours - for large Organizations. - - - *Note: These endpoints are only available to [Service Accounts](https://asana.com/guide/help/premium/service-accounts) of an [Enterprise](https://asana.com/enterprise) Organization.* - name: Organization Exports - - description: |- - A `portfolio` gives a high-level overview of the status of multiple initiatives in Asana. Portfolios provide a dashboard overview of the state of multiple projects, including a progress report and the most recent [project status](/docs/asana-project-statuses) update. - Portfolios have some restrictions on size. Each portfolio has a max of 250 items and, like projects, a max of 20 custom fields. - name: Portfolios - - description: This object determines if a user is a member of a portfolio. - name: Portfolio Memberships - - description: |- - A `project` represents a prioritized list of tasks in Asana or a board with columns of tasks represented as cards. It exists in a single workspace or organization and is accessible to a subset of users in that workspace or organization, depending on its permissions. - - Projects in organizations are shared with a single team. You cannot currently change the team of a project via the API. Non-organization workspaces do not have teams and so you should not specify the team of project in a regular workspace. - - Followers of a project are a subset of the members of that project. Followers of a project will receive all updates including tasks created, added and removed from that project. Members of the project have access to and will receive status updates of the project. Adding followers to a project will add them as members if they are not already, removing followers from a project will not affect membership. - name: Projects - - description: With the introduction of “comment-only” projects in Asana, a user’s membership in a project comes with associated permissions. These permissions (whether a user has full access to the project or comment-only access) are accessible through the project memberships endpoints described here. - name: Project Memberships - - description: |- - A *project status* is an update on the progress of a particular project, and is sent out to all project followers when created. These updates include both text describing the update and a color code intended to represent the overall state of the project: "green" for projects that are on track, "yellow" for projects at risk, "red" for projects that are behind, and "blue" for projects on hold. - - Project statuses can be created and deleted, but not modified. - name: Project Statuses - - description: |- - A *section* is a subdivision of a project that groups tasks together. It can either be a header above a list of tasks in a list view or a column in a board view of a project. - - Sections are largely a shared idiom in Asana’s API for both list and board views of a project regardless of the project’s layout. - - The ‘memberships’ property when [getting a task](/docs/get-a-task) will return the information for the section or the column under ‘section’ in the response. - name: Sections - - description: |- - *See [our forum post](https://forum.asana.com/t/no-more-parsing-story-text-new-fields-on-stories/42924) for more info on when conditional fields are returned.* - - A *story* represents an activity associated with an object in the Asana system. Stories are generated by the system whenever users take actions such as creating or assigning tasks, or moving tasks between projects. *Comments* are also a form of user-generated story. - name: Stories - - description: |- - A tag is a label that can be attached to any task in Asana. It exists in a single workspace or organization. - - Tags have some metadata associated with them, but it is possible that we will simplify them in the future so it is not encouraged to rely too heavily on it. Unlike projects, tags do not provide any ordering on the tasks they are associated with. - name: Tags - - description: |- - The task is the basic object around which many operations in Asana are centered. In the Asana application, multiple tasks populate the middle pane according to some view parameters, and the set of selected tasks determines the more detailed information presented in the details pane. - - Sections are unique in that they will be included in the *memberships* field of task objects returned in the API when the task is within a section. They can also be used to manipulate the ordering of a task within a project. - - [Queries](/docs/get-a-set-of-tasks) return a compact representation of each object which is typically the id and name fields. Interested in a specific set of fields or all of the fields? Use [field selectors](/docs/input-output-options) to manipulate what data is included in a response. - name: Tasks - - description: A *team* is used to group related projects and people together within an organization. Each project in an organization is associated with a team. - name: Teams - - description: This object determines if a user is a member of a team. - name: Team Memberships - - description: The typeahead search API provides search for objects from a single workspace. - name: Typeahead - - description: |- - A user object represents an account in Asana that can be given access to various workspaces, projects, and tasks. - - Like other objects in the system, users are referred to by numerical IDs. However, the special string identifier `me` can be used anywhere a user ID is accepted, to refer to the current authenticated user. - name: Users - - description: A user task list represents the tasks assigned to a particular user. - name: User Task Lists - - description: |- - *Note: Recently, some users have seen intermittent delays with webhook event distributions. We are in the process of transferring the webhooks system to a more reliable infrastructure while also iteratively improving the current system. As such, for the time being we advise against using webhooks for functionality beyond logging (e.g., syncing state with real-time notification data).* - *If you experience latency issues, we recommend using webhooks in conjunction with fetching the resource periodically (e.g. [GET a task](https://developers.asana.com/docs/get-a-task)). More details and ongoing updates can be found in [this post](https://forum.asana.com/t/an-update-on-our-webhooks/119684) in the developer forum.* - Webhooks allow an application to be notified of changes in Asana. - - This is similar to our [Events](/docs/asana-events) resource, but webhooks "push" events via HTTP `POST` rather than expecting integrations to repeatedly "poll" for them. For services that are already accessible on the Internet this is often more convenient and efficient. - - However, webhooks _require_ a server to be accessible over the internet at all times to receive the event. For most simple integrations, Events provide much of the same benefits while using a significantly simpler implementation which does not require maintaining an internet-accessible server. - - #### The webhook "handshake" - In order to ensure that the receiving server is available to receive incoming events from a webhook Asana will `POST` to the requested target endpoint during the webhook creation request. In other words, the outgoing webhook creation request will wait to return until another full `POST` request from Asana's servers to the target has been completed, *then* the webhook creation request can return with a successful response. - - *Note: this means that your server must be able to handle being blocked on the outgoing create request while still being able to receive and handle an incoming request. A common reason that webhook handshakes fail is that servers are not able to asynchronously handle the handshake request.* - - Included in the webhook handshake is a HTTP header called `X-Hook-Secret`. To successfully complete the handshake the receiving server should echo back the same header with the same value and a `200 OK` or `204 No Content` response code. - - The purpose of this header is to provide a shared secret that both Asana and the receiving server both store--this is the only time it will be transmitted. In future webhook events Asana will use this key to compute a signature over the webhook callback request's body which can be used to verify that the incoming request was genuine (details below). We strongly recommend that you take advantage of this security feature and reject webhooks that have an invalid signature. - - #### Receiving Events - - Because multiple events often happen in short succession, a webhook payload is designed to be able to transmit multiple events at once. The schema of these events is described in [Event](/docs/tocS_Event). - - The HTTP POST that the target receives contains: - - - * An `X-Hook-Signature` header, which allows verifying that the payload - is genuine. The signature is a SHA256 HMAC signature computed on the - request body using the shared secret transmitted during the handshake. - Verification is **strongly recommended**, as it would otherwise be - possible for an attacker to POST a malicious payload to the same - endpoint. - * A JSON body with a single key, `events`, containing an array of the - events that have occurred since the last webhook delivery. (Note that this - list may be empty, as periodically we send a "heartbeat" webhook to - verify that the endpoint is still available.) - - - Note that events are "skinny" and contain only some basic details of the change, not the whole resource. We expect integrations to make additional calls to the API to retrieve the latest state from Asana. - - #### Filtering - Webhook events will "propagate up" from contained objects through to parent objects--for instance, changes to comments will be sent to webhooks on the parent task and to ones on the task's projects. In this way a webhook on a project will be notified of all changes that occur in all of its tasks, subtasks of those tasks, and comments on those tasks and subtasks. - - This can be a lot of data, some of which might not be relevant to a particular integration, so Asana's webhooks have a filtering feature which allows integrations to specify only the types of changes that they care about. By specifying the list of [WebhookFilter](/docs/tocS_WebhookFilter)s on webhook creation an integration can select just the subset of events it wants to receive. When filters are specified on the webhook events will only be delivered if they pass any of the filters specified when creating the webhook. - - To reduce the volume of data to transfer, webhooks created on teams, portfolios, and workspaces *must* specify filters. In addition, the set of event filters that can be placed on a team-level or workspace-level webhook is more limited than filters for webhooks that are created on lower-level resources: - - - * Webhook events from tasks, subtasks, and stories won't be propagated - to these higher-level webhooks, so all changes on these resources are - automatically filtered out. - * Webhook events from `project` resources can be filtered for these - `action`s: `added`, `removed`, `deleted`, `undeleted`, and `changed`. - * Webhook events from `team_membership` resources can be filtered to - `action`s `added` and `removed`. - * Webhook events from `workspace_membership` resources can be filtered - to `added` and `removed`. - - - #### Error Handling and Retry - - If we attempt to send a webhook payload and we receive an error status code, or the request times out, we will retry delivery with exponential backoff. In general, if your servers are not available for an hour, you can expect it to take no longer than approximately an hour after they come back before the paused delivery resumes. However, if we are unable to deliver a message for 24 hours the webhook will be deactivated. - #### Resources and Actions - This is not an exhaustive list, but should cover the most common use cases. - - - * Attachment - deleted, undeleted - * Portfolio - added, deleted, removed - * Project - added, changed, deleted, removed, undeleted - * Project Membership - added, removed - * Section - added, changed, deleted, undeleted - * Story - added, removed, undeleted - * Tag - added, changed, deleted, undeleted - * Task - added, changed, deleted, removed, undeleted - * Team - added, changed, deleted - * Team Membership - added, removed - * Workspace - added, removed, changed - * Workspace Memberships - added, removed - - - #### Webhook Limits - - Webhooks have two different limits - - * 1k limit per resource in Asana. (If 10 apps each have 100 webhooks - watching the same resource, no more webhooks can be placed on the - webhook. `/events` streams count towards this limit) - * 10k per user-app (An app can have 10k webhooks for EACH user) - - #### Example Integration: Webhook Inspector - The [Webhook Inspector](https://github.com/Asana/devrel-examples/tree/master/python/webhooks) is a Python script that demonstrates the features of Asana webhooks, including how to both properly set them up and receive them. By using this script, you can create a webhook and log the contents of incoming notifications to your console. - To use this demo, be sure to generate a new [personal access token](https://developers.asana.com/docs/personal-access-token), then follow the instructions in README. - name: Webhooks - - description: |- - A *workspace* is the highest-level organizational unit in Asana. All projects and tasks have an associated workspace. - - An *organization* is a special kind of workspace that represents a company. In an organization, you can group your projects into teams. You can read more about how organizations work on the Asana Guide. To tell if your workspace is an organization or not, check its `is_organization` property. - - Over time, we intend to migrate most workspaces into organizations and to release more organization-specific functionality. We may eventually deprecate using workspace-based APIs for organizations. Currently, and until after some reasonable grace period following any further announcements, you can still reference organizations in any `workspace` parameter. - name: Workspaces - - description: This object determines if a user is a member of a workspace. - name: Workspace Memberships -paths: - "/attachments/{attachment_gid}": - delete: - description: |- - Deletes a specific, existing attachment. - - Returns an empty data record. - operationId: deleteAttachment - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully deleted the specified attachment. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Delete an attachment - tags: - - Attachments - get: - description: Get the full record for a single attachment. - operationId: getAttachment - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/AttachmentResponse" - type: object - description: Successfully retrieved the record for a single attachment. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "402": - $ref: "#/components/responses/PaymentRequired" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "424": - $ref: "#/components/responses/TooManyRequests" - "500": - $ref: "#/components/responses/InternalServerError" - "501": - $ref: "#/components/responses/BadGateway" - "503": - $ref: "#/components/responses/ServiceUnavailable" - "504": - $ref: "#/components/responses/GatewayTimeout" - summary: Get an attachment - tags: - - Attachments - parameters: - - $ref: "#/components/parameters/attachment_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - /batch: - parameters: - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: Make multiple requests in parallel to Asana's API. - operationId: createBatchRequest - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/BatchRequest" - type: object - description: The requests to batch together via the Batch API. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/BatchResponse" - type: array - type: object - description: Successfully completed the requested batch API operations. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Submit parallel requests - tags: - - Batch API - /custom_fields: - parameters: - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - post: - description: |- - Creates a new custom field in a workspace. Every custom field is required - to be created in a specific workspace, and this workspace cannot be - changed once set. - - A custom field’s name must be unique within a workspace and not conflict - with names of existing task properties such as ‘Due Date’ or ‘Assignee’. - A custom field’s type must be one of ‘text’, ‘enum’, or ‘number’. - - Returns the full record of the newly created custom field. - operationId: createCustomField - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/CustomFieldRequest" - type: object - description: The custom field object to create. - responses: - "201": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/CustomFieldResponse" - type: object - description: Custom field successfully created. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Create a custom field - tags: - - Custom Fields - "/custom_fields/{custom_field_gid}": - delete: - description: |- - A specific, existing custom field can be deleted by making a DELETE request on the URL for that custom field. - Locked custom fields can only be deleted by the user who locked the field. - Returns an empty data record. - operationId: deleteCustomField - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: The custom field was successfully deleted. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Delete a custom field - tags: - - Custom Fields - get: - description: |- - Get the complete definition of a custom field’s metadata. - - Since custom fields can be defined for one of a number of types, and - these types have different data and behaviors, there are fields that are - relevant to a particular type. For instance, as noted above, enum_options - is only relevant for the enum type and defines the set of choices that - the enum could represent. The examples below show some of these - type-specific custom field definitions. - operationId: getCustomField - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/CustomFieldResponse" - type: object - description: Successfully retrieved the complete definition of a custom field’s metadata. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a custom field - tags: - - Custom Fields - parameters: - - $ref: "#/components/parameters/custom_field_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - put: - description: |- - A specific, existing custom field can be updated by making a PUT request on the URL for that custom field. Only the fields provided in the `data` block will be updated; any unspecified fields will remain unchanged - When using this method, it is best to specify only those fields you wish to change, or else you may overwrite changes made by another user since you last retrieved the custom field. - A custom field’s `type` cannot be updated. - An enum custom field’s `enum_options` cannot be updated with this endpoint. Instead see “Work With Enum Options” for information on how to update `enum_options`. - Locked custom fields can only be updated by the user who locked the field. - Returns the complete updated custom field record. - operationId: updateCustomField - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/CustomFieldRequest" - type: object - description: The custom field object with all updated properties. - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/CustomFieldResponse" - type: object - description: The custom field was successfully updated. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Update a custom field - tags: - - Custom Fields - "/custom_fields/{custom_field_gid}/enum_options": - parameters: - - $ref: "#/components/parameters/custom_field_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - post: - description: |- - Creates an enum option and adds it to this custom field’s list of enum options. A custom field can have at most 50 enum options (including disabled options). By default new enum options are inserted at the end of a custom field’s list. - Locked custom fields can only have enum options added by the user who locked the field. - Returns the full record of the newly created enum option. - operationId: createEnumOptionForCustomField - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EnumOptionRequest" - type: object - description: The enum option object to create. - responses: - "201": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EnumOption" - type: object - description: Custom field enum option successfully created. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Create an enum option - tags: - - Custom Fields - "/custom_fields/{custom_field_gid}/enum_options/insert": - parameters: - - $ref: "#/components/parameters/custom_field_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Moves a particular enum option to be either before or after another specified enum option in the custom field. - Locked custom fields can only be reordered by the user who locked the field. - operationId: insertEnumOptionForCustomField - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EnumOptionInsertRequest" - type: object - description: The enum option object to create. - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EnumOption" - type: object - description: Custom field enum option successfully reordered. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Reorder a custom field's enum - tags: - - Custom Fields - "/enum_options/{enum_option_gid}": - parameters: - - description: Globally unique identifier for the enum option. - example: "124578" - in: path - name: enum_option_gid - required: true - schema: - type: string - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - put: - description: |- - Updates an existing enum option. Enum custom fields require at least one enabled enum option. - Locked custom fields can only be updated by the user who locked the field. - Returns the full record of the updated enum option. - operationId: updateEnumOption - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EnumOptionRequest" - type: object - description: The enum option object to update - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EnumOption" - type: object - description: Successfully updated the specified custom field enum. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Update an enum option - tags: - - Custom Fields - /events: - get: - description: |- - Returns the full record for all events that have occurred since the sync - token was created. - - A GET request to the endpoint /[path_to_resource]/events can be made in - lieu of including the resource ID in the data for the request. - - *Note: The resource returned will be the resource that triggered the - event. This may be different from the one that the events were requested - for. For example, a subscription to a project will contain events for - tasks contained within the project.* - operationId: getEvents - responses: - "200": - content: - application/json: - schema: - description: The full record for all events that have occurred since the sync token was created. - properties: - data: - description: An organization_export object represents a request to export the complete data of an organization. - items: - $ref: "#/components/schemas/EventResponse" - type: array - sync: - description: A sync token to be used with the next call to the events endpoint. - example: de4774f6915eae04714ca93bb2f5ee81 - type: string - type: object - description: Successfully retrieved events. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get events on a resource - tags: - - Events - parameters: - - description: A resource ID to subscribe to. The resource can be a task or project. - example: "12345" - in: query - name: resource - required: true - schema: - type: string - - description: |- - A sync token received from the last request, or none on first sync. Events will be returned from the point in time that the sync token was generated. - *Note: On your first request, omit the sync token. The response will be the same as for an expired sync token, and will include a new valid sync token.If the sync token is too old (which may happen from time to time) the API will return a `412 Precondition Failed` error, and include a fresh sync token in the response.* - example: de4774f6915eae04714ca93bb2f5ee81 - in: query - name: sync - required: false - schema: - type: string - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - "/jobs/{job_gid}": - get: - description: Returns the full record for a job. - operationId: getJob - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/JobResponse" - type: object - description: Successfully retrieved Job. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a job by id - tags: - - Jobs - parameters: - - $ref: "#/components/parameters/job_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - /organization_exports: - parameters: - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - post: - description: This method creates a request to export an Organization. Asana will complete the export at some point after you create the request. - operationId: createOrganizationExport - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/OrganizationExportRequest" - type: object - description: The organization to export. - required: true - responses: - "201": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/OrganizationExportResponse" - type: object - description: Successfully created organization export request. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Create an organization export request - tags: - - Organization Exports - "/organization_exports/{organization_export_gid}": - get: - description: Returns details of a previously-requested Organization export. - operationId: getOrganizationExport - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/OrganizationExportResponse" - type: object - description: Successfully retrieved organization export object. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get details on an org export request - tags: - - Organization Exports - parameters: - - $ref: "#/components/parameters/organization_export_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - "/organizations/{workspace_gid}/teams": - get: - description: Returns the compact records for all teams in the organization visible to the authorized user. - operationId: getTeamsForOrganization - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/TeamCompact" - type: array - type: object - description: Returns the team records for all teams in the organization or workspace accessible to the authenticated user. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get teams in an organization - tags: - - Teams - parameters: - - $ref: "#/components/parameters/workspace_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - /portfolio_memberships: - get: - description: Returns a list of portfolio memberships in compact representation. You must specify `portfolio`, `portfolio` and `user`, or `workspace` and `user`. - operationId: getPortfolioMemberships - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/PortfolioMembershipCompact" - type: array - type: object - description: Successfully retrieved portfolio memberships. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get multiple portfolio memberships - tags: - - Portfolio Memberships - parameters: - - $ref: "#/components/parameters/portfolio_query_param" - - $ref: "#/components/parameters/workspace_query_param" - - $ref: "#/components/parameters/user_query_param" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - "/portfolio_memberships/{portfolio_membership_gid}": - get: - description: Returns the complete portfolio record for a single portfolio membership. - operationId: getPortfolioMembership - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/PortfolioMembershipResponse" - type: object - description: Successfully retrieved the requested portfolio membership. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a portfolio membership - tags: - - Portfolio Memberships - parameters: - - $ref: "#/components/parameters/portfolio_membership_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - /portfolios: - get: - description: Returns a list of the portfolios in compact representation that are owned by the current API user. - operationId: getPortfolios - parameters: - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - - description: The workspace or organization to filter portfolios on. - example: "1331" - in: query - name: workspace - required: true - schema: - type: string - - description: The user who owns the portfolio. Currently, API users can only get a list of portfolios that they themselves own. - example: "14916" - in: query - name: owner - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/PortfolioCompact" - type: array - type: object - description: Successfully retrieved portfolios. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get multiple portfolios - tags: - - Portfolios - parameters: - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Creates a new portfolio in the given workspace with the supplied name. - - Note that portfolios created in the Asana UI may have some state - (like the “Priority” custom field) which is automatically added - to the portfolio when it is created. Portfolios created via our - API will *not* be created with the same initial state to allow - integrations to create their own starting state on a portfolio. - operationId: createPortfolio - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/PortfolioRequest" - type: object - description: The portfolio to create. - required: true - responses: - "201": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/PortfolioResponse" - type: object - description: Successfully created portfolio. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Create a portfolio - tags: - - Portfolios - "/portfolios/{portfolio_gid}": - delete: - description: |- - An existing portfolio can be deleted by making a DELETE request on - the URL for that portfolio. - - Returns an empty data record. - operationId: deletePortfolio - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully deleted the specified portfolio. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Delete a portfolio - tags: - - Portfolios - get: - description: Returns the complete portfolio record for a single portfolio. - operationId: getPortfolio - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/PortfolioResponse" - type: object - description: Successfully retrieved the requested portfolio. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a portfolio - tags: - - Portfolios - parameters: - - $ref: "#/components/parameters/portfolio_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - put: - description: |- - An existing portfolio can be updated by making a PUT request on the URL for - that portfolio. Only the fields provided in the `data` block will be updated; - any unspecified fields will remain unchanged. - - Returns the complete updated portfolio record. - operationId: updatePortfolio - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/PortfolioRequest" - type: object - description: The updated fields for the portfolio. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/PortfolioResponse" - type: object - description: Successfully updated the portfolio. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Update a portfolio - tags: - - Portfolios - "/portfolios/{portfolio_gid}/addCustomFieldSetting": - parameters: - - $ref: "#/components/parameters/portfolio_path_gid" - - $ref: "#/components/parameters/pretty" - post: - description: Custom fields are associated with portfolios by way of custom field settings. This method creates a setting for the portfolio. - operationId: addCustomFieldSettingForPortfolio - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/AddCustomFieldSettingRequest" - type: object - description: Information about the custom field setting. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully added the custom field to the portfolio. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Add a custom field to a portfolio - tags: - - Portfolios - "/portfolios/{portfolio_gid}/addItem": - parameters: - - $ref: "#/components/parameters/portfolio_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Add an item to a portfolio. - Returns an empty data block. - operationId: addItemForPortfolio - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/PortfolioAddItemRequest" - type: object - description: Information about the item being inserted. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully added the item to the portfolio. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Add a portfolio item - tags: - - Portfolios - "/portfolios/{portfolio_gid}/addMembers": - parameters: - - $ref: "#/components/parameters/portfolio_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Adds the specified list of users as members of the portfolio. - Returns the updated portfolio record. - operationId: addMembersForPortfolio - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/AddMembersRequest" - type: object - description: Information about the members being added. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully added members to the portfolio. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Add users to a portfolio - tags: - - Portfolios - "/portfolios/{portfolio_gid}/custom_field_settings": - get: - description: Returns a list of all of the custom fields settings on a portfolio, in compact form. - operationId: getCustomFieldSettingsForPortfolio - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/CustomFieldSettingResponse" - type: array - type: object - description: Successfully retrieved custom field settings objects for a portfolio. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a portfolio's custom fields - tags: - - Custom Field Settings - parameters: - - $ref: "#/components/parameters/portfolio_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - "/portfolios/{portfolio_gid}/items": - get: - description: Get a list of the items in compact form in a portfolio. - operationId: getItemsForPortfolio - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/ProjectCompact" - type: array - type: object - description: Successfully retrieved the requested portfolio's items. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get portfolio items - tags: - - Portfolios - parameters: - - $ref: "#/components/parameters/portfolio_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - "/portfolios/{portfolio_gid}/portfolio_memberships": - get: - description: Returns the compact portfolio membership records for the portfolio. - operationId: getPortfolioMembershipsForPortfolio - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/PortfolioMembershipCompact" - type: array - type: object - description: Successfully retrieved the requested portfolio's memberships. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get memberships from a portfolio - tags: - - Portfolio Memberships - parameters: - - $ref: "#/components/parameters/portfolio_path_gid" - - $ref: "#/components/parameters/user_query_param" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - "/portfolios/{portfolio_gid}/removeCustomFieldSetting": - parameters: - - $ref: "#/components/parameters/portfolio_path_gid" - - $ref: "#/components/parameters/pretty" - post: - description: Removes a custom field setting from a portfolio. - operationId: removeCustomFieldSettingForPortfolio - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/RemoveCustomFieldSettingRequest" - type: object - description: Information about the custom field setting being removed. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully removed the custom field from the portfolio. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Remove a custom field from a portfolio - tags: - - Portfolios - "/portfolios/{portfolio_gid}/removeItem": - parameters: - - $ref: "#/components/parameters/portfolio_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Remove an item from a portfolio. - Returns an empty data block. - operationId: removeItemForPortfolio - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/PortfolioRemoveItemRequest" - type: object - description: Information about the item being removed. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully removed the item from the portfolio. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Remove a portfolio item - tags: - - Portfolios - "/portfolios/{portfolio_gid}/removeMembers": - parameters: - - $ref: "#/components/parameters/portfolio_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Removes the specified list of users from members of the portfolio. - Returns the updated portfolio record. - operationId: removeMembersForPortfolio - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/RemoveMembersRequest" - type: object - description: Information about the members being removed. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully removed the members from the portfolio. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Remove users from a portfolio - tags: - - Portfolios - "/project_memberships/{project_membership_gid}": - get: - description: Returns the complete project record for a single project membership. - operationId: getProjectMembership - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/ProjectMembershipResponse" - type: object - description: Successfully retrieved the requested project membership. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a project membership - tags: - - Project Memberships - parameters: - - $ref: "#/components/parameters/project_membership_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - "/project_statuses/{project_status_gid}": - delete: - description: |- - Deletes a specific, existing project status update. - - Returns an empty data record. - operationId: deleteProjectStatus - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully deleted the specified project status. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Delete a project status - tags: - - Project Statuses - get: - description: Returns the complete record for a single status update. - operationId: getProjectStatus - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/ProjectStatusResponse" - type: object - description: Successfully retrieved the specified project's status updates. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a project status - tags: - - Project Statuses - parameters: - - $ref: "#/components/parameters/project_status_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - /projects: - get: - description: |- - Returns the compact project records for some filtered set of projects. Use one or more of the parameters provided to filter the projects returned. - *Note: This endpoint may timeout for large domains. Try filtering by team!* - operationId: getProjects - parameters: - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - - description: The workspace or organization to filter projects on. - example: "1331" - in: query - name: workspace - schema: - type: string - - description: The team to filter projects on. - example: "14916" - in: query - name: team - schema: - type: string - - $ref: "#/components/parameters/archived_query_param" - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/ProjectCompact" - type: array - type: object - description: Successfully retrieved projects. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get multiple projects - tags: - - Projects - parameters: - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Create a new project in a workspace or team. - - Every project is required to be created in a specific workspace or - organization, and this cannot be changed once set. Note that you can use - the `workspace` parameter regardless of whether or not it is an - organization. - - If the workspace for your project is an organization, you must also - supply a `team` to share the project with. - - Returns the full record of the newly created project. - operationId: createProject - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/ProjectRequest" - type: object - description: The project to create. - required: true - responses: - "201": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/ProjectResponse" - type: object - description: Successfully retrieved projects. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Create a project - tags: - - Projects - "/projects/{project_gid}": - delete: - description: |- - A specific, existing project can be deleted by making a DELETE request on - the URL for that project. - - Returns an empty data record. - operationId: deleteProject - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully deleted the specified project. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Delete a project - tags: - - Projects - get: - description: Returns the complete project record for a single project. - operationId: getProject - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/ProjectResponse" - type: object - description: Successfully retrieved the requested project. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a project - tags: - - Projects - parameters: - - $ref: "#/components/parameters/project_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - put: - description: |- - A specific, existing project can be updated by making a PUT request on - the URL for that project. Only the fields provided in the `data` block - will be updated; any unspecified fields will remain unchanged. - - When using this method, it is best to specify only those fields you wish - to change, or else you may overwrite changes made by another user since - you last retrieved the task. - - Returns the complete updated project record. - operationId: updateProject - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/ProjectRequest" - type: object - description: The updated fields for the project. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/ProjectResponse" - type: object - description: Successfully updated the project. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Update a project - tags: - - Projects - "/projects/{project_gid}/addCustomFieldSetting": - parameters: - - $ref: "#/components/parameters/project_path_gid" - - $ref: "#/components/parameters/pretty" - post: - description: Custom fields are associated with projects by way of custom field settings. This method creates a setting for the project. - operationId: addCustomFieldSettingForProject - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/AddCustomFieldSettingRequest" - type: object - description: Information about the custom field setting. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/CustomFieldSettingResponse" - type: object - description: Successfully added the custom field to the project. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Add a custom field to a project - tags: - - Projects - "/projects/{project_gid}/addFollowers": - parameters: - - $ref: "#/components/parameters/project_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Adds the specified list of users as followers to the project. Followers are a subset of members, therefore if the users are not already members of the project they will also become members as a result of this operation. - Returns the updated project record. - operationId: addFollowersForProject - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/AddFollowersRequest" - type: object - description: Information about the followers being added. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully added followers to the project. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Add followers to a project - tags: - - Projects - "/projects/{project_gid}/addMembers": - parameters: - - $ref: "#/components/parameters/project_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Adds the specified list of users as members of the project. - Returns the updated project record. - operationId: addMembersForProject - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/AddMembersRequest" - type: object - description: Information about the members being added. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully added members to the project. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Add users to a project - tags: - - Projects - "/projects/{project_gid}/custom_field_settings": - get: - description: Returns a list of all of the custom fields settings on a project, in compact form. Note that, as in all queries to collections which return compact representation, `opt_fields` can be used to include more data than is returned in the compact representation. See the [getting started guide on input/output options](https://developers.asana.com/docs/#input-output-options) for more information. - operationId: getCustomFieldSettingsForProject - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/CustomFieldSettingResponse" - type: array - type: object - description: Successfully retrieved custom field settings objects for a project. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a project's custom fields - tags: - - Custom Field Settings - parameters: - - $ref: "#/components/parameters/project_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - "/projects/{project_gid}/duplicate": - parameters: - - $ref: "#/components/parameters/project_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: Creates and returns a job that will asynchronously handle the duplication. - operationId: duplicateProject - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/ProjectDuplicateRequest" - type: object - description: Describes the duplicate's name and the elements that will be duplicated. - responses: - "201": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/JobResponse" - type: object - description: Successfully created the job to handle duplication. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Duplicate a project - tags: - - Projects - "/projects/{project_gid}/project_memberships": - get: - description: Returns the compact project membership records for the project. - operationId: getProjectMembershipsForProject - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/ProjectMembershipCompact" - type: array - type: object - description: Successfully retrieved the requested project's memberships. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get memberships from a project - tags: - - Project Memberships - parameters: - - $ref: "#/components/parameters/project_path_gid" - - $ref: "#/components/parameters/user_query_param" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - "/projects/{project_gid}/project_statuses": - get: - description: Returns the compact project status update records for all updates on the project. - operationId: getProjectStatusesForProject - parameters: - - $ref: "#/components/parameters/project_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/ProjectStatusCompact" - type: array - type: object - description: Successfully retrieved the specified project's status updates. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get statuses from a project - tags: - - Project Statuses - parameters: - - $ref: "#/components/parameters/project_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Creates a new status update on the project. - Returns the full record of the newly created project status update. - operationId: createProjectStatusForProject - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/ProjectStatusRequest" - type: object - description: The project status to create. - required: true - responses: - "201": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/ProjectStatusResponse" - type: object - description: Successfully created a new story. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Create a project status - tags: - - Project Statuses - "/projects/{project_gid}/removeCustomFieldSetting": - parameters: - - $ref: "#/components/parameters/project_path_gid" - - $ref: "#/components/parameters/pretty" - post: - description: Removes a custom field setting from a project. - operationId: removeCustomFieldSettingForProject - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/RemoveCustomFieldSettingRequest" - type: object - description: Information about the custom field setting being removed. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully removed the custom field from the project. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Remove a custom field from a project - tags: - - Projects - "/projects/{project_gid}/removeFollowers": - parameters: - - $ref: "#/components/parameters/project_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Removes the specified list of users from following the project, this will not affect project membership status. - Returns the updated project record. - operationId: removeFollowersForProject - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/RemoveFollowersRequest" - type: object - description: Information about the followers being removed. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully removed followers from the project. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Remove followers from a project - tags: - - Projects - "/projects/{project_gid}/removeMembers": - parameters: - - $ref: "#/components/parameters/project_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Removes the specified list of users from members of the project. - Returns the updated project record. - operationId: removeMembersForProject - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/RemoveMembersRequest" - type: object - description: Information about the members being removed. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully removed the members from the project. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Remove users from a project - tags: - - Projects - "/projects/{project_gid}/sections": - get: - description: Returns the compact records for all sections in the specified project. - operationId: getSectionsForProject - parameters: - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/SectionCompact" - type: array - type: object - description: Successfully retrieved sections in project. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get sections in a project - tags: - - Sections - parameters: - - $ref: "#/components/parameters/project_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Creates a new section in a project. - Returns the full record of the newly created section. - operationId: createSectionForProject - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/SectionRequest" - type: object - description: The section to create. - required: true - responses: - "201": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/SectionResponse" - type: object - description: Successfully created the specified section. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Create a section in a project - tags: - - Sections - "/projects/{project_gid}/sections/insert": - parameters: - - $ref: "#/components/parameters/project_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Move sections relative to each other. One of - `before_section` or `after_section` is required. - - Sections cannot be moved between projects. - - Returns an empty data block. - operationId: insertSectionForProject - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/ProjectSectionInsertRequest" - type: object - description: The section's move action. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully moved the specified section. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Move or Insert sections - tags: - - Sections - "/projects/{project_gid}/task_counts": - get: - description: |- - Get an object that holds task count fields. **All fields are excluded by default**. You must [opt in](/docs/input-output-options) using `opt_fields` to get any information from this endpoint. - - This endpoint has an additional [rate limit](/docs/standard-rate-limits) and each field counts especially high against our [cost limits](/docs/cost-limits). - - Milestones are just tasks, so they are included in the `num_tasks`, `num_incomplete_tasks`, and `num_completed_tasks` counts. - operationId: getTaskCountsForProject - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TaskCountResponse" - type: object - description: Successfully retrieved the requested project's task counts. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get task count of a project - tags: - - Projects - parameters: - - $ref: "#/components/parameters/project_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - "/projects/{project_gid}/tasks": - get: - description: Returns the compact task records for all tasks within the given project, ordered by their priority within the project. Tasks can exist in more than one project at a time. - operationId: getTasksForProject - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/TaskCompact" - type: array - type: object - description: Successfully retrieved the requested project's tasks. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get tasks from a project - tags: - - Tasks - parameters: - - $ref: "#/components/parameters/project_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - "/sections/{section_gid}": - delete: - description: |- - A specific, existing section can be deleted by making a DELETE request on - the URL for that section. - - Note that sections must be empty to be deleted. - - The last remaining section cannot be deleted. - - Returns an empty data block. - operationId: deleteSection - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully deleted the specified section. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Delete a section - tags: - - Sections - get: - description: Returns the complete record for a single section. - operationId: getSection - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/SectionResponse" - type: object - description: Successfully retrieved section. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a section - tags: - - Sections - parameters: - - $ref: "#/components/parameters/section_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - put: - description: |- - A specific, existing section can be updated by making a PUT request on - the URL for that project. Only the fields provided in the `data` block - will be updated; any unspecified fields will remain unchanged. (note that - at this time, the only field that can be updated is the `name` field.) - - When using this method, it is best to specify only those fields you wish - to change, or else you may overwrite changes made by another user since - you last retrieved the task. - - Returns the complete updated section record. - operationId: updateSection - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/SectionRequest" - type: object - description: The section to create. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/SectionResponse" - type: object - description: Successfully updated the specified section. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Update a section - tags: - - Sections - "/sections/{section_gid}/addTask": - parameters: - - $ref: "#/components/parameters/section_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Add a task to a specific, existing section. This will remove the task from other sections of the project. - - The task will be inserted at the top of a section unless an insert_before or insert_after parameter is declared. - - This does not work for separators (tasks with the resource_subtype of section). - operationId: addTaskForSection - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/SectionTaskInsertRequest" - type: object - description: The task and optionally the insert location. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully added the task. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Add task to section - tags: - - Sections - "/sections/{section_gid}/tasks": - get: - description: "*Board view only*: Returns the compact section records for all tasks within the given section." - operationId: getTasksForSection - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/TaskCompact" - type: array - type: object - description: Successfully retrieved the section's tasks. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get tasks from a section - tags: - - Tasks - parameters: - - $ref: "#/components/parameters/section_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - "/stories/{story_gid}": - delete: - description: |- - Deletes a story. A user can only delete stories they have created. - - Returns an empty data record. - operationId: deleteStory - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully deleted the specified story. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Delete a story - tags: - - Stories - get: - description: Returns the full record for a single story. - operationId: getStory - parameters: - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/StoryResponse" - type: object - description: Successfully retrieved the specified story. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a story - tags: - - Stories - parameters: - - $ref: "#/components/parameters/story_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - put: - description: Updates the story and returns the full record for the updated story. Only comment stories can have their text updated, and only comment stories and attachment stories can be pinned. Only one of `text` and `html_text` can be specified. - operationId: updateStory - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/StoryRequest" - type: object - description: The comment story to update. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/StoryResponse" - type: object - description: Successfully retrieved the specified story. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Update a story - tags: - - Stories - /tags: - get: - description: Returns the compact tag records for some filtered set of tags. Use one or more of the parameters provided to filter the tags returned. - operationId: getTags - parameters: - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - - description: The workspace to filter tags on. - example: "1331" - in: query - name: workspace - schema: - type: string - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/TagCompact" - type: array - type: object - description: Successfully retrieved the specified set of tags. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get multiple tags - tags: - - Tags - parameters: - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Creates a new tag in a workspace or organization. - - Every tag is required to be created in a specific workspace or - organization, and this cannot be changed once set. Note that you can use - the workspace parameter regardless of whether or not it is an - organization. - - Returns the full record of the newly created tag. - operationId: createTag - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TagRequest" - type: object - description: The tag to create. - required: true - responses: - "201": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TagResponse" - type: object - description: Successfully created the newly specified tag. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Create a tag - tags: - - Tags - "/tags/{tag_gid}": - delete: - description: |- - A specific, existing tag can be deleted by making a DELETE request on - the URL for that tag. - - Returns an empty data record. - operationId: deleteTag - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully deleted the specified tag. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Delete a tag - tags: - - Tags - get: - description: Returns the complete tag record for a single tag. - operationId: getTag - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TagResponse" - type: object - description: Successfully retrieved the specified tag. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a tag - tags: - - Tags - parameters: - - $ref: "#/components/parameters/tag_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - put: - description: |- - Updates the properties of a tag. Only the fields provided in the `data` - block will be updated; any unspecified fields will remain unchanged. - - When using this method, it is best to specify only those fields you wish - to change, or else you may overwrite changes made by another user since - you last retrieved the tag. - - Returns the complete updated tag record. - operationId: updateTag - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TagResponse" - type: object - description: Successfully updated the specified tag. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Update a tag - tags: - - Tags - "/tags/{tag_gid}/tasks": - get: - description: Returns the compact task records for all tasks with the given tag. Tasks can have more than one tag at a time. - operationId: getTasksForTag - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/TaskCompact" - type: array - type: object - description: Successfully retrieved the tasks associated with the specified tag. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get tasks from a tag - tags: - - Tasks - parameters: - - $ref: "#/components/parameters/tag_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - /tasks: - get: - description: |- - Returns the compact task records for some filtered set of tasks. Use one or more of the parameters provided to filter the tasks returned. You must specify a `project` or `tag` if you do not specify `assignee` and `workspace`. - For more complex task retrieval, use [workspaces/{workspace_gid}/tasks/search](/docs/search-tasks-in-a-workspace). - operationId: getTasks - parameters: - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - - description: |- - The assignee to filter tasks on. - *Note: If you specify `assignee`, you must also specify the `workspace` to filter on.* - example: "14641" - in: query - name: assignee - schema: - type: string - x-env-variable: assignee - - description: The project to filter tasks on. - example: "321654" - in: query - name: project - schema: - type: string - x-env-variable: project - - description: |- - The section to filter tasks on. - *Note: Currently, this is only supported in board views.* - example: "321654" - in: query - name: section - schema: - type: string - x-env-variable: section - - description: |- - The workspace to filter tasks on. - *Note: If you specify `workspace`, you must also specify the `assignee` to filter on.* - example: "321654" - in: query - name: workspace - schema: - type: string - x-env-variable: workspace - - description: Only return tasks that are either incomplete or that have been completed since this time. - in: query - name: completed_since - schema: - example: 2012-02-22T02:06:58.158Z - format: date-time - type: string - - description: |- - Only return tasks that have been modified since the given time. - - *Note: A task is considered “modified” if any of its properties - change, or associations between it and other objects are modified - (e.g. a task being added to a project). A task is not considered - modified just because another object it is associated with (e.g. a - subtask) is modified. Actions that count as modifying the task - include assigning, renaming, completing, and adding stories.* - example: 2012-02-22T02:06:58.158Z - in: query - name: modified_since - schema: - format: date-time - type: string - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/TaskCompact" - type: array - type: object - description: Successfully retrieved requested tasks. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get multiple tasks - tags: - - Tasks - parameters: - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Creating a new task is as easy as POSTing to the `/tasks` endpoint with a - data block containing the fields you’d like to set on the task. Any - unspecified fields will take on default values. - - Every task is required to be created in a specific workspace, and this - workspace cannot be changed once set. The workspace need not be set - explicitly if you specify `projects` or a `parent` task instead. - operationId: createTask - requestBody: - description: Create Task Request - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TaskRequest" - type: object - required: true - responses: - "201": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TaskResponse" - type: object - description: Successfully created a new task. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Create a task - tags: - - Tasks - "/tasks/{task_gid}": - delete: - description: |- - A specific, existing task can be deleted by making a DELETE request on - the URL for that task. Deleted tasks go into the “trash” of the user - making the delete request. Tasks can be recovered from the trash within a - period of 30 days; afterward they are completely removed from the system. - - Returns an empty data record. - operationId: deleteTask - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully deleted the specified task. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Delete a task - tags: - - Tasks - get: - description: Returns the complete task record for a single task. - operationId: getTask - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TaskResponse" - type: object - description: Successfully retrieved the specified task. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a task - tags: - - Tasks - parameters: - - $ref: "#/components/parameters/task_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - put: - description: |- - A specific, existing task can be updated by making a PUT request on the - URL for that task. Only the fields provided in the `data` block will be - updated; any unspecified fields will remain unchanged. - - When using this method, it is best to specify only those fields you wish - to change, or else you may overwrite changes made by another user since - you last retrieved the task. - - Returns the complete updated task record. - operationId: updateTask - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TaskRequest" - type: object - description: The task to update. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TaskResponse" - type: object - description: Successfully updated the specified task. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Update a task - tags: - - Tasks - "/tasks/{task_gid}/addDependencies": - parameters: - - $ref: "#/components/parameters/task_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: Marks a set of tasks as dependencies of this task, if they are not already dependencies. *A task can have at most 15 dependencies*. - operationId: addDependenciesForTask - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/ModifyDependenciesRequest" - type: object - description: The list of tasks to set as dependencies. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully set the specified dependencies on the task. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "402": - $ref: "#/components/responses/PaymentRequired" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Set dependencies for a task - tags: - - Tasks - "/tasks/{task_gid}/addDependents": - parameters: - - $ref: "#/components/parameters/task_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: Marks a set of tasks as dependents of this task, if they are not already dependents. *A task can have at most 30 dependents*. - operationId: addDependentsForTask - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/ModifyDependentsRequest" - type: object - description: The list of tasks to add as dependents. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/TaskCompact" - type: array - type: object - description: Successfully set the specified dependents on the given task. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "402": - $ref: "#/components/responses/PaymentRequired" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Set dependents for a task - tags: - - Tasks - "/tasks/{task_gid}/addFollowers": - parameters: - - $ref: "#/components/parameters/task_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Adds followers to a task. Returns an empty data block. - Each task can be associated with zero or more followers in the system. - Requests to add/remove followers, if successful, will return the complete updated task record, described above. - operationId: addFollowersForTask - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TaskAddFollowersRequest" - type: object - description: The followers to add to the task. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully added the specified followers to the task. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Add followers to a task - tags: - - Tasks - "/tasks/{task_gid}/addProject": - parameters: - - $ref: "#/components/parameters/task_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Adds the task to the specified project, in the optional location - specified. If no location arguments are given, the task will be added to - the end of the project. - - `addProject` can also be used to reorder a task within a project or - section that already contains it. - - At most one of `insert_before`, `insert_after`, or `section` should be - specified. Inserting into a section in an non-order-dependent way can be - done by specifying section, otherwise, to insert within a section in a - particular place, specify `insert_before` or `insert_after` and a task - within the section to anchor the position of this task. - - Returns an empty data block. - operationId: addProjectForTask - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TaskAddProjectRequest" - type: object - description: The project to add the task to. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully added the specified project to the task. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Add a project to a task - tags: - - Tasks - "/tasks/{task_gid}/addTag": - parameters: - - $ref: "#/components/parameters/task_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: Adds a tag to a task. Returns an empty data block. - operationId: addTagForTask - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TaskAddTagRequest" - type: object - description: The tag to add to the task. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully added the specified tag to the task. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Add a tag to a task - tags: - - Tasks - "/tasks/{task_gid}/attachments": - get: - description: Returns the compact records for all attachments on the task. - operationId: getAttachmentsForTask - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/AttachmentCompact" - type: array - type: object - description: Successfully retrieved the compact records for all attachments on the task. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get attachments for a task - tags: - - Attachments - parameters: - - $ref: "#/components/parameters/task_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - post: - description: |- - Upload an attachment. - - This method uploads an attachment to a task and returns the compact - record for the created attachment object. It is not possible to attach - files from third party services such as Dropbox, Box & Google Drive via - the API. You must download the file content first and then upload it as - any other attachment. - - The 100MB size limit on attachments in Asana is enforced on this endpoint. - - This endpoint expects a multipart/form-data encoded request containing - the full contents of the file to be uploaded. - - Requests made should follow the HTTP/1.1 specification that line - terminators are of the form `CRLF` or `\r\n` outlined - [here](http://www.w3.org/Protocols/HTTP/1.1/draft-ietf-http-v11-spec-01#Basic-Rules) - in order for the server to reliably and properly handle the request. - operationId: createAttachmentForTask - requestBody: - content: - multipart/form-data: - schema: - $ref: "#/components/schemas/AttachmentRequest" - description: |- - The file you want to upload. - - *Note when using curl:* - - Be sure to add an `‘@’` before the file path, and use the `--form` - option instead of the `-d` option. - - When uploading PDFs with curl, force the content-type to be pdf by - appending the content type to the file path: `--form - "file=@file.pdf;type=application/pdf"`. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/AttachmentResponse" - type: object - description: Successfully uploaded the attachment to the task. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Upload an attachment - tags: - - Attachments - "/tasks/{task_gid}/dependencies": - get: - description: Returns the compact representations of all of the dependencies of a task. - operationId: getDependenciesForTask - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/TaskCompact" - type: array - type: object - description: Successfully retrieved the specified task's dependencies. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "402": - $ref: "#/components/responses/PaymentRequired" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get dependencies from a task - tags: - - Tasks - parameters: - - $ref: "#/components/parameters/task_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - "/tasks/{task_gid}/dependents": - get: - description: Returns the compact representations of all of the dependents of a task. - operationId: getDependentsForTask - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/TaskCompact" - type: array - type: object - description: Successfully retrieved the specified dependents of the task. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "402": - $ref: "#/components/responses/PaymentRequired" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get dependents from a task - tags: - - Tasks - parameters: - - $ref: "#/components/parameters/task_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - "/tasks/{task_gid}/duplicate": - parameters: - - $ref: "#/components/parameters/task_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: Creates and returns a job that will asynchronously handle the duplication. - operationId: duplicateTask - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TaskDuplicateRequest" - type: object - description: Describes the duplicate's name and the fields that will be duplicated. - required: true - responses: - "201": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/JobResponse" - type: object - description: Successfully created the job to handle duplication. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Duplicate a task - tags: - - Tasks - "/tasks/{task_gid}/projects": - get: - description: Returns a compact representation of all of the projects the task is in. - operationId: getProjectsForTask - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/ProjectCompact" - type: array - type: object - description: Successfully retrieved the projects for the given task. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get projects a task is in - tags: - - Projects - parameters: - - $ref: "#/components/parameters/task_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - "/tasks/{task_gid}/removeDependencies": - parameters: - - $ref: "#/components/parameters/task_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: Unlinks a set of dependencies from this task. - operationId: removeDependenciesForTask - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/ModifyDependenciesRequest" - type: object - description: The list of tasks to unlink as dependencies. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/EmptyResponse" - type: array - type: object - description: Successfully unlinked the dependencies from the specified task. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "402": - $ref: "#/components/responses/PaymentRequired" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Unlink dependencies from a task - tags: - - Tasks - "/tasks/{task_gid}/removeDependents": - parameters: - - $ref: "#/components/parameters/task_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: Unlinks a set of dependents from this task. - operationId: removeDependentsForTask - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/ModifyDependentsRequest" - type: object - description: The list of tasks to remove as dependents. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/EmptyResponse" - type: array - type: object - description: Successfully unlinked the specified tasks as dependents. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "402": - $ref: "#/components/responses/PaymentRequired" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Unlink dependents from a task - tags: - - Tasks - "/tasks/{task_gid}/removeFollowers": - parameters: - - $ref: "#/components/parameters/task_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: Removes each of the specified followers from the task if they are following. Returns the complete, updated record for the affected task. - operationId: removeFollowerForTask - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TaskRemoveFollowersRequest" - type: object - description: The followers to remove from the task. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully removed the specified followers from the task. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Remove followers from a task - tags: - - Tasks - "/tasks/{task_gid}/removeProject": - parameters: - - $ref: "#/components/parameters/task_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Removes the task from the specified project. The task will still exist in - the system, but it will not be in the project anymore. - - Returns an empty data block. - operationId: removeProjectForTask - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TaskRemoveProjectRequest" - type: object - description: The project to remove the task from. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully removed the specified project from the task. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Remove a project from a task - tags: - - Tasks - "/tasks/{task_gid}/removeTag": - parameters: - - $ref: "#/components/parameters/task_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: Removes a tag from a task. Returns an empty data block. - operationId: removeTagForTask - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TaskRemoveTagRequest" - type: object - description: The tag to remove from the task. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully removed the specified tag from the task. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Remove a tag from a task - tags: - - Tasks - "/tasks/{task_gid}/setParent": - parameters: - - $ref: "#/components/parameters/task_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: parent, or no parent task at all. Returns an empty data block. When using `insert_before` and `insert_after`, at most one of those two options can be specified, and they must already be subtasks of the parent. - operationId: setParentForTask - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TaskSetParentRequest" - type: object - description: The new parent of the subtask. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TaskResponse" - type: object - description: Successfully changed the parent of the specified subtask. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Set the parent of a task - tags: - - Tasks - "/tasks/{task_gid}/stories": - get: - description: Returns the compact records for all stories on the task. - operationId: getStoriesForTask - parameters: - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/StoryCompact" - type: object - description: Successfully retrieved the specified task's stories. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get stories from a task - tags: - - Stories - parameters: - - $ref: "#/components/parameters/task_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Adds a story to a task. This endpoint currently only allows for comment - stories to be created. The comment will be authored by the currently - authenticated user, and timestamped when the server receives the request. - - Returns the full record for the new story added to the task. - operationId: createStoryForTask - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/StoryRequest" - type: object - description: The story to create. - required: true - responses: - "201": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/StoryResponse" - type: object - description: Successfully created a new story. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Create a story on a task - tags: - - Stories - "/tasks/{task_gid}/subtasks": - get: - description: Returns a compact representation of all of the subtasks of a task. - operationId: getSubtasksForTask - parameters: - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/TaskCompact" - type: array - type: object - description: Successfully retrieved the specified task's subtasks. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get subtasks from a task - tags: - - Tasks - parameters: - - $ref: "#/components/parameters/task_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: Creates a new subtask and adds it to the parent task. Returns the full record for the newly created subtask. - operationId: createSubtaskForTask - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TaskRequest" - type: object - description: The new subtask to create. - required: true - responses: - "201": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TaskResponse" - type: object - description: Successfully created the specified subtask. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Create a subtask - tags: - - Tasks - "/tasks/{task_gid}/tags": - get: - description: Get a compact representation of all of the tags the task has. - operationId: getTagsForTask - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/TagCompact" - type: array - type: object - description: Successfully retrieved the tags for the given task. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a task's tags - tags: - - Tags - parameters: - - $ref: "#/components/parameters/task_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - /team_memberships: - get: - description: Returns compact team membership records. - operationId: getTeamMemberships - parameters: - - description: Globally unique identifier for the team. - example: "159874" - in: query - name: team - schema: - type: string - - description: A string identifying a user. This can either be the string "me", an email, or the gid of a user. This parameter must be used with the workspace parameter. - example: "512241" - in: query - name: user - schema: - type: string - - description: Globally unique identifier for the workspace. This parameter must be used with the user parameter. - example: "31326" - in: query - name: workspace - schema: - type: string - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/TeamMembershipCompact" - type: array - type: object - description: Successfully retrieved the requested team memberships. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get team memberships - tags: - - Team Memberships - parameters: - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - "/team_memberships/{team_membership_gid}": - get: - description: Returns the complete team membership record for a single team membership. - operationId: getTeamMembership - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TeamMembershipResponse" - type: object - description: Successfully retrieved the requested team membership. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a team membership - tags: - - Team Memberships - parameters: - - $ref: "#/components/parameters/team_membership_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - /teams: - parameters: - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - post: - description: Creates a team within the current workspace. - operationId: createTeam - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TeamRequest" - type: object - description: The team to create. - required: true - responses: - "201": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TeamResponse" - type: object - description: Successfully created a new team. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Create a team - tags: - - Teams - "/teams/{team_gid}": - get: - description: Returns the full record for a single team. - operationId: getTeam - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TeamResponse" - type: object - description: Successsfully retrieved the record for a single team. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a team - tags: - - Teams - parameters: - - $ref: "#/components/parameters/team_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - "/teams/{team_gid}/addUser": - parameters: - - $ref: "#/components/parameters/team_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: The user making this call must be a member of the team in order to add others. The user being added must exist in the same organization as the team. - operationId: addUserForTeam - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TeamAddUserRequest" - type: object - description: The user to add to the team. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/UserResponse" - type: object - description: Returns the full user record for the added user. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Add a user to a team - tags: - - Teams - "/teams/{team_gid}/projects": - get: - description: Returns the compact project records for all projects in the team. - operationId: getProjectsForTeam - parameters: - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/archived_query_param" - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/ProjectCompact" - type: array - type: object - description: Successfully retrieved the requested team's projects. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a team's projects - tags: - - Projects - parameters: - - $ref: "#/components/parameters/team_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Creates a project shared with the given team. - - Returns the full record of the newly created project. - operationId: createProjectForTeam - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/ProjectRequest" - type: object - description: The new project to create. - required: true - responses: - "201": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/ProjectResponse" - type: object - description: Successfully created the specified project. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Create a project in a team - tags: - - Projects - "/teams/{team_gid}/removeUser": - parameters: - - $ref: "#/components/parameters/team_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: The user making this call must be a member of the team in order to remove themselves or others. - operationId: removeUserForTeam - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TeamRemoveUserRequest" - type: object - description: The user to remove from the team. - required: true - responses: - "204": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Returns an empty data record - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Remove a user from a team - tags: - - Teams - "/teams/{team_gid}/team_memberships": - get: - description: Returns the compact team memberships for the team. - operationId: getTeamMembershipsForTeam - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/TeamMembershipCompact" - type: array - type: object - description: Successfully retrieved the requested team's memberships. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get memberships from a team - tags: - - Team Memberships - parameters: - - $ref: "#/components/parameters/team_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - "/teams/{team_gid}/users": - get: - description: |- - Returns the compact records for all users that are members of the team. - Results are sorted alphabetically and limited to 2000. For more results use the `/users` endpoint. - operationId: getUsersForTeam - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/UserCompact" - type: array - type: object - description: Returns the user records for all the members of the team, including guests and limited access users - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get users in a team - tags: - - Users - parameters: - - $ref: "#/components/parameters/team_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/offset" - "/user_task_lists/{user_task_list_gid}": - get: - description: Returns the full record for a user task list. - operationId: getUserTaskList - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/UserTaskListResponse" - type: object - description: Successfully retrieved the user task list. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a user task list - tags: - - User Task Lists - parameters: - - $ref: "#/components/parameters/user_task_list_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - "/user_task_lists/{user_task_list_gid}/tasks": - get: - description: |- - Returns the compact list of tasks in a user’s My Tasks list. - *Note: Access control is enforced for this endpoint as with all Asana API endpoints, meaning a user’s private tasks will be filtered out if the API-authenticated user does not have access to them.* - *Note: Both complete and incomplete tasks are returned by default unless they are filtered out (for example, setting `completed_since=now` will return only incomplete tasks, which is the default view for “My Tasks” in Asana.)* - operationId: getTasksForUserTaskList - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/TaskCompact" - type: array - type: object - description: Successfully retrieved the user task list's tasks. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get tasks from a user task list - tags: - - Tasks - parameters: - - description: | - Only return tasks that are either incomplete or that have been completed since this time. Accepts a date-time string or the keyword *now*. - example: 2012-02-22T02:06:58.158Z - in: query - name: completed_since - required: false - schema: - type: string - - $ref: "#/components/parameters/user_task_list_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - /users: - get: - description: |- - Returns the user records for all users in all workspaces and organizations accessible to the authenticated user. Accepts an optional workspace ID parameter. - Results are sorted by user ID. - operationId: getUsers - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/UserCompact" - type: array - type: object - description: Successfully retrieved the requested user records. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get multiple users - tags: - - Users - parameters: - - description: The workspace or organization ID to filter users on. - example: "1331" - in: query - name: workspace - schema: - type: string - - description: The team ID to filter users on. - example: "15627" - in: query - name: team - schema: - type: string - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - "/users/{user_gid}": - get: - description: Returns the full user record for the single user with the provided ID. - operationId: getUser - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/UserResponse" - type: object - description: Returns the user specified. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a user - tags: - - Users - parameters: - - $ref: "#/components/parameters/user_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - "/users/{user_gid}/favorites": - get: - description: |- - Returns all of a user's favorites in the given workspace, of the given type. - Results are given in order (The same order as Asana's sidebar). - operationId: getFavoritesForUser - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/AsanaNamedResource" - type: array - type: object - description: Returns the specified user's favorites. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a user's favorites - tags: - - Users - parameters: - - $ref: "#/components/parameters/user_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - description: The resource type of favorites to be returned. - in: query - name: resource_type - required: true - schema: - default: project - enum: - - portfolio - - project - - tag - - task - - user - type: string - - description: The workspace in which to get favorites. - example: "1234" - in: query - name: workspace - required: true - schema: - type: string - "/users/{user_gid}/team_memberships": - get: - description: Returns the compact team membership records for the user. - operationId: getTeamMembershipsForUser - parameters: - - description: Globally unique identifier for the workspace. - example: "31326" - in: query - name: workspace - required: true - schema: - type: string - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/TeamMembershipCompact" - type: array - type: object - description: Successfully retrieved the requested users's memberships. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get memberships from a user - tags: - - Team Memberships - parameters: - - $ref: "#/components/parameters/user_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - "/users/{user_gid}/teams": - get: - description: Returns the compact records for all teams to which the given user is assigned. - operationId: getTeamsForUser - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/TeamCompact" - type: array - type: object - description: Returns the team records for all teams in the organization or workspace to which the given user is assigned. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get teams for a user - tags: - - Teams - parameters: - - $ref: "#/components/parameters/user_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - - description: The workspace or organization to filter teams on. - example: "1331" - in: query - name: organization - required: true - schema: - type: string - "/users/{user_gid}/user_task_list": - get: - description: Returns the full record for a user's task list. - operationId: getUserTaskListForUser - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/UserTaskListResponse" - type: object - description: Successfully retrieved the user's task list. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a user's task list - tags: - - User Task Lists - parameters: - - $ref: "#/components/parameters/user_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - description: The workspace in which to get the user task list. - example: "1234" - in: query - name: workspace - required: true - schema: - type: string - "/users/{user_gid}/workspace_memberships": - get: - description: Returns the compact workspace membership records for the user. - operationId: getWorkspaceMembershipsForUser - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/WorkspaceMembershipCompact" - type: array - type: object - description: Successfully retrieved the requested user's workspace memberships. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get workspace memberships for a user - tags: - - Workspace Memberships - parameters: - - $ref: "#/components/parameters/user_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - /webhooks: - get: - description: Get the compact representation of all webhooks your app has registered for the authenticated user in the given workspace. - operationId: getWebhooks - parameters: - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - - description: The workspace to query for webhooks in. - example: "1331" - in: query - name: workspace - required: true - schema: - type: string - - description: Only return webhooks for the given resource. - example: "51648" - in: query - name: resource - schema: - type: string - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/WebhookResponse" - type: array - type: object - description: Successfully retrieved the requested webhooks. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get multiple webhooks - tags: - - Webhooks - parameters: - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Establishing a webhook is a two-part process. First, a simple HTTP POST - request initiates the creation similar to creating any other resource. - - Next, in the middle of this request comes the confirmation handshake. - When a webhook is created, we will send a test POST to the target with an - `X-Hook-Secret` header. The target must respond with a `200 OK` or `204 - No Content` and a matching `X-Hook-Secret` header to confirm that this - webhook subscription is indeed expected. We strongly recommend storing - this secret to be used to verify future webhook event signatures. - - The POST request to create the webhook will then return with the status - of the request. If you do not acknowledge the webhook’s confirmation - handshake it will fail to setup, and you will receive an error in - response to your attempt to create it. This means you need to be able to - receive and complete the webhook *while* the POST request is in-flight - (in other words, have a server that can handle requests asynchronously). - - Invalid hostnames like localhost will recieve a 403 Forbidden status code. - - ``` - # Request - curl -H "Authorization: Bearer " \ - -X POST https://app.asana.com/api/1.0/webhooks \ - -d "resource=8675309" \ - -d "target=https://example.com/receive-webhook/7654" - ``` - - ``` - # Handshake sent to https://example.com/ - POST /receive-webhook/7654 - X-Hook-Secret: b537207f20cbfa02357cf448134da559e8bd39d61597dcd5631b8012eae53e81 - ``` - - ``` - # Handshake response sent by example.com - HTTP/1.1 200 - X-Hook-Secret: b537207f20cbfa02357cf448134da559e8bd39d61597dcd5631b8012eae53e81 - ``` - - ``` - # Response - HTTP/1.1 201 - { - "data": { - "gid": "43214", - "resource": { - "gid": "8675309", - "name": "Bugs" - }, - "target": "https://example.com/receive-webhook/7654", - "active": false, - "last_success_at": null, - "last_failure_at": null, - "last_failure_content": null - } - } - ``` - operationId: createWebhook - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/WebhookRequest" - type: object - description: The webhook workspace and target. - required: true - responses: - "201": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/WebhookResponse" - type: object - description: Successfully created the requested webhook. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Establish a webhook - tags: - - Webhooks - "/webhooks/{webhook_gid}": - delete: - description: This method *permanently* removes a webhook. Note that it may be possible to receive a request that was already in flight after deleting the webhook, but no further requests will be issued. - operationId: deleteWebhook - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: Successfully retrieved the requested webhook. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Delete a webhook - tags: - - Webhooks - get: - description: Returns the full record for the given webhook. - operationId: getWebhook - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/WebhookResponse" - type: object - description: Successfully retrieved the requested webhook. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a webhook - tags: - - Webhooks - parameters: - - $ref: "#/components/parameters/webhook_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - "/workspace_memberships/{workspace_membership_gid}": - get: - description: Returns the complete workspace record for a single workspace membership. - operationId: getWorkspaceMembership - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/WorkspaceMembershipResponse" - type: object - description: Successfully retrieved the requested workspace membership. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a workspace membership - tags: - - Workspace Memberships - parameters: - - $ref: "#/components/parameters/workspace_membership_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - /workspaces: - get: - description: Returns the compact records for all workspaces visible to the authorized user. - operationId: getWorkspaces - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/WorkspaceCompact" - type: array - type: object - description: Return all workspaces visible to the authorized user. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get multiple workspaces - tags: - - Workspaces - parameters: - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - "/workspaces/{workspace_gid}": - get: - description: Returns the full workspace record for a single workspace. - operationId: getWorkspace - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/WorkspaceResponse" - type: object - description: Return the full workspace record. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a workspace - tags: - - Workspaces - parameters: - - $ref: "#/components/parameters/workspace_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - put: - description: |- - A specific, existing workspace can be updated by making a PUT request on the URL for that workspace. Only the fields provided in the data block will be updated; any unspecified fields will remain unchanged. - Currently the only field that can be modified for a workspace is its name. - Returns the complete, updated workspace record. - operationId: updateWorkspace - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/WorkspaceRequest" - type: object - description: The workspace object with all updated properties. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/WorkspaceResponse" - type: object - description: Update for the workspace was successful. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Update a workspace - tags: - - Workspaces - "/workspaces/{workspace_gid}/addUser": - parameters: - - $ref: "#/components/parameters/workspace_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Add a user to a workspace or organization. - The user can be referenced by their globally unique user ID or their email address. Returns the full user record for the invited user. - operationId: addUserForWorkspace - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/WorkspaceAddUserRequest" - type: object - description: The user to add to the workspace. - required: true - responses: - "200": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/UserResponse" - type: object - description: The user was added successfully to the workspace or organization. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Add a user to a workspace or organization - tags: - - Workspaces - "/workspaces/{workspace_gid}/custom_fields": - get: - description: Returns a list of the compact representation of all of the custom fields in a workspace. - operationId: getCustomFieldsForWorkspace - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/CustomFieldResponse" - type: array - type: object - description: Successfully retrieved all custom fields for the given workspace. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get a workspace's custom fields - tags: - - Custom Fields - parameters: - - $ref: "#/components/parameters/workspace_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - "/workspaces/{workspace_gid}/projects": - get: - description: |- - Returns the compact project records for all projects in the workspace. - *Note: This endpoint may timeout for large domains. Prefer the `/teams/{team_gid}/projects` endpoint.* - operationId: getProjectsForWorkspace - parameters: - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - - $ref: "#/components/parameters/archived_query_param" - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/ProjectCompact" - type: array - type: object - description: Successfully retrieved the requested workspace's projects. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get all projects in a workspace - tags: - - Projects - parameters: - - $ref: "#/components/parameters/workspace_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Returns the compact project records for all projects in the workspace. - - If the workspace for your project is an organization, you must also - supply a team to share the project with. - - Returns the full record of the newly created project. - operationId: createProjectForWorkspace - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/ProjectRequest" - type: object - description: The new project to create. - required: true - responses: - "201": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/ProjectResponse" - type: object - description: Successfully created a new project in the specified workspace. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Create a project in a workspace - tags: - - Projects - "/workspaces/{workspace_gid}/removeUser": - parameters: - - $ref: "#/components/parameters/workspace_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Remove a user from a workspace or organization. - The user making this call must be an admin in the workspace. The user can be referenced by their globally unique user ID or their email address. - Returns an empty data record. - operationId: removeUserForWorkspace - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/WorkspaceRemoveUserRequest" - type: object - description: The user to remove from the workspace. - required: true - responses: - "204": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/EmptyResponse" - type: object - description: The user was removed successfully to the workspace or organization. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Remove a user from a workspace or organization - tags: - - Workspaces - "/workspaces/{workspace_gid}/tags": - get: - description: Returns the compact tag records for some filtered set of tags. Use one or more of the parameters provided to filter the tags returned. - operationId: getTagsForWorkspace - parameters: - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/TagCompact" - type: array - type: object - description: Successfully retrieved the specified set of tags. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get tags in a workspace - tags: - - Tags - parameters: - - $ref: "#/components/parameters/workspace_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - post: - description: |- - Creates a new tag in a workspace or organization. - - Every tag is required to be created in a specific workspace or - organization, and this cannot be changed once set. Note that you can use - the workspace parameter regardless of whether or not it is an - organization. - - Returns the full record of the newly created tag. - operationId: createTagForWorkspace - requestBody: - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TagResponse" - type: object - description: The tag to create. - required: true - responses: - "201": - content: - application/json: - schema: - properties: - data: - $ref: "#/components/schemas/TagResponse" - type: object - description: Successfully created the newly specified tag. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Create a tag in a workspace - tags: - - Tags - "/workspaces/{workspace_gid}/tasks/search": - get: - description: |- - To mirror the functionality of the Asana web app's advanced search feature, the Asana API has a task search endpoint that allows you to build complex filters to find and retrieve the exact data you need. - #### Premium access - Like the Asana web product's advance search feature, this search endpoint will only be available to premium Asana users. A user is premium if any of the following is true: - - - The workspace in which the search is being performed is a premium workspace - The user is a member of a premium team inside the workspace - - Even if a user is only a member of a premium team inside a non-premium workspace, search will allow them to find data anywhere in the workspace, not just inside the premium team. Making a search request using credentials of a non-premium user will result in a `402 Payment Required` error. - #### Pagination - Search results are not stable; repeating the same query multiple times may return the data in a different order, even if the data do not change. Because of this, the traditional [pagination](https://developers.asana.com/docs/#pagination) available elsewhere in the Asana API is not available here. However, you can paginate manually by sorting the search results by their creation time and then modifying each subsequent query to exclude data you have already seen. Page sizes are limited to a maximum of 100 items, and can be specified by the `limit` query parameter. - #### Eventual consistency - Changes in Asana (regardless of whether they’re made though the web product or the API) are forwarded to our search infrastructure to be indexed. This process can take between 10 and 60 seconds to complete under normal operation, and longer during some production incidents. Making a change to a task that would alter its presence in a particular search query will not be reflected immediately. This is also true of the advanced search feature in the web product. - #### Rate limits - You may receive a `429 Too Many Requests` response if you hit any of our [rate limits](https://developers.asana.com/docs/#rate-limits). - #### Custom field parameters - | Parameter name | Custom field type | Accepted type | - |---|---|---| - | custom_fields.{gid}.is_set | All | Boolean | - | custom_fields.{gid}.value | Text | String | - | custom_fields.{gid}.value | Number | Number | - | custom_fields.{gid}.value | Enum | Enum option ID | - | custom_fields.{gid}.starts_with | Text only | String | - | custom_fields.{gid}.ends_with | Text only | String | - | custom_fields.{gid}.contains | Text only | String | - | custom_fields.{gid}.less_than | Number only | Number | - | custom_fields.{gid}.greater_than | Number only | Number | - - - For example, if the gid of the custom field is 12345, these query parameter to find tasks where it is set would be `custom_fields.12345.is_set=true`. To match an exact value for an enum custom field, use the gid of the desired enum option and not the name of the enum option: `custom_fields.12345.value=67890`. - - Searching for multiple exact matches of a custom field is not supported. - - *Note: If you specify `projects.any` and `sections.any`, you will receive tasks for the project **and** tasks for the section. If you're looking for only tasks in a section, omit the `projects.any` from the request.* - operationId: searchTasksForWorkspace - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/TaskCompact" - type: array - type: object - description: Successfully retrieved the section's tasks. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Search tasks in a workspace - tags: - - Tasks - parameters: - - $ref: "#/components/parameters/workspace_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - description: Performs full-text search on both task name and description - example: Bug - in: query - name: text - schema: - type: string - - description: Filters results by the task's resource_subtype - in: query - name: resource_subtype - schema: - default: milestone - enum: - - default_task - - milestone - type: string - - description: Comma-separated list of user identifiers - example: 12345,23456,34567 - in: query - name: assignee.any - schema: - type: string - - description: Comma-separated list of user identifiers - example: 12345,23456,34567 - in: query - name: assignee.not - schema: - type: string - - description: Comma-separated list of portfolio IDs - example: 12345,23456,34567 - in: query - name: portfolios.any - schema: - type: string - - description: Comma-separated list of project IDs - example: 12345,23456,34567 - in: query - name: projects.any - schema: - type: string - - description: Comma-separated list of project IDs - example: 12345,23456,34567 - in: query - name: projects.not - schema: - type: string - - description: Comma-separated list of project IDs - example: 12345,23456,34567 - in: query - name: projects.all - schema: - type: string - - description: Comma-separated list of section or column IDs - example: 12345,23456,34567 - in: query - name: sections.any - schema: - type: string - - description: Comma-separated list of section or column IDs - example: 12345,23456,34567 - in: query - name: sections.not - schema: - type: string - - description: Comma-separated list of section or column IDs - example: 12345,23456,34567 - in: query - name: sections.all - schema: - type: string - - description: Comma-separated list of tag IDs - example: 12345,23456,34567 - in: query - name: tags.any - schema: - type: string - - description: Comma-separated list of tag IDs - example: 12345,23456,34567 - in: query - name: tags.not - schema: - type: string - - description: Comma-separated list of tag IDs - example: 12345,23456,34567 - in: query - name: tags.all - schema: - type: string - - description: Comma-separated list of team IDs - example: 12345,23456,34567 - in: query - name: teams.any - schema: - type: string - - description: Comma-separated list of user identifiers - example: 12345,23456,34567 - in: query - name: followers.any - schema: - type: string - - description: Comma-separated list of user identifiers - example: 12345,23456,34567 - in: query - name: followers.not - schema: - type: string - - description: Comma-separated list of user identifiers - example: 12345,23456,34567 - in: query - name: created_by.any - schema: - type: string - - description: Comma-separated list of user identifiers - example: 12345,23456,34567 - in: query - name: created_by.not - schema: - type: string - - description: Comma-separated list of user identifiers - example: 12345,23456,34567 - in: query - name: assigned_by.any - schema: - type: string - - description: Comma-separated list of user identifiers - example: 12345,23456,34567 - in: query - name: assigned_by.not - schema: - type: string - - description: Comma-separated list of user identifiers - example: 12345,23456,34567 - in: query - name: liked_by.any - schema: - type: string - - description: Comma-separated list of user identifiers - example: 12345,23456,34567 - in: query - name: liked_by.not - schema: - type: string - - description: Comma-separated list of user identifiers - example: 12345,23456,34567 - in: query - name: commented_on_by.any - schema: - type: string - - description: Comma-separated list of user identifiers - example: 12345,23456,34567 - in: query - name: commented_on_by.not - schema: - type: string - - description: ISO 8601 date string - example: 2019-09-15 - in: query - name: due_on.before - schema: - format: date - type: string - - description: ISO 8601 date string - example: 2019-09-15 - in: query - name: due_on.after - schema: - format: date - type: string - - description: ISO 8601 date string or `null` - example: 2019-09-15 - in: query - name: due_on - schema: - format: date - nullable: true - type: string - - description: ISO 8601 datetime string - example: 2019-04-15T01:01:46.055Z - in: query - name: due_at.before - schema: - format: date-time - type: string - - description: ISO 8601 datetime string - example: 2019-04-15T01:01:46.055Z - in: query - name: due_at.after - schema: - format: date-time - type: string - - description: ISO 8601 date string - example: 2019-09-15 - in: query - name: start_on.before - schema: - format: date - type: string - - description: ISO 8601 date string - example: 2019-09-15 - in: query - name: start_on.after - schema: - format: date - type: string - - description: ISO 8601 date string or `null` - example: 2019-09-15 - in: query - name: start_on - schema: - format: date - nullable: true - type: string - - description: ISO 8601 date string - example: 2019-09-15 - in: query - name: created_on.before - schema: - format: date - type: string - - description: ISO 8601 date string - example: 2019-09-15 - in: query - name: created_on.after - schema: - format: date - type: string - - description: ISO 8601 date string or `null` - example: 2019-09-15 - in: query - name: created_on - schema: - format: date - nullable: true - type: string - - description: ISO 8601 datetime string - example: 2019-04-15T01:01:46.055Z - in: query - name: created_at.before - schema: - format: date-time - type: string - - description: ISO 8601 datetime string - example: 2019-04-15T01:01:46.055Z - in: query - name: created_at.after - schema: - format: date-time - type: string - - description: ISO 8601 date string - example: 2019-09-15 - in: query - name: completed_on.before - schema: - format: date - type: string - - description: ISO 8601 date string - example: 2019-09-15 - in: query - name: completed_on.after - schema: - format: date - type: string - - description: ISO 8601 date string or `null` - example: 2019-09-15 - in: query - name: completed_on - schema: - format: date - nullable: true - type: string - - description: ISO 8601 datetime string - example: 2019-04-15T01:01:46.055Z - in: query - name: completed_at.before - schema: - format: date-time - type: string - - description: ISO 8601 datetime string - example: 2019-04-15T01:01:46.055Z - in: query - name: completed_at.after - schema: - format: date-time - type: string - - description: ISO 8601 date string - example: 2019-09-15 - in: query - name: modified_on.before - schema: - format: date - type: string - - description: ISO 8601 date string - example: 2019-09-15 - in: query - name: modified_on.after - schema: - format: date - type: string - - description: ISO 8601 date string or `null` - example: 2019-09-15 - in: query - name: modified_on - schema: - format: date - nullable: true - type: string - - description: ISO 8601 datetime string - example: 2019-04-15T01:01:46.055Z - in: query - name: modified_at.before - schema: - format: date-time - type: string - - description: ISO 8601 datetime string - example: 2019-04-15T01:01:46.055Z - in: query - name: modified_at.after - schema: - format: date-time - type: string - - description: Filter to incomplete tasks with dependents - example: false - in: query - name: is_blocking - schema: - type: boolean - - description: Filter to tasks with incomplete dependencies - example: false - in: query - name: is_blocked - schema: - type: boolean - - description: Filter to tasks with attachments - example: false - in: query - name: has_attachment - schema: - type: boolean - - description: Filter to completed tasks - example: false - in: query - name: completed - schema: - type: boolean - - description: Filter to subtasks - example: false - in: query - name: is_subtask - schema: - type: boolean - - description: One of `due_date`, `created_at`, `completed_at`, `likes`, or `modified_at`, defaults to `modified_at` - example: likes - in: query - name: sort_by - schema: - default: modified_at - enum: - - due_date - - created_at - - completed_at - - likes - - modified_at - type: string - - description: Default `false` - example: true - in: query - name: sort_ascending - schema: - default: false - type: boolean - "/workspaces/{workspace_gid}/typeahead": - get: - description: |- - Retrieves objects in the workspace based via an auto-completion/typeahead - search algorithm. This feature is meant to provide results quickly, so do - not rely on this API to provide extremely accurate search results. The - result set is limited to a single page of results with a maximum size, so - you won’t be able to fetch large numbers of results. - - The typeahead search API provides search for objects from a single - workspace. This endpoint should be used to query for objects when - creating an auto-completion/typeahead search feature. This API is meant - to provide results quickly and should not be relied upon for accurate or - exhaustive search results. The results sets are limited in size and - cannot be paginated. - - Queries return a compact representation of each object which is typically - the gid and name fields. Interested in a specific set of fields or all of - the fields?! Of course you are. Use field selectors to manipulate what - data is included in a response. - - Resources with type `user` are returned in order of most contacted to - least contacted. This is determined by task assignments, adding the user - to projects, and adding the user as a follower to tasks, messages, - etc. - - Resources with type `project` are returned in order of recency. This is - determined when the user visits the project, is added to the project, and - completes tasks in the project. - - Resources with type `task` are returned with priority placed on tasks - the user is following, but no guarantee on the order of those tasks. - - Leaving the `query` string empty or omitted will give you results, still - following the resource ordering above. This could be used to list users or - projects that are relevant for the requesting user's api token. - operationId: typeaheadForWorkspace - responses: - "200": - content: - application/json: - schema: - properties: - data: - description: The data containing generic Asana Resource, containing a globally unique identifier. - items: - $ref: "#/components/schemas/AsanaNamedResource" - type: array - type: object - description: Successfully retrieved objects via a typeahead search algorithm. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get objects via typeahead - tags: - - Typeahead - parameters: - - $ref: "#/components/parameters/workspace_path_gid" - - description: "The type of values the typeahead should return. You can choose from one of the following: `custom_field`, `project`, `portfolio`, `tag`, `task`, and `user`. Note that unlike in the names of endpoints, the types listed here are in singular form (e.g. `task`). Using multiple types is not yet supported." - in: query - name: resource_type - required: true - schema: - default: user - enum: - - custom_field - - portfolio - - project - - tag - - task - - user - type: string - - description: "*Deprecated: new integrations should prefer the resource_type field.*" - in: query - name: type - required: false - schema: - default: user - enum: - - custom_field - - portfolio - - project - - tag - - task - - user - type: string - - description: The string that will be used to search for relevant objects. If an empty string is passed in, the API will currently return an empty result set. - example: Greg - in: query - name: query - schema: - type: string - - description: The number of results to return. The default is 20 if this parameter is omitted, with a minimum of 1 and a maximum of 100. If there are fewer results found than requested, all will be returned. - example: 20 - in: query - name: count - schema: - type: integer - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - "/workspaces/{workspace_gid}/users": - get: - description: |- - Returns the compact records for all users in the specified workspace or organization. - Results are sorted alphabetically and limited to 2000. For more results use the `/users` endpoint. - operationId: getUsersForWorkspace - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/UserCompact" - type: array - type: object - description: Return the users in the specified workspace or org. - "400": - $ref: "#/components/responses/BadRequest" - "401": - $ref: "#/components/responses/Unauthorized" - "403": - $ref: "#/components/responses/Forbidden" - "404": - $ref: "#/components/responses/NotFound" - "500": - $ref: "#/components/responses/InternalServerError" - summary: Get users in a workspace or organization - tags: - - Users - parameters: - - $ref: "#/components/parameters/workspace_path_gid" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/offset" - "/workspaces/{workspace_gid}/workspace_memberships": - get: - description: Returns the compact workspace membership records for the workspace. - operationId: getWorkspaceMembershipsForWorkspace - responses: - "200": - content: - application/json: - schema: - properties: - data: - items: - $ref: "#/components/schemas/WorkspaceMembershipCompact" - type: array - type: object - description: Successfully retrieved the requested workspace's memberships. - summary: Get the workspace memberships for a workspace - tags: - - Workspace Memberships - parameters: - - $ref: "#/components/parameters/workspace_path_gid" - - $ref: "#/components/parameters/user_query_param" - - $ref: "#/components/parameters/pretty" - - $ref: "#/components/parameters/fields" - - $ref: "#/components/parameters/limit" - - $ref: "#/components/parameters/offset" -components: - parameters: - archived_query_param: - description: Only return projects whose `archived` field takes on the value of this parameter. - example: false - in: query - name: archived - schema: - type: boolean - attachment_path_gid: - description: Globally unique identifier for the attachment. - example: "12345" - in: path - name: attachment_gid - required: true - schema: - type: string - x-env-variable: attachment - custom_field_path_gid: - description: Globally unique identifier for the custom field. - example: "12345" - in: path - name: custom_field_gid - required: true - schema: - type: string - x-env-variable: custom_field - fields: - description: |- - Defines fields to return. - Some requests return *compact* representations of objects in order to conserve resources and complete the request more efficiently. Other times requests return more information than you may need. This option allows you to list the exact set of fields that the API should be sure to return for the objects. The field names should be provided as paths, described below. - The id of included objects will always be returned, regardless of the field options. - example: - - followers - - assignee - explode: false - in: query - name: opt_fields - required: false - schema: - items: - type: string - type: array - style: form - job_path_gid: - description: Globally unique identifier for the job. - example: "12345" - in: path - name: job_gid - required: true - schema: - type: string - x-env-variable: job - limit: - description: |- - Results per page. - The number of objects to return per page. The value must be between 1 and 100. - example: 50 - in: query - name: limit - schema: - type: integer - offset: - description: |- - Offset token. - An offset to the next page returned by the API. A pagination request will return an offset token, which can be used as an input parameter to the next request. If an offset is not passed in, the API will return the first page of results. - 'Note: You can only pass in an offset that was returned to you via a previously paginated request.' - example: eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9 - in: query - name: offset - schema: - type: string - organization_export_path_gid: - description: Globally unique identifier for the organization export. - example: "12345" - in: path - name: organization_export_gid - required: true - schema: - type: string - x-env-variable: organization_export - portfolio_membership_path_gid: - description: Globally unique identifier for the portfolio membership - example: "1331" - in: path - name: portfolio_membership_gid - required: true - schema: - type: string - x-env-variable: portfolio_membership - portfolio_path_gid: - description: Globally unique identifier for the portfolio. - example: "12345" - in: path - name: portfolio_gid - required: true - schema: - type: string - x-env-variable: portfolio - portfolio_query_param: - description: The portfolio to filter results on. - example: "12345" - in: query - name: portfolio - schema: - type: string - x-env-variable: portfolio - pretty: - allowEmptyValue: true - description: |- - Provides the response in a “pretty” format. In the case of JSON this means doing proper line breaking and indentation to make it readable. This will take extra time and increase the response size so it is advisable only to use this during debugging. - example: true - in: query - name: opt_pretty - required: false - schema: - type: boolean - style: form - project_membership_path_gid: - description: Globally unique identifier for the project membership. - example: "1331" - in: path - name: project_membership_gid - required: true - schema: - type: string - x-env-variable: project_membership - project_path_gid: - description: Globally unique identifier for the project. - example: "1331" - in: path - name: project_gid - required: true - schema: - type: string - x-env-variable: project - project_status_path_gid: - description: The project status update to get. - example: "321654" - in: path - name: project_status_gid - required: true - schema: - type: string - x-env-variable: project_status - section_path_gid: - description: The globally unique identifier for the section. - example: "321654" - in: path - name: section_gid - required: true - schema: - type: string - x-env-variable: section - story_path_gid: - description: Globally unique identifier for the story. - example: "35678" - in: path - name: story_gid - required: true - schema: - type: string - x-env-variable: story - tag_path_gid: - description: Globally unique identifier for the tag. - example: "11235" - in: path - name: tag_gid - required: true - schema: - type: string - x-env-variable: tag - task_path_gid: - description: Globally unique identifier for the task. - example: "321654" - in: path - name: task_gid - required: true - schema: - type: string - x-env-variable: task - team_membership_path_gid: - description: Globally unique identifier for the team membership. - example: "724362" - in: path - name: team_membership_gid - required: true - schema: - type: string - x-env-variable: team_membership - team_path_gid: - description: Globally unique identifier for the team. - example: "159874" - in: path - name: team_gid - required: true - schema: - type: string - x-env-variable: team - user_path_gid: - description: A string identifying a user. This can either be the string "me", an email, or the gid of a user. - example: me - in: path - name: user_gid - required: true - schema: - type: string - x-env-variable: user - user_query_param: - description: A string identifying a user. This can either be the string "me", an email, or the gid of a user. - example: me - in: query - name: user - schema: - type: string - x-env-variable: user - user_task_list_path_gid: - description: Globally unique identifier for the user task list. - example: "12345" - in: path - name: user_task_list_gid - required: true - schema: - type: string - x-env-variable: user_task_list - webhook_path_gid: - description: Globally unique identifier for the webhook. - example: "12345" - in: path - name: webhook_gid - required: true - schema: - type: string - x-env-variable: webhook - workspace_membership_path_gid: - description: Globally unique identifier for the workspace membership - example: "12345" - in: path - name: workspace_membership_gid - required: true - schema: - type: string - x-env-variable: workspace_membership - workspace_path_gid: - description: Globally unique identifier for the workspace or organization. - example: "12345" - in: path - name: workspace_gid - required: true - schema: - type: string - x-env-variable: workspace - workspace_query_param: - description: The workspace to filter results on. - example: "12345" - in: query - name: workspace - schema: - type: string - x-env-variable: workspace - responses: - BadGateway: - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - description: There is an issue between the load balancers and Asana's API. - BadRequest: - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - description: This usually occurs because of a missing or malformed parameter. Check the documentation and the syntax of your request and try again. - Forbidden: - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - description: The authentication and request syntax was valid but the server is refusing to complete the request. This can happen if you try to read or write to objects or properties that the user does not have access to. - GatewayTimeout: - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - description: This request took too long to complete. - GenericErrorResponse: - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - description: Sadly, sometimes requests to the API are not successful. Failures can occur for a wide range of reasons. In all cases, the API should return an HTTP Status Code that indicates the nature of the failure, with a response body in JSON format containing additional information. In the event of a server error the response body will contain an error phrase. These phrases are automatically generated using the [node-asana-phrase library](https://github.com/Asana/node-asana-phrase) and can be used by Asana support to quickly look up the incident that caused the server error. - InternalServerError: - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - description: There was a problem on Asana’s end. In the event of a server error the response body should contain an error phrase. These phrases can be used by Asana support to quickly look up the incident that caused the server error. Some errors are due to server load, and will not supply an error phrase. - NotFound: - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - description: Either the request method and path supplied do not specify a known action in the API, or the object specified by the request does not exist. - PaymentRequired: - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - description: The request was valid, but the queried object or object mutation specified in the request is above your current premium level. - ServiceUnavailable: - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - description: Either the upstream service is unavailable to the API, or he API has been intentionally shut off. - TooManyRequests: - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - description: You have exceeded one of the enforced rate limits in the API. See the [documentation on rate limiting](https://developers.asana.com/docs/#rate-limits) for more information. - Unauthorized: - content: - application/json: - schema: - $ref: "#/components/schemas/ErrorResponse" - description: A valid authentication token was not provided with the request, so the API could not associate a user with the request. - schemas: - AddCustomFieldSettingRequest: - properties: - custom_field: - description: The custom field to associate with this container. - example: "14916" - type: string - insert_after: - description: A gid of a Custom Field Setting on this container, after which the new Custom Field Setting will be added. `insert_before` and `insert_after` parameters cannot both be specified. - example: "1331" - type: string - insert_before: - description: A gid of a Custom Field Setting on this container, before which the new Custom Field Setting will be added. `insert_before` and `insert_after` parameters cannot both be specified. - example: "1331" - type: string - is_important: - description: Whether this field should be considered important to this container (for instance, to display in the list view of items in the container). - example: true - type: boolean - required: - - custom_field - type: object - AddFollowersRequest: - properties: - followers: - description: An array of strings identifying users. These can either be the string "me", an email, or the gid of a user. - example: 521621,621373 - type: string - required: - - followers - type: object - AddMembersRequest: - properties: - members: - description: An array of strings identifying users. These can either be the string "me", an email, or the gid of a user. - example: 521621,621373 - type: string - required: - - members - type: object - AsanaNamedResource: - description: A generic Asana Resource, containing a globally unique identifier. - allOf: - - $ref: "#/components/schemas/AsanaResource" - - properties: - name: - description: The name of the object. - example: Bug Task - type: string - type: object - AsanaResource: - description: A generic Asana Resource, containing a globally unique identifier. - properties: - gid: - description: Globally unique identifier of the resource, as a string. - example: "12345" - readOnly: true - type: string - x-insert-after: false - resource_type: - description: The base type of this resource. - example: task - readOnly: true - type: string - x-insert-after: gid - type: object - AttachmentBase: - $ref: "#/components/schemas/AttachmentCompact" - AttachmentCompact: - allOf: - - $ref: "#/components/schemas/AsanaResource" - - description: An *attachment* object represents any file attached to a task in Asana, whether it’s an uploaded file or one associated via a third-party service such as Dropbox or Google Drive. - properties: - name: - description: The name of the file. - example: Screenshot.png - readOnly: true - type: string - resource_subtype: - description: |- - The service hosting the attachment. Valid values are `asana`, `dropbox`, `gdrive`, `onedrive`, `box`, and `external`. - `external` attachments are a beta feature currently limited to specific integrations. - type: object - x-docs-overrides: - properties.resource_type.example: attachment - AttachmentRequest: - properties: - file: - format: binary - type: string - type: object - AttachmentResponse: - allOf: - - $ref: "#/components/schemas/AttachmentBase" - - properties: - created_at: - description: The time at which this resource was created. - example: 2012-02-22T02:06:58.147Z - format: date-time - readOnly: true - type: string - download_url: - description: |- - The URL containing the content of the attachment. - *Note:* May be null if the attachment is hosted by [Box](https://www.box.com/). If present, this URL may only be valid for two minutes from the time of retrieval. You should avoid persisting this URL somewhere and just refresh it on demand to ensure you do not keep stale URLs. - example: https://s3.amazonaws.com/assets/123/Screenshot.png - format: uri - nullable: true - readOnly: true - type: string - host: - description: The service hosting the attachment. Valid values are `asana`, `dropbox`, `gdrive` and `box`. - example: dropbox - readOnly: true - type: string - parent: - $ref: "#/components/schemas/TaskCompact" - description: The task this attachment is attached to. - readOnly: true - view_url: - description: The URL where the attachment can be viewed, which may be friendlier to users in a browser than just directing them to a raw file. May be null if no view URL exists for the service. - example: https://www.dropbox.com/s/123/Screenshot.png - format: uri - nullable: true - readOnly: true - type: string - type: object - BatchRequest: - description: A request object for use in a batch request. - properties: - actions: - description: Batch request actions - items: - $ref: "#/components/schemas/BatchRequestAction" - type: array - type: object - BatchRequestAction: - description: An action object for use in a batch request. - properties: - data: - description: For `GET` requests, this should be a map of query parameters you would have normally passed in the URL. Options and pagination are not accepted here; put them in `options` instead. For `POST`, `PATCH`, and `PUT` methods, this should be the content you would have normally put in the data field of the body. - example: - assignee: me - workspace: "1337" - type: object - method: - description: The HTTP method you wish to emulate for the action. - enum: - - get - - post - - put - - delete - - patch - - head - example: get - type: string - options: - description: Pagination (`limit` and `offset`) and output options (`fields` or `expand`) for the action. “Pretty” JSON output is not an available option on individual actions; if you want pretty output, specify that option on the parent request. - example: - fields: - - name - - notes - - completed - limit: 3 - properties: - fields: - description: The fields to retrieve in the request. - example: - - name - - gid - - notes - - completed - items: - type: string - type: array - limit: - description: Pagination limit for the request. - example: 50 - type: integer - offset: - description: Pagination offset for the request. - example: eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9 - type: integer - type: object - relative_path: - description: The path of the desired endpoint relative to the API’s base URL. Query parameters are not accepted here; put them in `data` instead. - example: /tasks/123 - type: string - required: - - relative_path - - method - type: object - BatchResponse: - description: A response object returned from a batch request. - properties: - body: - description: The JSON body that the invoked endpoint returned. - example: - data: - completed: false - gid: "1967" - name: Hello, world! - notes: How are you today? - type: object - headers: - description: A map of HTTP headers specific to this result. This is primarily used for returning a `Location` header to accompany a `201 Created` result. The parent HTTP response will contain all common headers. - example: - location: /tasks/1234 - type: object - status_code: - description: The HTTP status code that the invoked endpoint returned. - example: 200 - type: integer - type: object - CustomFieldBase: - allOf: - - $ref: "#/components/schemas/CustomFieldCompact" - - properties: - currency_code: - description: ISO 4217 currency code to format this custom field. This will be null if the `format` is not `currency`. - example: EUR - nullable: true - type: string - custom_label: - description: This is the string that appears next to the custom field value. This will be null if the `format` is not `custom`. - example: gold pieces - nullable: true - type: string - custom_label_position: - description: Only relevant for custom fields with `custom` format. This depicts where to place the custom label. This will be null if the `format` is not `custom`. - enum: - - prefix - - suffix - example: suffix - type: string - description: - description: "[Opt In](/docs/input-output-options). The description of the custom field." - example: Development team priority - type: string - enum_options: - description: "*Conditional*. Only relevant for custom fields of type enum. This array specifies the possible values which an `enum` custom field can adopt. To modify the enum options, refer to [working with enum options](/docs/create-an-enum-option)." - items: - $ref: "#/components/schemas/EnumOption" - type: array - format: - description: The format of this custom field. - enum: - - currency - - identifier - - percentage - - custom - - none - example: custom - type: string - has_notifications_enabled: - description: "*Conditional*. This flag describes whether a follower of a task with this field should receive inbox notifications from changes to this field." - example: true - type: boolean - is_global_to_workspace: - description: This flag describes whether this custom field is available to every container in the workspace. Before project-specific custom fields, this field was always true. - example: true - readOnly: true - type: boolean - precision: - description: |- - Only relevant for custom fields of type ‘Number’. This field dictates the number of places after the decimal to round to, i.e. 0 is integer values, 1 rounds to the nearest tenth, and so on. Must be between 0 and 6, inclusive. - For percentage format, this may be unintuitive, as a value of 0.25 has a precision of 0, while a value of 0.251 has a precision of 1. This is due to 0.25 being displayed as 25%. - The identifier format will always have a precision of 0. - example: 2 - type: integer - type: object - CustomFieldCompact: - description: Custom Fields store the metadata that is used in order to add user-specified information to tasks in Asana. Be sure to reference the [Custom Fields](/docs/asana-custom-fields) developer documentation for more information about how custom fields relate to various resources in Asana. - allOf: - - $ref: "#/components/schemas/AsanaResource" - - description: |- - Custom Fields store the metadata that is used in order to add user-specified information to tasks in Asana. Be sure to reference the [Custom Fields](/docs/asana-custom-fields) developer documentation for more information about how custom fields relate to various resources in Asana. - - Users in Asana can [lock custom fields](https://asana.com/guide/help/premium/custom-fields#gl-lock-fields), which will make them read-only when accessed by other users. Attempting to edit a locked custom field will return HTTP error code `403 Forbidden`. - properties: - display_value: - description: A string representation for the value of the custom field. Integrations that don't require the underlying type should use this field to read values. Using this field will future-proof an app against new custom field types. - example: blue - readOnly: true - type: string - enabled: - description: "*Conditional*. Determines if the custom field is enabled or not." - example: true - type: boolean - enum_options: - description: "*Conditional*. Only relevant for custom fields of type enum. This array specifies the possible values which an `enum` custom field can adopt. To modify the enum options, refer to [working with enum options](/docs/create-an-enum-option)." - items: - $ref: "#/components/schemas/EnumOption" - type: array - name: - description: The name of the custom field. - example: Status - type: string - number_value: - description: "*Conditional*. This number is the value of a number custom field." - example: 5.2 - type: number - resource_subtype: - description: | - The type of the custom field. Must be one of the given values. - enum: - - text - - enum - - number - example: text - type: string - text_value: - description: "*Conditional*. This string is the value of a text custom field." - example: Some Value - type: string - type: - description: | - *Deprecated: new integrations should prefer the resource_subtype field.* The type of the custom field. Must be one of the given values. - enum: - - text - - enum - - number - readOnly: true - type: string - type: object - x-docs-overrides: - properties.resource_type.example: custom_field - CustomFieldRequest: - allOf: - - $ref: "#/components/schemas/CustomFieldBase" - - properties: - workspace: - description: "*Create-Only* The workspace to create a custom field in." - example: "1331" - type: string - required: - - workspace - type: object - CustomFieldResponse: - allOf: - - $ref: "#/components/schemas/CustomFieldBase" - - properties: - created_by: - $ref: "#/components/schemas/UserCompact" - enum_value: - $ref: "#/components/schemas/EnumOption" - description: "*Conditional*. Only relevant for custom fields of type `enum`. This object is the chosen value of an enum custom field." - type: object - CustomFieldSettingBase: - $ref: "#/components/schemas/CustomFieldSettingCompact" - CustomFieldSettingCompact: - allOf: - - $ref: "#/components/schemas/AsanaResource" - - description: Custom Fields Settings objects represent the many-to-many join of the Custom Field and Project as well as stores information that is relevant to that particular pairing. - type: object - x-docs-overrides: - properties.resource_type.example: custom_field_setting - CustomFieldSettingResponse: - allOf: - - $ref: "#/components/schemas/CustomFieldSettingBase" - - properties: - custom_field: - $ref: "#/components/schemas/CustomFieldResponse" - description: The custom field that is applied to the `parent`. - readOnly: true - is_important: - description: "`is_important` is used in the Asana web application to determine if this custom field is displayed in the list/grid view of a project or portfolio." - example: false - readOnly: true - type: boolean - parent: - $ref: "#/components/schemas/ProjectCompact" - description: The parent to which the custom field is applied. This can be a project or portfolio and indicates that the tasks or projects that the parent contains may be given custom field values for this custom field. - readOnly: true - project: - $ref: "#/components/schemas/ProjectCompact" - description: "*Deprecated: new integrations should prefer the `parent` field.* The id of the project that this custom field settings refers to." - readOnly: true - type: object - EmptyResponse: - description: An empty object. Some endpoints do not return an object on success. The success is conveyed through a 2-- status code and returning an empty object. - type: object - EnumOption: - description: Enum options are the possible values which an enum custom field can adopt. - allOf: - - $ref: "#/components/schemas/AsanaResource" - - description: |- - Enum options are the possible values which an enum custom field can adopt. An enum custom field must contain at least 1 enum option but no more than 50. - - You can add enum options to a custom field by using the `POST /custom_fields/custom_field_gid/enum_options` endpoint. - - **It is not possible to remove or delete an enum option**. Instead, enum options can be disabled by updating the `enabled` field to false with the `PUT /enum_options/enum_option_gid` endpoint. Other attributes can be updated similarly. - - On creation of an enum option, `enabled` is always set to `true`, meaning the enum option is a selectable value for the custom field. Setting `enabled=false` is equivalent to “trashing” the enum option in the Asana web app within the “Edit Fields” dialog. The enum option will no longer be selectable but, if the enum option value was previously set within a task, the task will retain the value. - - Enum options are an ordered list and by default new enum options are inserted at the end. Ordering in relation to existing enum options can be specified on creation by using `insert_before` or `insert_after` to reference an existing enum option. Only one of `insert_before` and `insert_after` can be provided when creating a new enum option. - - An enum options list can be reordered with the `POST /custom_fields/custom_field_gid/enum_options/insert` endpoint. - properties: - color: - description: The color of the enum option. Defaults to ‘none’. - example: blue - type: string - enabled: - description: Whether or not the enum option is a selectable value for the custom field. - example: true - type: boolean - name: - description: The name of the enum option. - example: Low - type: string - type: object - x-docs-overrides: - properties.resource_type.example: enum_option - EnumOptionBase: - $ref: "#/components/schemas/EnumOption" - EnumOptionInsertRequest: - properties: - after_enum_option: - description: An existing enum option within this custom field after which the new enum option should be inserted. Cannot be provided together with before_enum_option. - example: "12345" - type: string - before_enum_option: - description: An existing enum option within this custom field before which the new enum option should be inserted. Cannot be provided together with after_enum_option. - example: "12345" - type: string - enum_option: - description: The gid of the enum option to relocate. - example: "97285" - type: string - required: - - enum_option - type: object - EnumOptionRequest: - allOf: - - $ref: "#/components/schemas/EnumOptionBase" - - properties: - insert_after: - description: An existing enum option within this custom field after which the new enum option should be inserted. Cannot be provided together with before_enum_option. - example: "12345" - type: string - insert_before: - description: An existing enum option within this custom field before which the new enum option should be inserted. Cannot be provided together with after_enum_option. - example: "12345" - type: string - type: object - Error: - properties: - help: - description: Additional information directing developers to resources on how to address and fix the problem, if available. - example: "For more information on API status codes and how to handle them, read the docs on errors: https://asana.github.io/developer-docs/#errors'" - readOnly: true - type: string - message: - description: Message providing more detail about the error that occurred, if available. - example: "project: Missing input" - readOnly: true - type: string - phrase: - description: "*500 errors only*. A unique error phrase which can be used when contacting developer support to help identify the exact occurrence of the problem in Asana’s logs." - example: 6 sad squid snuggle softly - readOnly: true - type: string - type: object - ErrorResponse: - description: |- - Sadly, sometimes requests to the API are not successful. Failures can - occur for a wide range of reasons. In all cases, the API should return - an HTTP Status Code that indicates the nature of the failure, - with a response body in JSON format containing additional information. - - - In the event of a server error the response body will contain an error - phrase. These phrases are automatically generated using the - [node-asana-phrase - library](https://github.com/Asana/node-asana-phrase) and can be used by - Asana support to quickly look up the incident that caused the server - error. - properties: - errors: - description: Array of errors when requests to the API are not successful. - items: - $ref: "#/components/schemas/Error" - type: array - type: object - EventResponse: - description: |- - An *event* is an object representing a change to a resource that was - observed by an event subscription or delivered asynchronously to - the target location of an active webhook. - - The event may be triggered by a different `user` than the - subscriber. For example, if user A subscribes to a task and user B - modified it, the event’s user will be user B. Note: Some events - are generated by the system, and will have `null` as the user. API - consumers should make sure to handle this case. - - The `resource` that triggered the event may be different from the one - that the events were requested for or the webhook is subscribed to. For - example, a subscription to a project will contain events for tasks - contained within the project. - - **Note:** pay close attention to the relationship between the fields - `Event.action` and `Event.change.action`. - `Event.action` represents the action taken on the resource - itself, and `Event.change.action` represents how the information - within the resource's fields have been modified. - - For instance, consider these scenarios: - - - * When at task is added to a project, `Event.action` will be - `added`, `Event.parent` will be on object with the `id` and - `type` of the project, and there will be no `change` field. - - - * When an assignee is set on the task, `Event.parent` will be - `null`, `Event.action` will be `changed`, - `Event.change.action` will be `changed`, and `changed_value` will - be an object with the user's `id` and `type`. - - - * When a collaborator is added to the task, `Event.parent` will - be `null`, `Event.action` will be `changed`, - `Event.change.action` will be `added`, and `added_value` will be - an object with the user's `id` and `type`. - properties: - action: - description: The type of action taken on the **resource** that triggered the event. This can be one of `changed`, `added`, `removed`, `deleted`, or `undeleted` depending on the nature of the event. - example: changed - readOnly: true - type: string - change: - description: Information about the type of change that has occurred. This field is only present when the value of the property `action`, describing the action taken on the **resource**, is `changed`. - properties: - action: - description: The type of action taken on the **field** which has been changed. This can be one of `changed`, `added`, or `removed` depending on the nature of the change. - example: changed - readOnly: true - type: string - added_value: - description: "*Conditional.* This property is only present when the **field's** `action` is `added` and the `added_value` is an Asana resource. This will be only the `gid` and `resource_type` of the resource when the events come from webhooks; this will be the compact representation (and can have fields expanded with [opt_fields](/docs/input-output-options)) when using the [Events](/docs/asana-events) resource." - example: - gid: "12345" - resource_type: user - field: - description: The name of the field that has changed in the resource. - example: assignee - readOnly: true - type: string - new_value: - description: "*Conditional.* This property is only present when the **field's** `action` is `changed` and the `new_value` is an Asana resource. This will be only the `gid` and `resource_type` of the resource when the events come from webhooks; this will be the compact representation (and can have fields expanded with [opt_fields](/docs/input-output-options)) when using the [Events](/docs/asana-events) resource." - example: - gid: "12345" - resource_type: user - removed_value: - description: "*Conditional.* This property is only present when the **field's** `action` is `removed` and the `removed_value` is an Asana resource. This will be only the `gid` and `resource_type` of the resource when the events come from webhooks; this will be the compact representation (and can have fields expanded with [opt_fields](/docs/input-output-options)) when using the [Events](/docs/asana-events) resource." - example: - gid: "12345" - resource_type: user - readOnly: true - type: object - created_at: - description: The timestamp when the event occurred. - example: 2012-02-22T02:06:58.147Z - format: date-time - readOnly: true - type: string - parent: - description: For added/removed events, the parent object that resource was added to or removed from. - $ref: "#/components/schemas/AsanaNamedResource" - resource: - $ref: "#/components/schemas/AsanaNamedResource" - description: The resource which has triggered the event by being modified in some way. - type: - description: "*Deprecated: Refer to the resource_type of the resource.* The type of the resource that generated the event." - example: task - readOnly: true - type: string - user: - $ref: "#/components/schemas/UserCompact" - description: The user who triggered the event. - type: object - JobBase: - $ref: "#/components/schemas/JobCompact" - JobCompact: - allOf: - - $ref: "#/components/schemas/AsanaResource" - - description: A *job* is an object representing a process that handles asynchronous work. - properties: - new_project: - description: Represents prioritized list of tasks in Asana or a board with columns of tasks. - $ref: "#/components/schemas/ProjectCompact" - new_task: - description: Represents basic object around which many operations in Asana are centered. - $ref: "#/components/schemas/TaskCompact" - resource_subtype: - description: The subtype of this resource. Different subtypes retain many of the same fields and behavior, but may render differently in Asana or represent resources with different semantic meaning. - example: duplicate_task - readOnly: true - type: string - status: - description: Status of job. - enum: - - not_started - - in_progress - - completed - - failed - example: in_progress - readOnly: true - type: string - type: object - x-docs-overrides: - properties.resource_type.example: job - JobResponse: - $ref: "#/components/schemas/JobBase" - Like: - description: An object to represent a user's like. - properties: - gid: - description: Globally unique identifier of the object, as a string. - example: "12345" - readOnly: true - type: string - user: - $ref: "#/components/schemas/UserCompact" - type: object - ModifyDependenciesRequest: - example: - dependencies: - - "133713" - - "184253" - properties: - dependencies: - description: An array of task gids that a task depends on. - items: - type: string - type: array - type: object - ModifyDependentsRequest: - description: A set of dependent tasks. - example: - dependents: - - "133713" - - "184253" - properties: - dependents: - description: An array of task gids that are dependents of the given task. - items: - type: string - type: array - type: object - OrganizationExportBase: - $ref: "#/components/schemas/OrganizationExportCompact" - OrganizationExportCompact: - allOf: - - $ref: "#/components/schemas/AsanaResource" - - description: An *organization_export* object represents a request to export the complete data of an Organization in JSON format. - properties: - created_at: - description: The time at which this resource was created. - example: 2012-02-22T02:06:58.147Z - format: date-time - readOnly: true - type: string - download_url: - description: |- - Download this URL to retreive the full export of the organization - in JSON format. It will be compressed in a gzip (.gz) container. - - *Note: May be null if the export is still in progress or - failed. If present, this URL may only be valid for 1 hour from - the time of retrieval. You should avoid persisting this URL - somewhere and rather refresh on demand to ensure you do not keep - stale URLs.* - example: https://asana-export.s3.amazonaws.com/export-4632784536274-20170127-43246.json.gz?AWSAccessKeyId=xxxxxxxx - format: uri - nullable: true - readOnly: true - type: string - organization: - description: Represents workspace is the highest-level organizational unit in Asana - $ref: "#/components/schemas/WorkspaceCompact" - state: - description: The current state of the export. - enum: - - pending - - started - - finished - - error - example: started - readOnly: true - type: string - type: object - x-docs-overrides: - properties.resource_type.example: organization_export - OrganizationExportRequest: - description: An *organization_export* request starts a job to export the complete data of the given Organization. - properties: - organization: - description: Globally unique identifier for the workspace or organization. - example: "1331" - type: string - type: object - OrganizationExportResponse: - $ref: "#/components/schemas/OrganizationExportBase" - PortfolioAddItemRequest: - properties: - insert_after: - description: An id of an item in this portfolio. The new item will be added after the one specified here. `insert_before` and `insert_after` parameters cannot both be specified. - example: "1331" - type: string - insert_before: - description: An id of an item in this portfolio. The new item will be added before the one specified here. `insert_before` and `insert_after` parameters cannot both be specified. - example: "1331" - type: string - item: - description: The item to add to the portfolio. - example: "1331" - type: string - required: - - item - type: object - PortfolioBase: - allOf: - - $ref: "#/components/schemas/PortfolioCompact" - - properties: - color: - description: Color of the portfolio. - enum: - - dark-pink - - dark-green - - dark-blue - - dark-red - - dark-teal - - dark-brown - - dark-orange - - dark-purple - - dark-warm-gray - - light-pink - - light-green - - light-blue - - light-red - - light-teal - - light-brown - - light-orange - - light-purple - - light-warm-gray - example: light-green - type: string - type: object - PortfolioCompact: - description: A *portfolio* gives a high-level overview of the status of multiple initiatives in Asana. - allOf: - - $ref: "#/components/schemas/AsanaResource" - - description: |- - A *portfolio* gives a high-level overview of the status of multiple initiatives in Asana. Portfolios provide a dashboard overview of the state of multiple projects, including a progress report and the most recent [project status](/docs/asana-project-statuses) update. - Portfolios have some restrictions on size. Each portfolio has a max of 250 items and, like projects, a max of 20 custom fields. - properties: - name: - description: The name of the portfolio. - example: Bug Portfolio - type: string - type: object - x-docs-overrides: - properties.resource_type.example: portfolio - PortfolioMembershipBase: - $ref: "#/components/schemas/PortfolioMembershipCompact" - PortfolioMembershipCompact: - allOf: - - $ref: "#/components/schemas/AsanaResource" - - description: This object determines if a user is a member of a portfolio. - properties: - portfolio: - $ref: "#/components/schemas/PortfolioCompact" - description: "[Opt In](/docs/input-output-options). The portfolio the user is a member of." - user: - $ref: "#/components/schemas/UserCompact" - type: object - x-docs-overrides: - properties.resource_type.example: portfolio_membership - PortfolioMembershipResponse: - $ref: "#/components/schemas/PortfolioMembershipBase" - PortfolioRemoveItemRequest: - properties: - item: - description: The item to remove from the portfolio. - example: "1331" - type: string - required: - - item - type: object - PortfolioRequest: - allOf: - - $ref: "#/components/schemas/PortfolioBase" - - properties: - members: - description: An array of strings identifying users. These can either be the string "me", an email, or the gid of a user. - example: - - "52164" - - "15363" - items: - description: Gid of an object. - type: string - type: array - workspace: - description: Gid of an object. - example: "167589" - type: string - type: object - PortfolioResponse: - allOf: - - $ref: "#/components/schemas/PortfolioBase" - - properties: - created_at: - description: The time at which this resource was created. - example: 2012-02-22T02:06:58.147Z - format: date-time - readOnly: true - type: string - created_by: - $ref: "#/components/schemas/UserCompact" - custom_field_settings: - description: Array of custom field settings applied to the portfolio. - items: - $ref: "#/components/schemas/CustomFieldSettingResponse" - type: array - due_on: - description: The localized day on which this portfolio is due. This takes a date with format YYYY-MM-DD. - example: 2019-09-15 - format: date-time - nullable: true - type: string - members: - items: - $ref: "#/components/schemas/UserCompact" - readOnly: true - type: array - owner: - $ref: "#/components/schemas/UserCompact" - permalink_url: - description: A url that points directly to the object within Asana. - example: https://app.asana.com/0/resource/123456789/list - readOnly: true - type: string - start_on: - description: "The day on which work for this portfolio begins, or null if the portfolio has no start date. This takes a date with `YYYY-MM-DD` format. *Note: `due_on` must be present in the request when setting or unsetting the `start_on` parameter. Additionally, start_on and due_on cannot be the same date.*" - example: 2019-09-14 - format: date - nullable: true - type: string - workspace: - $ref: "#/components/schemas/WorkspaceCompact" - description: "*Create-only*. The workspace or organization that the portfolio belongs to." - type: object - Preview: - description: |- - A collection of rich text that will be displayed as a preview to another app. - - This is read-only except for a small group of whitelisted apps. - properties: - fallback: - description: Some fallback text to display if unable to display the full preview. - example: "Greg: Great! I like this idea.\\n\\nhttps//a_company.slack.com/archives/ABCDEFG/12345678" - type: string - footer: - description: Text to display in the footer. - example: Mar 17, 2019 1:25 PM - type: string - header: - description: Text to display in the header. - example: Asana for Slack - type: string - header_link: - description: Where the header will link to. - example: https://asana.comn/apps/slack - type: string - html_text: - description: HTML formatted text for the body of the preview. - example: Great! I like this idea. - type: string - text: - description: Text for the body of the preview. - example: Great! I like this idea. - type: string - title: - description: Text to display as the title. - example: Greg - type: string - title_link: - description: Where to title will link to. - example: https://asana.slack.com/archives/ABCDEFG/12345678 - type: string - readOnly: true - type: object - ProjectBase: - allOf: - - $ref: "#/components/schemas/ProjectCompact" - - properties: - archived: - description: True if the project is archived, false if not. Archived projects do not show in the UI by default and may be treated differently for queries. - example: false - type: boolean - color: - description: Color of the project. - enum: - - dark-pink - - dark-green - - dark-blue - - dark-red - - dark-teal - - dark-brown - - dark-orange - - dark-purple - - dark-warm-gray - - light-pink - - light-green - - light-blue - - light-red - - light-teal - - light-brown - - light-orange - - light-purple - - light-warm-gray - example: light-green - nullable: true - type: string - created_at: - description: The time at which this resource was created. - example: 2012-02-22T02:06:58.147Z - format: date-time - readOnly: true - type: string - current_status: - $ref: "#/components/schemas/ProjectStatusResponse" - custom_field_settings: - description: Array of Custom Field Settings (in compact form). - items: - $ref: "#/components/schemas/CustomFieldSettingCompact" - readOnly: true - type: array - default_view: - description: The default view (list, board, calendar, or timeline) of a project. - enum: - - list - - board - - calendar - - timeline - example: calendar - type: string - due_date: - description: "*Deprecated: new integrations should prefer the due_on field.*" - example: 2019-09-15 - format: date-time - nullable: true - type: string - due_on: - description: The day on which this project is due. This takes a date with format YYYY-MM-DD. - example: 2019-09-15 - format: date-time - nullable: true - type: string - html_notes: - description: "[Opt In](/docs/input-output-options). The notes of the project with formatting as HTML." - example: These are things we need to purchase. - type: string - is_template: - description: "[Opt In](/docs/input-output-options). Determines if the project is a template." - example: false - type: boolean - members: - description: Array of users who are members of this project. - items: - $ref: "#/components/schemas/UserCompact" - readOnly: true - type: array - modified_at: - description: |- - The time at which this project was last modified. - *Note: This does not currently reflect any changes in associations such as tasks or comments that may have been added or removed from the project.* - example: 2012-02-22T02:06:58.147Z - format: date-time - readOnly: true - type: string - notes: - description: More detailed, free-form textual information associated with the project. - example: These are things we need to purchase. - type: string - public: - description: True if the project is public to the organization. If false, do not share this project with other users in this organization without explicitly checking to see if they have access. - example: false - type: boolean - start_on: - description: "The day on which work for this project begins, or null if the project has no start date. This takes a date with `YYYY-MM-DD` format. *Note: `due_on` or `due_at` must be present in the request when setting or unsetting the `start_on` parameter. Additionally, start_on and due_on cannot be the same date.*" - example: 2019-09-14 - format: date - nullable: true - type: string - workspace: - $ref: "#/components/schemas/WorkspaceCompact" - description: "*Create-only*. The workspace or organization this project is associated with. Once created, projects cannot be moved to a different workspace. This attribute can only be specified at creation time." - readOnly: true - type: object - ProjectCompact: - description: A *project* represents a prioritized list of tasks in Asana or a board with columns of tasks represented as cards. It exists in a single workspace or organization and is accessible to a subset of users in that workspace or organization, depending on its permissions. - allOf: - - $ref: "#/components/schemas/AsanaResource" - - description: A *project* represents a prioritized list of tasks in Asana or a board with columns of tasks represented as cards. It exists in a single workspace or organization and is accessible to a subset of users in that workspace or organization, depending on its permissions. - properties: - name: - description: Name of the project. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer. - example: Stuff to buy - type: string - type: object - x-docs-overrides: - properties.resource_type.example: project - ProjectDuplicateRequest: - properties: - include: - description: The elements that will be duplicated to the new project. Tasks are always included. - enum: - - members - - notes - - forms - - task_notes - - task_assignee - - task_subtasks - - task_attachments - - task_dates - - task_dependencies - - task_followers - - task_tags - - task_projects - example: - - members - - task_notes - type: string - name: - description: The name of the new project. - example: New Project Name - type: string - schedule_dates: - description: A dictionary of options to auto-shift dates. `task_dates` must be included to use this option. Requires either `start_on` or `due_on`, but not both. - properties: - due_on: - description: Sets the last due date in the duplicated project to the given date. The rest of the due dates will be offset by the same amount as the due dates in the original project. - example: 2019-05-21 - type: string - should_skip_weekends: - description: Determines if the auto-shifted dates should skip weekends. - example: true - type: boolean - start_on: - description: Sets the first start date in the duplicated project to the given date. The rest of the start dates will be offset by the same amount as the start dates in the original project. - example: 2019-05-21 - type: string - required: - - should_skip_weekends - type: object - team: - description: Sets the team of the new project. If team is not defined, the new project will be in the same team as the the original project. - example: "12345" - type: string - required: - - name - type: object - ProjectMembershipBase: - $ref: "#/components/schemas/ProjectMembershipCompact" - ProjectMembershipCompact: - allOf: - - $ref: "#/components/schemas/AsanaResource" - - description: With the introduction of “comment-only” projects in Asana, a user’s membership in a project comes with associated permissions. These permissions (whether a user has full access to the project or comment-only access) are accessible through the project memberships endpoints described here. - properties: - user: - $ref: "#/components/schemas/UserCompact" - type: object - x-docs-overrides: - properties.resource_type.example: project_membership - ProjectMembershipResponse: - allOf: - - $ref: "#/components/schemas/ProjectMembershipBase" - - properties: - project: - $ref: "#/components/schemas/ProjectCompact" - description: "[Opt In](/docs/input-output-options). The project the user is a member of." - write_access: - description: Whether the user has full access to the project or has comment-only access. - enum: - - full_write - - comment_only - example: full_write - readOnly: true - type: string - type: object - ProjectRequest: - allOf: - - $ref: "#/components/schemas/ProjectBase" - - properties: - custom_fields: - additionalProperties: - description: '"{custom_field_gid}" => Value (Can be text, number, etc.)' - type: string - description: An object where each key is a Custom Field gid and each value is an enum gid, string, or number. - example: - "4578152156": Not Started - "5678904321": On Hold - type: object - followers: - description: "*Create-only*. Comma separated string of users. Followers are a subset of members who receive all notifications for a project, the default notification setting when adding members to a project in-product." - example: 12345,23456 - type: string - owner: - description: The current owner of the project, may be null. - example: "12345" - nullable: true - type: string - team: - description: "*Create-only*. The team that this project is shared with. This field only exists for projects in organizations." - example: "12345" - type: string - type: object - ProjectResponse: - allOf: - - $ref: "#/components/schemas/ProjectBase" - - properties: - custom_fields: - description: Array of Custom Fields. - items: - $ref: "#/components/schemas/CustomFieldCompact" - readOnly: true - type: array - followers: - description: Array of users following this project. Followers are a subset of members who receive all notifications for a project, the default notification setting when adding members to a project in-product. - items: - $ref: "#/components/schemas/UserCompact" - readOnly: true - type: array - icon: - description: The icon for a project. - enum: - - list - - board - - timeline - - calendar - - rocket - - people - - graph - - star - - bug - - light_bulb - - globe - - gear - - notebook - - computer - - check - - target - - html - - megaphone - - chat_bubbles - - briefcase - - page_layout - - mountain_flag - - puzzle - - presentation - - line_and_symbols - - speed_dial - - ribbon - - shoe - - shopping_basket - - map - - ticket - - coins - example: chat_bubbles - nullable: true - type: string - owner: - $ref: "#/components/schemas/UserCompact" - description: The current owner of the project, may be null. - nullable: true - permalink_url: - description: A url that points directly to the object within Asana. - example: https://app.asana.com/0/resource/123456789/list - readOnly: true - type: string - team: - $ref: "#/components/schemas/TeamCompact" - description: "*Create-only*. The team that this project is shared with. This field only exists for projects in organizations." - type: object - ProjectSectionInsertRequest: - properties: - after_section: - description: Insert the given section immediately after the section specified by this parameter. - example: "987654" - type: string - before_section: - description: Insert the given section immediately before the section specified by this parameter. - example: "86420" - type: string - project: - description: The project in which to reorder the given section. - example: "123456" - type: string - section: - description: The section to reorder. - example: "321654" - type: string - required: - - project - - section - type: object - ProjectStatusBase: - allOf: - - $ref: "#/components/schemas/ProjectStatusCompact" - - properties: - author: - $ref: "#/components/schemas/UserCompact" - color: - description: The color associated with the status update. - enum: - - green - - yellow - - red - - blue - type: string - html_text: - description: "[Opt In](/docs/input-output-options). The text content of the status update with formatting as HTML." - example: The project is moving forward according to plan... - type: string - modified_at: - description: |- - The time at which this project status was last modified. - *Note: This does not currently reflect any changes in associations such as comments that may have been added or removed from the project status.* - text: - description: The text content of the status update. - example: The project is moving forward according to plan... - type: string - required: - - text - - color - type: object - ProjectStatusCompact: - allOf: - - $ref: "#/components/schemas/AsanaResource" - - description: 'A *project status* is an update on the progress of a particular project, and is sent out to all project followers when created. These updates include both text describing the update and a color code intended to represent the overall state of the project: "green" for projects that are on track, "yellow" for projects at risk, and "red" for projects that are behind.' - properties: - title: - description: The title of the project status update. - example: Status Update - Jun 15 - type: string - type: object - x-docs-overrides: - properties.resource_type.example: project_status - ProjectStatusRequest: - $ref: "#/components/schemas/ProjectStatusBase" - ProjectStatusResponse: - nullable: true - allOf: - - $ref: "#/components/schemas/ProjectStatusBase" - - properties: - created_at: - description: The time at which this resource was created. - example: 2012-02-22T02:06:58.147Z - format: date-time - readOnly: true - type: string - created_by: - $ref: "#/components/schemas/UserCompact" - type: object - RemoveCustomFieldSettingRequest: - properties: - custom_field: - description: The custom field to remove from this portfolio. - example: "14916" - type: string - required: - - custom_field - type: object - RemoveFollowersRequest: - properties: - followers: - description: An array of strings identifying users. These can either be the string "me", an email, or the gid of a user. - example: 521621,621373 - type: string - required: - - followers - type: object - RemoveMembersRequest: - properties: - members: - description: An array of strings identifying users. These can either be the string "me", an email, or the gid of a user. - example: 521621,621373 - type: string - required: - - members - type: object - SectionBase: - $ref: "#/components/schemas/SectionCompact" - SectionCompact: - description: A section is a subdivision of a project that groups tasks together. - allOf: - - $ref: "#/components/schemas/AsanaResource" - - description: A *section* is a subdivision of a project that groups tasks together. It can either be a header above a list of tasks in a list view or a column in a board view of a project. - properties: - name: - description: The name of the section (i.e. the text displayed as the section header). - example: Next Actions - type: string - type: object - x-docs-overrides: - properties.resource_type.example: section - SectionRequest: - properties: - insert_after: - description: An existing section within this project after which the added section should be inserted. Cannot be provided together with insert_before. - example: "987654" - type: string - insert_before: - description: An existing section within this project before which the added section should be inserted. Cannot be provided together with insert_after. - example: "86420" - type: string - name: - description: The text to be displayed as the section name. This cannot be an empty string. - example: Next Actions - type: string - project: - description: "*Create-Only* The project to create the section in" - example: "13579" - type: string - required: - - project - - name - type: object - SectionResponse: - allOf: - - $ref: "#/components/schemas/SectionBase" - - properties: - created_at: - description: The time at which this resource was created. - example: 2012-02-22T02:06:58.147Z - format: date-time - readOnly: true - type: string - project: - $ref: "#/components/schemas/ProjectCompact" - projects: - description: "*Deprecated - please use project instead*" - items: - $ref: "#/components/schemas/ProjectCompact" - readOnly: true - type: array - type: object - SectionTaskInsertRequest: - properties: - insert_after: - description: An existing task within this section after which the added task should be inserted. Cannot be provided together with insert_before. - example: "987654" - type: string - insert_before: - description: An existing task within this section before which the added task should be inserted. Cannot be provided together with insert_after. - example: "86420" - type: string - task: - description: The task to add to this section. - example: "123456" - type: string - required: - - task - type: object - StoryBase: - allOf: - - $ref: "#/components/schemas/AsanaResource" - - description: A story represents an activity associated with an object in the Asana system. - properties: - created_at: - description: The time at which this resource was created. - example: 2012-02-22T02:06:58.147Z - format: date-time - readOnly: true - type: string - html_text: - description: "[Opt In](/docs/input-output-options). HTML formatted text for a comment. This will not include the name of the creator." - example: This is a comment. - type: string - is_pinned: - description: "*Conditional*. Whether the story should be pinned on the resource." - example: false - type: boolean - resource_subtype: - description: The subtype of this resource. Different subtypes retain many of the same fields and behavior, but may render differently in Asana or represent resources with different semantic meaning. - example: comment_added - readOnly: true - type: string - sticker_name: - description: The name of the sticker in this story. `null` if there is no sticker. - enum: - - green_checkmark - - people_dancing - - dancing_unicorn - - heart - - party_popper - - people_waving_flags - - splashing_narwhal - - trophy - - yeti_riding_unicorn - - celebrating_people - - determined_climbers - - phoenix_spreading_love - example: dancing_unicorn - type: string - text: - description: The plain text of the comment to add. Cannot be used with html_text. - example: This is a comment. - type: string - type: object - x-docs-overrides: - properties.resource_type.example: story - StoryCompact: - description: A story represents an activity associated with an object in the Asana system. - allOf: - - $ref: "#/components/schemas/AsanaResource" - - description: A story represents an activity associated with an object in the Asana system. - properties: - created_at: - description: The time at which this resource was created. - example: 2012-02-22T02:06:58.147Z - format: date-time - readOnly: true - type: string - created_by: - $ref: "#/components/schemas/UserCompact" - resource_subtype: - description: The subtype of this resource. Different subtypes retain many of the same fields and behavior, but may render differently in Asana or represent resources with different semantic meaning. - example: comment_added - readOnly: true - type: string - text: - description: |- - *Create-only*. Human-readable text for the story or comment. - This will not include the name of the creator. - *Note: This is not guaranteed to be stable for a given type of story. For example, text for a reassignment may not always say “assigned to …” as the text for a story can both be edited and change based on the language settings of the user making the request.* - Use the `resource_subtype` property to discover the action that created the story. - example: marked today - type: string - type: object - x-docs-overrides: - properties.resource_type.example: story - StoryRequest: - $ref: "#/components/schemas/StoryBase" - StoryResponse: - description: Represents activity associated with an object in the Asana system - allOf: - - $ref: "#/components/schemas/StoryBase" - - properties: - assignee: - $ref: "#/components/schemas/UserCompact" - description: "*Conditional*" - readOnly: true - created_by: - $ref: "#/components/schemas/UserCompact" - custom_field: - $ref: "#/components/schemas/CustomFieldCompact" - description: "*Conditional*" - readOnly: true - dependency: - $ref: "#/components/schemas/TaskCompact" - description: "*Conditional*" - readOnly: true - duplicate_of: - $ref: "#/components/schemas/TaskCompact" - description: "*Conditional*" - readOnly: true - duplicated_from: - $ref: "#/components/schemas/TaskCompact" - description: "*Conditional*" - readOnly: true - follower: - $ref: "#/components/schemas/UserCompact" - description: "*Conditional*" - readOnly: true - hearted: - description: |- - *Deprecated - please use likes instead* - *Conditional*. True if the story is hearted by the authorized user, false if not. - example: false - readOnly: true - type: boolean - hearts: - description: |- - *Deprecated - please use likes instead* - - *Conditional*. Array of likes for users who have hearted this story. - items: - $ref: "#/components/schemas/Like" - readOnly: true - type: array - is_edited: - description: "*Conditional*. Whether the text of the story has been edited after creation." - example: false - readOnly: true - type: boolean - liked: - description: "*Conditional*. True if the story is liked by the authorized user, false if not." - example: false - readOnly: true - type: boolean - likes: - description: "*Conditional*. Array of likes for users who have liked this story." - items: - $ref: "#/components/schemas/Like" - readOnly: true - type: array - new_approval_status: - description: "*Conditional*" - example: approved - readOnly: true - type: string - new_dates: - description: "" - $ref: "#/components/schemas/StoryResponseDates" - new_enum_value: - $ref: "#/components/schemas/EnumOption" - description: "*Conditional*" - readOnly: true - new_name: - description: "*Conditional*" - example: This is the New Name - readOnly: true - type: string - new_number_value: - description: "*Conditional*" - example: 2 - readOnly: true - type: integer - new_resource_subtype: - description: "*Conditional*" - example: milestone - readOnly: true - type: string - new_section: - $ref: "#/components/schemas/SectionCompact" - description: "*Conditional*" - readOnly: true - new_text_value: - description: "*Conditional*" - example: This is the New Text - readOnly: true - type: string - num_hearts: - description: |- - *Deprecated - please use likes instead* - - *Conditional*. The number of users who have hearted this story. - example: 5 - readOnly: true - type: integer - num_likes: - description: "*Conditional*. The number of users who have liked this story." - example: 5 - readOnly: true - type: integer - old_approval_status: - description: "*Conditional*" - example: pending - readOnly: true - type: string - old_dates: - $ref: "#/components/schemas/StoryResponseDates" - old_enum_value: - $ref: "#/components/schemas/EnumOption" - description: "*Conditional*" - readOnly: true - old_name: - description: "*Conditional*'" - example: This was the Old Name - type: string - old_number_value: - description: "*Conditional*" - example: 1 - readOnly: true - type: integer - old_resource_subtype: - description: "*Conditional*" - example: default_task - readOnly: true - type: string - old_section: - $ref: "#/components/schemas/SectionCompact" - description: "*Conditional*" - readOnly: true - old_text_value: - description: "*Conditional*" - example: This was the Old Text - readOnly: true - type: string - previews: - description: |- - *Conditional*. A collection of previews to be displayed in the story. - - *Note: This property only exists for comment stories.* - items: - $ref: "#/components/schemas/Preview" - readOnly: true - type: array - project: - $ref: "#/components/schemas/ProjectCompact" - description: "*Conditional*" - readOnly: true - source: - description: The component of the Asana product the user used to trigger the story. - enum: - - web - - email - - mobile - - api - - unknown - example: web - readOnly: true - type: string - story: - $ref: "#/components/schemas/StoryCompact" - description: "*Conditional*" - readOnly: true - tag: - $ref: "#/components/schemas/TagCompact" - description: "*Conditional*" - readOnly: true - target: - description: The object this story is associated with. Currently may only be a task. - properties: - gid: - description: The gid of the object this story is associated with. - example: "1234" - type: string - name: - description: The name of the object this story is associated with. - example: Bug Task - type: string - readOnly: true - task: - $ref: "#/components/schemas/TaskCompact" - description: "*Conditional*" - readOnly: true - type: object - StoryResponseDates: - description: "*Conditional*" - properties: - due_at: - description: Date and time representing activity occurance - example: 2019-09-15T02:06:58.158Z - format: date-time - type: string - due_on: - description: Date representing activity occurance - example: 2019-09-15 - format: date - type: string - start_on: - description: Date representing activity start - example: 2019-09-14 - format: date - type: string - readOnly: true - type: object - TagBase: - allOf: - - $ref: "#/components/schemas/TagCompact" - - properties: - color: - description: Color of the tag. - enum: - - dark-pink - - dark-green - - dark-blue - - dark-red - - dark-teal - - dark-brown - - dark-orange - - dark-purple - - dark-warm-gray - - light-pink - - light-green - - light-blue - - light-red - - light-teal - - light-brown - - light-orange - - light-purple - - light-warm-gray - example: light-green - type: string - type: object - TagCompact: - description: A tag is a label that can be attached to any task in Asana. - allOf: - - $ref: "#/components/schemas/AsanaResource" - - description: A *tag* is a label that can be attached to any task in Asana. It exists in a single workspace or organization. - properties: - name: - description: Name of the tag. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer. - example: Stuff to buy - type: string - type: object - x-docs-overrides: - properties.resource_type.example: tag - TagRequest: - allOf: - - $ref: "#/components/schemas/TagBase" - - properties: - followers: - description: An array of strings identifying users. These can either be the string "me", an email, or the gid of a user. - example: - - "12345" - - "42563" - items: - type: string - type: array - workspace: - description: Gid of an object. - example: "12345" - type: string - x-env-variable: true - type: object - TagResponse: - allOf: - - $ref: "#/components/schemas/TagBase" - - properties: - followers: - description: Array of users following this tag. - items: - $ref: "#/components/schemas/UserCompact" - readOnly: true - type: array - permalink_url: - description: A url that points directly to the object within Asana. - example: https://app.asana.com/0/resource/123456789/list - readOnly: true - type: string - workspace: - $ref: "#/components/schemas/WorkspaceCompact" - type: object - TaskAddFollowersRequest: - properties: - followers: - description: An array of strings identifying users. These can either be the string "me", an email, or the gid of a user. - example: - - "13579" - - "321654" - items: - type: string - type: array - required: - - followers - type: object - TaskAddProjectRequest: - properties: - insert_after: - description: A task in the project to insert the task after, or `null` to insert at the beginning of the list. - example: "124816" - nullable: true - type: string - insert_before: - description: A task in the project to insert the task before, or `null` to insert at the end of the list. - example: "432134" - nullable: true - type: string - project: - description: The project to add the task to. - example: "13579" - type: string - section: - description: A section in the project to insert the task into. The task will be inserted at the bottom of the section. - example: "987654" - nullable: true - type: string - required: - - project - type: object - TaskAddTagRequest: - properties: - tag: - description: The tag to add to the task. - example: "13579" - type: string - required: - - tag - type: object - TaskBase: - allOf: - - $ref: "#/components/schemas/TaskCompact" - - properties: - approval_status: - description: "*Conditional* Reflects the approval status of this task. This field is kept in sync with `completed`, meaning `pending` translates to false while `approved`, `rejected`, and `changes_requested` translate to true. If you set completed to true, this field will be set to `approved`." - enum: - - pending - - approved - - rejected - - changes_requested - example: pending - type: string - assignee_status: - description: '*Deprecated* Scheduling status of this task for the user it is assigned to. This field can only be set if the assignee is non-null. Setting this field to "inbox" or "upcoming" inserts it at the top of the section, while the other options will insert at the bottom.' - enum: - - today - - upcoming - - later - - new - - inbox - example: upcoming - type: string - completed: - description: True if the task is currently marked complete, false if not. - example: false - type: boolean - completed_at: - description: The time at which this task was completed, or null if the task is incomplete. - example: 2012-02-22T02:06:58.147Z - format: date-time - nullable: true - readOnly: true - type: string - completed_by: - $ref: "#/components/schemas/UserCompact" - readOnly: true - created_at: - description: The time at which this resource was created. - example: 2012-02-22T02:06:58.147Z - format: date-time - readOnly: true - type: string - dependencies: - description: "[Opt In](/docs/input-output-options). Array of resources referencing tasks that this task depends on. The objects contain only the gid of the dependency." - items: - $ref: "#/components/schemas/AsanaResource" - readOnly: true - type: array - dependents: - description: "[Opt In](/docs/input-output-options). Array of resources referencing tasks that depend on this task. The objects contain only the ID of the dependent." - items: - $ref: "#/components/schemas/AsanaResource" - readOnly: true - type: array - due_at: - description: The UTC date and time on which this task is due, or null if the task has no due time. This takes an ISO 8601 date string in UTC and should not be used together with `due_on`. - example: 2019-09-15T02:06:58.147Z - format: date - nullable: true - type: string - due_on: - description: The localized date on which this task is due, or null if the task has no due date. This takes a date with `YYYY-MM-DD` format and should not be used together with due_at. - example: 2019-09-15 - format: date - nullable: true - type: string - external: - description: |- - *OAuth Required*. *Conditional*. This field is returned only if external values are set or included by using [Opt In] (/docs/input-output-options). - The external field allows you to store app-specific metadata on tasks, including a gid that can be used to retrieve tasks and a data blob that can store app-specific character strings. Note that you will need to authenticate with Oauth to access or modify this data. Once an external gid is set, you can use the notation `external:custom_gid` to reference your object anywhere in the API where you may use the original object gid. See the page on Custom External Data for more details. - example: - data: A blob of information - gid: my_gid - properties: - data: - description: The data of external field allows you to store app-specific metadata on tasks. - example: A blob of information. - type: string - gid: - description: Globally unique identifier of the resource, as a string. - example: "1234" - type: string - type: object - hearted: - description: "*Deprecated - please use liked instead* True if the task is hearted by the authorized user, false if not." - example: true - readOnly: true - type: boolean - hearts: - description: "*Deprecated - please use likes instead* Array of likes for users who have hearted this task." - items: - $ref: "#/components/schemas/Like" - readOnly: true - type: array - html_notes: - description: "[Opt In](/docs/input-output-options). The notes of the text with formatting as HTML." - example: Mittens really likes the stuff from Humboldt. - type: string - is_rendered_as_separator: - description: "[Opt In](/docs/input-output-options). In some contexts tasks can be rendered as a visual separator; for instance, subtasks can appear similar to [sections](/docs/asana-sections) without being true `section` objects. If a `task` object is rendered this way in any context it will have the property `is_rendered_as_separator` set to `true`." - example: false - readOnly: true - type: boolean - liked: - description: True if the task is liked by the authorized user, false if not. - example: true - type: boolean - likes: - description: Array of likes for users who have liked this task. - items: - $ref: "#/components/schemas/Like" - readOnly: true - type: array - memberships: - description: "*Create-only*. Array of projects this task is associated with and the section it is in. At task creation time, this array can be used to add the task to specific sections. After task creation, these associations can be modified using the `addProject` and `removeProject` endpoints. Note that over time, more types of memberships may be added to this property." - items: - properties: - project: - $ref: "#/components/schemas/ProjectCompact" - section: - $ref: "#/components/schemas/SectionCompact" - type: object - readOnly: true - type: array - modified_at: - description: |- - The time at which this task was last modified. - - *Note: This does not currently reflect any changes in - associations such as projects or comments that may have been - added or removed from the task.* - example: 2012-02-22T02:06:58.147Z - format: date-time - readOnly: true - type: string - name: - description: Name of the task. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer. - example: Buy catnip - type: string - notes: - description: More detailed, free-form textual information associated with the task. - example: Mittens really likes the stuff from Humboldt. - type: string - num_hearts: - description: "*Deprecated - please use likes instead* The number of users who have hearted this task." - example: 5 - readOnly: true - type: integer - num_likes: - description: The number of users who have liked this task. - example: 5 - readOnly: true - type: integer - num_subtasks: - description: | - [Opt In](/docs/input-output-options). The number of subtasks on this task. - example: 3 - readOnly: true - type: integer - resource_subtype: - description: |- - The subtype of this resource. Different subtypes retain many of the same fields and behavior, but may render differently in Asana or represent resources with different semantic meaning. - The resource_subtype `milestone` represent a single moment in time. This means tasks with this subtype cannot have a start_date. - enum: - - default_task - - milestone - - section - - approval - example: default_task - type: string - start_at: - description: |- - Date and time on which work begins for the task, or null if the task has no start time. This takes a UTC timestamp format. - *Note: `due_at` must be present in the request when setting or unsetting the `start_at` parameter.* - example: 2019-09-14T02:06:58.147Z - format: date - nullable: true - type: string - start_on: - description: |- - The day on which work begins for the task , or null if the task has no start date. This takes a date with `YYYY-MM-DD` format. - *Note: `due_on` or `due_at` must be present in the request when setting or unsetting the `start_on` parameter.* - example: 2019-09-14 - format: date - nullable: true - type: string - type: object - TaskCompact: - description: The *task* is the basic object around which many operations in Asana are centered. - nullable: true - allOf: - - $ref: "#/components/schemas/AsanaResource" - - description: The *task* is the basic object around which many operations in Asana are centered. - properties: - name: - description: The name of the task. - example: Bug Task - type: string - type: object - x-docs-overrides: - properties.resource_type.example: task - TaskCountResponse: - description: A response object returned from the task count endpoint. - properties: - num_completed_milestones: - description: The number of completed milestones in a project. - example: 3 - type: integer - num_completed_tasks: - description: The number of completed tasks in a project. - example: 150 - type: integer - num_incomplete_milestones: - description: The number of incomplete milestones in a project. - example: 7 - type: integer - num_incomplete_tasks: - description: The number of incomplete tasks in a project. - example: 50 - type: integer - num_milestones: - description: The number of milestones in a project. - example: 10 - type: integer - num_tasks: - description: The number of tasks in a project. - example: 200 - type: integer - type: object - TaskDuplicateRequest: - properties: - include: - description: The fields that will be duplicated to the new task. - enum: - - notes - - assignee - - subtasks - - attachments - - tags - - followers - - projects - - dates - - dependencies - - parent - example: - - notes - - assignee - type: string - name: - description: The name of the new task. - example: New Task Name - type: string - type: object - TaskRemoveFollowersRequest: - properties: - followers: - description: An array of strings identifying users. These can either be the string "me", an email, or the gid of a user. - example: - - "13579" - - "321654" - items: - type: string - type: array - required: - - followers - type: object - TaskRemoveProjectRequest: - properties: - project: - description: The project to remove the task from. - example: "13579" - type: string - required: - - project - type: object - TaskRemoveTagRequest: - properties: - tag: - description: The tag to remove from the task. - example: "13579" - type: string - required: - - tag - type: object - TaskRequest: - allOf: - - $ref: "#/components/schemas/TaskBase" - - properties: - assignee: - description: Gid of a user. - example: "12345" - nullable: true - readOnly: false - type: string - x-env-variable: true - custom_fields: - additionalProperties: - description: '"{custom_field_gid}" => Value (Can be text, number, etc.)' - type: string - description: An object where each key is a Custom Field gid and each value is an enum gid, string, or number. - example: - "4578152156": Not Started - "5678904321": On Hold - type: object - followers: - description: '*Create-Only* An array of strings identifying users. These can either be the string "me", an email, or the gid of a user. In order to change followers on an existing task use `addFollowers` and `removeFollowers`.' - example: - - "12345" - items: - description: Gid of a user. - type: string - type: array - parent: - description: Gid of a task. - example: "12345" - nullable: true - readOnly: false - type: string - x-env-variable: true - projects: - description: "*Create-Only* Array of project gids. In order to change projects on an existing task use `addProject` and `removeProject`." - example: - - "12345" - items: - description: Gid of a project. - type: string - type: array - tags: - description: "*Create-Only* Array of tag gids. In order to change tags on an existing task use `addTag` and `removeTag`." - example: - - "12345" - items: - description: Gid of a tag. - type: string - type: array - workspace: - description: Gid of a workspace. - example: "12345" - readOnly: false - type: string - x-env-variable: true - type: object - TaskResponse: - allOf: - - $ref: "#/components/schemas/TaskBase" - - properties: - assignee: - description: Users assigned to the task. - $ref: "#/components/schemas/UserCompact" - custom_fields: - description: Array of custom field values applied to the task. These represent the custom field values recorded on this project for a particular custom field. For example, these custom field values will contain an `enum_value` property for custom fields of type enum, a `text_value` property for custom fields of type text, and so on. Please note that the `gid` returned on each custom field value *is identical* to the `gid` of the custom field, which allows referencing the custom field metadata through the `/custom_fields/custom_field-gid` endpoint. - items: - $ref: "#/components/schemas/CustomFieldResponse" - readOnly: true - type: array - followers: - description: Array of users following this task. - items: - $ref: "#/components/schemas/UserCompact" - readOnly: true - type: array - parent: - $ref: "#/components/schemas/TaskCompact" - description: The parent of this task, or `null` if this is not a subtask. This property cannot be modified using a PUT request but you can change it with the `setParent` endpoint. You can create subtasks by using the subtasks endpoint. - readOnly: true - permalink_url: - description: A url that points directly to the object within Asana. - example: https://app.asana.com/0/resource/123456789/list - readOnly: true - type: string - projects: - description: "*Create-only.* Array of projects this task is associated with. At task creation time, this array can be used to add the task to many projects at once. After task creation, these associations can be modified using the addProject and removeProject endpoints." - items: - $ref: "#/components/schemas/ProjectCompact" - readOnly: true - type: array - tags: - description: Array of tags associated with this task. In order to change tags on an existing task use `addTag` and `removeTag`. - example: - - gid: "59746" - name: Grade A - items: - $ref: "#/components/schemas/TagCompact" - readOnly: true - type: array - workspace: - $ref: "#/components/schemas/WorkspaceCompact" - description: "*Create-only*. The workspace this task is associated with. Once created, task cannot be moved to a different workspace. This attribute can only be specified at creation time." - readOnly: true - type: object - TaskSetParentRequest: - properties: - insert_after: - description: A subtask of the parent to insert the task after, or `null` to insert at the beginning of the list. - example: "null" - type: string - insert_before: - description: A subtask of the parent to insert the task before, or `null` to insert at the end of the list. - example: "124816" - type: string - parent: - description: The new parent of the task, or `null` for no parent. - example: "987654" - type: string - required: - - parent - type: object - TeamAddUserRequest: - description: A user identification object for specification with the addUser/removeUser endpoints. - properties: - user: - description: A string identifying a user. This can either be the string "me", an email, or the gid of a user. - example: "12345" - type: string - type: object - TeamBase: - $ref: "#/components/schemas/TeamCompact" - TeamCompact: - description: A *team* is used to group related projects and people together within an organization. - allOf: - - $ref: "#/components/schemas/AsanaResource" - - description: A *team* is used to group related projects and people together within an organization. Each project in an organization is associated with a team. - properties: - name: - description: The name of the team. - example: Marketing - type: string - type: object - x-docs-overrides: - properties.resource_type.example: team - TeamMembershipBase: - $ref: "#/components/schemas/TeamMembershipCompact" - TeamMembershipCompact: - allOf: - - $ref: "#/components/schemas/AsanaResource" - - description: This object represents a user's connection to a team. - properties: - is_guest: - description: Describes if the user is a guest in the team. - example: false - type: boolean - team: - $ref: "#/components/schemas/TeamCompact" - user: - $ref: "#/components/schemas/UserCompact" - type: object - x-docs-overrides: - properties.resource_type.example: team_membership - TeamMembershipResponse: - $ref: "#/components/schemas/TeamMembershipBase" - TeamRemoveUserRequest: - description: A user identification object for specification with the addUser/removeUser endpoints. - properties: - user: - description: A string identifying a user. This can either be the string "me", an email, or the gid of a user. - example: "12345" - type: string - type: object - TeamRequest: - allOf: - - $ref: "#/components/schemas/TeamBase" - - properties: - description: - description: | - The description of the team. - example: All developers should be members of this team. - type: string - html_description: - description: | - The description of the team with formatting as HTML. - example: All developers should be members of this team. - type: string - organization: - description: | - The organization/workspace the team belongs to. - example: "123456789" - type: string - type: object - TeamResponse: - allOf: - - $ref: "#/components/schemas/TeamBase" - - properties: - description: - description: | - [Opt In](/docs/input-output-options). The description of the team. - example: All developers should be members of this team. - type: string - html_description: - description: | - [Opt In](/docs/input-output-options). The description of the team with formatting as HTML. - example: All developers should be members of this team. - type: string - organization: - $ref: "#/components/schemas/WorkspaceCompact" - description: | - The organization/workspace the team belongs to. - permalink_url: - description: A url that points directly to the object within Asana. - example: https://app.asana.com/0/resource/123456789/list - readOnly: true - type: string - type: object - UserCompact: - description: The owner of the user task list, i.e. the person whose My Tasks is represented by this resource. - nullable: true - allOf: - - $ref: "#/components/schemas/AsanaResource" - - description: A *user* object represents an account in Asana that can be given access to various workspaces, projects, and tasks. - properties: - name: - description: "*Read-only except when same user as requester*. The user’s name." - example: Greg Sanchez - type: string - type: object - x-docs-overrides: - properties.resource_type.example: user - UserRequest: - $ref: "#/components/schemas/UserCompact" - UserResponse: - allOf: - - $ref: "#/components/schemas/UserCompact" - - properties: - email: - description: The user's email address. - example: gsanchez@example.com - format: email - readOnly: true - type: string - photo: - description: A map of the user’s profile photo in various sizes, or null if no photo is set. Sizes provided are 21, 27, 36, 60, and 128. Images are in PNG format. - example: - image_128x128: https://... - image_21x21: https://... - image_27x27: https://... - image_36x36: https://... - image_60x60: https://... - nullable: true - properties: - image_128x128: - description: User profile image of size 128x128 - format: uri - type: string - image_21x21: - description: User profile image of size 21x21 - format: uri - type: string - image_27x27: - description: User profile image of size 27x27 - format: uri - type: string - image_36x36: - description: User profile image of size 36x36 - format: uri - type: string - image_60x60: - description: User profile image of size 60x60 - format: uri - type: string - readOnly: true - type: object - workspaces: - description: |- - Workspaces and organizations this user may access. - Note\: The API will only return workspaces and organizations that also contain the authenticated user. - items: - $ref: "#/components/schemas/WorkspaceCompact" - readOnly: true - type: array - type: object - UserTaskListBase: - $ref: "#/components/schemas/UserTaskListCompact" - UserTaskListCompact: - allOf: - - $ref: "#/components/schemas/AsanaResource" - - description: A user task list represents the tasks assigned to a particular user. It provides API access to a user’s “My Tasks” view in Asana. - properties: - name: - description: The name of the user task list. - example: My Tasks in My Workspace - type: string - owner: - $ref: "#/components/schemas/UserCompact" - description: The owner of the user task list, i.e. the person whose My Tasks is represented by this resource. - readOnly: true - workspace: - $ref: "#/components/schemas/WorkspaceCompact" - description: The workspace in which the user task list is located. - readOnly: true - type: object - x-docs-overrides: - properties.resource_type.example: user_task_list - UserTaskListRequest: - $ref: "#/components/schemas/UserTaskListBase" - UserTaskListResponse: - $ref: "#/components/schemas/UserTaskListBase" - WebhookCompact: - allOf: - - $ref: "#/components/schemas/AsanaResource" - - description: Webhook objects represent the state of an active subscription for a server to be updated with information from Asana. This schema represents the subscription itself, not the objects that are sent to the server. For information on those please refer to the [Event](/docs/tocS_Event) schema. - properties: - active: - description: If true, the webhook will send events - if false it is considered inactive and will not generate events. - example: false - readOnly: true - type: boolean - resource: - $ref: "#/components/schemas/AsanaNamedResource" - target: - description: The URL to receive the HTTP POST. - example: https://example.com/receive-webhook/7654 - format: uri - readOnly: true - type: string - type: object - x-docs-overrides: - properties.resource_type.example: webhook - WebhookFilter: - description: A WebhookFilter can be passed on creation of a webhook in order to filter the types of actions that trigger delivery of an [Event](/docs/tocS_Event) - properties: - action: - description: The type of change on the **resource** to pass through the filter. For more information refer to `Event.action` in the [Event](/docs/tocS_Event) schema. This can be one of `changed`, `added`, `removed`, `deleted`, and `undeleted` depending on the nature of what has occurred on the resource. - example: changed - type: string - fields: - description: "*Conditional.* A whitelist of fields for events which will pass the filter when the resource is changed. These can be any combination of the fields on the resources themselves. This field is only valid for `action` of type 'changed'" - example: - - due_at - - due_on - - dependencies - items: - type: string - type: array - resource_subtype: - description: The resource subtype of the resource that the filter applies to. This should be set to the same value as is returned on the `resource_subtype` field on the resources themselves. - example: milestone - type: string - resource_type: - description: The type of the resource which created the event when modified; for example, to filter to changes on regular tasks this field should be set to `task`. - example: task - type: string - type: object - WebhookRequest: - properties: - filters: - description: An array of WebhookFilter objects to specify a whitelist of filters to apply to events from this webhook. If a webhook event passes any of the filters the event will be delivered; otherwise no event will be sent to the receiving server. - items: - $ref: "#/components/schemas/WebhookFilter" - description: A set of filters to specify a whitelist for what types of events will be delivered. - type: array - resource: - description: A resource ID to subscribe to. Many Asana resources are valid to create webhooks on, but higher-level resources require filters. - example: "12345" - type: string - target: - description: The URL to receive the HTTP POST. The full URL will be used to deliver events from this webhook (including parameters) which allows encoding of application-specific state when the webhook is created. - example: https://example.com/receive-webhook/7654?app_specific_param=app_specific_value - format: uri - type: string - required: - - resource - - target - type: object - WebhookResponse: - allOf: - - $ref: "#/components/schemas/WebhookCompact" - - properties: - created_at: - description: The time at which this resource was created. - example: 2012-02-22T02:06:58.147Z - format: date-time - readOnly: true - type: string - filters: - description: Whitelist of filters to apply to events from this webhook. If a webhook event passes any of the filters the event will be delivered; otherwise no event will be sent to the receiving server. - items: - $ref: "#/components/schemas/WebhookFilter" - description: A set of filters to specify a whitelist for what types of events will be delivered. - type: array - last_failure_at: - description: The timestamp when the webhook last received an error when sending an event to the target. - example: 2012-02-22T02:06:58.147Z - format: date-time - readOnly: true - type: string - last_failure_content: - description: The contents of the last error response sent to the webhook when attempting to deliver events to the target. - example: 500 Server Error\n\nCould not complete the request - readOnly: true - type: string - last_success_at: - description: The timestamp when the webhook last successfully sent an event to the target. - example: 2012-02-22T02:06:58.147Z - format: date-time - readOnly: true - type: string - type: object - WorkspaceAddUserRequest: - description: A user identification object for specification with the addUser/removeUser endpoints. - properties: - user: - description: A string identifying a user. This can either be the string "me", an email, or the gid of a user. - example: "12345" - type: string - type: object - WorkspaceBase: - $ref: "#/components/schemas/WorkspaceCompact" - WorkspaceCompact: - description: The workspace in which the user task list is located. - allOf: - - $ref: "#/components/schemas/AsanaResource" - - description: A *workspace* is the highest-level organizational unit in Asana. All projects and tasks have an associated workspace. - properties: - name: - description: The name of the workspace. - example: My Company Workspace - type: string - type: object - x-docs-overrides: - properties.resource_type.example: workspace - WorkspaceMembershipBase: - $ref: "#/components/schemas/WorkspaceMembershipCompact" - WorkspaceMembershipCompact: - allOf: - - $ref: "#/components/schemas/AsanaResource" - - description: This object determines if a user is a member of a workspace. - properties: - user: - description: A user object represents an account in Asana that can be given access to various workspaces, projects, and tasks. - $ref: "#/components/schemas/UserCompact" - workspace: - description: A workspace is the highest-level organizational unit in Asana. All projects and tasks have an associated workspace. - $ref: "#/components/schemas/WorkspaceCompact" - type: object - x-docs-overrides: - properties.resource_type.example: workspace_membership - WorkspaceMembershipRequest: - $ref: "#/components/schemas/WorkspaceMembershipBase" - WorkspaceMembershipResponse: - allOf: - - $ref: "#/components/schemas/WorkspaceMembershipBase" - - properties: - is_active: - description: Reflects if this user still a member of the workspace. - readOnly: true - type: boolean - is_admin: - description: Reflects if this user is an admin of the workspace. - readOnly: true - type: boolean - is_guest: - description: Reflects if this user is a guest of the workspace. - readOnly: true - type: boolean - user_task_list: - $ref: "#/components/schemas/UserTaskListResponse" - description: The user's "My Tasks" in the workspace. - readOnly: true - type: object - WorkspaceRemoveUserRequest: - description: A user identification object for specification with the addUser/removeUser endpoints. - properties: - user: - description: A string identifying a user. This can either be the string "me", an email, or the gid of a user. - example: "12345" - type: string - type: object - WorkspaceRequest: - $ref: "#/components/schemas/WorkspaceBase" - WorkspaceResponse: - allOf: - - $ref: "#/components/schemas/WorkspaceBase" - - properties: - email_domains: - description: The email domains that are associated with this workspace. - example: - - asana.com - items: - format: uri - type: string - type: array - is_organization: - description: Whether the workspace is an *organization*. - example: false - type: boolean - type: object - securitySchemes: - oauth2: - description: |- - We require that applications designed to access the Asana API on behalf of multiple users implement OAuth 2.0. - Asana supports the Authorization Code Grant flow. - flows: - authorizationCode: - authorizationUrl: https://app.asana.com/-/oauth_authorize - refreshUrl: https://app.asana.com/-/oauth_token - scopes: - default: Provides access to all endpoints documented in our API reference. If no scopes are requested, this scope is assumed by default. - email: Provides access to the user’s email through the OpenID Connect user info endpoint. - openid: Provides access to OpenID Connect ID tokens and the OpenID Connect user info endpoint. - profile: Provides access to the user’s name and profile photo through the OpenID Connect user info endpoint. - tokenUrl: https://app.asana.com/-/oauth_token - type: oauth2 - personalAccessToken: - description: A personal access token allows access to the api for the user who created it. This should be kept a secret and be treated like a password. - scheme: bearer - type: http \ No newline at end of file diff --git a/openapi/asana/types.bal b/openapi/asana/types.bal deleted file mode 100644 index d093e4505..000000000 --- a/openapi/asana/types.bal +++ /dev/null @@ -1,1758 +0,0 @@ -// Copyright (c) 2022 WSO2 LLC. (http://www.wso2.org) All Rights Reserved. -// -// WSO2 Inc. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/http; - -# Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint. -@display {label: "Connection Config"} -public type ConnectionConfig record {| - # Configurations related to client authentication - http:BearerTokenConfig|OAuth2RefreshTokenGrantConfig auth; - # The HTTP version understood by the client - http:HttpVersion httpVersion = http:HTTP_2_0; - # Configurations related to HTTP/1.x protocol - ClientHttp1Settings http1Settings?; - # Configurations related to HTTP/2 protocol - http:ClientHttp2Settings http2Settings?; - # The maximum time to wait (in seconds) for a response before closing the connection - decimal timeout = 60; - # The choice of setting `forwarded`/`x-forwarded` header - string forwarded = "disable"; - # Configurations associated with request pooling - http:PoolConfiguration poolConfig?; - # HTTP caching related configurations - http:CacheConfig cache?; - # Specifies the way of handling compression (`accept-encoding`) header - http:Compression compression = http:COMPRESSION_AUTO; - # Configurations associated with the behaviour of the Circuit Breaker - http:CircuitBreakerConfig circuitBreaker?; - # Configurations associated with retrying - http:RetryConfig retryConfig?; - # Configurations associated with inbound response size limits - http:ResponseLimitConfigs responseLimits?; - # SSL/TLS-related options - http:ClientSecureSocket secureSocket?; - # Proxy server related options - http:ProxyConfig proxy?; - # Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default - boolean validation = true; -|}; - -# Provides settings related to HTTP/1.x protocol. -public type ClientHttp1Settings record {| - # Specifies whether to reuse a connection for multiple requests - http:KeepAlive keepAlive = http:KEEPALIVE_AUTO; - # The chunking behaviour of the request - http:Chunking chunking = http:CHUNKING_AUTO; - # Proxy server related options - ProxyConfig proxy?; -|}; - -# Proxy server configurations to be used with the HTTP client endpoint. -public type ProxyConfig record {| - # Host name of the proxy server - string host = ""; - # Proxy server port - int port = 0; - # Proxy server username - string userName = ""; - # Proxy server password - @display {label: "", kind: "password"} - string password = ""; -|}; - -# OAuth2 Refresh Token Grant Configs -public type OAuth2RefreshTokenGrantConfig record {| - *http:OAuth2RefreshTokenGrantConfig; - # Refresh URL - string refreshUrl = "https://app.asana.com/-/oauth_token"; -|}; - -public type PortfolioMembershipResponse PortfolioMembershipBase; - -public type CustomFieldsCustomFieldGidBody record { - CustomFieldRequest data?; -}; - -# A response object returned from a batch request. -public type BatchResponse record { - # The JSON body that the invoked endpoint returned. - record {} body?; - # A map of HTTP headers specific to this result. This is primarily used for returning a `Location` header to accompany a `201 Created` result. The parent HTTP response will contain all common headers. - record {} headers?; - # The HTTP status code that the invoked endpoint returned. - int status_code?; -}; - -public type ProjectStatusRequest ProjectStatusBase; - -public type TeamRequest record { - *TeamBase; - # The description of the team. - string description?; - # The description of the team with formatting as HTML. - string html_description?; - # The organization/workspace the team belongs to. - string organization?; -}; - -public type SectionTaskInsertRequest record { - # An existing task within this section after which the added task should be inserted. Cannot be provided together with insert_before. - string insert_after?; - # An existing task within this section before which the added task should be inserted. Cannot be provided together with insert_after. - string insert_before?; - # The task to add to this section. - string task; -}; - -public type ProjectMembershipBase ProjectMembershipCompact; - -public type CustomFieldSettingBase CustomFieldSettingCompact; - -public type PortfolioResponse record { - *PortfolioBase; - # The time at which this resource was created. - string created_at?; - # The owner of the user task list, i.e. the person whose My Tasks is represented by this resource. - UserCompact? created_by?; - # Array of custom field settings applied to the portfolio. - CustomFieldSettingResponse[] custom_field_settings?; - # The localized day on which this portfolio is due. This takes a date with format YYYY-MM-DD. - string? due_on?; - UserCompact[] members?; - # The owner of the user task list, i.e. the person whose My Tasks is represented by this resource. - UserCompact? owner?; - # A url that points directly to the object within Asana. - string permalink_url?; - # The day on which work for this portfolio begins, or null if the portfolio has no start date. This takes a date with `YYYY-MM-DD` format. *Note: `due_on` must be present in the request when setting or unsetting the `start_on` parameter. Additionally, start_on and due_on cannot be the same date.* - string? start_on?; - # The workspace in which the user task list is located. - WorkspaceCompact workspace?; -}; - -public type ProjectGidSectionsBody record { - SectionRequest data?; -}; - -public type ProjectGidRemovefollowersBody record { - RemoveFollowersRequest data?; -}; - -public type StoryBase record { - *AsanaResource; - # The time at which this resource was created. - string created_at?; - # [Opt In](/docs/input-output-options). HTML formatted text for a comment. This will not include the name of the creator. - string html_text?; - # *Conditional*. Whether the story should be pinned on the resource. - boolean is_pinned?; - # The subtype of this resource. Different subtypes retain many of the same fields and behavior, but may render differently in Asana or represent resources with different semantic meaning. - string resource_subtype?; - # The name of the sticker in this story. `null` if there is no sticker. - string sticker_name?; - # The plain text of the comment to add. Cannot be used with html_text. - string text?; -}; - -public type WebhookRequest record { - # An array of WebhookFilter objects to specify a whitelist of filters to apply to events from this webhook. If a webhook event passes any of the filters the event will be delivered; otherwise no event will be sent to the receiving server. - WebhookFilter[] filters?; - # A resource ID to subscribe to. Many Asana resources are valid to create webhooks on, but higher-level resources require filters. - string 'resource; - # The URL to receive the HTTP POST. The full URL will be used to deliver events from this webhook (including parameters) which allows encoding of application-specific state when the webhook is created. - string target; -}; - -public type TaskAddTagRequest record { - # The tag to add to the task. - string tag; -}; - -# A request object for use in a batch request. -public type BatchRequest record { - # Batch request actions - BatchRequestAction[] actions?; -}; - -public type PortfolioGidAddmembersBody record { - AddMembersRequest data?; -}; - -public type CustomFieldSettingCompact record { - *AsanaResource; -}; - -public type TagResponse record { - *TagBase; - # Array of users following this tag. - UserCompact[] followers?; - # A url that points directly to the object within Asana. - string permalink_url?; - # The workspace in which the user task list is located. - WorkspaceCompact workspace?; -}; - -public type TeamGidRemoveuserBody record { - # A user identification object for specification with the addUser/removeUser endpoints. - TeamRemoveUserRequest data?; -}; - -public type TaskAddProjectRequest record { - # A task in the project to insert the task after, or `null` to insert at the beginning of the list. - string? insert_after?; - # A task in the project to insert the task before, or `null` to insert at the end of the list. - string? insert_before?; - # The project to add the task to. - string project; - # A section in the project to insert the task into. The task will be inserted at the bottom of the section. - string? section?; -}; - -public type WebhookResponse record { - *WebhookCompact; - # The time at which this resource was created. - string created_at?; - # Whitelist of filters to apply to events from this webhook. If a webhook event passes any of the filters the event will be delivered; otherwise no event will be sent to the receiving server. - WebhookFilter[] filters?; - # The timestamp when the webhook last received an error when sending an event to the target. - string last_failure_at?; - # The contents of the last error response sent to the webhook when attempting to deliver events to the target. - string last_failure_content?; - # The timestamp when the webhook last successfully sent an event to the target. - string last_success_at?; -}; - -public type TagsBody record { - TagRequest data?; -}; - -public type AddCustomFieldSettingRequest record { - # The custom field to associate with this container. - string custom_field; - # A gid of a Custom Field Setting on this container, after which the new Custom Field Setting will be added. `insert_before` and `insert_after` parameters cannot both be specified. - string insert_after?; - # A gid of a Custom Field Setting on this container, before which the new Custom Field Setting will be added. `insert_before` and `insert_after` parameters cannot both be specified. - string insert_before?; - # Whether this field should be considered important to this container (for instance, to display in the list view of items in the container). - boolean is_important?; -}; - -public type ProjectBase record { - *ProjectCompact; - # True if the project is archived, false if not. Archived projects do not show in the UI by default and may be treated differently for queries. - boolean archived?; - # Color of the project. - string? color?; - # The time at which this resource was created. - string created_at?; - ProjectStatusResponse? current_status?; - # Array of Custom Field Settings (in compact form). - CustomFieldSettingCompact[] custom_field_settings?; - # The default view (list, board, calendar, or timeline) of a project. - string default_view?; - # *Deprecated: new integrations should prefer the due_on field.* - string? due_date?; - # The day on which this project is due. This takes a date with format YYYY-MM-DD. - string? due_on?; - # [Opt In](/docs/input-output-options). The notes of the project with formatting as HTML. - string html_notes?; - # [Opt In](/docs/input-output-options). Determines if the project is a template. - boolean is_template?; - # Array of users who are members of this project. - UserCompact[] members?; - # The time at which this project was last modified. - # *Note: This does not currently reflect any changes in associations such as tasks or comments that may have been added or removed from the project.* - string modified_at?; - # More detailed, free-form textual information associated with the project. - string notes?; - # True if the project is public to the organization. If false, do not share this project with other users in this organization without explicitly checking to see if they have access. - boolean 'public?; - # The day on which work for this project begins, or null if the project has no start date. This takes a date with `YYYY-MM-DD` format. *Note: `due_on` or `due_at` must be present in the request when setting or unsetting the `start_on` parameter. Additionally, start_on and due_on cannot be the same date.* - string? start_on?; - # The workspace in which the user task list is located. - WorkspaceCompact workspace?; -}; - -public type CustomFieldResponse record { - *CustomFieldBase; - # The owner of the user task list, i.e. the person whose My Tasks is represented by this resource. - UserCompact? created_by?; - # Enum options are the possible values which an enum custom field can adopt. - EnumOption enum_value?; -}; - -# A map of the user’s profile photo in various sizes, or null if no photo is set. Sizes provided are 21, 27, 36, 60, and 128. Images are in PNG format. -public type UserresponsePhoto record { - # User profile image of size 128x128 - string image_128x128?; - # User profile image of size 21x21 - string image_21x21?; - # User profile image of size 27x27 - string image_27x27?; - # User profile image of size 36x36 - string image_36x36?; - # User profile image of size 60x60 - string image_60x60?; -}; - -# Custom Fields store the metadata that is used in order to add user-specified information to tasks in Asana. Be sure to reference the [Custom Fields](/docs/asana-custom-fields) developer documentation for more information about how custom fields relate to various resources in Asana. -public type CustomFieldCompact record { - *AsanaResource; - # A string representation for the value of the custom field. Integrations that don't require the underlying type should use this field to read values. Using this field will future-proof an app against new custom field types. - string display_value?; - # *Conditional*. Determines if the custom field is enabled or not. - boolean enabled?; - # *Conditional*. Only relevant for custom fields of type enum. This array specifies the possible values which an `enum` custom field can adopt. To modify the enum options, refer to [working with enum options](/docs/create-an-enum-option). - EnumOption[] enum_options?; - # The name of the custom field. - string name?; - # *Conditional*. This number is the value of a number custom field. - decimal number_value?; - # The type of the custom field. Must be one of the given values. - string resource_subtype?; - # *Conditional*. This string is the value of a text custom field. - string text_value?; - # *Deprecated: new integrations should prefer the resource_subtype field.* The type of the custom field. Must be one of the given values. - string 'type?; -}; - -public type JobCompact record { - *AsanaResource; - # A *project* represents a prioritized list of tasks in Asana or a board with columns of tasks represented as cards. It exists in a single workspace or organization and is accessible to a subset of users in that workspace or organization, depending on its permissions. - ProjectCompact new_project?; - # The *task* is the basic object around which many operations in Asana are centered. - TaskCompact? new_task?; - # The subtype of this resource. Different subtypes retain many of the same fields and behavior, but may render differently in Asana or represent resources with different semantic meaning. - string resource_subtype?; - # Status of job. - string status?; -}; - -public type WorkspaceResponse record { - *WorkspaceBase; - # The email domains that are associated with this workspace. - string[] email_domains?; - # Whether the workspace is an *organization*. - boolean is_organization?; -}; - -public type InlineResponse2009 record { - CustomFieldSettingResponse[] data?; -}; - -public type InlineResponse2008 record { - PortfolioCompact[] data?; -}; - -public type PortfolioRequest record { - *PortfolioBase; - # An array of strings identifying users. These can either be the string "me", an email, or the gid of a user. - string[] members?; - # Gid of an object. - string workspace?; -}; - -public type SectionResponse record { - *SectionBase; - # The time at which this resource was created. - string created_at?; - # A *project* represents a prioritized list of tasks in Asana or a board with columns of tasks represented as cards. It exists in a single workspace or organization and is accessible to a subset of users in that workspace or organization, depending on its permissions. - ProjectCompact project?; - # *Deprecated - please use project instead* - ProjectCompact[] projects?; -}; - -public type WorkspaceGidTagsBody record { - TagResponse data?; -}; - -public type TaskRemoveProjectRequest record { - # The project to remove the task from. - string project; -}; - -public type AttachmentCompact record { - *AsanaResource; - # The name of the file. - string name?; - # The service hosting the attachment. Valid values are `asana`, `dropbox`, `gdrive`, `onedrive`, `box`, and `external`. - # `external` attachments are a beta feature currently limited to specific integrations. - anydata resource_subtype?; -}; - -# A user identification object for specification with the addUser/removeUser endpoints. -public type WorkspaceAddUserRequest record { - # A string identifying a user. This can either be the string "me", an email, or the gid of a user. - string user?; -}; - -public type StoriesStoryGidBody record { - StoryRequest data?; -}; - -# A *project* represents a prioritized list of tasks in Asana or a board with columns of tasks represented as cards. It exists in a single workspace or organization and is accessible to a subset of users in that workspace or organization, depending on its permissions. -public type ProjectCompact record { - *AsanaResource; - # Name of the project. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer. - string name?; -}; - -public type ProjectGidProjectStatusesBody record { - ProjectStatusRequest data?; -}; - -public type InlineResponse2012 record { - OrganizationExportResponse data?; -}; - -# A WebhookFilter can be passed on creation of a webhook in order to filter the types of actions that trigger delivery of an [Event](/docs/tocS_Event) -public type WebhookFilter record { - # The type of change on the **resource** to pass through the filter. For more information refer to `Event.action` in the [Event](/docs/tocS_Event) schema. This can be one of `changed`, `added`, `removed`, `deleted`, and `undeleted` depending on the nature of what has occurred on the resource. - string action?; - # *Conditional.* A whitelist of fields for events which will pass the filter when the resource is changed. These can be any combination of the fields on the resources themselves. This field is only valid for `action` of type 'changed' - string[] fields?; - # The resource subtype of the resource that the filter applies to. This should be set to the same value as is returned on the `resource_subtype` field on the resources themselves. - string resource_subtype?; - # The type of the resource which created the event when modified; for example, to filter to changes on regular tasks this field should be set to `task`. - string resource_type?; -}; - -public type InlineResponse2011 record { - # Enum options are the possible values which an enum custom field can adopt. - EnumOption data?; -}; - -public type InlineResponse2014 record { - ProjectResponse data?; -}; - -public type InlineResponse2013 record { - PortfolioResponse data?; -}; - -public type InlineResponse2016 record { - TagResponse data?; -}; - -public type InlineResponse2015 record { - SectionResponse data?; -}; - -public type InlineResponse2018 record { - TeamResponse data?; -}; - -public type InlineResponse2017 record { - TaskResponse data?; -}; - -public type TeamMembershipBase TeamMembershipCompact; - -public type PortfolioRemoveItemRequest record { - # The item to remove from the portfolio. - string item; -}; - -public type TaskRequest record { - *TaskBase; - # Gid of a user. - string? assignee?; - # An object where each key is a Custom Field gid and each value is an enum gid, string, or number. - record {} custom_fields?; - # *Create-Only* An array of strings identifying users. These can either be the string "me", an email, or the gid of a user. In order to change followers on an existing task use `addFollowers` and `removeFollowers`. - string[] followers?; - # Gid of a task. - string? parent?; - # *Create-Only* Array of project gids. In order to change projects on an existing task use `addProject` and `removeProject`. - string[] projects?; - # *Create-Only* Array of tag gids. In order to change tags on an existing task use `addTag` and `removeTag`. - string[] tags?; - # Gid of a workspace. - string workspace?; -}; - -public type UserTaskListRequest UserTaskListBase; - -# Sadly, sometimes requests to the API are not successful. Failures can -# occur for a wide range of reasons. In all cases, the API should return -# an HTTP Status Code that indicates the nature of the failure, -# with a response body in JSON format containing additional information. -# -# -# In the event of a server error the response body will contain an error -# phrase. These phrases are automatically generated using the -# [node-asana-phrase -# library](https://github.com/Asana/node-asana-phrase) and can be used by -# Asana support to quickly look up the incident that caused the server -# error. -public type ErrorResponse record { - # Array of errors when requests to the API are not successful. - Error[] errors?; -}; - -public type InlineResponse2001 record { - # An empty object. Some endpoints do not return an object on success. The success is conveyed through a 2-- status code and returning an empty object. - EmptyResponse data?; -}; - -# The full record for all events that have occurred since the sync token was created. -public type InlineResponse2003 record { - # An organization_export object represents a request to export the complete data of an organization. - EventResponse[] data?; - # A sync token to be used with the next call to the events endpoint. - string sync?; -}; - -public type InlineResponse2002 record { - BatchResponse[] data?; -}; - -public type InlineResponse2005 record { - TeamCompact[] data?; -}; - -public type InlineResponse2004 record { - JobResponse data?; -}; - -public type CustomFieldsBody record { - CustomFieldRequest data?; -}; - -public type InlineResponse2007 record { - PortfolioMembershipResponse data?; -}; - -public type InlineResponse2006 record { - PortfolioMembershipCompact[] data?; -}; - -public type OrganizationExportBase OrganizationExportCompact; - -# A generic Asana Resource, containing a globally unique identifier. -public type AsanaNamedResource record { - *AsanaResource; - # The name of the object. - string name?; -}; - -public type SectionsSectionGidBody record { - SectionRequest data?; -}; - -# A section is a subdivision of a project that groups tasks together. -public type SectionBase SectionCompact; - -public type PortfolioGidRemovecustomfieldsettingBody record { - RemoveCustomFieldSettingRequest data?; -}; - -public type UserTaskListCompact record { - *AsanaResource; - # The name of the user task list. - string name?; - # The owner of the user task list, i.e. the person whose My Tasks is represented by this resource. - UserCompact? owner?; - # The workspace in which the user task list is located. - WorkspaceCompact workspace?; -}; - -# A user identification object for specification with the addUser/removeUser endpoints. -public type WorkspaceRemoveUserRequest record { - # A string identifying a user. This can either be the string "me", an email, or the gid of a user. - string user?; -}; - -public type PortfolioAddItemRequest record { - # An id of an item in this portfolio. The new item will be added after the one specified here. `insert_before` and `insert_after` parameters cannot both be specified. - string insert_after?; - # An id of an item in this portfolio. The new item will be added before the one specified here. `insert_before` and `insert_after` parameters cannot both be specified. - string insert_before?; - # The item to add to the portfolio. - string item; -}; - -public type PortfolioBase record { - *PortfolioCompact; - # Color of the portfolio. - string color?; -}; - -# The owner of the user task list, i.e. the person whose My Tasks is represented by this resource. -public type UserRequest UserCompact?; - -public type TaskSetParentRequest record { - # A subtask of the parent to insert the task after, or `null` to insert at the beginning of the list. - string insert_after?; - # A subtask of the parent to insert the task before, or `null` to insert at the end of the list. - string insert_before?; - # The new parent of the task, or `null` for no parent. - string parent; -}; - -public type TeamGidAdduserBody record { - # A user identification object for specification with the addUser/removeUser endpoints. - TeamAddUserRequest data?; -}; - -public type RemoveMembersRequest record { - # An array of strings identifying users. These can either be the string "me", an email, or the gid of a user. - string members; -}; - -# Enum options are the possible values which an enum custom field can adopt. -public type EnumOption record { - *AsanaResource; - # The color of the enum option. Defaults to ‘none’. - string color?; - # Whether or not the enum option is a selectable value for the custom field. - boolean enabled?; - # The name of the enum option. - string name?; -}; - -# The owner of the user task list, i.e. the person whose My Tasks is represented by this resource. -public type UserCompact record { - *AsanaResource; - # *Read-only except when same user as requester*. The user’s name. - string name?; -}; - -public type TaskAddFollowersRequest record { - # An array of strings identifying users. These can either be the string "me", an email, or the gid of a user. - string[] followers; -}; - -public type TaskGidSetparentBody record { - TaskSetParentRequest data?; -}; - -public type EnumOptionRequest record { - *EnumOptionBase; - # An existing enum option within this custom field after which the new enum option should be inserted. Cannot be provided together with before_enum_option. - string insert_after?; - # An existing enum option within this custom field before which the new enum option should be inserted. Cannot be provided together with after_enum_option. - string insert_before?; -}; - -public type ProjectResponse record { - *ProjectBase; - # Array of Custom Fields. - CustomFieldCompact[] custom_fields?; - # Array of users following this project. Followers are a subset of members who receive all notifications for a project, the default notification setting when adding members to a project in-product. - UserCompact[] followers?; - # The icon for a project. - string? icon?; - # The owner of the user task list, i.e. the person whose My Tasks is represented by this resource. - UserCompact? owner?; - # A url that points directly to the object within Asana. - string permalink_url?; - # A *team* is used to group related projects and people together within an organization. - TeamCompact team?; -}; - -# A *team* is used to group related projects and people together within an organization. -public type TeamBase TeamCompact; - -public type ProjectStatusResponse record { - *ProjectStatusBase; - # The time at which this resource was created. - string created_at?; - # The owner of the user task list, i.e. the person whose My Tasks is represented by this resource. - UserCompact? created_by?; -}; - -# *OAuth Required*. *Conditional*. This field is returned only if external values are set or included by using [Opt In] (/docs/input-output-options). -# The external field allows you to store app-specific metadata on tasks, including a gid that can be used to retrieve tasks and a data blob that can store app-specific character strings. Note that you will need to authenticate with Oauth to access or modify this data. Once an external gid is set, you can use the notation `external:custom_gid` to reference your object anywhere in the API where you may use the original object gid. See the page on Custom External Data for more details. -public type TaskbaseExternal record { - # The data of external field allows you to store app-specific metadata on tasks. - string data?; - # Globally unique identifier of the resource, as a string. - string gid?; -}; - -public type OrganizationExportResponse OrganizationExportBase; - -# A section is a subdivision of a project that groups tasks together. -public type SectionCompact record { - *AsanaResource; - # The name of the section (i.e. the text displayed as the section header). - string name?; -}; - -public type PortfolioGidRemoveitemBody record { - PortfolioRemoveItemRequest data?; -}; - -public type BatchBody record { - # A request object for use in a batch request. - BatchRequest data?; -}; - -# The workspace in which the user task list is located. -public type WorkspaceBase WorkspaceCompact; - -public type TeamResponse record { - *TeamBase; - # [Opt In](/docs/input-output-options). The description of the team. - string description?; - # [Opt In](/docs/input-output-options). The description of the team with formatting as HTML. - string html_description?; - # The workspace in which the user task list is located. - WorkspaceCompact organization?; - # A url that points directly to the object within Asana. - string permalink_url?; -}; - -# A set of dependent tasks. -public type ModifyDependentsRequest record { - # An array of task gids that are dependents of the given task. - string[] dependents?; -}; - -public type UserTaskListBase UserTaskListCompact; - -public type TaskGidAddprojectBody record { - TaskAddProjectRequest data?; -}; - -public type PortfolioGidAdditemBody record { - PortfolioAddItemRequest data?; -}; - -public type WorkspaceGidRemoveuserBody record { - # A user identification object for specification with the addUser/removeUser endpoints. - WorkspaceRemoveUserRequest data?; -}; - -public type TaskbaseMemberships record { - # A *project* represents a prioritized list of tasks in Asana or a board with columns of tasks represented as cards. It exists in a single workspace or organization and is accessible to a subset of users in that workspace or organization, depending on its permissions. - ProjectCompact project?; - # A section is a subdivision of a project that groups tasks together. - SectionCompact section?; -}; - -public type ProjectMembershipResponse record { - *ProjectMembershipBase; - # A *project* represents a prioritized list of tasks in Asana or a board with columns of tasks represented as cards. It exists in a single workspace or organization and is accessible to a subset of users in that workspace or organization, depending on its permissions. - ProjectCompact project?; - # Whether the user has full access to the project or has comment-only access. - string write_access?; -}; - -public type UserResponse record { - *UserCompact; - # The user's email address. - string email?; - # A map of the user’s profile photo in various sizes, or null if no photo is set. Sizes provided are 21, 27, 36, 60, and 128. Images are in PNG format. - UserresponsePhoto? photo?; - # Workspaces and organizations this user may access. - # Note\: The API will only return workspaces and organizations that also contain the authenticated user. - WorkspaceCompact[] workspaces?; -}; - -public type RemoveFollowersRequest record { - # An array of strings identifying users. These can either be the string "me", an email, or the gid of a user. - string followers; -}; - -# A user identification object for specification with the addUser/removeUser endpoints. -public type TeamAddUserRequest record { - # A string identifying a user. This can either be the string "me", an email, or the gid of a user. - string user?; -}; - -public type TeamMembershipCompact record { - *AsanaResource; - # Describes if the user is a guest in the team. - boolean is_guest?; - # A *team* is used to group related projects and people together within an organization. - TeamCompact team?; - # The owner of the user task list, i.e. the person whose My Tasks is represented by this resource. - UserCompact? user?; -}; - -public type PortfolioMembershipCompact record { - *AsanaResource; - # A *portfolio* gives a high-level overview of the status of multiple initiatives in Asana. - PortfolioCompact portfolio?; - # The owner of the user task list, i.e. the person whose My Tasks is represented by this resource. - UserCompact? user?; -}; - -# A response object returned from the task count endpoint. -public type TaskCountResponse record { - # The number of completed milestones in a project. - int num_completed_milestones?; - # The number of completed tasks in a project. - int num_completed_tasks?; - # The number of incomplete milestones in a project. - int num_incomplete_milestones?; - # The number of incomplete tasks in a project. - int num_incomplete_tasks?; - # The number of milestones in a project. - int num_milestones?; - # The number of tasks in a project. - int num_tasks?; -}; - -# Represents activity associated with an object in the Asana system -public type StoryResponse record { - *StoryBase; - # The owner of the user task list, i.e. the person whose My Tasks is represented by this resource. - UserCompact? assignee?; - # The owner of the user task list, i.e. the person whose My Tasks is represented by this resource. - UserCompact? created_by?; - # Custom Fields store the metadata that is used in order to add user-specified information to tasks in Asana. Be sure to reference the [Custom Fields](/docs/asana-custom-fields) developer documentation for more information about how custom fields relate to various resources in Asana. - CustomFieldCompact custom_field?; - # The *task* is the basic object around which many operations in Asana are centered. - TaskCompact? dependency?; - # The *task* is the basic object around which many operations in Asana are centered. - TaskCompact? duplicate_of?; - # The *task* is the basic object around which many operations in Asana are centered. - TaskCompact? duplicated_from?; - # The owner of the user task list, i.e. the person whose My Tasks is represented by this resource. - UserCompact? follower?; - # *Deprecated - please use likes instead* - # *Conditional*. True if the story is hearted by the authorized user, false if not. - boolean hearted?; - # *Deprecated - please use likes instead* - # - # *Conditional*. Array of likes for users who have hearted this story. - Like[] hearts?; - # *Conditional*. Whether the text of the story has been edited after creation. - boolean is_edited?; - # *Conditional*. True if the story is liked by the authorized user, false if not. - boolean liked?; - # *Conditional*. Array of likes for users who have liked this story. - Like[] likes?; - # *Conditional* - string new_approval_status?; - # *Conditional* - StoryResponseDates new_dates?; - # Enum options are the possible values which an enum custom field can adopt. - EnumOption new_enum_value?; - # *Conditional* - string new_name?; - # *Conditional* - int new_number_value?; - # *Conditional* - string new_resource_subtype?; - # A section is a subdivision of a project that groups tasks together. - SectionCompact new_section?; - # *Conditional* - string new_text_value?; - # *Deprecated - please use likes instead* - # - # *Conditional*. The number of users who have hearted this story. - int num_hearts?; - # *Conditional*. The number of users who have liked this story. - int num_likes?; - # *Conditional* - string old_approval_status?; - # *Conditional* - StoryResponseDates old_dates?; - # Enum options are the possible values which an enum custom field can adopt. - EnumOption old_enum_value?; - # *Conditional*' - string old_name?; - # *Conditional* - int old_number_value?; - # *Conditional* - string old_resource_subtype?; - # A section is a subdivision of a project that groups tasks together. - SectionCompact old_section?; - # *Conditional* - string old_text_value?; - # *Conditional*. A collection of previews to be displayed in the story. - # - # *Note: This property only exists for comment stories.* - Preview[] previews?; - # A *project* represents a prioritized list of tasks in Asana or a board with columns of tasks represented as cards. It exists in a single workspace or organization and is accessible to a subset of users in that workspace or organization, depending on its permissions. - ProjectCompact project?; - # The component of the Asana product the user used to trigger the story. - string 'source?; - # A story represents an activity associated with an object in the Asana system. - StoryCompact story?; - # A tag is a label that can be attached to any task in Asana. - TagCompact tag?; - # The object this story is associated with. Currently may only be a task. - StoryresponseTarget target?; - # The *task* is the basic object around which many operations in Asana are centered. - TaskCompact? task?; -}; - -public type PortfoliosPortfolioGidBody record { - PortfolioRequest data?; -}; - -public type ProjectMembershipCompact record { - *AsanaResource; - # The owner of the user task list, i.e. the person whose My Tasks is represented by this resource. - UserCompact? user?; -}; - -public type TaskRemoveTagRequest record { - # The tag to remove from the task. - string tag; -}; - -public type InlineResponse20019 record { - # Represents activity associated with an object in the Asana system - StoryResponse data?; -}; - -public type CustomFieldSettingResponse record { - *CustomFieldSettingBase; - CustomFieldResponse custom_field?; - # `is_important` is used in the Asana web application to determine if this custom field is displayed in the list/grid view of a project or portfolio. - boolean is_important?; - # A *project* represents a prioritized list of tasks in Asana or a board with columns of tasks represented as cards. It exists in a single workspace or organization and is accessible to a subset of users in that workspace or organization, depending on its permissions. - ProjectCompact parent?; - # A *project* represents a prioritized list of tasks in Asana or a board with columns of tasks represented as cards. It exists in a single workspace or organization and is accessible to a subset of users in that workspace or organization, depending on its permissions. - ProjectCompact project?; -}; - -public type TaskGidAdddependentsBody record { - # A set of dependent tasks. - ModifyDependentsRequest data?; -}; - -public type SectionRequest record { - # An existing section within this project after which the added section should be inserted. Cannot be provided together with insert_before. - string insert_after?; - # An existing section within this project before which the added section should be inserted. Cannot be provided together with insert_after. - string insert_before?; - # The text to be displayed as the section name. This cannot be an empty string. - string name; - # *Create-Only* The project to create the section in - string project; -}; - -public type CustomFieldRequest record { - *CustomFieldBase; - # *Create-Only* The workspace to create a custom field in. - string workspace; -}; - -# An action object for use in a batch request. -public type BatchRequestAction record { - # For `GET` requests, this should be a map of query parameters you would have normally passed in the URL. Options and pagination are not accepted here; put them in `options` instead. For `POST`, `PATCH`, and `PUT` methods, this should be the content you would have normally put in the data field of the body. - record {} data?; - # The HTTP method you wish to emulate for the action. - string method; - # Pagination (`limit` and `offset`) and output options (`fields` or `expand`) for the action. “Pretty” JSON output is not an available option on individual actions; if you want pretty output, specify that option on the parent request. - BatchrequestactionOptions options?; - # The path of the desired endpoint relative to the API’s base URL. Query parameters are not accepted here; put them in `data` instead. - string relative_path; -}; - -public type TasksBody record { - TaskRequest data?; -}; - -public type PortfolioGidAddcustomfieldsettingBody record { - AddCustomFieldSettingRequest data?; -}; - -public type TaskGidRemovedependentsBody record { - # A set of dependent tasks. - ModifyDependentsRequest data?; -}; - -public type InlineResponse20021 record { - AttachmentCompact[] data?; -}; - -public type InlineResponse20020 record { - TagCompact[] data?; -}; - -public type InlineResponse20023 record { - StoryCompact[] data?; -}; - -public type InlineResponse20022 record { - EmptyResponse[] data?; -}; - -public type InlineResponse20025 record { - TeamMembershipResponse data?; -}; - -public type AttachmentRequest record { - string file?; -}; - -public type InlineResponse20024 record { - TeamMembershipCompact[] data?; -}; - -public type InlineResponse20027 record { - UserCompact[] data?; -}; - -public type TaskResponse record { - *TaskBase; - # The owner of the user task list, i.e. the person whose My Tasks is represented by this resource. - UserCompact? assignee?; - # Array of custom field values applied to the task. These represent the custom field values recorded on this project for a particular custom field. For example, these custom field values will contain an `enum_value` property for custom fields of type enum, a `text_value` property for custom fields of type text, and so on. Please note that the `gid` returned on each custom field value *is identical* to the `gid` of the custom field, which allows referencing the custom field metadata through the `/custom_fields/custom_field-gid` endpoint. - CustomFieldResponse[] custom_fields?; - # Array of users following this task. - UserCompact[] followers?; - # The *task* is the basic object around which many operations in Asana are centered. - TaskCompact? parent?; - # A url that points directly to the object within Asana. - string permalink_url?; - # *Create-only.* Array of projects this task is associated with. At task creation time, this array can be used to add the task to many projects at once. After task creation, these associations can be modified using the addProject and removeProject endpoints. - ProjectCompact[] projects?; - # Array of tags associated with this task. In order to change tags on an existing task use `addTag` and `removeTag`. - TagCompact[] tags?; - # The workspace in which the user task list is located. - WorkspaceCompact workspace?; -}; - -public type InlineResponse20026 record { - UserResponse data?; -}; - -public type InlineResponse20029 record { - AsanaNamedResource[] data?; -}; - -public type InlineResponse20028 record { - UserTaskListResponse data?; -}; - -public type SectionGidAddtaskBody record { - SectionTaskInsertRequest data?; -}; - -public type WorkspaceMembershipResponse record { - *WorkspaceMembershipBase; - # Reflects if this user still a member of the workspace. - boolean is_active?; - # Reflects if this user is an admin of the workspace. - boolean is_admin?; - # Reflects if this user is a guest of the workspace. - boolean is_guest?; - UserTaskListResponse user_task_list?; -}; - -public type TaskGidDuplicateBody record { - TaskDuplicateRequest data?; -}; - -public type ProjectStatusBase record { - *ProjectStatusCompact; - # The owner of the user task list, i.e. the person whose My Tasks is represented by this resource. - UserCompact? author?; - # The color associated with the status update. - string color; - # [Opt In](/docs/input-output-options). The text content of the status update with formatting as HTML. - string html_text?; - # The time at which this project status was last modified. - # *Note: This does not currently reflect any changes in associations such as comments that may have been added or removed from the project status.* - anydata modified_at?; - # The text content of the status update. - string text; -}; - -# An *organization_export* request starts a job to export the complete data of the given Organization. -public type OrganizationExportRequest record { - # Globally unique identifier for the workspace or organization. - string organization?; -}; - -# The *task* is the basic object around which many operations in Asana are centered. -public type TaskCompact record { - *AsanaResource; - # The name of the task. - string name?; -}; - -public type InlineResponse20030 record { - WorkspaceMembershipCompact[] data?; -}; - -public type InlineResponse20032 record { - WorkspaceMembershipResponse data?; -}; - -public type ProjectRequest record { - *ProjectBase; - # An object where each key is a Custom Field gid and each value is an enum gid, string, or number. - record {} custom_fields?; - # *Create-only*. Comma separated string of users. Followers are a subset of members who receive all notifications for a project, the default notification setting when adding members to a project in-product. - string followers?; - # The current owner of the project, may be null. - string? owner?; - # *Create-only*. The team that this project is shared with. This field only exists for projects in organizations. - string team?; -}; - -public type InlineResponse20031 record { - WebhookResponse[] data?; -}; - -public type OrganizationExportsBody record { - # An *organization_export* request starts a job to export the complete data of the given Organization. - OrganizationExportRequest data?; -}; - -public type InlineResponse20034 record { - WorkspaceResponse data?; -}; - -public type InlineResponse20033 record { - WorkspaceCompact[] data?; -}; - -public type InlineResponse20036 record { - # The data containing generic Asana Resource, containing a globally unique identifier. - AsanaNamedResource[] data?; -}; - -public type InlineResponse20035 record { - CustomFieldResponse[] data?; -}; - -public type CustomFieldBase record { - *CustomFieldCompact; - # ISO 4217 currency code to format this custom field. This will be null if the `format` is not `currency`. - string? currency_code?; - # This is the string that appears next to the custom field value. This will be null if the `format` is not `custom`. - string? custom_label?; - # Only relevant for custom fields with `custom` format. This depicts where to place the custom label. This will be null if the `format` is not `custom`. - string custom_label_position?; - # [Opt In](/docs/input-output-options). The description of the custom field. - string description?; - # *Conditional*. Only relevant for custom fields of type enum. This array specifies the possible values which an `enum` custom field can adopt. To modify the enum options, refer to [working with enum options](/docs/create-an-enum-option). - EnumOption[] enum_options?; - # The format of this custom field. - string format?; - # *Conditional*. This flag describes whether a follower of a task with this field should receive inbox notifications from changes to this field. - boolean has_notifications_enabled?; - # This flag describes whether this custom field is available to every container in the workspace. Before project-specific custom fields, this field was always true. - boolean is_global_to_workspace?; - # Only relevant for custom fields of type ‘Number’. This field dictates the number of places after the decimal to round to, i.e. 0 is integer values, 1 rounds to the nearest tenth, and so on. Must be between 0 and 6, inclusive. - # For percentage format, this may be unintuitive, as a value of 0.25 has a precision of 0, while a value of 0.251 has a precision of 1. This is due to 0.25 being displayed as 25%. - # The identifier format will always have a precision of 0. - int precision?; -}; - -public type AttachmentBase AttachmentCompact; - -public type ProjectGidAddmembersBody record { - AddMembersRequest data?; -}; - -public type JobResponse JobBase; - -public type TaskBase record { - *TaskCompact; - # *Conditional* Reflects the approval status of this task. This field is kept in sync with `completed`, meaning `pending` translates to false while `approved`, `rejected`, and `changes_requested` translate to true. If you set completed to true, this field will be set to `approved`. - string approval_status?; - # *Deprecated* Scheduling status of this task for the user it is assigned to. This field can only be set if the assignee is non-null. Setting this field to "inbox" or "upcoming" inserts it at the top of the section, while the other options will insert at the bottom. - string assignee_status?; - # True if the task is currently marked complete, false if not. - boolean completed?; - # The time at which this task was completed, or null if the task is incomplete. - string? completed_at?; - # The owner of the user task list, i.e. the person whose My Tasks is represented by this resource. - UserCompact? completed_by?; - # The time at which this resource was created. - string created_at?; - # [Opt In](/docs/input-output-options). Array of resources referencing tasks that this task depends on. The objects contain only the gid of the dependency. - AsanaResource[] dependencies?; - # [Opt In](/docs/input-output-options). Array of resources referencing tasks that depend on this task. The objects contain only the ID of the dependent. - AsanaResource[] dependents?; - # The UTC date and time on which this task is due, or null if the task has no due time. This takes an ISO 8601 date string in UTC and should not be used together with `due_on`. - string? due_at?; - # The localized date on which this task is due, or null if the task has no due date. This takes a date with `YYYY-MM-DD` format and should not be used together with due_at. - string? due_on?; - # *OAuth Required*. *Conditional*. This field is returned only if external values are set or included by using [Opt In] (/docs/input-output-options). - # The external field allows you to store app-specific metadata on tasks, including a gid that can be used to retrieve tasks and a data blob that can store app-specific character strings. Note that you will need to authenticate with Oauth to access or modify this data. Once an external gid is set, you can use the notation `external:custom_gid` to reference your object anywhere in the API where you may use the original object gid. See the page on Custom External Data for more details. - TaskbaseExternal 'external?; - # *Deprecated - please use liked instead* True if the task is hearted by the authorized user, false if not. - boolean hearted?; - # *Deprecated - please use likes instead* Array of likes for users who have hearted this task. - Like[] hearts?; - # [Opt In](/docs/input-output-options). The notes of the text with formatting as HTML. - string html_notes?; - # [Opt In](/docs/input-output-options). In some contexts tasks can be rendered as a visual separator; for instance, subtasks can appear similar to [sections](/docs/asana-sections) without being true `section` objects. If a `task` object is rendered this way in any context it will have the property `is_rendered_as_separator` set to `true`. - boolean is_rendered_as_separator?; - # True if the task is liked by the authorized user, false if not. - boolean liked?; - # Array of likes for users who have liked this task. - Like[] likes?; - # *Create-only*. Array of projects this task is associated with and the section it is in. At task creation time, this array can be used to add the task to specific sections. After task creation, these associations can be modified using the `addProject` and `removeProject` endpoints. Note that over time, more types of memberships may be added to this property. - TaskbaseMemberships[] memberships?; - # The time at which this task was last modified. - # - # *Note: This does not currently reflect any changes in - # associations such as projects or comments that may have been - # added or removed from the task.* - string modified_at?; - # Name of the task. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer. - string name?; - # More detailed, free-form textual information associated with the task. - string notes?; - # *Deprecated - please use likes instead* The number of users who have hearted this task. - int num_hearts?; - # The number of users who have liked this task. - int num_likes?; - # [Opt In](/docs/input-output-options). The number of subtasks on this task. - int num_subtasks?; - # The subtype of this resource. Different subtypes retain many of the same fields and behavior, but may render differently in Asana or represent resources with different semantic meaning. - # The resource_subtype `milestone` represent a single moment in time. This means tasks with this subtype cannot have a start_date. - string resource_subtype?; - # Date and time on which work begins for the task, or null if the task has no start time. This takes a UTC timestamp format. - # *Note: `due_at` must be present in the request when setting or unsetting the `start_at` parameter.* - string? start_at?; - # The day on which work begins for the task , or null if the task has no start date. This takes a date with `YYYY-MM-DD` format. - # *Note: `due_on` or `due_at` must be present in the request when setting or unsetting the `start_on` parameter.* - string? start_on?; -}; - -# An *event* is an object representing a change to a resource that was -# observed by an event subscription or delivered asynchronously to -# the target location of an active webhook. -# -# The event may be triggered by a different `user` than the -# subscriber. For example, if user A subscribes to a task and user B -# modified it, the event’s user will be user B. Note: Some events -# are generated by the system, and will have `null` as the user. API -# consumers should make sure to handle this case. -# -# The `resource` that triggered the event may be different from the one -# that the events were requested for or the webhook is subscribed to. For -# example, a subscription to a project will contain events for tasks -# contained within the project. -# -# **Note:** pay close attention to the relationship between the fields -# `Event.action` and `Event.change.action`. -# `Event.action` represents the action taken on the resource -# itself, and `Event.change.action` represents how the information -# within the resource's fields have been modified. -# -# For instance, consider these scenarios: -# -# -# * When at task is added to a project, `Event.action` will be -# `added`, `Event.parent` will be on object with the `id` and -# `type` of the project, and there will be no `change` field. -# -# -# * When an assignee is set on the task, `Event.parent` will be -# `null`, `Event.action` will be `changed`, -# `Event.change.action` will be `changed`, and `changed_value` will -# be an object with the user's `id` and `type`. -# -# -# * When a collaborator is added to the task, `Event.parent` will -# be `null`, `Event.action` will be `changed`, -# `Event.change.action` will be `added`, and `added_value` will be -# an object with the user's `id` and `type`. -public type EventResponse record { - # The type of action taken on the **resource** that triggered the event. This can be one of `changed`, `added`, `removed`, `deleted`, or `undeleted` depending on the nature of the event. - string action?; - # Information about the type of change that has occurred. This field is only present when the value of the property `action`, describing the action taken on the **resource**, is `changed`. - EventresponseChange change?; - # The timestamp when the event occurred. - string created_at?; - # A generic Asana Resource, containing a globally unique identifier. - AsanaNamedResource parent?; - # A generic Asana Resource, containing a globally unique identifier. - AsanaNamedResource 'resource?; - # *Deprecated: Refer to the resource_type of the resource.* The type of the resource that generated the event. - string 'type?; - # The owner of the user task list, i.e. the person whose My Tasks is represented by this resource. - UserCompact? user?; -}; - -# A *team* is used to group related projects and people together within an organization. -public type TeamCompact record { - *AsanaResource; - # The name of the team. - string name?; -}; - -public type ModifyDependenciesRequest record { - # An array of task gids that a task depends on. - string[] dependencies?; -}; - -# A story represents an activity associated with an object in the Asana system. -public type StoryCompact record { - *AsanaResource; - # The time at which this resource was created. - string created_at?; - # The owner of the user task list, i.e. the person whose My Tasks is represented by this resource. - UserCompact? created_by?; - # The subtype of this resource. Different subtypes retain many of the same fields and behavior, but may render differently in Asana or represent resources with different semantic meaning. - string resource_subtype?; - # *Create-only*. Human-readable text for the story or comment. - # This will not include the name of the creator. - # *Note: This is not guaranteed to be stable for a given type of story. For example, text for a reassignment may not always say “assigned to …” as the text for a story can both be edited and change based on the language settings of the user making the request.* - # Use the `resource_subtype` property to discover the action that created the story. - string text?; -}; - -public type ProjectSectionInsertRequest record { - # Insert the given section immediately after the section specified by this parameter. - string after_section?; - # Insert the given section immediately before the section specified by this parameter. - string before_section?; - # The project in which to reorder the given section. - string project; - # The section to reorder. - string section; -}; - -# Information about the type of change that has occurred. This field is only present when the value of the property `action`, describing the action taken on the **resource**, is `changed`. -public type EventresponseChange record { - # The type of action taken on the **field** which has been changed. This can be one of `changed`, `added`, or `removed` depending on the nature of the change. - string action?; - # *Conditional.* This property is only present when the **field's** `action` is `added` and the `added_value` is an Asana resource. This will be only the `gid` and `resource_type` of the resource when the events come from webhooks; this will be the compact representation (and can have fields expanded with [opt_fields](/docs/input-output-options)) when using the [Events](/docs/asana-events) resource. - anydata added_value?; - # The name of the field that has changed in the resource. - string 'field?; - # *Conditional.* This property is only present when the **field's** `action` is `changed` and the `new_value` is an Asana resource. This will be only the `gid` and `resource_type` of the resource when the events come from webhooks; this will be the compact representation (and can have fields expanded with [opt_fields](/docs/input-output-options)) when using the [Events](/docs/asana-events) resource. - anydata new_value?; - # *Conditional.* This property is only present when the **field's** `action` is `removed` and the `removed_value` is an Asana resource. This will be only the `gid` and `resource_type` of the resource when the events come from webhooks; this will be the compact representation (and can have fields expanded with [opt_fields](/docs/input-output-options)) when using the [Events](/docs/asana-events) resource. - anydata removed_value?; -}; - -# A user identification object for specification with the addUser/removeUser endpoints. -public type TeamRemoveUserRequest record { - # A string identifying a user. This can either be the string "me", an email, or the gid of a user. - string user?; -}; - -# The object this story is associated with. Currently may only be a task. -public type StoryresponseTarget record { - # The gid of the object this story is associated with. - string gid?; - # The name of the object this story is associated with. - string name?; -}; - -public type TeamGidProjectsBody record { - ProjectRequest data?; -}; - -public type TasksTaskGidBody record { - TaskRequest data?; -}; - -public type ProjectsProjectGidBody record { - ProjectRequest data?; -}; - -public type JobBase JobCompact; - -public type StoryRequest StoryBase; - -public type TaskGidRemovefollowersBody record { - TaskRemoveFollowersRequest data?; -}; - -public type ProjectStatusCompact record { - *AsanaResource; - # The title of the project status update. - string title?; -}; - -public type PortfolioGidRemovemembersBody record { - RemoveMembersRequest data?; -}; - -public type ProjectGidAddcustomfieldsettingBody record { - AddCustomFieldSettingRequest data?; -}; - -# A *portfolio* gives a high-level overview of the status of multiple initiatives in Asana. -public type PortfolioCompact record { - *AsanaResource; - # The name of the portfolio. - string name?; -}; - -public type WorkspaceMembershipRequest WorkspaceMembershipBase; - -public type ProjectGidRemovecustomfieldsettingBody record { - RemoveCustomFieldSettingRequest data?; -}; - -public type TagRequest record { - *TagBase; - # An array of strings identifying users. These can either be the string "me", an email, or the gid of a user. - string[] followers?; - # Gid of an object. - string workspace?; -}; - -public type TaskGidAddtagBody record { - TaskAddTagRequest data?; -}; - -# An object to represent a user's like. -public type Like record { - # Globally unique identifier of the object, as a string. - string gid?; - # The owner of the user task list, i.e. the person whose My Tasks is represented by this resource. - UserCompact? user?; -}; - -public type ProjectsBody record { - ProjectRequest data?; -}; - -public type AttachmentResponse record { - *AttachmentBase; - # The time at which this resource was created. - string created_at?; - # The URL containing the content of the attachment. - # *Note:* May be null if the attachment is hosted by [Box](https://www.box.com/). If present, this URL may only be valid for two minutes from the time of retrieval. You should avoid persisting this URL somewhere and just refresh it on demand to ensure you do not keep stale URLs. - string? download_url?; - # The service hosting the attachment. Valid values are `asana`, `dropbox`, `gdrive` and `box`. - string host?; - # The *task* is the basic object around which many operations in Asana are centered. - TaskCompact? parent?; - # The URL where the attachment can be viewed, which may be friendlier to users in a browser than just directing them to a raw file. May be null if no view URL exists for the service. - string? view_url?; -}; - -public type WorkspaceRequest WorkspaceBase; - -public type PortfoliosBody record { - PortfolioRequest data?; -}; - -public type AddMembersRequest record { - # An array of strings identifying users. These can either be the string "me", an email, or the gid of a user. - string members; -}; - -public type InlineResponse2019 record { - WebhookResponse data?; -}; - -public type TeamsBody record { - TeamRequest data?; -}; - -# Enum options are the possible values which an enum custom field can adopt. -public type EnumOptionBase EnumOption; - -public type TaskGidAddfollowersBody record { - TaskAddFollowersRequest data?; -}; - -public type WebhookCompact record { - *AsanaResource; - # If true, the webhook will send events - if false it is considered inactive and will not generate events. - boolean active?; - # A generic Asana Resource, containing a globally unique identifier. - AsanaNamedResource 'resource?; - # The URL to receive the HTTP POST. - string target?; -}; - -public type AddFollowersRequest record { - # An array of strings identifying users. These can either be the string "me", an email, or the gid of a user. - string followers; -}; - -public type EnumOptionsEnumOptionGidBody record { - EnumOptionRequest data?; -}; - -public type SectionsInsertBody record { - ProjectSectionInsertRequest data?; -}; - -public type TagBase record { - *TagCompact; - # Color of the tag. - string color?; -}; - -public type EnumOptionsInsertBody record { - EnumOptionInsertRequest data?; -}; - -public type WebhooksBody record { - WebhookRequest data?; -}; - -# An empty object. Some endpoints do not return an object on success. The success is conveyed through a 2-- status code and returning an empty object. -public type EmptyResponse record { -}; - -public type RemoveCustomFieldSettingRequest record { - # The custom field to remove from this portfolio. - string custom_field; -}; - -public type TaskGidAdddependenciesBody record { - ModifyDependenciesRequest data?; -}; - -public type WorkspaceMembershipCompact record { - *AsanaResource; - # The owner of the user task list, i.e. the person whose My Tasks is represented by this resource. - UserCompact? user?; - # The workspace in which the user task list is located. - WorkspaceCompact workspace?; -}; - -public type TaskDuplicateRequest record { - # The fields that will be duplicated to the new task. - string include?; - # The name of the new task. - string name?; -}; - -public type WorkspacesWorkspaceGidBody record { - WorkspaceRequest data?; -}; - -public type TaskGidRemovedependenciesBody record { - ModifyDependenciesRequest data?; -}; - -public type ProjectDuplicateRequest record { - # The elements that will be duplicated to the new project. Tasks are always included. - string include?; - # The name of the new project. - string name; - # A dictionary of options to auto-shift dates. `task_dates` must be included to use this option. Requires either `start_on` or `due_on`, but not both. - ProjectduplicaterequestScheduleDates schedule_dates?; - # Sets the team of the new project. If team is not defined, the new project will be in the same team as the the original project. - string team?; -}; - -public type InlineResponse201 record { - CustomFieldResponse data?; -}; - -# A tag is a label that can be attached to any task in Asana. -public type TagCompact record { - *AsanaResource; - # Name of the tag. This is generally a short sentence fragment that fits on a line in the UI for maximum readability. However, it can be longer. - string name?; -}; - -public type InlineResponse200 record { - AttachmentResponse data?; -}; - -# A generic Asana Resource, containing a globally unique identifier. -public type AsanaResource record { - # Globally unique identifier of the resource, as a string. - string gid?; - # The base type of this resource. - string resource_type?; -}; - -public type TaskGidStoriesBody record { - StoryRequest data?; -}; - -# A dictionary of options to auto-shift dates. `task_dates` must be included to use this option. Requires either `start_on` or `due_on`, but not both. -public type ProjectduplicaterequestScheduleDates record { - # Sets the last due date in the duplicated project to the given date. The rest of the due dates will be offset by the same amount as the due dates in the original project. - string due_on?; - # Determines if the auto-shifted dates should skip weekends. - boolean should_skip_weekends; - # Sets the first start date in the duplicated project to the given date. The rest of the start dates will be offset by the same amount as the start dates in the original project. - string start_on?; -}; - -public type UserTaskListResponse UserTaskListBase; - -public type OrganizationExportCompact record { - *AsanaResource; - # The time at which this resource was created. - string created_at?; - # Download this URL to retreive the full export of the organization - # in JSON format. It will be compressed in a gzip (.gz) container. - # - # *Note: May be null if the export is still in progress or - # failed. If present, this URL may only be valid for 1 hour from - # the time of retrieval. You should avoid persisting this URL - # somewhere and rather refresh on demand to ensure you do not keep - # stale URLs.* - string? download_url?; - # The workspace in which the user task list is located. - WorkspaceCompact organization?; - # The current state of the export. - string state?; -}; - -public type ProjectGidDuplicateBody record { - ProjectDuplicateRequest data?; -}; - -public type ProjectGidRemovemembersBody record { - RemoveMembersRequest data?; -}; - -public type TeamMembershipResponse TeamMembershipBase; - -public type WorkspaceMembershipBase WorkspaceMembershipCompact; - -# Pagination (`limit` and `offset`) and output options (`fields` or `expand`) for the action. “Pretty” JSON output is not an available option on individual actions; if you want pretty output, specify that option on the parent request. -public type BatchrequestactionOptions record { - # The fields to retrieve in the request. - string[] fields?; - # Pagination limit for the request. - int 'limit?; - # Pagination offset for the request. - int offset?; -}; - -public type WorkspaceGidAdduserBody record { - # A user identification object for specification with the addUser/removeUser endpoints. - WorkspaceAddUserRequest data?; -}; - -public type Error record { - # Additional information directing developers to resources on how to address and fix the problem, if available. - string help?; - # Message providing more detail about the error that occurred, if available. - string message?; - # *500 errors only*. A unique error phrase which can be used when contacting developer support to help identify the exact occurrence of the problem in Asana’s logs. - string phrase?; -}; - -# A collection of rich text that will be displayed as a preview to another app. -# -# This is read-only except for a small group of whitelisted apps. -public type Preview record { - # Some fallback text to display if unable to display the full preview. - string fallback?; - # Text to display in the footer. - string footer?; - # Text to display in the header. - string header?; - # Where the header will link to. - string header_link?; - # HTML formatted text for the body of the preview. - string html_text?; - # Text for the body of the preview. - string text?; - # Text to display as the title. - string title?; - # Where to title will link to. - string title_link?; -}; - -public type PortfolioMembershipBase PortfolioMembershipCompact; - -public type CustomFieldGidEnumOptionsBody record { - EnumOptionRequest data?; -}; - -public type ProjectGidAddfollowersBody record { - AddFollowersRequest data?; -}; - -public type TaskGidRemovetagBody record { - TaskRemoveTagRequest data?; -}; - -public type TaskGidRemoveprojectBody record { - TaskRemoveProjectRequest data?; -}; - -public type TaskGidSubtasksBody record { - TaskRequest data?; -}; - -# *Conditional* -public type StoryResponseDates record { - # Date and time representing activity occurance - string due_at?; - # Date representing activity occurance - string due_on?; - # Date representing activity start - string start_on?; -}; - -public type InlineResponse20010 record { - ProjectCompact[] data?; -}; - -# The workspace in which the user task list is located. -public type WorkspaceCompact record { - *AsanaResource; - # The name of the workspace. - string name?; -}; - -public type InlineResponse20012 record { - ProjectStatusResponse? data?; -}; - -public type EnumOptionInsertRequest record { - # An existing enum option within this custom field after which the new enum option should be inserted. Cannot be provided together with before_enum_option. - string after_enum_option?; - # An existing enum option within this custom field before which the new enum option should be inserted. Cannot be provided together with after_enum_option. - string before_enum_option?; - # The gid of the enum option to relocate. - string enum_option; -}; - -public type InlineResponse20011 record { - ProjectMembershipResponse data?; -}; - -public type TaskRemoveFollowersRequest record { - # An array of strings identifying users. These can either be the string "me", an email, or the gid of a user. - string[] followers; -}; - -public type InlineResponse20014 record { - ProjectMembershipCompact[] data?; -}; - -public type InlineResponse20013 record { - CustomFieldSettingResponse data?; -}; - -public type InlineResponse20016 record { - SectionCompact[] data?; -}; - -public type InlineResponse20015 record { - ProjectStatusCompact[] data?; -}; - -public type InlineResponse20018 record { - TaskCompact[] data?; -}; - -public type InlineResponse20017 record { - # A response object returned from the task count endpoint. - TaskCountResponse data?; -}; - -public type WorkspaceGidProjectsBody record { - ProjectRequest data?; -}; diff --git a/openapi/asana/utils.bal b/openapi/asana/utils.bal deleted file mode 100644 index 551778bc0..000000000 --- a/openapi/asana/utils.bal +++ /dev/null @@ -1,244 +0,0 @@ -// Copyright (c) 2022 WSO2 LLC. (http://www.wso2.org) All Rights Reserved. -// -// WSO2 Inc. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/url; -import ballerina/mime; - -type SimpleBasicType string|boolean|int|float|decimal; - -# Represents encoding mechanism details. -type Encoding record { - # Defines how multiple values are delimited - string style = FORM; - # Specifies whether arrays and objects should generate as separate fields - boolean explode = true; - # Specifies the custom content type - string contentType?; - # Specifies the custom headers - map headers?; -}; - -enum EncodingStyle { - DEEPOBJECT, FORM, SPACEDELIMITED, PIPEDELIMITED -} - -final Encoding & readonly defaultEncoding = {}; - -# Serialize the record according to the deepObject style. -# -# + parent - Parent record name -# + anyRecord - Record to be serialized -# + return - Serialized record as a string -isolated function getDeepObjectStyleRequest(string parent, record {} anyRecord) returns string { - string[] recordArray = []; - foreach [string, anydata] [key, value] in anyRecord.entries() { - if value is SimpleBasicType { - recordArray.push(parent + "[" + key + "]" + "=" + getEncodedUri(value.toString())); - } else if value is SimpleBasicType[] { - recordArray.push(getSerializedArray(parent + "[" + key + "]" + "[]", value, DEEPOBJECT, true)); - } else if value is record {} { - string nextParent = parent + "[" + key + "]"; - recordArray.push(getDeepObjectStyleRequest(nextParent, value)); - } else if value is record {}[] { - string nextParent = parent + "[" + key + "]"; - recordArray.push(getSerializedRecordArray(nextParent, value, DEEPOBJECT)); - } - recordArray.push("&"); - } - _ = recordArray.pop(); - return string:'join("", ...recordArray); -} - -# Serialize the record according to the form style. -# -# + parent - Parent record name -# + anyRecord - Record to be serialized -# + explode - Specifies whether arrays and objects should generate separate parameters -# + return - Serialized record as a string -isolated function getFormStyleRequest(string parent, record {} anyRecord, boolean explode = true) returns string { - string[] recordArray = []; - if explode { - foreach [string, anydata] [key, value] in anyRecord.entries() { - if (value is SimpleBasicType) { - recordArray.push(key, "=", getEncodedUri(value.toString())); - } else if (value is SimpleBasicType[]) { - recordArray.push(getSerializedArray(key, value, explode = explode)); - } else if (value is record {}) { - recordArray.push(getFormStyleRequest(parent, value, explode)); - } - recordArray.push("&"); - } - _ = recordArray.pop(); - } else { - foreach [string, anydata] [key, value] in anyRecord.entries() { - if (value is SimpleBasicType) { - recordArray.push(key, ",", getEncodedUri(value.toString())); - } else if (value is SimpleBasicType[]) { - recordArray.push(getSerializedArray(key, value, explode = false)); - } else if (value is record {}) { - recordArray.push(getFormStyleRequest(parent, value, explode)); - } - recordArray.push(","); - } - _ = recordArray.pop(); - } - return string:'join("", ...recordArray); -} - -# Serialize arrays. -# -# + arrayName - Name of the field with arrays -# + anyArray - Array to be serialized -# + style - Defines how multiple values are delimited -# + explode - Specifies whether arrays and objects should generate separate parameters -# + return - Serialized array as a string -isolated function getSerializedArray(string arrayName, anydata[] anyArray, string style = "form", boolean explode = true) returns string { - string key = arrayName; - string[] arrayValues = []; - if (anyArray.length() > 0) { - if (style == FORM && !explode) { - arrayValues.push(key, "="); - foreach anydata i in anyArray { - arrayValues.push(getEncodedUri(i.toString()), ","); - } - } else if (style == SPACEDELIMITED && !explode) { - arrayValues.push(key, "="); - foreach anydata i in anyArray { - arrayValues.push(getEncodedUri(i.toString()), "%20"); - } - } else if (style == PIPEDELIMITED && !explode) { - arrayValues.push(key, "="); - foreach anydata i in anyArray { - arrayValues.push(getEncodedUri(i.toString()), "|"); - } - } else if (style == DEEPOBJECT) { - foreach anydata i in anyArray { - arrayValues.push(key, "[]", "=", getEncodedUri(i.toString()), "&"); - } - } else { - foreach anydata i in anyArray { - arrayValues.push(key, "=", getEncodedUri(i.toString()), "&"); - } - } - _ = arrayValues.pop(); - } - return string:'join("", ...arrayValues); -} - -# Serialize the array of records according to the form style. -# -# + parent - Parent record name -# + value - Array of records to be serialized -# + style - Defines how multiple values are delimited -# + explode - Specifies whether arrays and objects should generate separate parameters -# + return - Serialized record as a string -isolated function getSerializedRecordArray(string parent, record {}[] value, string style = FORM, boolean explode = true) returns string { - string[] serializedArray = []; - if style == DEEPOBJECT { - int arayIndex = 0; - foreach var recordItem in value { - serializedArray.push(getDeepObjectStyleRequest(parent + "[" + arayIndex.toString() + "]", recordItem), "&"); - arayIndex = arayIndex + 1; - } - } else { - if (!explode) { - serializedArray.push(parent, "="); - } - foreach var recordItem in value { - serializedArray.push(getFormStyleRequest(parent, recordItem, explode), ","); - } - } - _ = serializedArray.pop(); - return string:'join("", ...serializedArray); -} - -# Get Encoded URI for a given value. -# -# + value - Value to be encoded -# + return - Encoded string -isolated function getEncodedUri(anydata value) returns string { - string|error encoded = url:encode(value.toString(), "UTF8"); - if (encoded is string) { - return encoded; - } else { - return value.toString(); - } -} - -# Generate query path with query parameter. -# -# + queryParam - Query parameter map -# + encodingMap - Details on serialization mechanism -# + return - Returns generated Path or error at failure of client initialization -isolated function getPathForQueryParam(map queryParam, map encodingMap = {}) returns string|error { - string[] param = []; - if (queryParam.length() > 0) { - param.push("?"); - foreach var [key, value] in queryParam.entries() { - if value is () { - _ = queryParam.remove(key); - continue; - } - Encoding encodingData = encodingMap.hasKey(key) ? encodingMap.get(key) : defaultEncoding; - if (value is SimpleBasicType) { - param.push(key, "=", getEncodedUri(value.toString())); - } else if (value is SimpleBasicType[]) { - param.push(getSerializedArray(key, value, encodingData.style, encodingData.explode)); - } else if (value is record {}) { - if (encodingData.style == DEEPOBJECT) { - param.push(getDeepObjectStyleRequest(key, value)); - } else { - param.push(getFormStyleRequest(key, value, encodingData.explode)); - } - } else { - param.push(key, "=", value.toString()); - } - param.push("&"); - } - _ = param.pop(); - } - string restOfPath = string:'join("", ...param); - return restOfPath; -} - -isolated function createBodyParts(record {|anydata...;|} anyRecord, map encodingMap = {}) -returns mime:Entity[]|error { - mime:Entity[] entities = []; - foreach [string, anydata] [key, value] in anyRecord.entries() { - Encoding encodingData = encodingMap.hasKey(key) ? encodingMap.get(key) : {}; - mime:Entity entity = new mime:Entity(); - if value is byte[] { - entity.setByteArray(value); - } else if value is SimpleBasicType|SimpleBasicType[] { - entity.setText(value.toString()); - } else if value is record {}|record {}[] { - entity.setJson(value.toJson()); - } - if (encodingData?.contentType is string) { - check entity.setContentType(encodingData?.contentType.toString()); - } - map? headers = encodingData?.headers; - if (headers is map) { - foreach var [headerName, headerValue] in headers.entries() { - if headerValue is SimpleBasicType { - entity.setHeader(headerName, headerValue.toString()); - } - } - } - entities.push(entity); - } - return entities; -} diff --git a/openapi/zendesk.support/.gitignore b/openapi/zendesk.support/.gitignore deleted file mode 100644 index eb5a316cb..000000000 --- a/openapi/zendesk.support/.gitignore +++ /dev/null @@ -1 +0,0 @@ -target diff --git a/openapi/zendesk.support/Ballerina.toml b/openapi/zendesk.support/Ballerina.toml deleted file mode 100644 index 86dc35666..000000000 --- a/openapi/zendesk.support/Ballerina.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -license = ["Apache-2.0"] -keywords = ["Support/Customer Support", "Cost/Freemium"] -org = "ballerinax" -name = "zendesk.support" -icon = "icon.png" -distribution = "2201.4.1" -repository = "https://github.com/ballerina-platform/openapi-connectors/tree/main/openapi/zendesk.support" -version = "1.6.1" -authors = ["Ballerina"] -[build-options] -observabilityIncluded = true diff --git a/openapi/zendesk.support/Dependencies.toml b/openapi/zendesk.support/Dependencies.toml deleted file mode 100644 index ef606e1a0..000000000 --- a/openapi/zendesk.support/Dependencies.toml +++ /dev/null @@ -1,307 +0,0 @@ -# AUTO-GENERATED FILE. DO NOT MODIFY. - -# This file is auto-generated by Ballerina for managing dependency versions. -# It should not be modified by hand. - -[ballerina] -dependencies-toml-version = "2" - -[[package]] -org = "ballerina" -name = "auth" -version = "2.6.0" -dependencies = [ - {org = "ballerina", name = "crypto"}, - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.array"}, - {org = "ballerina", name = "lang.string"}, - {org = "ballerina", name = "log"}, - {org = "ballerina", name = "regex"} -] - -[[package]] -org = "ballerina" -name = "cache" -version = "3.4.0" -dependencies = [ - {org = "ballerina", name = "constraint"}, - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "task"}, - {org = "ballerina", name = "time"} -] - -[[package]] -org = "ballerina" -name = "constraint" -version = "1.1.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"} -] - -[[package]] -org = "ballerina" -name = "crypto" -version = "2.3.1" -dependencies = [ - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "time"} -] - -[[package]] -org = "ballerina" -name = "file" -version = "1.6.0" -dependencies = [ - {org = "ballerina", name = "io"}, - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "log"}, - {org = "ballerina", name = "os"}, - {org = "ballerina", name = "regex"}, - {org = "ballerina", name = "time"} -] - -[[package]] -org = "ballerina" -name = "http" -version = "2.6.1" -dependencies = [ - {org = "ballerina", name = "auth"}, - {org = "ballerina", name = "cache"}, - {org = "ballerina", name = "constraint"}, - {org = "ballerina", name = "crypto"}, - {org = "ballerina", name = "file"}, - {org = "ballerina", name = "io"}, - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "jwt"}, - {org = "ballerina", name = "lang.array"}, - {org = "ballerina", name = "lang.decimal"}, - {org = "ballerina", name = "lang.int"}, - {org = "ballerina", name = "lang.runtime"}, - {org = "ballerina", name = "lang.string"}, - {org = "ballerina", name = "lang.value"}, - {org = "ballerina", name = "log"}, - {org = "ballerina", name = "mime"}, - {org = "ballerina", name = "oauth2"}, - {org = "ballerina", name = "observe"}, - {org = "ballerina", name = "regex"}, - {org = "ballerina", name = "time"}, - {org = "ballerina", name = "url"} -] -modules = [ - {org = "ballerina", packageName = "http", moduleName = "http"} -] - -[[package]] -org = "ballerina" -name = "io" -version = "1.4.1" -dependencies = [ - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.value"} -] - -[[package]] -org = "ballerina" -name = "jballerina.java" -version = "0.0.0" - -[[package]] -org = "ballerina" -name = "jwt" -version = "2.6.0" -dependencies = [ - {org = "ballerina", name = "cache"}, - {org = "ballerina", name = "crypto"}, - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.int"}, - {org = "ballerina", name = "lang.string"}, - {org = "ballerina", name = "log"}, - {org = "ballerina", name = "regex"}, - {org = "ballerina", name = "time"} -] - -[[package]] -org = "ballerina" -name = "lang.__internal" -version = "0.0.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.object"} -] - -[[package]] -org = "ballerina" -name = "lang.array" -version = "0.0.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.__internal"} -] - -[[package]] -org = "ballerina" -name = "lang.decimal" -version = "0.0.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"} -] - -[[package]] -org = "ballerina" -name = "lang.int" -version = "0.0.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"} -] - -[[package]] -org = "ballerina" -name = "lang.object" -version = "0.0.0" - -[[package]] -org = "ballerina" -name = "lang.regexp" -version = "0.0.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"} -] - -[[package]] -org = "ballerina" -name = "lang.runtime" -version = "0.0.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"} -] - -[[package]] -org = "ballerina" -name = "lang.string" -version = "0.0.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.regexp"} -] - -[[package]] -org = "ballerina" -name = "lang.value" -version = "0.0.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"} -] - -[[package]] -org = "ballerina" -name = "log" -version = "2.6.0" -dependencies = [ - {org = "ballerina", name = "io"}, - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.value"}, - {org = "ballerina", name = "observe"} -] - -[[package]] -org = "ballerina" -name = "mime" -version = "2.6.0" -dependencies = [ - {org = "ballerina", name = "io"}, - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.int"} -] - -[[package]] -org = "ballerina" -name = "oauth2" -version = "2.6.1" -dependencies = [ - {org = "ballerina", name = "cache"}, - {org = "ballerina", name = "crypto"}, - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "log"}, - {org = "ballerina", name = "time"}, - {org = "ballerina", name = "url"} -] - -[[package]] -org = "ballerina" -name = "observe" -version = "1.0.7" -dependencies = [ - {org = "ballerina", name = "jballerina.java"} -] - -[[package]] -org = "ballerina" -name = "os" -version = "1.6.0" -dependencies = [ - {org = "ballerina", name = "io"}, - {org = "ballerina", name = "jballerina.java"} -] - -[[package]] -org = "ballerina" -name = "regex" -version = "1.3.2" -dependencies = [ - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "lang.string"} -] - -[[package]] -org = "ballerina" -name = "task" -version = "2.3.2" -dependencies = [ - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "time"} -] - -[[package]] -org = "ballerina" -name = "time" -version = "2.2.5" -dependencies = [ - {org = "ballerina", name = "jballerina.java"} -] - -[[package]] -org = "ballerina" -name = "url" -version = "2.2.4" -dependencies = [ - {org = "ballerina", name = "jballerina.java"} -] -modules = [ - {org = "ballerina", packageName = "url", moduleName = "url"} -] - -[[package]] -org = "ballerinai" -name = "observe" -version = "0.0.0" -dependencies = [ - {org = "ballerina", name = "jballerina.java"}, - {org = "ballerina", name = "observe"} -] -modules = [ - {org = "ballerinai", packageName = "observe", moduleName = "observe"} -] - -[[package]] -org = "ballerinax" -name = "zendesk.support" -version = "1.6.0" -dependencies = [ - {org = "ballerina", name = "http"}, - {org = "ballerina", name = "url"}, - {org = "ballerinai", name = "observe"} -] -modules = [ - {org = "ballerinax", packageName = "zendesk.support", moduleName = "zendesk.support"} -] - diff --git a/openapi/zendesk.support/Module.md b/openapi/zendesk.support/Module.md deleted file mode 100644 index 12484e4c9..000000000 --- a/openapi/zendesk.support/Module.md +++ /dev/null @@ -1,52 +0,0 @@ -## Overview -This is a generated connector for [Zendesk Support API v2](https://developer.zendesk.com/api-reference/) OpenAPI specification. -Zendesk Support is a simple system for tracking, prioritizing and solving customer support tickets. - -## Prerequisites -Before using this connector in your Ballerina application, complete the following: -1. Create an [Zendesk account](https://www.zendesk.com/). -2. Obtain tokens - Follow [this guide](https://developer.zendesk.com/api-reference/ticketing/introduction/#security-and-authentication). - -## Quickstart - -To use the Zendesk Support connector in your Ballerina application, update the .bal file as follows: - -### Step 1: Import connector -First, import the `ballerinax/zendesk.support` module into the Ballerina project. -```ballerina -import ballerinax/zendesk.support as zensupport; -``` - -### Step 2: Create a new connector instance -Create a `zensupport:ClientConfig` with the username and password obtained, then initialize the connector with it and the service URL (Zendesk Support URL) according to the [Zendesk Support documentation](https://developer.zendesk.com/api-reference/ticketing/introduction/). -```ballerina -zensupport:ClientConfig clientConfig = { - auth: { - username: , - password: - } -}; -zensupport:Client baseClient = check new Client(clientConfig, serviceUrl = ""); -``` - -### Step 3: Invoke connector operation -1. Now you can use the operations available within the connector. Note that they are in the form of remote operations. - - Following is an example on how to create a user using the connector. - - ```ballerina - public function main() returns error? { - zensupport:CreateUserInfo user = { - user:{ - name: "Roger Wilco", - email: "roger@gmail.com", - organization: { name: "Rogers Organization" }, - role: "agent" - } - }; - zensupport:UserResponse userResult = check baseClient->createUser(user); - log:printInfo(userResult.toString()); - } - ``` - -2. Use `bal run` command to compile and run the Ballerina program. diff --git a/openapi/zendesk.support/Package.md b/openapi/zendesk.support/Package.md deleted file mode 100644 index 7891d333e..000000000 --- a/openapi/zendesk.support/Package.md +++ /dev/null @@ -1,19 +0,0 @@ -Connects to [Zendesk Support](https://developer.zendesk.com/api-reference/) from Ballerina - -## Package overview -The `ballerinax/zendesk.support` is a [Ballerina](https://ballerina.io/) connector for Zendesk Support API. -This package provides the capability of tracking, prioritizing and solving customer support tickets with Zendesk Support. - -### Compatibility -| | Version | -|---------------------|---------------------------| -| Ballerina Language | Ballerina Swan Lake 2201.4.1| -| Zendesk Support API | v2 | - -## Report issues -To report bugs, request new features, start new discussions, view project boards, etc., go to the [Ballerina Extended Library repository](https://github.com/ballerina-platform/ballerina-extended-library) - -## Useful links -- Discuss code changes of the Ballerina project in [ballerina-dev@googlegroups.com](mailto:ballerina-dev@googlegroups.com). -- Chat live with us via our [Discord server](https://discord.gg/ballerinalang). -- Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag diff --git a/openapi/zendesk.support/client.bal b/openapi/zendesk.support/client.bal deleted file mode 100644 index 1b8ff7389..000000000 --- a/openapi/zendesk.support/client.bal +++ /dev/null @@ -1,151 +0,0 @@ -// Copyright (c) 2022 WSO2 LLC. (http://www.wso2.org) All Rights Reserved. -// -// WSO2 Inc. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. -import ballerina/http; - -# This is a generated connector for [Zendesk Support API v2](https://developer.zendesk.com/api-reference/) OpenAPI specification. -# Zendesk Support is a simple system for tracking, prioritizing and solving customer support tickets. -@display {label: "Zendesk Support", iconPath: "icon.png"} -public isolated client class Client { - final http:Client clientEp; - # Gets invoked to initialize the `connector`. - # The connector initialization requires setting the API credentials. - # Create an [Zendesk account](https://www.zendesk.com/) and obtain tokens by following [this guide](https://developer.zendesk.com/api-reference/ticketing/introduction/#security-and-authentication). - # - # + config - The configurations to be used when initializing the `connector` - # + serviceUrl - URL of the target service - # + return - An error if connector initialization failed - public isolated function init(ConnectionConfig config, string serviceUrl) returns error? { - http:ClientConfiguration httpClientConfig = {auth: config.auth, httpVersion: config.httpVersion, timeout: config.timeout, forwarded: config.forwarded, poolConfig: config.poolConfig, compression: config.compression, circuitBreaker: config.circuitBreaker, retryConfig: config.retryConfig, validation: config.validation}; - do { - if config.http1Settings is ClientHttp1Settings { - ClientHttp1Settings settings = check config.http1Settings.ensureType(ClientHttp1Settings); - httpClientConfig.http1Settings = {...settings}; - } - if config.http2Settings is http:ClientHttp2Settings { - httpClientConfig.http2Settings = check config.http2Settings.ensureType(http:ClientHttp2Settings); - } - if config.cache is http:CacheConfig { - httpClientConfig.cache = check config.cache.ensureType(http:CacheConfig); - } - if config.responseLimits is http:ResponseLimitConfigs { - httpClientConfig.responseLimits = check config.responseLimits.ensureType(http:ResponseLimitConfigs); - } - if config.secureSocket is http:ClientSecureSocket { - httpClientConfig.secureSocket = check config.secureSocket.ensureType(http:ClientSecureSocket); - } - if config.proxy is http:ProxyConfig { - httpClientConfig.proxy = check config.proxy.ensureType(http:ProxyConfig); - } - } - http:Client httpEp = check new (serviceUrl, httpClientConfig); - self.clientEp = httpEp; - return; - } - # List Users. - # - # + return - Returns list of users available - remote isolated function listUsers() returns Users|error { - string resourcePath = string `/api/v2/users.json`; - Users response = check self.clientEp->get(resourcePath); - return response; - } - # Create User. - # - # + payload - The information for create user request - # + return - Returns detail of user created - remote isolated function createUser(CreateUserInfo payload) returns UserResponse|error { - string resourcePath = string `/api/v2/users.json`; - http:Request request = new; - json jsonBody = payload.toJson(); - request.setPayload(jsonBody, "application/json"); - UserResponse response = check self.clientEp->post(resourcePath, request); - return response; - } - # Search Users. - # - # + query - Query - # + return - Returns users matching the searchable string - remote isolated function searchUsers(string? query = ()) returns json|error { - string resourcePath = string `/api/v2/search.json`; - map queryParam = {"query": query}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam); - json response = check self.clientEp->get(resourcePath); - return response; - } - # Get User By Id. - # - # + user_id - User Id - # + return - Returns user belong to the user id - remote isolated function getUserById(string user_id) returns UserResponse|error { - string resourcePath = string `/api/v2/users/${getEncodedUri(user_id)}.json`; - UserResponse response = check self.clientEp->get(resourcePath); - return response; - } - # Delete User By Id. - # - # + user_id - User Id - # + return - Returns detail of user deleted - remote isolated function deleteUserById(string user_id) returns UserResponse|error { - string resourcePath = string `/api/v2/users/${getEncodedUri(user_id)}.json`; - UserResponse response = check self.clientEp-> delete(resourcePath); - return response; - } - # List Tickets. - # - # + return - Returns list of tickets available - remote isolated function listTickets() returns Tickets|error { - string resourcePath = string `/api/v2/tickets.json`; - Tickets response = check self.clientEp->get(resourcePath); - return response; - } - # Create Ticket. - # - # + payload - The information for create ticket request - # + return - Returns detail of created ticket - remote isolated function createTicket(CreateTicketInfo payload) returns TicketResponse|error { - string resourcePath = string `/api/v2/tickets.json`; - http:Request request = new; - json jsonBody = payload.toJson(); - request.setPayload(jsonBody, "application/json"); - TicketResponse response = check self.clientEp->post(resourcePath, request); - return response; - } - # Update Ticket. - # - # + ticket_id - Ticket Id - # + payload - The information for update ticket request - # + return - Returns deatil of updated ticket by ticket id - remote isolated function updateTicket(string ticket_id, UpdateTicketInfo payload) returns json|error { - string resourcePath = string `/api/v2/tickets/${getEncodedUri(ticket_id)}`; - http:Request request = new; - json jsonBody = payload.toJson(); - request.setPayload(jsonBody, "application/json"); - json response = check self.clientEp->put(resourcePath, request); - return response; - } - # Create Organization. - # - # + payload - The information for create organization request - # + return - Organization created - remote isolated function createOrganization(CreateOrganizationInfo payload) returns OrganizationResponse|error { - string resourcePath = string `/api/v2/organizations.json`; - http:Request request = new; - json jsonBody = payload.toJson(); - request.setPayload(jsonBody, "application/json"); - OrganizationResponse response = check self.clientEp->post(resourcePath, request); - return response; - } -} diff --git a/openapi/zendesk.support/icon.png b/openapi/zendesk.support/icon.png deleted file mode 100644 index 382c619c3..000000000 Binary files a/openapi/zendesk.support/icon.png and /dev/null differ diff --git a/openapi/zendesk.support/openapi.yaml b/openapi/zendesk.support/openapi.yaml deleted file mode 100644 index 355855a17..000000000 --- a/openapi/zendesk.support/openapi.yaml +++ /dev/null @@ -1,836 +0,0 @@ -openapi: 3.0.1 -info: - title: Zendesk Support API - description: > - This is a generated connector for [Zendesk Support API v2](https://developer.zendesk.com/api-reference/) OpenAPI specification. - - Zendesk Support is a simple system for tracking, prioritizing and solving customer support tickets. - version: "v2" - x-ballerina-init-description: > - The connector initialization requires setting the API credentials. - - Create an [Zendesk account](https://www.zendesk.com/) and obtain tokens by following [this guide](https://developer.zendesk.com/api-reference/ticketing/introduction/#security-and-authentication). - x-ballerina-display: - label: Zendesk Support - iconPath: "icon.png" -paths: - /api/v2/users.json: - get: - summary: List Users. - operationId: listUsers - responses: - 200: - description: Returns list of users available - content: - application/json: - schema: - $ref: "#/components/schemas/Users" - post: - summary: Create User. - operationId: createUser - requestBody: - description: The information for create user request - content: - application/json: - schema: - $ref: "#/components/schemas/CreateUserInfo" - required: true - responses: - 200: - description: Returns detail of user created - content: - application/json: - schema: - $ref: "#/components/schemas/UserResponse" - /api/v2/search.json: - get: - summary: Search Users. - operationId: searchUsers - parameters: - - name: query - in: query - description: Query - schema: - type: string - responses: - 200: - description: Returns users matching the searchable string - content: - application/json: {} - /api/v2/users/{user_id}.json: - get: - summary: Get User By Id. - operationId: getUserById - parameters: - - name: user_id - in: path - required: true - description: User Id - schema: - type: string - responses: - 200: - description: Returns user belong to the user id - content: - application/json: - schema: - $ref: "#/components/schemas/UserResponse" - delete: - summary: Delete User By Id. - operationId: deleteUserById - parameters: - - name: user_id - in: path - required: true - description: User Id - schema: - type: string - responses: - 200: - description: Returns detail of user deleted - content: - application/json: - schema: - $ref: "#/components/schemas/UserResponse" - /api/v2/tickets.json: - get: - summary: List Tickets. - operationId: listTickets - responses: - 200: - description: Returns list of tickets available - content: - application/json: - schema: - $ref: "#/components/schemas/Tickets" - post: - summary: Create Ticket. - operationId: createTicket - requestBody: - description: The information for create ticket request - content: - application/json: - schema: - $ref: "#/components/schemas/CreateTicketInfo" - required: true - responses: - 200: - description: Returns detail of created ticket - content: - application/json: - schema: - $ref: "#/components/schemas/TicketResponse" - /api/v2/tickets/{ticket_id}: - put: - summary: Update Ticket. - operationId: updateTicket - parameters: - - name: ticket_id - in: path - required: true - description: Ticket Id - schema: - type: string - requestBody: - description: The information for update ticket request - content: - application/json: - schema: - $ref: "#/components/schemas/UpdateTicketInfo" - required: true - responses: - 200: - description: Returns deatil of updated ticket by ticket id - content: - application/json: {} - /api/v2/organizations.json: - post: - summary: Create Organization. - operationId: createOrganization - requestBody: - description: The information for create organization request - content: - application/json: - schema: - $ref: "#/components/schemas/CreateOrganizationInfo" - required: true - responses: - 200: - description: Organization created - content: - application/json: - schema: - $ref: "#/components/schemas/OrganizationResponse" - 422: - description: Unprocessable Entity - content: - application/json: {} -components: - securitySchemes: - basicAuth: - type: http - scheme: basic - schemas: - CreateTicketInfo: - description: The information for create ticket request - type: object - properties: - ticket: - type: object - $ref: "#/components/schemas/TicketInfo" - TicketInfo: - type: object - description: The ticket information to create - properties: - assignee_email: - type: string - description: The email address of the agent to assign the ticket to - assignee_id: - type: integer - description: The agent currently assigned to the ticket - attribute_value_ids: - type: array - items: - type: integer - description: An array of the IDs of attribute values to be associated with the ticket - collaborator_ids: - type: array - items: - type: integer - description: The ids of users currently CC'ed on the ticket - custom_fields: - type: array - items: - type: object - $ref: "#/components/schemas/CustomField" - description: Custom fields for the ticket - custom_status_id: - type: integer - description: The custom ticket status id of the ticket - due_at: - type: string - description: If this is a ticket of type "task" it has a due date. Due date format uses ISO 8601 format. - email_ccs: - type: array - items: - type: object - $ref: "#/components/schemas/EmailCC" - description: An array of objects that represent agent or end users email CCs to add or delete from the ticket - external_id: - type: string - description: An id you can use to link Zendesk Support tickets to local records - followers: - type: array - items: - type: object - $ref: "#/components/schemas/Follower" - description: An array of objects that represent agent followers to add or delete from the ticket - group_id: - type: integer - description: The group this ticket is assigned to - organization_id: - type: integer - description: The organization of the requester. You can only specify the ID of an organization associated with the requester. - priority: - type: string - description: Priority of ticket. Allowed values are "urgent", "high", "normal", or "low". - problem_id: - type: integer - description: For tickets of type "incident", the ID of the problem the incident is linked to - requester_id: - type: integer - description: The user who requested this ticket - safe_update: - type: boolean - description: Optional boolean. When true and an update_stamp date is included, protects against ticket update collisions and returns a message to let you know if one occurs. - sharing_agreement_ids: - type: array - items: - type: integer - description: The ids of the sharing agreements used for this ticket - status: - type: string - description: The state of the ticket. Allowed values are "new", "open", "pending", "hold", "solved", or "closed". - subject: - type: string - description: The value of the subject field for this ticket - tags: - type: array - items: - type: string - description: The array of tags applied to this ticket - type: - type: string - description: The type of this ticket. Allowed values are "problem", "incident", "question", or "task". - updated_stamp: - type: string - description: Datetime of last update received from API. See the safe_update property - brand_id: - type: integer - description: Enterprise only. The id of the brand this ticket is associated with - collaborators: - type: array - items: - oneOf: - - type: string - - type: integer - - $ref: "#/components/schemas/Collaborator" - description: Users to add as cc's when creating a ticket. - email_cc_ids: - type: array - items: - type: integer - description: The ids of agents or end users currently CC'ed on the ticket. - follower_ids: - type: array - items: - type: integer - description: The ids of agents currently following the ticket. - macro_ids: - type: array - items: - type: integer - description: List of macro IDs to be recorded in the ticket audit - raw_subject: - type: string - description: The dynamic content placeholder, if present, or the "subject" value - recipient: - type: string - description: The original recipient e-mail address of the ticket - submitter_id: - type: integer - description: The user who submitted the ticket - ticket_form_id: - type: integer - description: Enterprise only. The id of the ticket form to render for the ticket - via: - type: object - description: How or why an action or event was created - $ref: "#/components/schemas/Via" - via_followup_source_id: - type: integer - description: The id of a closed ticket when creating a follow-up ticket - comment: - type: object - $ref: "#/components/schemas/Comment" - Collaborator: - description: Details of a collaborator - type: object - properties: - name: - type: string - email: - type: string - CustomField: - description: Custom fields for the ticket - type: object - properties: - id: - type: integer - value: - type: string - EmailCC: - description: Agent or end users email CCs to add or delete from the ticket - type: object - properties: - user_id: - type: string - action: - type: string - user_email: - type: string - user_name: - type: string - Follower: - description: Agent followers to add or delete from the ticket - type: object - properties: - user_id: - type: string - action: - type: string - user_email: - type: string - user_name: - type: string - Via: - description: How or why an action or event was created - type: object - properties: - channel: - oneOf: - - type: string - - type: integer - source: - type: object - $ref: "#/components/schemas/Source" - Source: - description: More information about the source of the ticket - type: object - properties: - rel: - type: string - from: - type: object - $ref: "#/components/schemas/SourceDetail" - to: - type: object - $ref: "#/components/schemas/SourceDetail" - SourceDetail: - properties: - id: - type: integer - title: - type: string - CreateUserInfo: - description: The information for create user request - type: object - properties: - user: - type: object - $ref: "#/components/schemas/UserInfo" - UserInfo: - description: The user information to create - type: object - properties: - custom_role_id: - type: string - description: A custom role if the user is an agent on the Enterprise plan or above - email: - type: string - description: The user's primary email address - name: - type: string - description: The user's name - organization: - type: object - description: The user's organization information - $ref: "#/components/schemas/OrganizationInfo" - role: - type: string - description: The user's role. Possible values are "end-user", "agent", or "admin" - OrganizationInfo: - description: The organization information to create - type: object - properties: - name: - type: string - description: organization name - UpdateTicketInfo: - description: The information for create ticket request - type: object - properties: - ticket: - type: object - $ref: "#/components/schemas/TicketInfoUpdate" - TicketInfoUpdate: - description: The information for create ticket request - type: object - properties: - ticket: - type: object - properties: - subject: - type: string - description: subject - priority: - type: string - description: Priority of ticket. Allowed values are "urgent", "high", "normal", or "low" - comment: - type: object - $ref: "#/components/schemas/Comment" - Comment: - description: Ticket comments represent the conversation between requesters, collaborators, and agents - type: object - properties: - author_id: - type: integer - description: author_id - body: - type: string - description: body - html_body: - type: string - description: html_body - public: - type: boolean - description: public - TicketResponse: - description: Ticket comments represent the conversation between requesters, collaborators, and agents - type: object - properties: - ticket: - type: object - $ref: "#/components/schemas/Ticket" - Ticket: - type: object - properties: - allow_attachments: - type: boolean - description: Permission for agents to add add attachments to a comment. Defaults to true - nullable: true - allow_channelback: - type: boolean - description: Is false if channelback is disabled, true otherwise. Only applicable for channels framework ticket - nullable: true - assignee_id: - type: integer - description: The agent currently assigned to the ticket - nullable: true - brand_id: - type: integer - description: Enterprise only. The id of the brand this ticket is associated with - nullable: true - created_at: - type: string - description: When this ticket record was created - nullable: true - description: - type: string - description: Read-only first comment on the ticket. When creating a ticket, use comment to set the description - nullable: true - due_at: - type: string - description: If this is a ticket of type "task" it has a due date. Due date format uses ISO 8601 format - nullable: true - external_id: - type: string - description: An id you can use to link Zendesk Support tickets to local records - nullable: true - forum_topic_id: - type: integer - description: The topic in the Zendesk Web portal this ticket originated from, if any. The Web portal is deprecated - nullable: true - group_id: - type: integer - description: The group this ticket is assigned to - nullable: true - has_incidents: - type: boolean - description: Is true if a ticket is a problem type and has one or more incidents linked to it. Otherwise, the value is false. - nullable: true - id: - type: integer - description: Automatically assigned when the ticket is created - nullable: true - is_public: - type: boolean - description: Is true if any comments are public, false otherwise - nullable: true - organization_id: - type: integer - description: The organization of the requester. You can only specify the ID of an organization associated with the requester - nullable: true - priority: - type: string - description: The urgency with which the ticket should be addressed. Allowed values are "urgent", "high", "normal", or "low" - nullable: true - problem_id: - type: integer - description: For tickets of type "incident", the ID of the problem the incident is linked to - nullable: true - raw_subject: - type: string - description: The dynamic content placeholder, if present, or the "subject" value - nullable: true - recipient: - type: string - description: The original recipient e-mail address of the ticket - nullable: true - requester_id: - type: integer - description: The user who requested this ticket - nullable: true - status: - type: string - description: The state of the ticket. Allowed values are "new", "open", "pending", "hold", "solved", or "closed"The state of the ticket. Allowed values are "new", "open", "pending", "hold", "solved", or "closed". - nullable: true - subject: - type: string - description: The value of the subject field for this ticket - nullable: true - submitter_id: - type: integer - description: The user who submitted the ticket. The submitter always becomes the author of the first comment on the ticket - nullable: true - ticket_form_id: - type: integer - description: Enterprise only. The id of the ticket form to render for the ticket - type: - type: string - description: The type of this ticket. Allowed values are "problem", "incident", "question", or "task" The type of this ticket. Allowed values are "problem", "incident", "question", or "task". - nullable: true - updated_at: - type: string - description: When this record last got updated - nullable: true - url: - type: string - description: The API url of this ticket - nullable: true - via_followup_source_id: - type: integer - description: The id of a closed ticket when creating a follow-up ticket - nullable: true - Tickets: - type: object - properties: - tickets: - type: array - items: - $ref: "#/components/schemas/Ticket" - next_page: - type: integer - description: next_page - nullable: true - previous_page: - type: integer - description: previous_page - nullable: true - count: - type: integer - description: count - OrganizationResponse: - type: object - properties: - organization: - type: object - $ref: "#/components/schemas/Organization" - Organization: - type: object - properties: - url: - type: string - description: The API url of this organization - id: - type: integer - description: Automatically assigned id when the organization is created - name: - type: string - description: A unique name for the organization - shared_tickets: - type: boolean - description: End users in this organization are able to see each other's tickets - shared_comments: - type: boolean - description: End users in this organization are able to see each other's comments on tickets - external_id: - type: string - description: A unique external id to associate organizations to an external record - nullable: true - created_at: - type: string - description: The time the organization was created - updated_at: - type: string - description: The time the organization was updated - domain_names: - type: array - items: - type: string - description: An array of domain names associated with this organization - details: - type: string - description: Any details obout the organization, such as the address - nullable: true - notes: - type: string - description: Any notes you have about the organization - nullable: true - group_id: - type: integer - description: New tickets from users in this organization are automatically put in this group - nullable: true - tags: - type: array - items: - type: string - description: The tags of the organization - organization_fields: - type: object - description: organization_fields - CreateOrganizationInfo: - description: The information for create organization request - type: object - properties: - organization: - type: object - $ref: "#/components/schemas/OrganizationInfo" - UserResponse: - type: object - properties: - user: - type: object - $ref: "#/components/schemas/User" - User: - type: object - properties: - active: - type: boolean - description: False if the user has been deleted - nullable: true - alias: - type: string - description: An alias displayed to end users - nullable: true - chat_only: - type: boolean - description: Whether or not the user is a chat-only agent - nullable: true - created_at: - type: string - description: The time the user was created - nullable: true - custom_role_id: - type: integer - description: A custom role if the user is an agent on the Enterprise plan or above - nullable: true - default_group_id: - type: integer - description: The id of the user's default group - nullable: true - details: - type: string - description: Any details you want to store about the user, such as an address - nullable: true - email: - type: string - description: The user's primary email address - nullable: true - external_id: - type: string - description: A unique identifier from another system. The API treats the id as case insensitive. Example - "ian1" and "Ian1" are the same user - nullable: true - iana_time_zone: - type: string - description: The time zone for the user - nullable: true - id: - type: integer - description: Automatically assigned id when the user is created - nullable: true - last_login_at: - type: string - description: The last time the user signed in to Zendesk Support - nullable: true - locale: - type: string - description: The user's locale. A BCP-47 compliant tag for the locale. If both "locale" and "locale_id" are present on create or update, "locale_id" is ignored and only "locale" is used. - nullable: true - locale_id: - type: integer - description: The user's language identifier - nullable: true - moderator: - type: boolean - description: Designates whether the user has forum moderation capabilities - nullable: true - name: - type: string - description: The user's name - nullable: true - notes: - type: string - description: Any notes you want to store about the user - nullable: true - only_private_comments: - type: boolean - description: true if the user can only create private comments - nullable: true - organization_id: - type: integer - description: The id of the user's organization. If the user has more than one organization memberships, the id of the user's default organization - nullable: true - phone: - type: string - description: The user's primary phone number - nullable: true - report_csv: - type: boolean - description: Whether or not the user can access the CSV report on the Search tab of the Reporting page in the Support admin interface - nullable: true - restricted_agent: - type: boolean - description: If the agent has any restrictions; false for admins and unrestricted agents, true for other agents - role: - type: string - description: The user's role. Possible values are "end-user", "agent", or "admin" - nullable: true - role_type: - type: integer - description: The user's role id. 0 for custom agents, 1 for light agent, 2 for chat agent, 3 for chat agent added to the Support account as a contributor (Chat Phase 4), and 5 for billing admins - nullable: true - shared: - type: boolean - description: If the user is shared from a different Zendesk Support instance. Ticket sharing accounts only - nullable: true - shared_agent: - type: boolean - description: If the user is a shared agent from a different Zendesk Support instance. Ticket sharing accounts only - nullable: true - shared_phone_number: - type: boolean - description: Whether the phone number is shared or not - nullable: true - signature: - type: string - description: The user's signature. Only agents and admins can have signatures - nullable: true - suspended: - type: boolean - description: If the agent is suspended. Tickets from suspended users are also suspended, and these users cannot sign in to the end user portal - nullable: true - ticket_restriction: - type: string - description: Specifies which tickets the user has access to. Possible values are - "organization", "groups", "assigned", "requested", null - nullable: true - time_zone: - type: string - description: The user's time zone - nullable: true - two_factor_auth_enabled: - type: boolean - description: If two factor authentication is enabled - nullable: true - updated_at: - type: string - description: The time the user was last updated - nullable: true - url: - type: string - description: The user's API url - nullable: true - verified: - type: boolean - description: Any of the user's identities is verified - nullable: true - Users: - type: object - properties: - users: - type: array - items: - properties: - id: - type: integer - description: id - url: - type: string - description: url - name: - type: string - description: name - email: - type: string - description: email - next_page: - type: integer - description: next_page - nullable: true - previous_page: - type: integer - description: previous_page - nullable: true - count: - type: integer - description: count diff --git a/openapi/zendesk.support/types.bal b/openapi/zendesk.support/types.bal deleted file mode 100644 index 725686343..000000000 --- a/openapi/zendesk.support/types.bal +++ /dev/null @@ -1,469 +0,0 @@ -// Copyright (c) 2022 WSO2 LLC. (http://www.wso2.org) All Rights Reserved. -// -// WSO2 Inc. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/http; - -# Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint. -@display {label: "Connection Config"} -public type ConnectionConfig record {| - # Configurations related to client authentication - http:CredentialsConfig auth; - # The HTTP version understood by the client - http:HttpVersion httpVersion = http:HTTP_2_0; - # Configurations related to HTTP/1.x protocol - ClientHttp1Settings http1Settings?; - # Configurations related to HTTP/2 protocol - http:ClientHttp2Settings http2Settings?; - # The maximum time to wait (in seconds) for a response before closing the connection - decimal timeout = 60; - # The choice of setting `forwarded`/`x-forwarded` header - string forwarded = "disable"; - # Configurations associated with request pooling - http:PoolConfiguration poolConfig?; - # HTTP caching related configurations - http:CacheConfig cache?; - # Specifies the way of handling compression (`accept-encoding`) header - http:Compression compression = http:COMPRESSION_AUTO; - # Configurations associated with the behaviour of the Circuit Breaker - http:CircuitBreakerConfig circuitBreaker?; - # Configurations associated with retrying - http:RetryConfig retryConfig?; - # Configurations associated with inbound response size limits - http:ResponseLimitConfigs responseLimits?; - # SSL/TLS-related options - http:ClientSecureSocket secureSocket?; - # Proxy server related options - http:ProxyConfig proxy?; - # Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default - boolean validation = true; -|}; - -# Provides settings related to HTTP/1.x protocol. -public type ClientHttp1Settings record {| - # Specifies whether to reuse a connection for multiple requests - http:KeepAlive keepAlive = http:KEEPALIVE_AUTO; - # The chunking behaviour of the request - http:Chunking chunking = http:CHUNKING_AUTO; - # Proxy server related options - ProxyConfig proxy?; -|}; - -# Proxy server configurations to be used with the HTTP client endpoint. -public type ProxyConfig record {| - # Host name of the proxy server - string host = ""; - # Proxy server port - int port = 0; - # Proxy server username - string userName = ""; - # Proxy server password - @display {label: "", kind: "password"} - string password = ""; -|}; - -public type Organization record { - # The API url of this organization - string url?; - # Automatically assigned id when the organization is created - int id?; - # A unique name for the organization - string name?; - # End users in this organization are able to see each other's tickets - boolean shared_tickets?; - # End users in this organization are able to see each other's comments on tickets - boolean shared_comments?; - # A unique external id to associate organizations to an external record - string? external_id?; - # The time the organization was created - string created_at?; - # The time the organization was updated - string updated_at?; - # An array of domain names associated with this organization - string[] domain_names?; - # Any details obout the organization, such as the address - string? details?; - # Any notes you have about the organization - string? notes?; - # New tickets from users in this organization are automatically put in this group - int? group_id?; - # The tags of the organization - string[] tags?; - # organization_fields - record {} organization_fields?; -}; - -public type User record { - # False if the user has been deleted - boolean? active?; - # An alias displayed to end users - string? alias?; - # Whether or not the user is a chat-only agent - boolean? chat_only?; - # The time the user was created - string? created_at?; - # A custom role if the user is an agent on the Enterprise plan or above - int? custom_role_id?; - # The id of the user's default group - int? default_group_id?; - # Any details you want to store about the user, such as an address - string? details?; - # The user's primary email address - string? email?; - # A unique identifier from another system. The API treats the id as case insensitive. Example - "ian1" and "Ian1" are the same user - string? external_id?; - # The time zone for the user - string? iana_time_zone?; - # Automatically assigned id when the user is created - int? id?; - # The last time the user signed in to Zendesk Support - string? last_login_at?; - # The user's locale. A BCP-47 compliant tag for the locale. If both "locale" and "locale_id" are present on create or update, "locale_id" is ignored and only "locale" is used. - string? locale?; - # The user's language identifier - int? locale_id?; - # Designates whether the user has forum moderation capabilities - boolean? moderator?; - # The user's name - string? name?; - # Any notes you want to store about the user - string? notes?; - # true if the user can only create private comments - boolean? only_private_comments?; - # The id of the user's organization. If the user has more than one organization memberships, the id of the user's default organization - int? organization_id?; - # The user's primary phone number - string? phone?; - # Whether or not the user can access the CSV report on the Search tab of the Reporting page in the Support admin interface - boolean? report_csv?; - # If the agent has any restrictions; false for admins and unrestricted agents, true for other agents - boolean restricted_agent?; - # The user's role. Possible values are "end-user", "agent", or "admin" - string? role?; - # The user's role id. 0 for custom agents, 1 for light agent, 2 for chat agent, 3 for chat agent added to the Support account as a contributor (Chat Phase 4), and 5 for billing admins - int? role_type?; - # If the user is shared from a different Zendesk Support instance. Ticket sharing accounts only - boolean? shared?; - # If the user is a shared agent from a different Zendesk Support instance. Ticket sharing accounts only - boolean? shared_agent?; - # Whether the phone number is shared or not - boolean? shared_phone_number?; - # The user's signature. Only agents and admins can have signatures - string? signature?; - # If the agent is suspended. Tickets from suspended users are also suspended, and these users cannot sign in to the end user portal - boolean? suspended?; - # Specifies which tickets the user has access to. Possible values are - "organization", "groups", "assigned", "requested", null - string? ticket_restriction?; - # The user's time zone - string? time_zone?; - # If two factor authentication is enabled - boolean? two_factor_auth_enabled?; - # The time the user was last updated - string? updated_at?; - # The user's API url - string? url?; - # Any of the user's identities is verified - boolean? verified?; -}; - -# The information for create ticket request -public type TicketInfoUpdate record { - TicketInfoUpdate_ticket ticket?; -}; - -# The information for create user request -public type CreateUserInfo record { - # The user information to create - UserInfo user?; -}; - -# Agent or end users email CCs to add or delete from the ticket -public type EmailCC record { - string user_id?; - string action?; - string user_email?; - string user_name?; -}; - -# The user information to create -public type UserInfo record { - # A custom role if the user is an agent on the Enterprise plan or above - string custom_role_id?; - # The user's primary email address - string email?; - # The user's name - string name?; - # The organization information to create - OrganizationInfo organization?; - # The user's role. Possible values are "end-user", "agent", or "admin" - string role?; -}; - -public type Users record { - Users_users[] users?; - # next_page - int? next_page?; - # previous_page - int? previous_page?; - # count - int count?; -}; - -# The information for create ticket request -public type CreateTicketInfo record { - # The ticket information to create - TicketInfo ticket?; -}; - -# More information about the source of the ticket -public type Source record { - string rel?; - SourceDetail 'from?; - SourceDetail to?; -}; - -public type Users_users record { - # id - int id?; - # url - string url?; - # name - string name?; - # email - string email?; -}; - -# Ticket comments represent the conversation between requesters, collaborators, and agents -public type TicketResponse record { - Ticket ticket?; -}; - -public type Tickets record { - Ticket[] tickets?; - # next_page - int? next_page?; - # previous_page - int? previous_page?; - # count - int count?; -}; - -# The information for create organization request -public type CreateOrganizationInfo record { - # The organization information to create - OrganizationInfo organization?; -}; - -# The organization information to create -public type OrganizationInfo record { - # organization name - string name?; -}; - -# Ticket comments represent the conversation between requesters, collaborators, and agents -public type Comment record { - # author_id - int author_id?; - # body - string body?; - # html_body - string html_body?; - # public - boolean 'public?; -}; - -public type Ticket record { - # Permission for agents to add add attachments to a comment. Defaults to true - boolean? allow_attachments?; - # Is false if channelback is disabled, true otherwise. Only applicable for channels framework ticket - boolean? allow_channelback?; - # The agent currently assigned to the ticket - int? assignee_id?; - # Enterprise only. The id of the brand this ticket is associated with - int? brand_id?; - # When this ticket record was created - string? created_at?; - # Read-only first comment on the ticket. When creating a ticket, use comment to set the description - string? description?; - # If this is a ticket of type "task" it has a due date. Due date format uses ISO 8601 format - string? due_at?; - # An id you can use to link Zendesk Support tickets to local records - string? external_id?; - # The topic in the Zendesk Web portal this ticket originated from, if any. The Web portal is deprecated - int? forum_topic_id?; - # The group this ticket is assigned to - int? group_id?; - # Is true if a ticket is a problem type and has one or more incidents linked to it. Otherwise, the value is false. - boolean? has_incidents?; - # Automatically assigned when the ticket is created - int? id?; - # Is true if any comments are public, false otherwise - boolean? is_public?; - # The organization of the requester. You can only specify the ID of an organization associated with the requester - int? organization_id?; - # The urgency with which the ticket should be addressed. Allowed values are "urgent", "high", "normal", or "low" - string? priority?; - # For tickets of type "incident", the ID of the problem the incident is linked to - int? problem_id?; - # The dynamic content placeholder, if present, or the "subject" value - string? raw_subject?; - # The original recipient e-mail address of the ticket - string? recipient?; - # The user who requested this ticket - int? requester_id?; - # The state of the ticket. Allowed values are "new", "open", "pending", "hold", "solved", or "closed"The state of the ticket. Allowed values are "new", "open", "pending", "hold", "solved", or "closed". - string? status?; - # The value of the subject field for this ticket - string? subject?; - # The user who submitted the ticket. The submitter always becomes the author of the first comment on the ticket - int? submitter_id?; - # Enterprise only. The id of the ticket form to render for the ticket - int ticket_form_id?; - # The type of this ticket. Allowed values are "problem", "incident", "question", or "task" The type of this ticket. Allowed values are "problem", "incident", "question", or "task". - string? 'type?; - # When this record last got updated - string? updated_at?; - # The API url of this ticket - string? url?; - # The id of a closed ticket when creating a follow-up ticket - int? via_followup_source_id?; -}; - -# The ticket information to create -public type TicketInfo record { - # The email address of the agent to assign the ticket to - string assignee_email?; - # The agent currently assigned to the ticket - int assignee_id?; - # An array of the IDs of attribute values to be associated with the ticket - int[] attribute_value_ids?; - # The ids of users currently CC'ed on the ticket - int[] collaborator_ids?; - # Custom fields for the ticket - CustomField[] custom_fields?; - # The custom ticket status id of the ticket - int custom_status_id?; - # If this is a ticket of type "task" it has a due date. Due date format uses ISO 8601 format. - string due_at?; - # An array of objects that represent agent or end users email CCs to add or delete from the ticket - EmailCC[] email_ccs?; - # An id you can use to link Zendesk Support tickets to local records - string external_id?; - # An array of objects that represent agent followers to add or delete from the ticket - Follower[] followers?; - # The group this ticket is assigned to - int group_id?; - # The organization of the requester. You can only specify the ID of an organization associated with the requester. - int organization_id?; - # Priority of ticket. Allowed values are "urgent", "high", "normal", or "low". - string priority?; - # For tickets of type "incident", the ID of the problem the incident is linked to - int problem_id?; - # The user who requested this ticket - int requester_id?; - # Optional boolean. When true and an update_stamp date is included, protects against ticket update collisions and returns a message to let you know if one occurs. - boolean safe_update?; - # The ids of the sharing agreements used for this ticket - int[] sharing_agreement_ids?; - # The state of the ticket. Allowed values are "new", "open", "pending", "hold", "solved", or "closed". - string status?; - # The value of the subject field for this ticket - string subject?; - # The array of tags applied to this ticket - string[] tags?; - # The type of this ticket. Allowed values are "problem", "incident", "question", or "task". - string 'type?; - # Datetime of last update received from API. See the safe_update property - string updated_stamp?; - # Enterprise only. The id of the brand this ticket is associated with - int brand_id?; - # Users to add as cc's when creating a ticket. - (string|int|Collaborator)[] collaborators?; - # The ids of agents or end users currently CC'ed on the ticket. - int[] email_cc_ids?; - # The ids of agents currently following the ticket. - int[] follower_ids?; - # List of macro IDs to be recorded in the ticket audit - int[] macro_ids?; - # The dynamic content placeholder, if present, or the "subject" value - string raw_subject?; - # The original recipient e-mail address of the ticket - string recipient?; - # The user who submitted the ticket - int submitter_id?; - # Enterprise only. The id of the ticket form to render for the ticket - int ticket_form_id?; - # How or why an action or event was created - Via via?; - # The id of a closed ticket when creating a follow-up ticket - int via_followup_source_id?; - # Ticket comments represent the conversation between requesters, collaborators, and agents - Comment comment?; -}; - -# The information for create ticket request -public type UpdateTicketInfo record { - # The information for create ticket request - TicketInfoUpdate ticket?; -}; - -# Agent followers to add or delete from the ticket -public type Follower record { - string user_id?; - string action?; - string user_email?; - string user_name?; -}; - -public type SourceDetail record { - int id?; - string title?; -}; - -# How or why an action or event was created -public type Via record { - string|int channel?; - # More information about the source of the ticket - Source 'source?; -}; - -public type TicketInfoUpdate_ticket record { - # subject - string subject?; - # Priority of ticket. Allowed values are "urgent", "high", "normal", or "low" - string priority?; - # Ticket comments represent the conversation between requesters, collaborators, and agents - Comment comment?; -}; - -public type UserResponse record { - User user?; -}; - -# Details of a collaborator -public type Collaborator record { - string name?; - string email?; -}; - -public type OrganizationResponse record { - Organization organization?; -}; - -# Custom fields for the ticket -public type CustomField record { - int id?; - string value?; -}; diff --git a/openapi/zendesk.support/utils.bal b/openapi/zendesk.support/utils.bal deleted file mode 100644 index e1c9578c9..000000000 --- a/openapi/zendesk.support/utils.bal +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) 2022 WSO2 LLC. (http://www.wso2.org) All Rights Reserved. -// -// WSO2 Inc. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/url; - -type SimpleBasicType string|boolean|int|float|decimal; - -# Represents encoding mechanism details. -type Encoding record { - # Defines how multiple values are delimited - string style = FORM; - # Specifies whether arrays and objects should generate as separate fields - boolean explode = true; - # Specifies the custom content type - string contentType?; - # Specifies the custom headers - map headers?; -}; - -enum EncodingStyle { - DEEPOBJECT, FORM, SPACEDELIMITED, PIPEDELIMITED -} - -final Encoding & readonly defaultEncoding = {}; - -# Serialize the record according to the deepObject style. -# -# + parent - Parent record name -# + anyRecord - Record to be serialized -# + return - Serialized record as a string -isolated function getDeepObjectStyleRequest(string parent, record {} anyRecord) returns string { - string[] recordArray = []; - foreach [string, anydata] [key, value] in anyRecord.entries() { - if value is SimpleBasicType { - recordArray.push(parent + "[" + key + "]" + "=" + getEncodedUri(value.toString())); - } else if value is SimpleBasicType[] { - recordArray.push(getSerializedArray(parent + "[" + key + "]" + "[]", value, DEEPOBJECT, true)); - } else if value is record {} { - string nextParent = parent + "[" + key + "]"; - recordArray.push(getDeepObjectStyleRequest(nextParent, value)); - } else if value is record {}[] { - string nextParent = parent + "[" + key + "]"; - recordArray.push(getSerializedRecordArray(nextParent, value, DEEPOBJECT)); - } - recordArray.push("&"); - } - _ = recordArray.pop(); - return string:'join("", ...recordArray); -} - -# Serialize the record according to the form style. -# -# + parent - Parent record name -# + anyRecord - Record to be serialized -# + explode - Specifies whether arrays and objects should generate separate parameters -# + return - Serialized record as a string -isolated function getFormStyleRequest(string parent, record {} anyRecord, boolean explode = true) returns string { - string[] recordArray = []; - if explode { - foreach [string, anydata] [key, value] in anyRecord.entries() { - if (value is SimpleBasicType) { - recordArray.push(key, "=", getEncodedUri(value.toString())); - } else if (value is SimpleBasicType[]) { - recordArray.push(getSerializedArray(key, value, explode = explode)); - } else if (value is record {}) { - recordArray.push(getFormStyleRequest(parent, value, explode)); - } - recordArray.push("&"); - } - _ = recordArray.pop(); - } else { - foreach [string, anydata] [key, value] in anyRecord.entries() { - if (value is SimpleBasicType) { - recordArray.push(key, ",", getEncodedUri(value.toString())); - } else if (value is SimpleBasicType[]) { - recordArray.push(getSerializedArray(key, value, explode = false)); - } else if (value is record {}) { - recordArray.push(getFormStyleRequest(parent, value, explode)); - } - recordArray.push(","); - } - _ = recordArray.pop(); - } - return string:'join("", ...recordArray); -} - -# Serialize arrays. -# -# + arrayName - Name of the field with arrays -# + anyArray - Array to be serialized -# + style - Defines how multiple values are delimited -# + explode - Specifies whether arrays and objects should generate separate parameters -# + return - Serialized array as a string -isolated function getSerializedArray(string arrayName, anydata[] anyArray, string style = "form", boolean explode = true) returns string { - string key = arrayName; - string[] arrayValues = []; - if (anyArray.length() > 0) { - if (style == FORM && !explode) { - arrayValues.push(key, "="); - foreach anydata i in anyArray { - arrayValues.push(getEncodedUri(i.toString()), ","); - } - } else if (style == SPACEDELIMITED && !explode) { - arrayValues.push(key, "="); - foreach anydata i in anyArray { - arrayValues.push(getEncodedUri(i.toString()), "%20"); - } - } else if (style == PIPEDELIMITED && !explode) { - arrayValues.push(key, "="); - foreach anydata i in anyArray { - arrayValues.push(getEncodedUri(i.toString()), "|"); - } - } else if (style == DEEPOBJECT) { - foreach anydata i in anyArray { - arrayValues.push(key, "[]", "=", getEncodedUri(i.toString()), "&"); - } - } else { - foreach anydata i in anyArray { - arrayValues.push(key, "=", getEncodedUri(i.toString()), "&"); - } - } - _ = arrayValues.pop(); - } - return string:'join("", ...arrayValues); -} - -# Serialize the array of records according to the form style. -# -# + parent - Parent record name -# + value - Array of records to be serialized -# + style - Defines how multiple values are delimited -# + explode - Specifies whether arrays and objects should generate separate parameters -# + return - Serialized record as a string -isolated function getSerializedRecordArray(string parent, record {}[] value, string style = FORM, boolean explode = true) returns string { - string[] serializedArray = []; - if style == DEEPOBJECT { - int arayIndex = 0; - foreach var recordItem in value { - serializedArray.push(getDeepObjectStyleRequest(parent + "[" + arayIndex.toString() + "]", recordItem), "&"); - arayIndex = arayIndex + 1; - } - } else { - if (!explode) { - serializedArray.push(parent, "="); - } - foreach var recordItem in value { - serializedArray.push(getFormStyleRequest(parent, recordItem, explode), ","); - } - } - _ = serializedArray.pop(); - return string:'join("", ...serializedArray); -} - -# Get Encoded URI for a given value. -# -# + value - Value to be encoded -# + return - Encoded string -isolated function getEncodedUri(anydata value) returns string { - string|error encoded = url:encode(value.toString(), "UTF8"); - if (encoded is string) { - return encoded; - } else { - return value.toString(); - } -} - -# Generate query path with query parameter. -# -# + queryParam - Query parameter map -# + encodingMap - Details on serialization mechanism -# + return - Returns generated Path or error at failure of client initialization -isolated function getPathForQueryParam(map queryParam, map encodingMap = {}) returns string|error { - string[] param = []; - if (queryParam.length() > 0) { - param.push("?"); - foreach var [key, value] in queryParam.entries() { - if value is () { - _ = queryParam.remove(key); - continue; - } - Encoding encodingData = encodingMap.hasKey(key) ? encodingMap.get(key) : defaultEncoding; - if (value is SimpleBasicType) { - param.push(key, "=", getEncodedUri(value.toString())); - } else if (value is SimpleBasicType[]) { - param.push(getSerializedArray(key, value, encodingData.style, encodingData.explode)); - } else if (value is record {}) { - if (encodingData.style == DEEPOBJECT) { - param.push(getDeepObjectStyleRequest(key, value)); - } else { - param.push(getFormStyleRequest(key, value, encodingData.explode)); - } - } else { - param.push(key, "=", value.toString()); - } - param.push("&"); - } - _ = param.pop(); - } - string restOfPath = string:'join("", ...param); - return restOfPath; -} diff --git a/openapi/zendesk.voice/.gitignore b/openapi/zendesk.voice/.gitignore deleted file mode 100644 index eb5a316cb..000000000 --- a/openapi/zendesk.voice/.gitignore +++ /dev/null @@ -1 +0,0 @@ -target diff --git a/openapi/zendesk.voice/Ballerina.toml b/openapi/zendesk.voice/Ballerina.toml deleted file mode 100644 index 58a3d4239..000000000 --- a/openapi/zendesk.voice/Ballerina.toml +++ /dev/null @@ -1,12 +0,0 @@ -[package] -license = ["Apache-2.0"] -keywords = ["Support/Customer Support", "Cost/Freemium"] -org = "ballerinax" -name = "zendesk.voice" -icon = "icon.png" -distribution = "2201.4.1" -repository = "https://github.com/ballerina-platform/openapi-connectors/tree/main/openapi/zendesk.voice" -version = "1.5.1" -authors = ["Ballerina"] -[build-options] -observabilityIncluded = true diff --git a/openapi/zendesk.voice/Module.md b/openapi/zendesk.voice/Module.md deleted file mode 100644 index 7c5de05a5..000000000 --- a/openapi/zendesk.voice/Module.md +++ /dev/null @@ -1,44 +0,0 @@ -## Overview -This is a generated connector for [Zendesk Talk API v2](https://developer.zendesk.com/api-reference/) OpenAPI specification. -Zendesk Voice provides capability to work with talk agents, groups, and tickets. - -## Prerequisites -Before using this connector in your Ballerina application, complete the following: -1. Create an [Zendesk account](https://www.zendesk.com/). -2. Obtain tokens - Follow [this guide](https://developer.zendesk.com/api-reference/ticketing/introduction/#security-and-authentication). - -## Quickstart - -To use the Zendesk Voice connector in your Ballerina application, update the .bal file as follows: - -### Step 1: Import connector -First, import the `ballerinax/zendesk.voice` module into the Ballerina project. -```ballerina -import ballerinax/zendesk.voice as zenvoice; -``` - -### Step 2: Create a new connector instance -Create a `zenvoice:ClientConfig` with the username and password obtained, then initialize the connector with it and the service URL (Zendesk Support URL) according to the [Zendesk Support documentation](https://developer.zendesk.com/api-reference/ticketing/introduction/). -```ballerina -zenvoice:ClientConfig clientConfig = { - auth: { - username: , - password: - } -}; -zenvoice:Client baseClient = check new Client(clientConfig, serviceUrl = ""); -``` - -### Step 3: Invoke connector operation -1. Now you can use the operations available within the connector. Note that they are in the form of remote operations. - - Following is an example on how to list the phone numbers. - - ```ballerina - public function main() returns error? { - zenvoice:PhoneNumbers phoneNumbers = check baseClient->listPhoneNumbers(); - log:printInfo(phoneNumbers.toString()); - } - ``` - -2. Use `bal run` command to compile and run the Ballerina program. diff --git a/openapi/zendesk.voice/Package.md b/openapi/zendesk.voice/Package.md deleted file mode 100644 index 7d258e44c..000000000 --- a/openapi/zendesk.voice/Package.md +++ /dev/null @@ -1,19 +0,0 @@ -Connects to [Zendesk Talk](https://developer.zendesk.com/api-reference/) from Ballerina - -## Package overview -The `ballerinax/zendesk.voice` is a [Ballerina](https://ballerina.io/) connector for Zendesk Talk API. -This package provides the capability to work with talk agents, groups, and tickets. - -### Compatibility -| | Version | -|--------------------|---------------------------| -| Ballerina Language | Ballerina Swan Lake 2201.4.1| -| Zendesk Talk API | v2 | - -## Report issues -To report bugs, request new features, start new discussions, view project boards, etc., go to the [Ballerina Extended Library repository](https://github.com/ballerina-platform/ballerina-extended-library) - -## Useful links -- Discuss code changes of the Ballerina project in [ballerina-dev@googlegroups.com](mailto:ballerina-dev@googlegroups.com). -- Chat live with us via our [Discord server](https://discord.gg/ballerinalang). -- Post all technical questions on Stack Overflow with the [#ballerina](https://stackoverflow.com/questions/tagged/ballerina) tag diff --git a/openapi/zendesk.voice/client.bal b/openapi/zendesk.voice/client.bal deleted file mode 100644 index 0cd2d7676..000000000 --- a/openapi/zendesk.voice/client.bal +++ /dev/null @@ -1,165 +0,0 @@ -// Copyright (c) 2022 WSO2 LLC. (http://www.wso2.org) All Rights Reserved. -// -// WSO2 Inc. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/http; - -# This is a generated connector for [Zendesk Talk API v2](https://developer.zendesk.com/api-reference/voice/talk-api/introduction/) OpenAPI specification. -# Zendesk Talk API in conjunction with the Support API to work with Talk agents, groups, and tickets. -@display {label: "Zendesk Voice", iconPath: "icon.png"} -public isolated client class Client { - final http:Client clientEp; - # Gets invoked to initialize the `connector`. - # The connector initialization requires setting the API credentials. - # Create an [Zendesk account](https://www.zendesk.com/) and obtain tokens by following [this guide](https://developer.zendesk.com/api-reference/ticketing/introduction/#security-and-authentication). - # - # + config - The configurations to be used when initializing the `connector` - # + serviceUrl - URL of the target service - # + return - An error if connector initialization failed - public isolated function init(ConnectionConfig config, string serviceUrl) returns error? { - http:ClientConfiguration httpClientConfig = {auth: config.auth, httpVersion: config.httpVersion, timeout: config.timeout, forwarded: config.forwarded, poolConfig: config.poolConfig, compression: config.compression, circuitBreaker: config.circuitBreaker, retryConfig: config.retryConfig, validation: config.validation}; - do { - if config.http1Settings is ClientHttp1Settings { - ClientHttp1Settings settings = check config.http1Settings.ensureType(ClientHttp1Settings); - httpClientConfig.http1Settings = {...settings}; - } - if config.http2Settings is http:ClientHttp2Settings { - httpClientConfig.http2Settings = check config.http2Settings.ensureType(http:ClientHttp2Settings); - } - if config.cache is http:CacheConfig { - httpClientConfig.cache = check config.cache.ensureType(http:CacheConfig); - } - if config.responseLimits is http:ResponseLimitConfigs { - httpClientConfig.responseLimits = check config.responseLimits.ensureType(http:ResponseLimitConfigs); - } - if config.secureSocket is http:ClientSecureSocket { - httpClientConfig.secureSocket = check config.secureSocket.ensureType(http:ClientSecureSocket); - } - if config.proxy is http:ProxyConfig { - httpClientConfig.proxy = check config.proxy.ensureType(http:ProxyConfig); - } - } - http:Client httpEp = check new (serviceUrl, httpClientConfig); - self.clientEp = httpEp; - return; - } - # List phone numbers. - # - # + return - Returns list of phone numbers - remote isolated function listPhoneNumbers() returns PhoneNumbers|error { - string resourcePath = string `/api/v2/channels/voice/phone_numbers.json`; - PhoneNumbers response = check self.clientEp->get(resourcePath); - return response; - } - # Create phone number (This endpoint is not available for trial accounts). - # - # + payload - The information for create phone number request - # + return - Returns detail of phone number created - remote isolated function createPhoneNumber(PhoneNumberInfo payload) returns PhoneNumber|error { - string resourcePath = string `/api/v2/channels/voice/phone_numbers.json`; - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - PhoneNumber response = check self.clientEp->post(resourcePath, request); - return response; - } - # Search for available phone numbers (This endpoint is not available for trial accounts). - # - # + country - The ISO country code - # + areaCode - Find phone numbers in the specified area code. (US and Canada only - # + contains - The regular expression used to search for phone numbers. Valid characters are '' and [0-9a-zA-Z] - # + tollFree - Whether the number should be toll-free or local - # + return - Returns available phone numbers - remote isolated function searchAvailablePhoneNumbers(string country, string? areaCode = (), string? contains = (), boolean? tollFree = ()) returns PhoneNumber|error { - string resourcePath = string `/api/v2/channels/voice/phone_numbers/search.json`; - map queryParam = {"country": country, "area_code": areaCode, "contains": contains, "toll_free": tollFree}; - resourcePath = resourcePath + check getPathForQueryParam(queryParam); - PhoneNumber response = check self.clientEp->get(resourcePath); - return response; - } - # Show phone number. - # - # + phoneNumberId - ID of a phone number - # + return - Returns phone number by id - remote isolated function showPhoneNumber(string phoneNumberId) returns PhoneNumber|error { - string resourcePath = string `/api/v2/channels/voice/phone_numbers/${getEncodedUri(phoneNumberId)}.json`; - PhoneNumber response = check self.clientEp->get(resourcePath); - return response; - } - # Delete phone number by id. - # - # + phoneNumberId - ID of a phone number - # + return - Returns detail of phone number deleted - remote isolated function deletePhoneNumberById(string phoneNumberId) returns PhoneNumber|error { - string resourcePath = string `/api/v2/channels/voice/phone_numbers/${getEncodedUri(phoneNumberId)}.json`; - PhoneNumber response = check self.clientEp-> delete(resourcePath); - return response; - } - # List greeting categories. - # - # + return - Returns list of greeting categories - remote isolated function listGreetingCategories() returns GreetingCategories|error { - string resourcePath = string `/api/v2/channels/voice/greeting_categories.json`; - GreetingCategories response = check self.clientEp->get(resourcePath); - return response; - } - # Show greeting category. - # - # + greetingCategoriesId - ID of the greeting category - # + return - Returns greeting category by id - remote isolated function showGreetingCategory(string greetingCategoriesId) returns GreetingCategory|error { - string resourcePath = string `/api/v2/channels/voice/greeting_categories/${getEncodedUri(greetingCategoriesId)}.json`; - GreetingCategory response = check self.clientEp->get(resourcePath); - return response; - } - # List greetings. - # - # + return - Returns list of greetings - remote isolated function listGreetings() returns Greetings|error { - string resourcePath = string `/api/v2/channels/voice/greetings.json`; - Greetings response = check self.clientEp->get(resourcePath); - return response; - } - # Create greeting. - # - # + payload - The information for create greeting request - # + return - Returns detail of greeting created - remote isolated function createGreeting(GreetingInfo payload) returns Greeting|error { - string resourcePath = string `/api/v2/channels/voice/greetings.json`; - http:Request request = new; - json jsonBody = check payload.cloneWithType(json); - request.setPayload(jsonBody, "application/json"); - Greeting response = check self.clientEp->post(resourcePath, request); - return response; - } - # Show greeting. - # - # + greetingsId - ID of a greeting - # + return - Returns greeting by id - remote isolated function showGreeting(string greetingsId) returns Greeting|error { - string resourcePath = string `/api/v2/channels/voice/greetings/${getEncodedUri(greetingsId)}.json`; - Greeting response = check self.clientEp->get(resourcePath); - return response; - } - # Delete greeting by id. - # - # + greetingsId - ID of a greeting - # + return - Returns detail of greeting deleted - remote isolated function deleteGreetingById(string greetingsId) returns Greeting|error { - string resourcePath = string `/api/v2/channels/voice/greetings/${getEncodedUri(greetingsId)}.json`; - Greeting response = check self.clientEp-> delete(resourcePath); - return response; - } -} diff --git a/openapi/zendesk.voice/icon.png b/openapi/zendesk.voice/icon.png deleted file mode 100644 index 518f4ac67..000000000 Binary files a/openapi/zendesk.voice/icon.png and /dev/null differ diff --git a/openapi/zendesk.voice/openapi.yaml b/openapi/zendesk.voice/openapi.yaml deleted file mode 100644 index bfa168d25..000000000 --- a/openapi/zendesk.voice/openapi.yaml +++ /dev/null @@ -1,490 +0,0 @@ -openapi: 3.0.1 -info: - title: Zendesk Talk API - description: > - This is a generated connector for [Zendesk Talk API v2](https://developer.zendesk.com/api-reference/voice/talk-api/introduction/) OpenAPI specification. - - Zendesk Talk API in conjunction with the Support API to work with Talk agents, groups, and tickets. - version: "v2" - x-ballerina-init-description: > - The connector initialization requires setting the API credentials. - - Create an [Zendesk account](https://www.zendesk.com/) and obtain tokens by following [this guide](https://developer.zendesk.com/api-reference/ticketing/introduction/#security-and-authentication). - x-ballerina-display: - label: Zendesk Voice - iconPath: "icon.png" -paths: - /api/v2/channels/voice/phone_numbers.json: - get: - summary: List phone numbers. - operationId: listPhoneNumbers - responses: - 200: - description: Returns list of phone numbers - content: - application/json: - schema: - $ref: '#/components/schemas/PhoneNumbers' - post: - summary: Create phone number (This endpoint is not available for trial accounts). - operationId: createPhoneNumber - requestBody: - description: The information for create phone number request - content: - application/json: - schema: - $ref: '#/components/schemas/PhoneNumberInfo' - required: true - responses: - 200: - description: Returns detail of phone number created - content: - application/json: - schema: - $ref: '#/components/schemas/PhoneNumber' - /api/v2/channels/voice/phone_numbers/search.json: - get: - summary: Search for available phone numbers (This endpoint is not available for trial accounts). - operationId: searchAvailablePhoneNumbers - parameters: - - name: country - in: query - required: true - description: The ISO country code - schema: - type: string - - name: area_code - in: query - required: false - description: Find phone numbers in the specified area code. (US and Canada only - schema: - type: string - - name: contains - in: query - required: false - description: The regular expression used to search for phone numbers. Valid characters are '' and [0-9a-zA-Z] - schema: - type: string - - name: toll_free - in: query - required: false - description: Whether the number should be toll-free or local - schema: - type: boolean - responses: - 200: - description: Returns available phone numbers - content: - application/json: - schema: - $ref: '#/components/schemas/PhoneNumber' - /api/v2/channels/voice/phone_numbers/{phone_number_id}.json: - get: - summary: Show phone number. - operationId: showPhoneNumber - parameters: - - name: phone_number_id - in: path - required: true - description: ID of a phone number - schema: - type: string - responses: - 200: - description: Returns phone number by id - content: - application/json: - schema: - $ref: '#/components/schemas/PhoneNumber' - delete: - summary: Delete phone number by id. - operationId: deletePhoneNumberById - parameters: - - name: phone_number_id - in: path - required: true - description: ID of a phone number - schema: - type: string - responses: - 200: - description: Returns detail of phone number deleted - content: - application/json: - schema: - $ref: '#/components/schemas/PhoneNumber' - /api/v2/channels/voice/greeting_categories.json: - get: - summary: List greeting categories. - operationId: listGreetingCategories - responses: - 200: - description: Returns list of greeting categories - content: - application/json: - schema: - $ref: '#/components/schemas/GreetingCategories' - /api/v2/channels/voice/greeting_categories/{greeting_categories_id}.json: - get: - summary: Show greeting category. - operationId: showGreetingCategory - parameters: - - name: greeting_categories_id - in: path - required: true - description: ID of the greeting category - schema: - type: string - responses: - 200: - description: Returns greeting category by id - content: - application/json: - schema: - $ref: '#/components/schemas/GreetingCategory' - /api/v2/channels/voice/greetings.json: - get: - summary: List greetings. - operationId: listGreetings - responses: - 200: - description: Returns list of greetings - content: - application/json: - schema: - $ref: '#/components/schemas/Greetings' - post: - summary: Create greeting. - operationId: createGreeting - requestBody: - description: The information for create greeting request - content: - application/json: - schema: - $ref: '#/components/schemas/GreetingInfo' - required: true - responses: - 200: - description: Returns detail of greeting created - content: - application/json: - schema: - $ref: '#/components/schemas/Greeting' - /api/v2/channels/voice/greetings/{greetings_id}.json: - get: - summary: Show greeting. - operationId: showGreeting - parameters: - - name: greetings_id - in: path - required: true - description: ID of a greeting - schema: - type: string - responses: - 200: - description: Returns greeting by id - content: - application/json: - schema: - $ref: '#/components/schemas/Greeting' - delete: - summary: Delete greeting by id. - operationId: deleteGreetingById - parameters: - - name: greetings_id - in: path - required: true - description: ID of a greeting - schema: - type: string - responses: - 200: - description: Returns detail of greeting deleted - content: - application/json: - schema: - $ref: '#/components/schemas/Greeting' -components: - securitySchemes: - basicAuth: - type: http - scheme: basic - schemas: - PhoneNumberInfo: - description: The phone number information to create - type: object - properties: - token: - type: string - description: Token returned by a search for available numbers. - PhoneNumber: - type: object - properties: - phone_number: - type: object - properties: - number: - type: string - description: The phone number digits - nullable: true - display_number: - type: string - description: The formatted phone number - nullable: true - toll_free: - type: boolean - description: Whether the number is toll-free or local - nullable: true - location: - type: string - description: The number's geographical location. For example, "CA" or "Leeds" - nullable: true - country_code: - type: string - description: The ISO code of the country for the phone number - nullable: true - token: - type: string - description: A generated token unique for each phone number and used when provisioning the number - nullable: true - price: - type: string - description: The monthly cost of the phone number - nullable: true - address_requirements: - type: string - description: The type of address that must be supplied when purchasing the phone number. Possible values - "none", "local", "any", or "foreign" - nullable: true - PhoneNumbers: - type: object - properties: - phone_numbers: - type: array - items: - properties: - call_recording_consent: - type: string - description: What call recording consent is set to - nullable: true - capabilities: - type: object - description: Whether a phone number has mms, sms, or voice capability - properties: - sms: - type: boolean - description: sms - nullable: true - mms: - type: boolean - description: mms - nullable: true - voice: - type: boolean - description: voice - nullable: true - country_code: - type: string - description: The ISO code of the country for this number - nullable: true - created_at: - type: string - description: The date and time the phone number was created - nullable: true - default_greeting_ids: - type: array - items: - type: string - description: The names of default system greetings associated with the phone number - default_group_id: - type: integer - description: Default group id - nullable: true - display_number: - type: string - description: The formatted phone number - nullable: true - external: - type: boolean - description: The external caller id number - nullable: true - failover_number: - type: string - description: Failover number associated with the phone number - nullable: true - greeting_ids: - type: array - items: - type: integer - description: Custom greetings associated with the phone number - group_ids: - type: array - items: - type: integer - description: An ids of associated groups - id: - type: integer - description: Automatically assigned id upon creation - nullable: true - ivr_id: - type: integer - description: ID of IVR associated with the phone number - nullable: true - line_type: - type: string - description: The type of line associated with the phone number - nullable: true - location: - type: string - description: The number's geographical location. For example, "CA" or "Leeds" - nullable: true - name: - type: string - description: The nickname if one is set. Otherwise the display_number - nullable: true - nickname: - type: string - description: The nickname of the number if one is set - nullable: true - number: - type: string - description: The phone number digits - nullable: true - outbound_enabled: - type: boolean - description: Whether or not the phone number has outbound enabled - nullable: true - priority: - type: integer - description: Level of priority associated with the phone number - nullable: true - recorded: - type: boolean - description: Whether calls for the number are recorded or not - nullable: true - schedule_id: - type: integer - description: ID of schedule associated with the phone number - nullable: true - sms_enabled: - type: boolean - description: Whether or not the phone number has sms enabled - nullable: true - sms_group_id: - type: integer - description: The group associated with this phone number - nullable: true - token: - type: string - description: A generated token, unique for each phone number and used when provisioning the number - nullable: true - toll_free: - type: boolean - description: Whether the number is toll-free or local - nullable: true - transcription: - type: boolean - description: Whether calls for the number are transcribed or not - nullable: true - voice_enabled: - type: boolean - description: Whether or not the phone number has voice enabled - nullable: true - next_page: - type: integer - description: Next page - nullable: true - previous_page: - type: integer - description: Previous page - nullable: true - count: - type: integer - description: Count of records exists - GreetingCategories: - type: object - properties: - greeting_categories: - type: array - items: - properties: - id: - type: integer - description: The greeting category ID - nullable: true - name: - type: string - description: The name of the greeting category - nullable: true - GreetingCategory: - type: object - properties: - greeting_category: - type: object - properties: - id: - type: integer - description: The greeting category ID - nullable: true - name: - type: string - description: The name of the greeting category - nullable: true - GreetingInfo: - description: The greeting information to create - type: object - properties: - category_id: - type: string - description: The greeting category ID - name: - type: string - description: The name of greeting - Greetings: - type: object - properties: - greetings: - type: array - items: - properties: - category_id: - type: integer - description: The greeting category ID - nullable: true - id: - type: integer - description: The greeting ID - nullable: true - name: - type: string - description: The name of the greeting category - nullable: true - next_page: - type: integer - description: Next page - nullable: true - previous_page: - type: integer - description: Previous page - nullable: true - count: - type: integer - description: Count of records exists - Greeting: - type: object - properties: - greeting: - type: object - properties: - category_id: - type: integer - description: The greeting category ID - nullable: true - id: - type: integer - description: The greeting ID - nullable: true - name: - type: string - description: The name of the greeting category - nullable: true \ No newline at end of file diff --git a/openapi/zendesk.voice/types.bal b/openapi/zendesk.voice/types.bal deleted file mode 100644 index ebb9514af..000000000 --- a/openapi/zendesk.voice/types.bal +++ /dev/null @@ -1,245 +0,0 @@ -// Copyright (c) 2022 WSO2 LLC. (http://www.wso2.org) All Rights Reserved. -// -// WSO2 Inc. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/http; - -# Provides a set of configurations for controlling the behaviours when communicating with a remote HTTP endpoint. -@display {label: "Connection Config"} -public type ConnectionConfig record {| - # Configurations related to client authentication - http:CredentialsConfig auth; - # The HTTP version understood by the client - http:HttpVersion httpVersion = http:HTTP_2_0; - # Configurations related to HTTP/1.x protocol - ClientHttp1Settings http1Settings?; - # Configurations related to HTTP/2 protocol - http:ClientHttp2Settings http2Settings?; - # The maximum time to wait (in seconds) for a response before closing the connection - decimal timeout = 60; - # The choice of setting `forwarded`/`x-forwarded` header - string forwarded = "disable"; - # Configurations associated with request pooling - http:PoolConfiguration poolConfig?; - # HTTP caching related configurations - http:CacheConfig cache?; - # Specifies the way of handling compression (`accept-encoding`) header - http:Compression compression = http:COMPRESSION_AUTO; - # Configurations associated with the behaviour of the Circuit Breaker - http:CircuitBreakerConfig circuitBreaker?; - # Configurations associated with retrying - http:RetryConfig retryConfig?; - # Configurations associated with inbound response size limits - http:ResponseLimitConfigs responseLimits?; - # SSL/TLS-related options - http:ClientSecureSocket secureSocket?; - # Proxy server related options - http:ProxyConfig proxy?; - # Enables the inbound payload validation functionality which provided by the constraint package. Enabled by default - boolean validation = true; -|}; - -# Provides settings related to HTTP/1.x protocol. -public type ClientHttp1Settings record {| - # Specifies whether to reuse a connection for multiple requests - http:KeepAlive keepAlive = http:KEEPALIVE_AUTO; - # The chunking behaviour of the request - http:Chunking chunking = http:CHUNKING_AUTO; - # Proxy server related options - ProxyConfig proxy?; -|}; - -# Proxy server configurations to be used with the HTTP client endpoint. -public type ProxyConfig record {| - # Host name of the proxy server - string host = ""; - # Proxy server port - int port = 0; - # Proxy server username - string userName = ""; - # Proxy server password - @display {label: "", kind: "password"} - string password = ""; -|}; - -public type PhoneNumbers record { - PhonenumbersPhoneNumbers[] phone_numbers?; - # Next page - int? next_page?; - # Previous page - int? previous_page?; - # Count of records exists - int count?; -}; - -public type Greeting record { - GreetingGreeting greeting?; -}; - -public type GreetingcategoriesGreetingCategories record { - # The greeting category ID - int? id?; - # The name of the greeting category - string? name?; -}; - -public type GreetingcategoryGreetingCategory record { - # The greeting category ID - int? id?; - # The name of the greeting category - string? name?; -}; - -# The greeting information to create -public type GreetingInfo record { - # The greeting category ID - string category_id?; - # The name of greeting - string name?; -}; - -public type GreetingGreeting record { - # The greeting category ID - int? category_id?; - # The greeting ID - int? id?; - # The name of the greeting category - string? name?; -}; - -public type GreetingCategory record { - GreetingcategoryGreetingCategory greeting_category?; -}; - -public type GreetingsGreetings record { - # The greeting category ID - int? category_id?; - # The greeting ID - int? id?; - # The name of the greeting category - string? name?; -}; - -# The phone number information to create -public type PhoneNumberInfo record { - # Token returned by a search for available numbers. - string token?; -}; - -public type GreetingCategories record { - GreetingcategoriesGreetingCategories[] greeting_categories?; -}; - -public type PhonenumberPhoneNumber record { - # The phone number digits - string? number?; - # The formatted phone number - string? display_number?; - # Whether the number is toll-free or local - boolean? toll_free?; - # The number's geographical location. For example, "CA" or "Leeds" - string? location?; - # The ISO code of the country for the phone number - string? country_code?; - # A generated token unique for each phone number and used when provisioning the number - string? token?; - # The monthly cost of the phone number - string? price?; - # The type of address that must be supplied when purchasing the phone number. Possible values - "none", "local", "any", or "foreign" - string? address_requirements?; -}; - -public type PhonenumbersPhoneNumbers record { - # What call recording consent is set to - string? call_recording_consent?; - # Whether a phone number has mms, sms, or voice capability - PhonenumbersCapabilities capabilities?; - # The ISO code of the country for this number - string? country_code?; - # The date and time the phone number was created - string? created_at?; - # The names of default system greetings associated with the phone number - string[] default_greeting_ids?; - # Default group id - int? default_group_id?; - # The formatted phone number - string? display_number?; - # The external caller id number - boolean? 'external?; - # Failover number associated with the phone number - string? failover_number?; - # Custom greetings associated with the phone number - int[] greeting_ids?; - # An ids of associated groups - int[] group_ids?; - # Automatically assigned id upon creation - int? id?; - # ID of IVR associated with the phone number - int? ivr_id?; - # The type of line associated with the phone number - string? line_type?; - # The number's geographical location. For example, "CA" or "Leeds" - string? location?; - # The nickname if one is set. Otherwise the display_number - string? name?; - # The nickname of the number if one is set - string? nickname?; - # The phone number digits - string? number?; - # Whether or not the phone number has outbound enabled - boolean? outbound_enabled?; - # Level of priority associated with the phone number - int? priority?; - # Whether calls for the number are recorded or not - boolean? recorded?; - # ID of schedule associated with the phone number - int? schedule_id?; - # Whether or not the phone number has sms enabled - boolean? sms_enabled?; - # The group associated with this phone number - int? sms_group_id?; - # A generated token, unique for each phone number and used when provisioning the number - string? token?; - # Whether the number is toll-free or local - boolean? toll_free?; - # Whether calls for the number are transcribed or not - boolean? transcription?; - # Whether or not the phone number has voice enabled - boolean? voice_enabled?; -}; - -public type PhoneNumber record { - PhonenumberPhoneNumber phone_number?; -}; - -public type Greetings record { - GreetingsGreetings[] greetings?; - # Next page - int? next_page?; - # Previous page - int? previous_page?; - # Count of records exists - int count?; -}; - -# Whether a phone number has mms, sms, or voice capability -public type PhonenumbersCapabilities record { - # sms - boolean? sms?; - # mms - boolean? mms?; - # voice - boolean? voice?; -}; diff --git a/openapi/zendesk.voice/utils.bal b/openapi/zendesk.voice/utils.bal deleted file mode 100644 index e1c9578c9..000000000 --- a/openapi/zendesk.voice/utils.bal +++ /dev/null @@ -1,214 +0,0 @@ -// Copyright (c) 2022 WSO2 LLC. (http://www.wso2.org) All Rights Reserved. -// -// WSO2 Inc. licenses this file to you under the Apache License, -// Version 2.0 (the "License"); you may not use this file except -// in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, -// software distributed under the License is distributed on an -// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -// KIND, either express or implied. See the License for the -// specific language governing permissions and limitations -// under the License. - -import ballerina/url; - -type SimpleBasicType string|boolean|int|float|decimal; - -# Represents encoding mechanism details. -type Encoding record { - # Defines how multiple values are delimited - string style = FORM; - # Specifies whether arrays and objects should generate as separate fields - boolean explode = true; - # Specifies the custom content type - string contentType?; - # Specifies the custom headers - map headers?; -}; - -enum EncodingStyle { - DEEPOBJECT, FORM, SPACEDELIMITED, PIPEDELIMITED -} - -final Encoding & readonly defaultEncoding = {}; - -# Serialize the record according to the deepObject style. -# -# + parent - Parent record name -# + anyRecord - Record to be serialized -# + return - Serialized record as a string -isolated function getDeepObjectStyleRequest(string parent, record {} anyRecord) returns string { - string[] recordArray = []; - foreach [string, anydata] [key, value] in anyRecord.entries() { - if value is SimpleBasicType { - recordArray.push(parent + "[" + key + "]" + "=" + getEncodedUri(value.toString())); - } else if value is SimpleBasicType[] { - recordArray.push(getSerializedArray(parent + "[" + key + "]" + "[]", value, DEEPOBJECT, true)); - } else if value is record {} { - string nextParent = parent + "[" + key + "]"; - recordArray.push(getDeepObjectStyleRequest(nextParent, value)); - } else if value is record {}[] { - string nextParent = parent + "[" + key + "]"; - recordArray.push(getSerializedRecordArray(nextParent, value, DEEPOBJECT)); - } - recordArray.push("&"); - } - _ = recordArray.pop(); - return string:'join("", ...recordArray); -} - -# Serialize the record according to the form style. -# -# + parent - Parent record name -# + anyRecord - Record to be serialized -# + explode - Specifies whether arrays and objects should generate separate parameters -# + return - Serialized record as a string -isolated function getFormStyleRequest(string parent, record {} anyRecord, boolean explode = true) returns string { - string[] recordArray = []; - if explode { - foreach [string, anydata] [key, value] in anyRecord.entries() { - if (value is SimpleBasicType) { - recordArray.push(key, "=", getEncodedUri(value.toString())); - } else if (value is SimpleBasicType[]) { - recordArray.push(getSerializedArray(key, value, explode = explode)); - } else if (value is record {}) { - recordArray.push(getFormStyleRequest(parent, value, explode)); - } - recordArray.push("&"); - } - _ = recordArray.pop(); - } else { - foreach [string, anydata] [key, value] in anyRecord.entries() { - if (value is SimpleBasicType) { - recordArray.push(key, ",", getEncodedUri(value.toString())); - } else if (value is SimpleBasicType[]) { - recordArray.push(getSerializedArray(key, value, explode = false)); - } else if (value is record {}) { - recordArray.push(getFormStyleRequest(parent, value, explode)); - } - recordArray.push(","); - } - _ = recordArray.pop(); - } - return string:'join("", ...recordArray); -} - -# Serialize arrays. -# -# + arrayName - Name of the field with arrays -# + anyArray - Array to be serialized -# + style - Defines how multiple values are delimited -# + explode - Specifies whether arrays and objects should generate separate parameters -# + return - Serialized array as a string -isolated function getSerializedArray(string arrayName, anydata[] anyArray, string style = "form", boolean explode = true) returns string { - string key = arrayName; - string[] arrayValues = []; - if (anyArray.length() > 0) { - if (style == FORM && !explode) { - arrayValues.push(key, "="); - foreach anydata i in anyArray { - arrayValues.push(getEncodedUri(i.toString()), ","); - } - } else if (style == SPACEDELIMITED && !explode) { - arrayValues.push(key, "="); - foreach anydata i in anyArray { - arrayValues.push(getEncodedUri(i.toString()), "%20"); - } - } else if (style == PIPEDELIMITED && !explode) { - arrayValues.push(key, "="); - foreach anydata i in anyArray { - arrayValues.push(getEncodedUri(i.toString()), "|"); - } - } else if (style == DEEPOBJECT) { - foreach anydata i in anyArray { - arrayValues.push(key, "[]", "=", getEncodedUri(i.toString()), "&"); - } - } else { - foreach anydata i in anyArray { - arrayValues.push(key, "=", getEncodedUri(i.toString()), "&"); - } - } - _ = arrayValues.pop(); - } - return string:'join("", ...arrayValues); -} - -# Serialize the array of records according to the form style. -# -# + parent - Parent record name -# + value - Array of records to be serialized -# + style - Defines how multiple values are delimited -# + explode - Specifies whether arrays and objects should generate separate parameters -# + return - Serialized record as a string -isolated function getSerializedRecordArray(string parent, record {}[] value, string style = FORM, boolean explode = true) returns string { - string[] serializedArray = []; - if style == DEEPOBJECT { - int arayIndex = 0; - foreach var recordItem in value { - serializedArray.push(getDeepObjectStyleRequest(parent + "[" + arayIndex.toString() + "]", recordItem), "&"); - arayIndex = arayIndex + 1; - } - } else { - if (!explode) { - serializedArray.push(parent, "="); - } - foreach var recordItem in value { - serializedArray.push(getFormStyleRequest(parent, recordItem, explode), ","); - } - } - _ = serializedArray.pop(); - return string:'join("", ...serializedArray); -} - -# Get Encoded URI for a given value. -# -# + value - Value to be encoded -# + return - Encoded string -isolated function getEncodedUri(anydata value) returns string { - string|error encoded = url:encode(value.toString(), "UTF8"); - if (encoded is string) { - return encoded; - } else { - return value.toString(); - } -} - -# Generate query path with query parameter. -# -# + queryParam - Query parameter map -# + encodingMap - Details on serialization mechanism -# + return - Returns generated Path or error at failure of client initialization -isolated function getPathForQueryParam(map queryParam, map encodingMap = {}) returns string|error { - string[] param = []; - if (queryParam.length() > 0) { - param.push("?"); - foreach var [key, value] in queryParam.entries() { - if value is () { - _ = queryParam.remove(key); - continue; - } - Encoding encodingData = encodingMap.hasKey(key) ? encodingMap.get(key) : defaultEncoding; - if (value is SimpleBasicType) { - param.push(key, "=", getEncodedUri(value.toString())); - } else if (value is SimpleBasicType[]) { - param.push(getSerializedArray(key, value, encodingData.style, encodingData.explode)); - } else if (value is record {}) { - if (encodingData.style == DEEPOBJECT) { - param.push(getDeepObjectStyleRequest(key, value)); - } else { - param.push(getFormStyleRequest(key, value, encodingData.explode)); - } - } else { - param.push(key, "=", value.toString()); - } - param.push("&"); - } - _ = param.pop(); - } - string restOfPath = string:'join("", ...param); - return restOfPath; -}