├── .github └── workflows │ └── publish.yaml ├── .gitignore ├── .swagger-codegen-ignore ├── .swagger-codegen └── VERSION ├── CHANGELOG ├── CODE_OF_CONDUCT.md ├── CONTRIBUTORS ├── LICENSE ├── MANIFEST.in ├── README.md ├── asana ├── __init__.py ├── api │ ├── __init__.py │ ├── allocations_api.py │ ├── attachments_api.py │ ├── audit_log_api_api.py │ ├── batch_api_api.py │ ├── custom_field_settings_api.py │ ├── custom_fields_api.py │ ├── custom_types_api.py │ ├── events_api.py │ ├── goal_relationships_api.py │ ├── goals_api.py │ ├── jobs_api.py │ ├── memberships_api.py │ ├── organization_exports_api.py │ ├── portfolio_memberships_api.py │ ├── portfolios_api.py │ ├── project_briefs_api.py │ ├── project_memberships_api.py │ ├── project_statuses_api.py │ ├── project_templates_api.py │ ├── projects_api.py │ ├── rules_api.py │ ├── sections_api.py │ ├── status_updates_api.py │ ├── stories_api.py │ ├── tags_api.py │ ├── task_templates_api.py │ ├── tasks_api.py │ ├── team_memberships_api.py │ ├── teams_api.py │ ├── time_periods_api.py │ ├── time_tracking_entries_api.py │ ├── typeahead_api.py │ ├── user_task_lists_api.py │ ├── users_api.py │ ├── webhooks_api.py │ ├── workspace_memberships_api.py │ └── workspaces_api.py ├── api_client.py ├── configuration.py ├── pagination │ ├── __init__.py │ ├── event_iterator.py │ └── page_iterator.py └── rest.py ├── build_tests ├── README.md ├── __init__.py ├── test_projects_api.py └── test_tasks_api.py ├── codegen ├── swagger │ ├── README.md │ ├── pom.xml │ └── src │ │ └── main │ │ ├── java │ │ └── com │ │ │ └── asana │ │ │ └── codegen │ │ │ ├── ExampleUtility.java │ │ │ ├── PythonClientCodegenGenerator.java │ │ │ └── ReadMe.java │ │ └── resources │ │ └── META-INF │ │ └── services │ │ └── io.swagger.codegen.v3.CodegenConfig └── templates │ ├── README.mustache │ ├── __init__package.mustache │ ├── __init__pagination.mustache │ ├── api.mustache │ ├── api_client.mustache │ ├── api_doc.mustache │ ├── code_sample.mustache │ ├── code_sample_client.mustache │ ├── code_samples.mustache │ ├── configuration.mustache │ ├── event_iterator.mustache │ ├── gitignore.mustache │ ├── page_iterator.mustache │ ├── requirements.mustache │ ├── rest.mustache │ └── setup.mustache ├── docs ├── AllocationsApi.md ├── AllocationsApi.yaml ├── AttachmentsApi.md ├── AttachmentsApi.yaml ├── AuditLogAPIApi.md ├── AuditLogAPIApi.yaml ├── BatchAPIApi.md ├── BatchAPIApi.yaml ├── CustomFieldSettingsApi.md ├── CustomFieldSettingsApi.yaml ├── CustomFieldsApi.md ├── CustomFieldsApi.yaml ├── CustomTypesApi.md ├── CustomTypesApi.yaml ├── EventsApi.md ├── EventsApi.yaml ├── GoalRelationshipsApi.md ├── GoalRelationshipsApi.yaml ├── GoalsApi.md ├── GoalsApi.yaml ├── JobsApi.md ├── JobsApi.yaml ├── MembershipsApi.md ├── MembershipsApi.yaml ├── OrganizationExportsApi.md ├── OrganizationExportsApi.yaml ├── PortfolioMembershipsApi.md ├── PortfolioMembershipsApi.yaml ├── PortfoliosApi.md ├── PortfoliosApi.yaml ├── ProjectBriefsApi.md ├── ProjectBriefsApi.yaml ├── ProjectMembershipsApi.md ├── ProjectMembershipsApi.yaml ├── ProjectStatusesApi.md ├── ProjectStatusesApi.yaml ├── ProjectTemplatesApi.md ├── ProjectTemplatesApi.yaml ├── ProjectsApi.md ├── ProjectsApi.yaml ├── RulesApi.md ├── RulesApi.yaml ├── SectionsApi.md ├── SectionsApi.yaml ├── StatusUpdatesApi.md ├── StatusUpdatesApi.yaml ├── StoriesApi.md ├── StoriesApi.yaml ├── TagsApi.md ├── TagsApi.yaml ├── TaskTemplatesApi.md ├── TaskTemplatesApi.yaml ├── TasksApi.md ├── TasksApi.yaml ├── TeamMembershipsApi.md ├── TeamMembershipsApi.yaml ├── TeamsApi.md ├── TeamsApi.yaml ├── TimePeriodsApi.md ├── TimePeriodsApi.yaml ├── TimeTrackingEntriesApi.md ├── TimeTrackingEntriesApi.yaml ├── TypeaheadApi.md ├── TypeaheadApi.yaml ├── UserTaskListsApi.md ├── UserTaskListsApi.yaml ├── UsersApi.md ├── UsersApi.yaml ├── WebhooksApi.md ├── WebhooksApi.yaml ├── WorkspaceMembershipsApi.md ├── WorkspaceMembershipsApi.yaml ├── WorkspacesApi.md └── WorkspacesApi.yaml ├── requirements.txt ├── setup.py ├── test-requirements.txt ├── test ├── __init__.py ├── test_allocations_api.py ├── test_attachments_api.py ├── test_audit_log_api_api.py ├── test_batch_api_api.py ├── test_custom_field_settings_api.py ├── test_custom_fields_api.py ├── test_custom_types_api.py ├── test_events_api.py ├── test_goal_relationships_api.py ├── test_goals_api.py ├── test_jobs_api.py ├── test_memberships_api.py ├── test_organization_exports_api.py ├── test_portfolio_memberships_api.py ├── test_portfolios_api.py ├── test_project_briefs_api.py ├── test_project_memberships_api.py ├── test_project_statuses_api.py ├── test_project_templates_api.py ├── test_projects_api.py ├── test_rules_api.py ├── test_sections_api.py ├── test_status_updates_api.py ├── test_stories_api.py ├── test_tags_api.py ├── test_task_templates_api.py ├── test_tasks_api.py ├── test_team_memberships_api.py ├── test_teams_api.py ├── test_time_periods_api.py ├── test_time_tracking_entries_api.py ├── test_typeahead_api.py ├── test_user_task_lists_api.py ├── test_users_api.py ├── test_webhooks_api.py ├── test_workspace_memberships_api.py └── test_workspaces_api.py └── tox.ini /.github/workflows/publish.yaml: -------------------------------------------------------------------------------- 1 | name: Generate client library + Publish 📦 to PyPI + Publish to GitHub Releases 2 | 3 | on: 4 | workflow_dispatch: 5 | inputs: 6 | version: 7 | required: true 8 | 9 | defaults: 10 | run: 11 | shell: bash 12 | 13 | permissions: 14 | contents: read 15 | id-token: write 16 | 17 | env: 18 | GENERATOR_VERSION: 3.0.67 19 | GENERATOR_NAME: swagger-codegen-cli.jar 20 | JAR_ASANA: codegen/swagger/target/AsanaClientCodegen-swagger-codegen-1.0.0.jar 21 | ACTUAL_LANG: com.asana.codegen.PythonClientCodegenGenerator 22 | NAME: asana 23 | 24 | jobs: 25 | generate-python-library: 26 | name: Generate Python client library 27 | runs-on: ubuntu-latest 28 | steps: 29 | - name: Authenticate to AWS 30 | uses: aws-actions/configure-aws-credentials@v4 31 | with: 32 | aws-region: us-east-1 33 | role-to-assume: arn:aws:iam::403483446840:role/autogen_github_actions_beta_release_asana_python_client_library 34 | - name: Get GitHub app token 35 | uses: asana/get-github-app-token@v1 36 | id: get-token 37 | with: 38 | github-app-name: asana-publish-client-libraries 39 | - name: Checkout repo files and set the git token 40 | uses: actions/checkout@v4 41 | with: 42 | token: ${{ steps.get-token.outputs.app-token }} 43 | - uses: actions/setup-java@v4 44 | with: 45 | distribution: "temurin" 46 | java-version: "17" 47 | - name: Download generator 48 | run: | 49 | wget -q -O $GENERATOR_NAME https://repo1.maven.org/maven2/io/swagger/codegen/v3/swagger-codegen-cli/${{ env.GENERATOR_VERSION }}/swagger-codegen-cli-${{ env.GENERATOR_VERSION }}.jar 50 | - name: Build custom code 51 | run: | 52 | pushd codegen/swagger >/dev/null 53 | mvn package 54 | popd >/dev/null 55 | - name: Generate library 56 | run: >- 57 | java -cp "${{ env.JAR_ASANA }}:${{ env.GENERATOR_NAME }}" 58 | io.swagger.codegen.v3.cli.SwaggerCodegen 59 | generate 60 | --input-spec https://raw.githubusercontent.com/Asana/openapi/master/defs/asana_sdk_oas.yaml 61 | --template-dir "codegen/templates" 62 | --lang "${{ env.ACTUAL_LANG }}" 63 | -DpackageName=${{ env.NAME }} 64 | --additional-properties "packageVersion=${{ inputs.version }},projectName=${{ env.NAME }},packageName=${{ env.NAME }}" 65 | - name: Clean up generator 66 | run: rm -rf codegen/swagger/target ${{ env.GENERATOR_NAME }} 67 | - name: Push changes to master branch 68 | run: | 69 | git config user.name asana-publish-client-libraries[bot] 70 | git config user.email 159857493+asana-publish-client-libraries[bot]@users.noreply.github.com 71 | git add . 72 | git commit -m 'Updated Python SDK: v${{ inputs.version }}' 73 | git push origin master 74 | git pull 75 | git tag 'v${{ inputs.version }}' --force 76 | git push origin --tags --force 77 | publish-to-pypi: 78 | needs: generate-python-library 79 | name: Build and publish Python 🐍 distributions 📦 to TestPyPI and PyPI 80 | runs-on: ubuntu-latest 81 | steps: 82 | - uses: actions/checkout@v4 83 | with: 84 | fetch-depth: 0 85 | ref: master 86 | - name: Set up Python 3.9 87 | uses: actions/setup-python@v5 88 | with: 89 | python-version: 3.9 90 | - name: Install pypa/build 91 | run: >- 92 | python -m 93 | pip install 94 | build 95 | --user 96 | - name: Build a binary wheel and a source tarball 97 | run: >- 98 | python -m 99 | build 100 | --sdist 101 | --wheel 102 | --outdir dist/ 103 | . 104 | - name: Publish distribution 📦 to Test PyPI 105 | uses: pypa/gh-action-pypi-publish@release/v1 106 | with: 107 | repository-url: https://test.pypi.org/legacy/ 108 | attestations: false 109 | - name: Publish distribution 📦 to PyPI 110 | uses: pypa/gh-action-pypi-publish@release/v1 111 | publish-to-github-releases: 112 | needs: publish-to-pypi 113 | name: Publish to GitHub Releases 114 | runs-on: ubuntu-latest 115 | steps: 116 | - name: Authenticate to AWS 117 | uses: aws-actions/configure-aws-credentials@v4 118 | with: 119 | aws-region: us-east-1 120 | role-to-assume: arn:aws:iam::403483446840:role/autogen_github_actions_beta_release_asana_python_client_library 121 | - name: Get GitHub app token 122 | uses: asana/get-github-app-token@v1 123 | id: get-token 124 | with: 125 | github-app-name: asana-publish-client-libraries 126 | - uses: actions/checkout@v4 127 | with: 128 | fetch-depth: 0 129 | ref: master 130 | - name: Publish to GitHub Releases 131 | run: gh release create v${{ inputs.version }} 132 | env: 133 | GH_TOKEN: ${{ steps.get-token.outputs.app-token }} 134 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | 27 | # PyInstaller 28 | # Usually these files are written by a python script from a template 29 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 30 | *.manifest 31 | *.spec 32 | 33 | # Installer logs 34 | pip-log.txt 35 | pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | htmlcov/ 39 | .tox/ 40 | .coverage 41 | .coverage.* 42 | .cache 43 | nosetests.xml 44 | coverage.xml 45 | *,cover 46 | .hypothesis/ 47 | venv/ 48 | .python-version 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | 57 | # Sphinx documentation 58 | docs/_build/ 59 | 60 | # PyBuilder 61 | target/ 62 | 63 | #Ipython Notebook 64 | .ipynb_checkpoints 65 | 66 | .travis.yml 67 | git_push.sh 68 | -------------------------------------------------------------------------------- /.swagger-codegen-ignore: -------------------------------------------------------------------------------- 1 | # Swagger Codegen Ignore 2 | # Generated by swagger-codegen https://github.com/swagger-api/swagger-codegen 3 | 4 | # Use this file to prevent files from being overwritten by the generator. 5 | # The patterns follow closely to .gitignore or .dockerignore. 6 | 7 | # As an example, the C# client generator defines ApiClient.cs. 8 | # You can make changes and tell Swagger Codgen to ignore just this file by uncommenting the following line: 9 | #ApiClient.cs 10 | 11 | # You can match any string of characters against a directory, file or extension with a single asterisk (*): 12 | #foo/*/qux 13 | # The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux 14 | 15 | # You can recursively match patterns against a directory, file or extension with a double asterisk (**): 16 | #foo/**/qux 17 | # This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux 18 | 19 | # You can also negate patterns with an exclamation (!). 20 | # For example, you can ignore all files in a docs folder with the file extension .md: 21 | #docs/*.md 22 | # Then explicitly reverse the ignore rule for a single file: 23 | #!docs/README.md 24 | -------------------------------------------------------------------------------- /.swagger-codegen/VERSION: -------------------------------------------------------------------------------- 1 | 3.0.67 -------------------------------------------------------------------------------- /CHANGELOG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asana/python-asana/5ea5521603b5fc472e91eef9847d57cf7d9e78ad/CHANGELOG -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Code of Conduct 2 | 3 | As contributors and maintainers of this project, and in the interest of fostering an open and welcoming community, we pledge to respect all people who contribute through reporting issues, posting feature requests, updating documentation, submitting pull requests or patches, and other activities. 4 | 5 | We are committed to making participation in this project a harassment-free experience for everyone, regardless of level of experience, gender, gender identity and expression, sexual orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or nationality. 6 | 7 | Examples of unacceptable behavior by participants include: 8 | 9 | * The use of sexualized language or imagery 10 | * Personal attacks 11 | * Trolling or insulting/derogatory comments 12 | * Public or private harassment 13 | * Publishing other's private information, such as physical or electronic addresses, without explicit permission 14 | * Other unethical or unprofessional conduct. 15 | 16 | Project maintainers have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct. By adopting this Code of Conduct, project maintainers commit themselves to fairly and consistently applying these principles to every aspect of managing this project. Project maintainers who do not follow or enforce the Code of Conduct may be permanently removed from the project team. 17 | 18 | This code of conduct applies both within project spaces and in public spaces when an individual is representing the project or its community. 19 | 20 | Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by opening an issue or contacting one or more of the project maintainers. 21 | 22 | This Code of Conduct is adapted from the [Contributor Covenant](http://contributor-covenant.org), version 1.2.0, available at [http://contributor-covenant.org/version/1/2/0/](http://contributor-covenant.org/version/1/2/0/) 23 | -------------------------------------------------------------------------------- /CONTRIBUTORS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asana/python-asana/5ea5521603b5fc472e91eef9847d57cf7d9e78ad/CONTRIBUTORS -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2015 Asana, Inc. 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | include LICENSE 2 | include CONTRIBUTORS 3 | include CHANGELOG 4 | include README.md 5 | -------------------------------------------------------------------------------- /asana/__init__.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | # flake8: noqa 4 | 5 | """ 6 | Asana 7 | 8 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 9 | 10 | OpenAPI spec version: 1.0 11 | 12 | Generated by: https://github.com/swagger-api/swagger-codegen.git 13 | """ 14 | 15 | from __future__ import absolute_import 16 | 17 | # import apis into sdk package 18 | from asana.api.allocations_api import AllocationsApi 19 | from asana.api.attachments_api import AttachmentsApi 20 | from asana.api.audit_log_api_api import AuditLogAPIApi 21 | from asana.api.batch_api_api import BatchAPIApi 22 | from asana.api.custom_field_settings_api import CustomFieldSettingsApi 23 | from asana.api.custom_fields_api import CustomFieldsApi 24 | from asana.api.custom_types_api import CustomTypesApi 25 | from asana.api.events_api import EventsApi 26 | from asana.api.goal_relationships_api import GoalRelationshipsApi 27 | from asana.api.goals_api import GoalsApi 28 | from asana.api.jobs_api import JobsApi 29 | from asana.api.memberships_api import MembershipsApi 30 | from asana.api.organization_exports_api import OrganizationExportsApi 31 | from asana.api.portfolio_memberships_api import PortfolioMembershipsApi 32 | from asana.api.portfolios_api import PortfoliosApi 33 | from asana.api.project_briefs_api import ProjectBriefsApi 34 | from asana.api.project_memberships_api import ProjectMembershipsApi 35 | from asana.api.project_statuses_api import ProjectStatusesApi 36 | from asana.api.project_templates_api import ProjectTemplatesApi 37 | from asana.api.projects_api import ProjectsApi 38 | from asana.api.rules_api import RulesApi 39 | from asana.api.sections_api import SectionsApi 40 | from asana.api.status_updates_api import StatusUpdatesApi 41 | from asana.api.stories_api import StoriesApi 42 | from asana.api.tags_api import TagsApi 43 | from asana.api.task_templates_api import TaskTemplatesApi 44 | from asana.api.tasks_api import TasksApi 45 | from asana.api.team_memberships_api import TeamMembershipsApi 46 | from asana.api.teams_api import TeamsApi 47 | from asana.api.time_periods_api import TimePeriodsApi 48 | from asana.api.time_tracking_entries_api import TimeTrackingEntriesApi 49 | from asana.api.typeahead_api import TypeaheadApi 50 | from asana.api.user_task_lists_api import UserTaskListsApi 51 | from asana.api.users_api import UsersApi 52 | from asana.api.webhooks_api import WebhooksApi 53 | from asana.api.workspace_memberships_api import WorkspaceMembershipsApi 54 | from asana.api.workspaces_api import WorkspacesApi 55 | # import ApiClient 56 | from asana.api_client import ApiClient 57 | from asana.configuration import Configuration 58 | -------------------------------------------------------------------------------- /asana/api/__init__.py: -------------------------------------------------------------------------------- 1 | from __future__ import absolute_import 2 | 3 | # flake8: noqa 4 | 5 | # import apis into api package 6 | from asana.api.allocations_api import AllocationsApi 7 | from asana.api.attachments_api import AttachmentsApi 8 | from asana.api.audit_log_api_api import AuditLogAPIApi 9 | from asana.api.batch_api_api import BatchAPIApi 10 | from asana.api.custom_field_settings_api import CustomFieldSettingsApi 11 | from asana.api.custom_fields_api import CustomFieldsApi 12 | from asana.api.custom_types_api import CustomTypesApi 13 | from asana.api.events_api import EventsApi 14 | from asana.api.goal_relationships_api import GoalRelationshipsApi 15 | from asana.api.goals_api import GoalsApi 16 | from asana.api.jobs_api import JobsApi 17 | from asana.api.memberships_api import MembershipsApi 18 | from asana.api.organization_exports_api import OrganizationExportsApi 19 | from asana.api.portfolio_memberships_api import PortfolioMembershipsApi 20 | from asana.api.portfolios_api import PortfoliosApi 21 | from asana.api.project_briefs_api import ProjectBriefsApi 22 | from asana.api.project_memberships_api import ProjectMembershipsApi 23 | from asana.api.project_statuses_api import ProjectStatusesApi 24 | from asana.api.project_templates_api import ProjectTemplatesApi 25 | from asana.api.projects_api import ProjectsApi 26 | from asana.api.rules_api import RulesApi 27 | from asana.api.sections_api import SectionsApi 28 | from asana.api.status_updates_api import StatusUpdatesApi 29 | from asana.api.stories_api import StoriesApi 30 | from asana.api.tags_api import TagsApi 31 | from asana.api.task_templates_api import TaskTemplatesApi 32 | from asana.api.tasks_api import TasksApi 33 | from asana.api.team_memberships_api import TeamMembershipsApi 34 | from asana.api.teams_api import TeamsApi 35 | from asana.api.time_periods_api import TimePeriodsApi 36 | from asana.api.time_tracking_entries_api import TimeTrackingEntriesApi 37 | from asana.api.typeahead_api import TypeaheadApi 38 | from asana.api.user_task_lists_api import UserTaskListsApi 39 | from asana.api.users_api import UsersApi 40 | from asana.api.webhooks_api import WebhooksApi 41 | from asana.api.workspace_memberships_api import WorkspaceMembershipsApi 42 | from asana.api.workspaces_api import WorkspacesApi 43 | -------------------------------------------------------------------------------- /asana/pagination/__init__.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | # flake8: noqa 4 | 5 | """ 6 | Asana 7 | 8 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 9 | 10 | OpenAPI spec version: 1.0 11 | 12 | Generated by: https://github.com/swagger-api/swagger-codegen.git 13 | """ 14 | 15 | from __future__ import absolute_import 16 | 17 | # import pagination into pagination package 18 | from asana.pagination.page_iterator import PageIterator 19 | from asana.pagination.event_iterator import EventIterator 20 | -------------------------------------------------------------------------------- /asana/pagination/event_iterator.py: -------------------------------------------------------------------------------- 1 | import json 2 | from asana.pagination.page_iterator import PageIterator 3 | from asana.rest import ApiException 4 | 5 | class EventIterator(PageIterator): 6 | def __init__(self, api_client, api_request_data, **kwargs): 7 | super().__init__(api_client, api_request_data, **kwargs) 8 | self.sync = False 9 | self.has_more = True 10 | 11 | def __next__(self): 12 | if not self.has_more: 13 | raise StopIteration 14 | 15 | result = {} 16 | 17 | try: 18 | result = self.call_api() 19 | except ApiException as e: 20 | if (e.status == 412): 21 | errors = json.loads(e.body.decode("utf-8")) 22 | self.sync = errors["sync"] 23 | else: 24 | raise e 25 | 26 | if (self.sync): 27 | self.api_request_data["query_params"]["sync"] = self.sync 28 | else: 29 | self.sync = result.get('sync', None) 30 | 31 | if not result: 32 | try: 33 | result = self.call_api() 34 | except ApiException as e: 35 | raise e 36 | 37 | self.has_more = result.get('has_more', False) 38 | return result["data"] 39 | -------------------------------------------------------------------------------- /asana/pagination/page_iterator.py: -------------------------------------------------------------------------------- 1 | from asana.rest import ApiException 2 | 3 | class PageIterator(object): 4 | def __init__(self, api_client, api_request_data, **kwargs): 5 | self.__api_client = api_client 6 | self.api_request_data = api_request_data 7 | self.next_page = False 8 | self.item_limit = float('inf') if kwargs.get('item_limit', None) == None else kwargs.get('item_limit') 9 | self.count = 0 10 | 11 | def __iter__(self): 12 | """Iterator interface, self is an iterator""" 13 | return self 14 | 15 | def __next__(self): 16 | limit = self.api_request_data["query_params"].get("limit", None) 17 | if limit: 18 | self.api_request_data["query_params"]["limit"] = min(limit, self.item_limit - self.count) 19 | 20 | if self.next_page is None or self.api_request_data["query_params"].get("limit", None) == 0: 21 | raise StopIteration 22 | 23 | try: 24 | result = self.call_api() 25 | except ApiException as e: 26 | raise e 27 | 28 | # If the response has a next_page add the offset to the api_request_data for the next request 29 | self.next_page = result.get('next_page', None) 30 | if (self.next_page): 31 | self.api_request_data["query_params"]["offset"] = self.next_page["offset"] 32 | data = result['data'] 33 | if data != None: 34 | self.count += len(data) 35 | return data 36 | 37 | def next(self): 38 | """Alias for __next__""" 39 | return self.__next__() 40 | 41 | def items(self): 42 | """Returns an iterator for each item in each page""" 43 | for page in self: 44 | for item in page: 45 | yield item 46 | 47 | def call_api(self): 48 | return self.__api_client.call_api( 49 | self.api_request_data["resource_path"], 50 | self.api_request_data["method"], 51 | self.api_request_data["path_params"], 52 | self.api_request_data["query_params"], 53 | self.api_request_data["header_params"], 54 | self.api_request_data["body"], 55 | self.api_request_data["post_params"], 56 | self.api_request_data["files"], 57 | self.api_request_data["response_type"], 58 | self.api_request_data["auth_settings"], 59 | self.api_request_data["async_req"], 60 | self.api_request_data["_return_http_data_only"], 61 | self.api_request_data["collection_formats"], 62 | self.api_request_data["_preload_content"], 63 | self.api_request_data["_request_timeout"] 64 | ) 65 | -------------------------------------------------------------------------------- /build_tests/README.md: -------------------------------------------------------------------------------- 1 | # Test Build 2 | 3 | This directory contains tests that are meant to be ran locally 4 | 5 | 1. Install install dependencies `pip install -r requirements.txt` 6 | 2. Create a `.env` file in the root directory and set environment variables 7 | ``` 8 | PERSONAL_ACCESS_TOKEN= 9 | TEAM_GID= 10 | TEXT_CUSTOM_FIELD_GID= -> NOTE: make sure that there is at least one task that has this custom field and the value of the custom field on that task is `custom_value` 11 | USER_GID= 12 | WORKSPACE_GID= 13 | ``` 14 | 3. Run tests: `python -m unittest discover ./build_tests` 15 | -------------------------------------------------------------------------------- /build_tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Asana/python-asana/5ea5521603b5fc472e91eef9847d57cf7d9e78ad/build_tests/__init__.py -------------------------------------------------------------------------------- /codegen/swagger/README.md: -------------------------------------------------------------------------------- 1 | # Swagger Codegen for the AsanaPythonClientCodegen library 2 | 3 | ## Overview 4 | This is a boiler-plate project to generate your own client library with Swagger. Its goal is 5 | to get you started with the basic plumbing so you can put in your own logic. It won't work without 6 | your changes applied. 7 | 8 | ## What's Swagger? 9 | The goal of Swagger™ is to define a standard, language-agnostic interface to REST APIs which allows both humans and computers to discover and understand the capabilities of the service without access to source code, documentation, or through network traffic inspection. When properly defined via Swagger, a consumer can understand and interact with the remote service with a minimal amount of implementation logic. Similar to what interfaces have done for lower-level programming, Swagger removes the guesswork in calling the service. 10 | 11 | 12 | Check out [OpenAPI-Spec](https://github.com/OAI/OpenAPI-Specification) for additional information about the Swagger project, including additional libraries with support for other languages and more. 13 | 14 | ## How do I use this? 15 | At this point, you've likely generated a client setup. It will include something along these lines: 16 | 17 | ``` 18 | . 19 | |- README.md // this file 20 | |- pom.xml // build script 21 | |-- src 22 | |--- main 23 | |---- java 24 | |----- com.asana.codegen.AsanaPythonClientCodegenGenerator.java // generator file 25 | |---- resources 26 | |----- AsanaPythonClientCodegen // template files 27 | |----- META-INF 28 | |------ services 29 | |------- io.swagger.codegen.CodegenConfig 30 | ``` 31 | 32 | You _will_ need to make changes in at least the following: 33 | 34 | `AsanaPythonClientCodegenGenerator.java` 35 | 36 | Templates in this folder: 37 | 38 | `src/main/resources/AsanaPythonClientCodegen` 39 | 40 | Once modified, you can run this: 41 | 42 | ``` 43 | mvn package 44 | ``` 45 | 46 | In your generator project. A single jar file will be produced in `target`. You can now use that with codegen: 47 | 48 | ``` 49 | java -cp /path/to/swagger-codegen-cli.jar:/path/to/your.jar io.swagger.codegen.v3.cli.SwaggerCodegen -l AsanaPythonClientCodegen -i /path/to/swagger.yaml -o ./test 50 | ``` 51 | 52 | Now your templates are available to the client generator and you can write output values 53 | 54 | ## But how do I modify this? 55 | The `ReadMe.java` has comments in it--lots of comments. There is no good substitute 56 | for reading the code more, though. See how the `ReadMe` implements `CodegenConfig`. 57 | That class has the signature of all values that can be overridden. 58 | 59 | For the templates themselves, you have a number of values available to you for generation. 60 | You can execute the `java` command from above while passing different debug flags to show 61 | the object you have available during client generation: 62 | 63 | ``` 64 | # The following additional debug options are available for all codegen targets: 65 | # -DdebugSwagger prints the OpenAPI Specification as interpreted by the codegen 66 | # -DdebugModels prints models passed to the template engine 67 | # -DdebugOperations prints operations passed to the template engine 68 | # -DdebugSupportingFiles prints additional data passed to the template engine 69 | 70 | java -DdebugOperations -cp /path/to/swagger-codegen-cli.jar:/path/to/your.jar io.swagger.codegen.Codegen -l AsanaPythonClientCodegen -i /path/to/swagger.yaml -o ./test 71 | ``` 72 | 73 | Will, for example, output the debug info for operations. You can use this info 74 | in the `api.mustache` file. 75 | -------------------------------------------------------------------------------- /codegen/swagger/pom.xml: -------------------------------------------------------------------------------- 1 | 3 | 4.0.0 4 | io.swagger 5 | AsanaClientCodegen-swagger-codegen 6 | jar 7 | AsanaClientCodegen-swagger-codegen 8 | 1.0.0 9 | 10 | 11 | 12 | org.apache.maven.plugins 13 | maven-enforcer-plugin 14 | 3.0.0-M1 15 | 16 | 17 | enforce-maven 18 | 19 | enforce 20 | 21 | 22 | 23 | 24 | 2.2.0 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | org.apache.maven.plugins 33 | maven-surefire-plugin 34 | 2.12 35 | 36 | 37 | 38 | loggerPath 39 | conf/log4j.properties 40 | 41 | 42 | -Xms512m -Xmx1500m 43 | methods 44 | pertest 45 | 46 | 47 | 48 | 49 | 50 | org.apache.maven.plugins 51 | maven-jar-plugin 52 | 2.2 53 | 54 | 55 | 56 | jar 57 | test-jar 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | org.codehaus.mojo 67 | build-helper-maven-plugin 68 | ${build-helper-maven-plugin} 69 | 70 | 71 | add_sources 72 | generate-sources 73 | 74 | add-source 75 | 76 | 77 | 78 | src/main/java 79 | 80 | 81 | 82 | 83 | add_test_sources 84 | generate-test-sources 85 | 86 | add-test-source 87 | 88 | 89 | 90 | src/test/java 91 | 92 | 93 | 94 | 95 | 96 | 97 | org.apache.maven.plugins 98 | maven-compiler-plugin 99 | 3.6.1 100 | 101 | 1.8 102 | 1.8 103 | 104 | 105 | 106 | 107 | 108 | 109 | io.swagger.codegen.v3 110 | swagger-codegen 111 | ${swagger-codegen-version} 112 | provided 113 | 114 | 115 | io.swagger.codegen.v3 116 | swagger-codegen-generators 117 | ${swagger-codegen-generators-version} 118 | provided 119 | 120 | 121 | 122 | UTF-8 123 | 3.0.67 124 | 1.0.56 125 | 1.0.0 126 | 4.13.1 127 | 3.0.0 128 | 129 | 130 | -------------------------------------------------------------------------------- /codegen/swagger/src/main/java/com/asana/codegen/ExampleUtility.java: -------------------------------------------------------------------------------- 1 | package com.asana.codegen; 2 | 3 | import org.json.*; 4 | import io.swagger.codegen.v3.*; 5 | 6 | class ExampleUtility { 7 | public static void tryToSetExample(CodegenParameter p) { 8 | JSONObject obj = new JSONObject(p.jsonSchema); 9 | 10 | if (obj.has("example")) { 11 | p.example = obj.get("example").toString(); 12 | return; 13 | } 14 | 15 | if (!obj.has("schema")) { 16 | return; 17 | } 18 | 19 | JSONObject schema = obj.getJSONObject("schema"); 20 | 21 | if (!schema.has("example")) { 22 | return; 23 | } 24 | 25 | p.example = schema.get("example").toString(); 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /codegen/swagger/src/main/java/com/asana/codegen/ReadMe.java: -------------------------------------------------------------------------------- 1 | package com.asana.codegen; 2 | 3 | import io.swagger.codegen.v3.*; 4 | import io.swagger.codegen.v3.generators.DefaultCodegenConfig; 5 | 6 | import java.util.*; 7 | import java.io.File; 8 | 9 | public class ReadMe extends DefaultCodegenConfig { 10 | 11 | // source folder where to write the files 12 | protected String sourceFolder = "src"; 13 | protected String apiVersion = "1.0.0"; 14 | 15 | /** 16 | * Configures the type of generator. 17 | * 18 | * @return the CodegenType for this generator 19 | * @see io.swagger.codegen.CodegenType 20 | */ 21 | public CodegenType getTag() { 22 | return CodegenType.CLIENT; 23 | } 24 | 25 | /** 26 | * Configures a friendly name for the generator. This will be used by the generator 27 | * to select the library with the -l flag. 28 | * 29 | * @return the friendly name for the generator 30 | */ 31 | public String getName() { 32 | return "AsanaPythonClientCodegen"; 33 | } 34 | 35 | /** 36 | * Returns human-friendly help for the generator. Provide the consumer with help 37 | * tips, parameters here 38 | * 39 | * @return A string value for the help message 40 | */ 41 | public String getHelp() { 42 | return "Generates a AsanaPythonClientCodegen client library."; 43 | } 44 | 45 | public ReadMe() { 46 | super(); 47 | 48 | // set the output folder here 49 | outputFolder = "generated-code/AsanaPythonClientCodegen"; 50 | 51 | /** 52 | * Models. You can write model files using the modelTemplateFiles map. 53 | * if you want to create one template for file, you can do so here. 54 | * for multiple files for model, just put another entry in the `modelTemplateFiles` with 55 | * a different extension 56 | */ 57 | modelTemplateFiles.put( 58 | "model.mustache", // the template to use 59 | ".sample"); // the extension for each file to write 60 | 61 | /** 62 | * Api classes. You can write classes for each Api file with the apiTemplateFiles map. 63 | * as with models, add multiple entries with different extensions for multiple files per 64 | * class 65 | */ 66 | apiTemplateFiles.put( 67 | "api.mustache", // the template to use 68 | ".sample"); // the extension for each file to write 69 | 70 | /** 71 | * Template Location. This is the location which templates will be read from. The generator 72 | * will use the resource stream to attempt to read the templates. 73 | */ 74 | templateDir = "AsanaPythonClientCodegen"; 75 | 76 | /** 77 | * Api Package. Optional, if needed, this can be used in templates 78 | */ 79 | apiPackage = "io.swagger.client.api"; 80 | 81 | /** 82 | * Model Package. Optional, if needed, this can be used in templates 83 | */ 84 | modelPackage = "io.swagger.client.model"; 85 | 86 | /** 87 | * Reserved words. Override this with reserved words specific to your language 88 | */ 89 | reservedWords = new HashSet ( 90 | Arrays.asList( 91 | "sample1", // replace with static values 92 | "sample2") 93 | ); 94 | 95 | /** 96 | * Additional Properties. These values can be passed to the templates and 97 | * are available in models, apis, and supporting files 98 | */ 99 | additionalProperties.put("apiVersion", apiVersion); 100 | 101 | /** 102 | * Supporting Files. You can write single files for the generator with the 103 | * entire object tree available. If the input file has a suffix of `.mustache 104 | * it will be processed by the template engine. Otherwise, it will be copied 105 | */ 106 | supportingFiles.add(new SupportingFile("myFile.mustache", // the input template or file 107 | "", // the destination folder, relative `outputFolder` 108 | "myFile.sample") // the output file 109 | ); 110 | 111 | /** 112 | * Language Specific Primitives. These types will not trigger imports by 113 | * the client generator 114 | */ 115 | languageSpecificPrimitives = new HashSet( 116 | Arrays.asList( 117 | "Type1", // replace these with your types 118 | "Type2") 119 | ); 120 | } 121 | 122 | /** 123 | * Escapes a reserved word as defined in the `reservedWords` array. Handle escaping 124 | * those terms here. This logic is only called if a variable matches the reserved words 125 | * 126 | * @return the escaped term 127 | */ 128 | @Override 129 | public String escapeReservedWord(String name) { 130 | return "_" + name; // add an underscore to the name 131 | } 132 | 133 | /** 134 | * Location to write model files. You can use the modelPackage() as defined when the class is 135 | * instantiated 136 | */ 137 | public String modelFileFolder() { 138 | return outputFolder + "/" + sourceFolder + "/" + modelPackage().replace('.', File.separatorChar); 139 | } 140 | 141 | /** 142 | * Location to write api files. You can use the apiPackage() as defined when the class is 143 | * instantiated 144 | */ 145 | @Override 146 | public String apiFileFolder() { 147 | return outputFolder + "/" + sourceFolder + "/" + apiPackage().replace('.', File.separatorChar); 148 | } 149 | 150 | @Override 151 | public String getArgumentsLocation() { 152 | return null; 153 | } 154 | 155 | @Override 156 | protected String getTemplateDir() { 157 | return templateDir; 158 | } 159 | 160 | @Override 161 | public String getDefaultTemplateDir() { 162 | return templateDir; 163 | } 164 | } 165 | -------------------------------------------------------------------------------- /codegen/swagger/src/main/resources/META-INF/services/io.swagger.codegen.v3.CodegenConfig: -------------------------------------------------------------------------------- 1 | com.asana.codegen.PythonClientCodegenGenerator 2 | -------------------------------------------------------------------------------- /codegen/templates/__init__package.mustache: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | # flake8: noqa 4 | 5 | {{>partial_header}} 6 | 7 | from __future__ import absolute_import 8 | 9 | # import apis into sdk package 10 | {{#apiInfo}}{{#apis}}from {{importPath}} import {{classname}} 11 | {{/apis}}{{/apiInfo}} 12 | # import ApiClient 13 | from {{packageName}}.api_client import ApiClient 14 | from {{packageName}}.configuration import Configuration 15 | -------------------------------------------------------------------------------- /codegen/templates/__init__pagination.mustache: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | # flake8: noqa 4 | 5 | {{>partial_header}} 6 | 7 | from __future__ import absolute_import 8 | 9 | # import pagination into pagination package 10 | from {{packageName}}.pagination.page_iterator import PageIterator 11 | from {{packageName}}.pagination.event_iterator import EventIterator 12 | -------------------------------------------------------------------------------- /codegen/templates/api_doc.mustache: -------------------------------------------------------------------------------- 1 | # {{packageName}}.{{classname}}{{#description}} 2 | {{description}}{{/description}} 3 | 4 | All URIs are relative to *{{basePath}}* 5 | 6 | Method | HTTP request | Description 7 | ------------- | ------------- | ------------- 8 | {{#operations}}{{#operation}}[**{{operationId}}**]({{classname}}.md#{{operationId}}) | **{{httpMethod}}** {{path}} | {{#summary}}{{summary}}{{/summary}} 9 | {{/operation}}{{/operations}} 10 | 11 | {{#operations}} 12 | {{#operation}} 13 | {{#contents}} 14 | {{#@first}} 15 | # **{{{operationId}}}** 16 | 17 | {{summary}}{{#notes}} 18 | 19 | {{{notes}}}{{/notes}} 20 | 21 | ([more information](https://developers.asana.com/reference/{{{vendorExtensions.x-codegen-operationIdLowerCase}}})) 22 | 23 | ### Example 24 | ```python 25 | {{>code_sample}} 26 | ``` 27 | 28 | ### Parameters 29 | {{^parameters}}This endpoint does not need any parameter.{{/parameters}}{{#parameters}}{{#@last}} 30 | Name | Type | Description | Notes 31 | ------------- | ------------- | ------------- | -------------{{/@last}}{{/parameters}} 32 | {{#parameters}} **{{paramName}}** | {{#isBinary}}**{{dataType}}**{{/isBinary}}{{^isBinary}}{{#isPrimitiveType}}**{{dataType}}**{{/isPrimitiveType}}{{^isPrimitiveType}}**Dict**{{/isPrimitiveType}}{{/isBinary}}| {{description}} | {{^required}}[optional] {{/required}}{{#defaultValue}}[default to {{defaultValue}}]{{/defaultValue}} 33 | {{/parameters}} 34 | 35 | ### Return type 36 | 37 | {{#vendorExtensions.x-codegen-isArrayResponse}}generator{{/vendorExtensions.x-codegen-isArrayResponse}}{{^vendorExtensions.x-codegen-isArrayResponse}}dict{{/vendorExtensions.x-codegen-isArrayResponse}} 38 | 39 | ### HTTP request headers 40 | 41 | - **Content-Type**: {{#consumes}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/consumes}}{{^consumes}}Not defined{{/consumes}} 42 | - **Accept**: {{#produces}}{{{mediaType}}}{{#hasMore}}, {{/hasMore}}{{/produces}}{{^produces}}Not defined{{/produces}} 43 | 44 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 45 | 46 | {{/@first}} 47 | {{/contents}} 48 | {{/operation}} 49 | {{/operations}} 50 | -------------------------------------------------------------------------------- /codegen/templates/code_sample.mustache: -------------------------------------------------------------------------------- 1 | {{>code_sample_client}}{{#hasAuthMethods}} 2 | 3 | # create an instance of the API class 4 | {{{vendorExtensions.x-codegen-resourceInstanceName}}} = {{{packageName}}}.{{{classname}}}(api_client){{#hasParams}} 5 | {{#vendorExtensions.x-codegen-hasRequiredParams}}{{#parameters}}{{#required}} 6 | {{{paramName}}} = {{{example}}} # {{{dataType}}} | {{{description}}} 7 | {{/required}}{{/parameters}}{{/vendorExtensions.x-codegen-hasRequiredParams}}{{#hasOptionalParams}} 8 | opts = { {{~#parameters}}{{^required}} 9 | '{{{paramName}}}': {{{example}}},{{#vendorExtensions.x-codegen-hasMoreOptional}}{{/vendorExtensions.x-codegen-hasMoreOptional}} # {{{dataType}}} | {{{description}}}{{/required}}{{/parameters}} 10 | }{{/hasOptionalParams}}{{/hasParams}} 11 | {{/hasAuthMethods}} 12 | {{^hasAuthMethods}} 13 | 14 | # create an instance of the API class 15 | {{{vendorExtensions.x-codegen-resourceInstanceName}}} = {{{packageName}}}.{{{classname}}}() 16 | {{#parameters}} 17 | {{paramName}} = {{{example}}} # {{{dataType}}} | {{{description}}}{{^required}} (optional){{/required}}{{#defaultValue}} (default to {{{.}}}){{/defaultValue}} 18 | {{/parameters}} 19 | {{/hasAuthMethods}} 20 | {{#vendorExtensions.x-codegen-isSearchTasksForWorkspace}} 21 | opts['custom_fields.123.is_set'] = True # bool | Filiter to tasks with custom field set or unset. Note: searching for multiple exact matches of a custom field, searching for multi-enum custom field 22 | opts['custom_fields.123.value'] = '456' # str or bool or Enum option ID | Filter to tasks with custom field that matches the provided value. Note: searching for multiple exact matches of a custom field, searching for multi-enum custom field 23 | opts['custom_fields.123.starts_with'] = 'start' # string | Filter to tasks with custom field that starts with provided string. Note: searching for multiple exact matches of a custom field, searching for multi-enum custom field 24 | opts['custom_fields.123.ends_with'] = 'end' # string | Filter to tasks with custom field that ends in provided string. Note: searching for multiple exact matches of a custom field, searching for multi-enum custom field 25 | opts['custom_fields.123.contains'] = 'first' # string | Filter to tasks with custom field that contains the provided string. Note: searching for multiple exact matches of a custom field, searching for multi-enum custom field 26 | opts['custom_fields.123.less_than'] = 10 # number | Filter to tasks with custom field with number value less than the provided number. Note: searching for multiple exact matches of a custom field, searching for multi-enum custom field 27 | opts['custom_fields.123.greater_than'] = 100 # number | Filter to tasks with custom field with number value greater than the provided number. Note: searching for multiple exact matches of a custom field, searching for multi-enum custom field 28 | {{/vendorExtensions.x-codegen-isSearchTasksForWorkspace}} 29 | 30 | try: 31 | {{#summary}} # {{{.}}} 32 | {{/summary}} {{#returnType}}api_response = {{/returnType}}{{{vendorExtensions.x-codegen-resourceInstanceName}}}.{{{operationId}}}({{#vendorExtensions.x-codegen-templateParams}}{{#required}}{{{paramName}}}{{#vendorExtensions.x-codegen-hasMoreRequired}}, {{/vendorExtensions.x-codegen-hasMoreRequired}}{{/required}}{{/vendorExtensions.x-codegen-templateParams}}{{#hasOptionalParams}}{{#vendorExtensions.x-codegen-hasRequiredParams}}, {{/vendorExtensions.x-codegen-hasRequiredParams}}opts{{/hasOptionalParams}}){{#returnType}} 33 | {{#vendorExtensions.x-codegen-isArrayResponse}}for data in api_response: 34 | pprint(data){{/vendorExtensions.x-codegen-isArrayResponse}}{{/returnType}}{{^vendorExtensions.x-codegen-isArrayResponse}}pprint(api_response){{/vendorExtensions.x-codegen-isArrayResponse}} 35 | except ApiException as e: 36 | print("Exception when calling {{classname}}->{{operationId}}: %s\n" % e) 37 | -------------------------------------------------------------------------------- /codegen/templates/code_sample_client.mustache: -------------------------------------------------------------------------------- 1 | import {{{packageName}}} 2 | from {{{packageName}}}.rest import ApiException 3 | from pprint import pprint 4 | {{#hasAuthMethods}}{{#authMethods}}{{#isBasic}} 5 | # Configure HTTP basic authorization: {{{name}}} 6 | configuration = {{{packageName}}}.Configuration() 7 | configuration.username = 'YOUR_USERNAME' 8 | configuration.password = 'YOUR_PASSWORD'{{/isBasic}}{{#isApiKey}} 9 | # Configure API key authorization: {{{name}}} 10 | configuration = {{{packageName}}}.Configuration() 11 | configuration.api_key['{{{keyParamName}}}'] = 'YOUR_API_KEY' 12 | # Uncomment below to setup prefix (e.g. Bearer) for API key, if needed 13 | # configuration.api_key_prefix['{{{keyParamName}}}'] = 'Bearer'{{/isApiKey}}{{#isOAuth}} 14 | # Configure OAuth2 access token for authorization: {{{name}}} 15 | configuration = {{{packageName}}}.Configuration() 16 | configuration.access_token = ''{{/isOAuth}}{{#isBearer}} 17 | configuration = {{{packageName}}}.Configuration() 18 | configuration.access_token = '' 19 | {{/isBearer}}{{/authMethods}} 20 | api_client = {{{packageName}}}.ApiClient(configuration){{/hasAuthMethods}} 21 | -------------------------------------------------------------------------------- /codegen/templates/code_samples.mustache: -------------------------------------------------------------------------------- 1 | {{classname}}: 2 | {{#operations}} 3 | {{#operation}} 4 | {{#contents}} 5 | {{#@first}} 6 | {{operationId}}: |- 7 | {{>code_sample}} 8 | {{/@first}} 9 | {{/contents}} 10 | {{/operation}} 11 | {{/operations}} 12 | -------------------------------------------------------------------------------- /codegen/templates/event_iterator.mustache: -------------------------------------------------------------------------------- 1 | import json 2 | from {{packageName}}.pagination.page_iterator import PageIterator 3 | from {{packageName}}.rest import ApiException 4 | 5 | class EventIterator(PageIterator): 6 | def __init__(self, api_client, api_request_data, **kwargs): 7 | super().__init__(api_client, api_request_data, **kwargs) 8 | self.sync = False 9 | self.has_more = True 10 | 11 | def __next__(self): 12 | if not self.has_more: 13 | raise StopIteration 14 | 15 | result = {} 16 | 17 | try: 18 | result = self.call_api() 19 | except ApiException as e: 20 | if (e.status == 412): 21 | errors = json.loads(e.body.decode("utf-8")) 22 | self.sync = errors["sync"] 23 | else: 24 | raise e 25 | 26 | if (self.sync): 27 | self.api_request_data["query_params"]["sync"] = self.sync 28 | else: 29 | self.sync = result.get('sync', None) 30 | 31 | if not result: 32 | try: 33 | result = self.call_api() 34 | except ApiException as e: 35 | raise e 36 | 37 | self.has_more = result.get('has_more', False) 38 | return result["data"] 39 | -------------------------------------------------------------------------------- /codegen/templates/gitignore.mustache: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | 27 | # PyInstaller 28 | # Usually these files are written by a python script from a template 29 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 30 | *.manifest 31 | *.spec 32 | 33 | # Installer logs 34 | pip-log.txt 35 | pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | htmlcov/ 39 | .tox/ 40 | .coverage 41 | .coverage.* 42 | .cache 43 | nosetests.xml 44 | coverage.xml 45 | *,cover 46 | .hypothesis/ 47 | venv/ 48 | .python-version 49 | 50 | # Translations 51 | *.mo 52 | *.pot 53 | 54 | # Django stuff: 55 | *.log 56 | 57 | # Sphinx documentation 58 | docs/_build/ 59 | 60 | # PyBuilder 61 | target/ 62 | 63 | #Ipython Notebook 64 | .ipynb_checkpoints 65 | 66 | .travis.yml 67 | git_push.sh 68 | -------------------------------------------------------------------------------- /codegen/templates/page_iterator.mustache: -------------------------------------------------------------------------------- 1 | from {{packageName}}.rest import ApiException 2 | 3 | class PageIterator(object): 4 | def __init__(self, api_client, api_request_data, **kwargs): 5 | self.__api_client = api_client 6 | self.api_request_data = api_request_data 7 | self.next_page = False 8 | self.item_limit = float('inf') if kwargs.get('item_limit', None) == None else kwargs.get('item_limit') 9 | self.count = 0 10 | 11 | def __iter__(self): 12 | """Iterator interface, self is an iterator""" 13 | return self 14 | 15 | def __next__(self): 16 | limit = self.api_request_data["query_params"].get("limit", None) 17 | if limit: 18 | self.api_request_data["query_params"]["limit"] = min(limit, self.item_limit - self.count) 19 | 20 | if self.next_page is None or self.api_request_data["query_params"].get("limit", None) == 0: 21 | raise StopIteration 22 | 23 | try: 24 | result = self.call_api() 25 | except ApiException as e: 26 | raise e 27 | 28 | # If the response has a next_page add the offset to the api_request_data for the next request 29 | self.next_page = result.get('next_page', None) 30 | if (self.next_page): 31 | self.api_request_data["query_params"]["offset"] = self.next_page["offset"] 32 | data = result['data'] 33 | if data != None: 34 | self.count += len(data) 35 | return data 36 | 37 | def next(self): 38 | """Alias for __next__""" 39 | return self.__next__() 40 | 41 | def items(self): 42 | """Returns an iterator for each item in each page""" 43 | for page in self: 44 | for item in page: 45 | yield item 46 | 47 | def call_api(self): 48 | return self.__api_client.call_api( 49 | self.api_request_data["resource_path"], 50 | self.api_request_data["method"], 51 | self.api_request_data["path_params"], 52 | self.api_request_data["query_params"], 53 | self.api_request_data["header_params"], 54 | self.api_request_data["body"], 55 | self.api_request_data["post_params"], 56 | self.api_request_data["files"], 57 | self.api_request_data["response_type"], 58 | self.api_request_data["auth_settings"], 59 | self.api_request_data["async_req"], 60 | self.api_request_data["_return_http_data_only"], 61 | self.api_request_data["collection_formats"], 62 | self.api_request_data["_preload_content"], 63 | self.api_request_data["_request_timeout"] 64 | ) 65 | -------------------------------------------------------------------------------- /codegen/templates/requirements.mustache: -------------------------------------------------------------------------------- 1 | certifi >= 14.05.14 2 | six >= 1.10 3 | python_dateutil >= 2.5.3 4 | setuptools >= 21.0.0 5 | urllib3 >= 1.15.1 6 | python-dotenv >= 1.0.1 7 | -------------------------------------------------------------------------------- /codegen/templates/setup.mustache: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | {{>partial_header}} 4 | 5 | import os 6 | from setuptools import setup, find_packages # noqa: H301 7 | 8 | NAME = "{{{projectName}}}" 9 | VERSION = "{{packageVersion}}" 10 | with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: 11 | LONG_DESCRIPTION = readme.read() 12 | {{#apiInfo}} 13 | {{#apis}} 14 | {{^hasMore}} 15 | # To install the library, run the following 16 | # 17 | # python setup.py install 18 | # 19 | # prerequisite: setuptools 20 | # http://pypi.python.org/pypi/setuptools 21 | 22 | REQUIRES = [ 23 | "certifi>=2017.4.17", 24 | "python-dateutil>=2.1", 25 | "six>=1.10", 26 | "urllib3>=1.23" 27 | ] 28 | 29 | {{#asyncio}} 30 | REQUIRES.append("aiohttp") 31 | {{/asyncio}} 32 | {{#tornado}} 33 | REQUIRES.append("tornado") 34 | {{/tornado}} 35 | 36 | setup( 37 | name=NAME, 38 | version=VERSION, 39 | description="{{appName}}", 40 | long_description=LONG_DESCRIPTION, 41 | long_description_content_type='text/markdown', 42 | author='Asana, Inc', 43 | url="http://github.com/asana/python-asana", 44 | keywords=["asana", "{{appName}}"], 45 | install_requires=REQUIRES, 46 | packages=find_packages(), 47 | include_package_data=True, 48 | license='MIT', 49 | ) 50 | {{/hasMore}} 51 | {{/apis}} 52 | {{/apiInfo}} 53 | -------------------------------------------------------------------------------- /docs/AttachmentsApi.yaml: -------------------------------------------------------------------------------- 1 | AttachmentsApi: 2 | create_attachment_for_object: |- 3 | import asana 4 | from asana.rest import ApiException 5 | from pprint import pprint 6 | 7 | configuration = asana.Configuration() 8 | configuration.access_token = '' 9 | api_client = asana.ApiClient(configuration) 10 | 11 | # create an instance of the API class 12 | attachments_api_instance = asana.AttachmentsApi(api_client) 13 | opts = { 14 | 'resource_subtype': "external", # str | 15 | 'file': "file_example", # str | 16 | 'parent': "parent_example", # str | 17 | 'url': "url_example", # str | 18 | 'name': "name_example", # str | 19 | 'connect_to_app': True, # bool | 20 | 'opt_fields': "connected_to_app,created_at,download_url,host,name,parent,parent.created_by,parent.name,parent.resource_subtype,permanent_url,resource_subtype,size,view_url", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 21 | } 22 | 23 | try: 24 | # Upload an attachment 25 | api_response = attachments_api_instance.create_attachment_for_object(opts) 26 | pprint(api_response) 27 | except ApiException as e: 28 | print("Exception when calling AttachmentsApi->create_attachment_for_object: %s\n" % e) 29 | delete_attachment: |- 30 | import asana 31 | from asana.rest import ApiException 32 | from pprint import pprint 33 | 34 | configuration = asana.Configuration() 35 | configuration.access_token = '' 36 | api_client = asana.ApiClient(configuration) 37 | 38 | # create an instance of the API class 39 | attachments_api_instance = asana.AttachmentsApi(api_client) 40 | attachment_gid = "12345" # str | Globally unique identifier for the attachment. 41 | 42 | 43 | try: 44 | # Delete an attachment 45 | api_response = attachments_api_instance.delete_attachment(attachment_gid) 46 | pprint(api_response) 47 | except ApiException as e: 48 | print("Exception when calling AttachmentsApi->delete_attachment: %s\n" % e) 49 | get_attachment: |- 50 | import asana 51 | from asana.rest import ApiException 52 | from pprint import pprint 53 | 54 | configuration = asana.Configuration() 55 | configuration.access_token = '' 56 | api_client = asana.ApiClient(configuration) 57 | 58 | # create an instance of the API class 59 | attachments_api_instance = asana.AttachmentsApi(api_client) 60 | attachment_gid = "12345" # str | Globally unique identifier for the attachment. 61 | opts = { 62 | 'opt_fields': "connected_to_app,created_at,download_url,host,name,parent,parent.created_by,parent.name,parent.resource_subtype,permanent_url,resource_subtype,size,view_url", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 63 | } 64 | 65 | try: 66 | # Get an attachment 67 | api_response = attachments_api_instance.get_attachment(attachment_gid, opts) 68 | pprint(api_response) 69 | except ApiException as e: 70 | print("Exception when calling AttachmentsApi->get_attachment: %s\n" % e) 71 | get_attachments_for_object: |- 72 | import asana 73 | from asana.rest import ApiException 74 | from pprint import pprint 75 | 76 | configuration = asana.Configuration() 77 | configuration.access_token = '' 78 | api_client = asana.ApiClient(configuration) 79 | 80 | # create an instance of the API class 81 | attachments_api_instance = asana.AttachmentsApi(api_client) 82 | parent = "159874" # str | Globally unique identifier for object to fetch statuses from. Must be a GID for a `project`, `project_brief`, or `task`. 83 | opts = { 84 | 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. 85 | 'offset': "eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9", # str | 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.* 86 | 'opt_fields': "connected_to_app,created_at,download_url,host,name,offset,parent,parent.created_by,parent.name,parent.resource_subtype,path,permanent_url,resource_subtype,size,uri,view_url", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 87 | } 88 | 89 | try: 90 | # Get attachments from an object 91 | api_response = attachments_api_instance.get_attachments_for_object(parent, opts) 92 | for data in api_response: 93 | pprint(data) 94 | except ApiException as e: 95 | print("Exception when calling AttachmentsApi->get_attachments_for_object: %s\n" % e) 96 | -------------------------------------------------------------------------------- /docs/AuditLogAPIApi.yaml: -------------------------------------------------------------------------------- 1 | AuditLogAPIApi: 2 | get_audit_log_events: |- 3 | import asana 4 | from asana.rest import ApiException 5 | from pprint import pprint 6 | 7 | configuration = asana.Configuration() 8 | configuration.access_token = '' 9 | api_client = asana.ApiClient(configuration) 10 | 11 | # create an instance of the API class 12 | audit_log_api_api_instance = asana.AuditLogAPIApi(api_client) 13 | workspace_gid = "12345" # str | Globally unique identifier for the workspace or organization. 14 | opts = { 15 | 'start_at': '2013-10-20T19:20:30+01:00', # datetime | Filter to events created after this time (inclusive). 16 | 'end_at': '2013-10-20T19:20:30+01:00', # datetime | Filter to events created before this time (exclusive). 17 | 'event_type': "event_type_example", # str | Filter to events of this type. Refer to the [supported audit log events](/docs/audit-log-events#supported-audit-log-events) for a full list of values. 18 | 'actor_type': "actor_type_example", # str | Filter to events with an actor of this type. This only needs to be included if querying for actor types without an ID. If `actor_gid` is included, this should be excluded. 19 | 'actor_gid': "actor_gid_example", # str | Filter to events triggered by the actor with this ID. 20 | 'resource_gid': "resource_gid_example", # str | Filter to events with this resource ID. 21 | 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. 22 | 'offset': "eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9", # str | 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.* 23 | } 24 | 25 | try: 26 | # Get audit log events 27 | api_response = audit_log_api_api_instance.get_audit_log_events(workspace_gid, opts) 28 | for data in api_response: 29 | pprint(data) 30 | except ApiException as e: 31 | print("Exception when calling AuditLogAPIApi->get_audit_log_events: %s\n" % e) 32 | -------------------------------------------------------------------------------- /docs/BatchAPIApi.md: -------------------------------------------------------------------------------- 1 | # asana.BatchAPIApi 2 | 3 | All URIs are relative to *https://app.asana.com/api/1.0* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**create_batch_request**](BatchAPIApi.md#create_batch_request) | **POST** /batch | Submit parallel requests 8 | 9 | # **create_batch_request** 10 | 11 | Submit parallel requests 12 | 13 | Make multiple requests in parallel to Asana's API. 14 | 15 | ([more information](https://developers.asana.com/reference/createbatchrequest)) 16 | 17 | ### Example 18 | ```python 19 | import asana 20 | from asana.rest import ApiException 21 | from pprint import pprint 22 | 23 | configuration = asana.Configuration() 24 | configuration.access_token = '' 25 | api_client = asana.ApiClient(configuration) 26 | 27 | # create an instance of the API class 28 | batch_api_api_instance = asana.BatchAPIApi(api_client) 29 | body = {"data": {"": "", "": "",}} # dict | The requests to batch together via the Batch API. 30 | opts = { 31 | 'opt_fields': "body,headers,status_code", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 32 | } 33 | 34 | try: 35 | # Submit parallel requests 36 | api_response = batch_api_api_instance.create_batch_request(body, opts) 37 | for data in api_response: 38 | pprint(data) 39 | except ApiException as e: 40 | print("Exception when calling BatchAPIApi->create_batch_request: %s\n" % e) 41 | ``` 42 | 43 | ### Parameters 44 | 45 | Name | Type | Description | Notes 46 | ------------- | ------------- | ------------- | ------------- 47 | **body** | **Dict**| The requests to batch together via the Batch API. | 48 | **opt_fields** | **Dict**| This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. | [optional] 49 | 50 | ### Return type 51 | 52 | generator 53 | 54 | ### HTTP request headers 55 | 56 | - **Content-Type**: application/json; charset=UTF-8 57 | - **Accept**: application/json; charset=UTF-8 58 | 59 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 60 | 61 | -------------------------------------------------------------------------------- /docs/BatchAPIApi.yaml: -------------------------------------------------------------------------------- 1 | BatchAPIApi: 2 | create_batch_request: |- 3 | import asana 4 | from asana.rest import ApiException 5 | from pprint import pprint 6 | 7 | configuration = asana.Configuration() 8 | configuration.access_token = '' 9 | api_client = asana.ApiClient(configuration) 10 | 11 | # create an instance of the API class 12 | batch_api_api_instance = asana.BatchAPIApi(api_client) 13 | body = {"data": {"": "", "": "",}} # dict | The requests to batch together via the Batch API. 14 | opts = { 15 | 'opt_fields': "body,headers,status_code", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 16 | } 17 | 18 | try: 19 | # Submit parallel requests 20 | api_response = batch_api_api_instance.create_batch_request(body, opts) 21 | for data in api_response: 22 | pprint(data) 23 | except ApiException as e: 24 | print("Exception when calling BatchAPIApi->create_batch_request: %s\n" % e) 25 | -------------------------------------------------------------------------------- /docs/CustomFieldSettingsApi.yaml: -------------------------------------------------------------------------------- 1 | CustomFieldSettingsApi: 2 | get_custom_field_settings_for_portfolio: |- 3 | import asana 4 | from asana.rest import ApiException 5 | from pprint import pprint 6 | 7 | configuration = asana.Configuration() 8 | configuration.access_token = '' 9 | api_client = asana.ApiClient(configuration) 10 | 11 | # create an instance of the API class 12 | custom_field_settings_api_instance = asana.CustomFieldSettingsApi(api_client) 13 | portfolio_gid = "12345" # str | Globally unique identifier for the portfolio. 14 | opts = { 15 | 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. 16 | 'offset': "eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9", # str | 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.* 17 | 'opt_fields': "custom_field,custom_field.asana_created_field,custom_field.created_by,custom_field.created_by.name,custom_field.currency_code,custom_field.custom_label,custom_field.custom_label_position,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.default_access_level,custom_field.description,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.format,custom_field.has_notifications_enabled,custom_field.id_prefix,custom_field.is_formula_field,custom_field.is_global_to_workspace,custom_field.is_value_read_only,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.people_value,custom_field.people_value.name,custom_field.precision,custom_field.privacy_setting,custom_field.representation_type,custom_field.resource_subtype,custom_field.text_value,custom_field.type,is_important,offset,parent,parent.name,path,project,project.name,uri", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 18 | } 19 | 20 | try: 21 | # Get a portfolio's custom fields 22 | api_response = custom_field_settings_api_instance.get_custom_field_settings_for_portfolio(portfolio_gid, opts) 23 | for data in api_response: 24 | pprint(data) 25 | except ApiException as e: 26 | print("Exception when calling CustomFieldSettingsApi->get_custom_field_settings_for_portfolio: %s\n" % e) 27 | get_custom_field_settings_for_project: |- 28 | import asana 29 | from asana.rest import ApiException 30 | from pprint import pprint 31 | 32 | configuration = asana.Configuration() 33 | configuration.access_token = '' 34 | api_client = asana.ApiClient(configuration) 35 | 36 | # create an instance of the API class 37 | custom_field_settings_api_instance = asana.CustomFieldSettingsApi(api_client) 38 | project_gid = "1331" # str | Globally unique identifier for the project. 39 | opts = { 40 | 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. 41 | 'offset': "eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9", # str | 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.* 42 | 'opt_fields': "custom_field,custom_field.asana_created_field,custom_field.created_by,custom_field.created_by.name,custom_field.currency_code,custom_field.custom_label,custom_field.custom_label_position,custom_field.date_value,custom_field.date_value.date,custom_field.date_value.date_time,custom_field.default_access_level,custom_field.description,custom_field.display_value,custom_field.enabled,custom_field.enum_options,custom_field.enum_options.color,custom_field.enum_options.enabled,custom_field.enum_options.name,custom_field.enum_value,custom_field.enum_value.color,custom_field.enum_value.enabled,custom_field.enum_value.name,custom_field.format,custom_field.has_notifications_enabled,custom_field.id_prefix,custom_field.is_formula_field,custom_field.is_global_to_workspace,custom_field.is_value_read_only,custom_field.multi_enum_values,custom_field.multi_enum_values.color,custom_field.multi_enum_values.enabled,custom_field.multi_enum_values.name,custom_field.name,custom_field.number_value,custom_field.people_value,custom_field.people_value.name,custom_field.precision,custom_field.privacy_setting,custom_field.representation_type,custom_field.resource_subtype,custom_field.text_value,custom_field.type,is_important,offset,parent,parent.name,path,project,project.name,uri", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 43 | } 44 | 45 | try: 46 | # Get a project's custom fields 47 | api_response = custom_field_settings_api_instance.get_custom_field_settings_for_project(project_gid, opts) 48 | for data in api_response: 49 | pprint(data) 50 | except ApiException as e: 51 | print("Exception when calling CustomFieldSettingsApi->get_custom_field_settings_for_project: %s\n" % e) 52 | -------------------------------------------------------------------------------- /docs/CustomTypesApi.md: -------------------------------------------------------------------------------- 1 | # asana.CustomTypesApi 2 | 3 | All URIs are relative to *https://app.asana.com/api/1.0* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**get_custom_types**](CustomTypesApi.md#get_custom_types) | **GET** /custom_types | Get all custom types associated with an object 8 | 9 | # **get_custom_types** 10 | 11 | Get all custom types associated with an object 12 | 13 | Returns a list of all of the custom types associated with an object. Currently, only projects are supported. 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 [documentation for input/output options](https://developers.asana.com/docs/inputoutput-options) for more information. 14 | 15 | ([more information](https://developers.asana.com/reference/getcustomtypes)) 16 | 17 | ### Example 18 | ```python 19 | import asana 20 | from asana.rest import ApiException 21 | from pprint import pprint 22 | 23 | configuration = asana.Configuration() 24 | configuration.access_token = '' 25 | api_client = asana.ApiClient(configuration) 26 | 27 | # create an instance of the API class 28 | custom_types_api_instance = asana.CustomTypesApi(api_client) 29 | project = "1331" # str | Globally unique identifier for the project, which is used as a filter when retrieving all custom types. 30 | opts = { 31 | 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. 32 | 'offset': "eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9", # str | 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.* 33 | 'opt_fields': "name,offset,path,status_options,status_options.color,status_options.completion_state,status_options.enabled,status_options.name,uri", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 34 | } 35 | 36 | try: 37 | # Get all custom types associated with an object 38 | api_response = custom_types_api_instance.get_custom_types(project, opts) 39 | for data in api_response: 40 | pprint(data) 41 | except ApiException as e: 42 | print("Exception when calling CustomTypesApi->get_custom_types: %s\n" % e) 43 | ``` 44 | 45 | ### Parameters 46 | 47 | Name | Type | Description | Notes 48 | ------------- | ------------- | ------------- | ------------- 49 | **project** | **str**| Globally unique identifier for the project, which is used as a filter when retrieving all custom types. | 50 | **limit** | **int**| Results per page. The number of objects to return per page. The value must be between 1 and 100. | [optional] 51 | **offset** | **str**| 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.* | [optional] 52 | **opt_fields** | **Dict**| This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. | [optional] 53 | 54 | ### Return type 55 | 56 | generator 57 | 58 | ### HTTP request headers 59 | 60 | - **Content-Type**: Not defined 61 | - **Accept**: application/json; charset=UTF-8 62 | 63 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 64 | 65 | -------------------------------------------------------------------------------- /docs/CustomTypesApi.yaml: -------------------------------------------------------------------------------- 1 | CustomTypesApi: 2 | get_custom_types: |- 3 | import asana 4 | from asana.rest import ApiException 5 | from pprint import pprint 6 | 7 | configuration = asana.Configuration() 8 | configuration.access_token = '' 9 | api_client = asana.ApiClient(configuration) 10 | 11 | # create an instance of the API class 12 | custom_types_api_instance = asana.CustomTypesApi(api_client) 13 | project = "1331" # str | Globally unique identifier for the project, which is used as a filter when retrieving all custom types. 14 | opts = { 15 | 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. 16 | 'offset': "eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9", # str | 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.* 17 | 'opt_fields': "name,offset,path,status_options,status_options.color,status_options.completion_state,status_options.enabled,status_options.name,uri", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 18 | } 19 | 20 | try: 21 | # Get all custom types associated with an object 22 | api_response = custom_types_api_instance.get_custom_types(project, opts) 23 | for data in api_response: 24 | pprint(data) 25 | except ApiException as e: 26 | print("Exception when calling CustomTypesApi->get_custom_types: %s\n" % e) 27 | -------------------------------------------------------------------------------- /docs/EventsApi.md: -------------------------------------------------------------------------------- 1 | # asana.EventsApi 2 | 3 | All URIs are relative to *https://app.asana.com/api/1.0* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**get_events**](EventsApi.md#get_events) | **GET** /events | Get events on a resource 8 | 9 | # **get_events** 10 | 11 | Get events on a resource 12 | 13 | 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. Asana limits a single sync token to 100 events. If more than 100 events exist for a given resource, `has_more: true` will be returned in the response, indicating that there are more events to pull. *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.* 14 | 15 | ([more information](https://developers.asana.com/reference/getevents)) 16 | 17 | ### Example 18 | ```python 19 | import asana 20 | from asana.rest import ApiException 21 | from pprint import pprint 22 | 23 | configuration = asana.Configuration() 24 | configuration.access_token = '' 25 | api_client = asana.ApiClient(configuration) 26 | 27 | # create an instance of the API class 28 | events_api_instance = asana.EventsApi(api_client) 29 | resource = "12345" # str | A resource ID to subscribe to. The resource can be a task, project, or goal. 30 | opts = { 31 | 'sync': "de4774f6915eae04714ca93bb2f5ee81", # str | 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.* 32 | 'opt_fields': "action,change,change.action,change.added_value,change.field,change.new_value,change.removed_value,created_at,parent,parent.name,resource,resource.name,type,user,user.name", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 33 | } 34 | 35 | try: 36 | # Get events on a resource 37 | api_response = events_api_instance.get_events(resource, opts) 38 | for data in api_response: 39 | pprint(data) 40 | except ApiException as e: 41 | print("Exception when calling EventsApi->get_events: %s\n" % e) 42 | ``` 43 | 44 | ### Parameters 45 | 46 | Name | Type | Description | Notes 47 | ------------- | ------------- | ------------- | ------------- 48 | **resource** | **str**| A resource ID to subscribe to. The resource can be a task, project, or goal. | 49 | **sync** | **str**| 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.* | [optional] 50 | **opt_fields** | **Dict**| This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. | [optional] 51 | 52 | ### Return type 53 | 54 | generator 55 | 56 | ### HTTP request headers 57 | 58 | - **Content-Type**: Not defined 59 | - **Accept**: application/json; charset=UTF-8 60 | 61 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 62 | 63 | -------------------------------------------------------------------------------- /docs/EventsApi.yaml: -------------------------------------------------------------------------------- 1 | EventsApi: 2 | get_events: |- 3 | import asana 4 | from asana.rest import ApiException 5 | from pprint import pprint 6 | 7 | configuration = asana.Configuration() 8 | configuration.access_token = '' 9 | api_client = asana.ApiClient(configuration) 10 | 11 | # create an instance of the API class 12 | events_api_instance = asana.EventsApi(api_client) 13 | resource = "12345" # str | A resource ID to subscribe to. The resource can be a task, project, or goal. 14 | opts = { 15 | 'sync': "de4774f6915eae04714ca93bb2f5ee81", # str | 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.* 16 | 'opt_fields': "action,change,change.action,change.added_value,change.field,change.new_value,change.removed_value,created_at,parent,parent.name,resource,resource.name,type,user,user.name", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 17 | } 18 | 19 | try: 20 | # Get events on a resource 21 | api_response = events_api_instance.get_events(resource, opts) 22 | for data in api_response: 23 | pprint(data) 24 | except ApiException as e: 25 | print("Exception when calling EventsApi->get_events: %s\n" % e) 26 | -------------------------------------------------------------------------------- /docs/JobsApi.md: -------------------------------------------------------------------------------- 1 | # asana.JobsApi 2 | 3 | All URIs are relative to *https://app.asana.com/api/1.0* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**get_job**](JobsApi.md#get_job) | **GET** /jobs/{job_gid} | Get a job by id 8 | 9 | # **get_job** 10 | 11 | Get a job by id 12 | 13 | Returns the full record for a job. 14 | 15 | ([more information](https://developers.asana.com/reference/getjob)) 16 | 17 | ### Example 18 | ```python 19 | import asana 20 | from asana.rest import ApiException 21 | from pprint import pprint 22 | 23 | configuration = asana.Configuration() 24 | configuration.access_token = '' 25 | api_client = asana.ApiClient(configuration) 26 | 27 | # create an instance of the API class 28 | jobs_api_instance = asana.JobsApi(api_client) 29 | job_gid = "12345" # str | Globally unique identifier for the job. 30 | opts = { 31 | 'opt_fields': "new_project,new_project.name,new_project_template,new_project_template.name,new_task,new_task.created_by,new_task.name,new_task.resource_subtype,resource_subtype,status", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 32 | } 33 | 34 | try: 35 | # Get a job by id 36 | api_response = jobs_api_instance.get_job(job_gid, opts) 37 | pprint(api_response) 38 | except ApiException as e: 39 | print("Exception when calling JobsApi->get_job: %s\n" % e) 40 | ``` 41 | 42 | ### Parameters 43 | 44 | Name | Type | Description | Notes 45 | ------------- | ------------- | ------------- | ------------- 46 | **job_gid** | **str**| Globally unique identifier for the job. | 47 | **opt_fields** | **Dict**| This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. | [optional] 48 | 49 | ### Return type 50 | 51 | dict 52 | 53 | ### HTTP request headers 54 | 55 | - **Content-Type**: Not defined 56 | - **Accept**: application/json; charset=UTF-8 57 | 58 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 59 | 60 | -------------------------------------------------------------------------------- /docs/JobsApi.yaml: -------------------------------------------------------------------------------- 1 | JobsApi: 2 | get_job: |- 3 | import asana 4 | from asana.rest import ApiException 5 | from pprint import pprint 6 | 7 | configuration = asana.Configuration() 8 | configuration.access_token = '' 9 | api_client = asana.ApiClient(configuration) 10 | 11 | # create an instance of the API class 12 | jobs_api_instance = asana.JobsApi(api_client) 13 | job_gid = "12345" # str | Globally unique identifier for the job. 14 | opts = { 15 | 'opt_fields': "new_project,new_project.name,new_project_template,new_project_template.name,new_task,new_task.created_by,new_task.name,new_task.resource_subtype,resource_subtype,status", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 16 | } 17 | 18 | try: 19 | # Get a job by id 20 | api_response = jobs_api_instance.get_job(job_gid, opts) 21 | pprint(api_response) 22 | except ApiException as e: 23 | print("Exception when calling JobsApi->get_job: %s\n" % e) 24 | -------------------------------------------------------------------------------- /docs/MembershipsApi.yaml: -------------------------------------------------------------------------------- 1 | MembershipsApi: 2 | create_membership: |- 3 | import asana 4 | from asana.rest import ApiException 5 | from pprint import pprint 6 | 7 | configuration = asana.Configuration() 8 | configuration.access_token = '' 9 | api_client = asana.ApiClient(configuration) 10 | 11 | # create an instance of the API class 12 | memberships_api_instance = asana.MembershipsApi(api_client) 13 | opts = { 14 | 'body': {"data": {"": "", "": "",}}, # dict | The updated fields for the membership. 15 | } 16 | 17 | try: 18 | # Create a membership 19 | api_response = memberships_api_instance.create_membership(opts) 20 | pprint(api_response) 21 | except ApiException as e: 22 | print("Exception when calling MembershipsApi->create_membership: %s\n" % e) 23 | delete_membership: |- 24 | import asana 25 | from asana.rest import ApiException 26 | from pprint import pprint 27 | 28 | configuration = asana.Configuration() 29 | configuration.access_token = '' 30 | api_client = asana.ApiClient(configuration) 31 | 32 | # create an instance of the API class 33 | memberships_api_instance = asana.MembershipsApi(api_client) 34 | membership_gid = "12345" # str | Globally unique identifier for the membership. 35 | 36 | 37 | try: 38 | # Delete a membership 39 | api_response = memberships_api_instance.delete_membership(membership_gid) 40 | pprint(api_response) 41 | except ApiException as e: 42 | print("Exception when calling MembershipsApi->delete_membership: %s\n" % e) 43 | get_membership: |- 44 | import asana 45 | from asana.rest import ApiException 46 | from pprint import pprint 47 | 48 | configuration = asana.Configuration() 49 | configuration.access_token = '' 50 | api_client = asana.ApiClient(configuration) 51 | 52 | # create an instance of the API class 53 | memberships_api_instance = asana.MembershipsApi(api_client) 54 | membership_gid = "12345" # str | Globally unique identifier for the membership. 55 | 56 | 57 | try: 58 | # Get a membership 59 | api_response = memberships_api_instance.get_membership(membership_gid) 60 | pprint(api_response) 61 | except ApiException as e: 62 | print("Exception when calling MembershipsApi->get_membership: %s\n" % e) 63 | get_memberships: |- 64 | import asana 65 | from asana.rest import ApiException 66 | from pprint import pprint 67 | 68 | configuration = asana.Configuration() 69 | configuration.access_token = '' 70 | api_client = asana.ApiClient(configuration) 71 | 72 | # create an instance of the API class 73 | memberships_api_instance = asana.MembershipsApi(api_client) 74 | opts = { 75 | 'parent': "159874", # str | Globally unique identifier for `goal`, `project`, `portfolio`, or `custom_field`. 76 | 'member': "1061493", # str | Globally unique identifier for `team` or `user`. 77 | 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. 78 | 'offset': "eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9", # str | 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.* 79 | 'opt_fields': "offset,path,uri", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 80 | } 81 | 82 | try: 83 | # Get multiple memberships 84 | api_response = memberships_api_instance.get_memberships(opts) 85 | for data in api_response: 86 | pprint(data) 87 | except ApiException as e: 88 | print("Exception when calling MembershipsApi->get_memberships: %s\n" % e) 89 | update_membership: |- 90 | import asana 91 | from asana.rest import ApiException 92 | from pprint import pprint 93 | 94 | configuration = asana.Configuration() 95 | configuration.access_token = '' 96 | api_client = asana.ApiClient(configuration) 97 | 98 | # create an instance of the API class 99 | memberships_api_instance = asana.MembershipsApi(api_client) 100 | body = {"data": {"": "", "": "",}} # dict | The membership to update. 101 | membership_gid = "12345" # str | Globally unique identifier for the membership. 102 | 103 | 104 | try: 105 | # Update a membership 106 | api_response = memberships_api_instance.update_membership(body, membership_gid) 107 | pprint(api_response) 108 | except ApiException as e: 109 | print("Exception when calling MembershipsApi->update_membership: %s\n" % e) 110 | -------------------------------------------------------------------------------- /docs/OrganizationExportsApi.md: -------------------------------------------------------------------------------- 1 | # asana.OrganizationExportsApi 2 | 3 | All URIs are relative to *https://app.asana.com/api/1.0* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**create_organization_export**](OrganizationExportsApi.md#create_organization_export) | **POST** /organization_exports | Create an organization export request 8 | [**get_organization_export**](OrganizationExportsApi.md#get_organization_export) | **GET** /organization_exports/{organization_export_gid} | Get details on an org export request 9 | 10 | # **create_organization_export** 11 | 12 | Create an organization export request 13 | 14 | This method creates a request to export an Organization. Asana will complete the export at some point after you create the request. 15 | 16 | ([more information](https://developers.asana.com/reference/createorganizationexport)) 17 | 18 | ### Example 19 | ```python 20 | import asana 21 | from asana.rest import ApiException 22 | from pprint import pprint 23 | 24 | configuration = asana.Configuration() 25 | configuration.access_token = '' 26 | api_client = asana.ApiClient(configuration) 27 | 28 | # create an instance of the API class 29 | organization_exports_api_instance = asana.OrganizationExportsApi(api_client) 30 | body = {"data": {"": "", "": "",}} # dict | The organization to export. 31 | opts = { 32 | 'opt_fields': "created_at,download_url,organization,organization.name,state", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 33 | } 34 | 35 | try: 36 | # Create an organization export request 37 | api_response = organization_exports_api_instance.create_organization_export(body, opts) 38 | pprint(api_response) 39 | except ApiException as e: 40 | print("Exception when calling OrganizationExportsApi->create_organization_export: %s\n" % e) 41 | ``` 42 | 43 | ### Parameters 44 | 45 | Name | Type | Description | Notes 46 | ------------- | ------------- | ------------- | ------------- 47 | **body** | **Dict**| The organization to export. | 48 | **opt_fields** | **Dict**| This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. | [optional] 49 | 50 | ### Return type 51 | 52 | dict 53 | 54 | ### HTTP request headers 55 | 56 | - **Content-Type**: application/json; charset=UTF-8 57 | - **Accept**: application/json; charset=UTF-8 58 | 59 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 60 | 61 | # **get_organization_export** 62 | 63 | Get details on an org export request 64 | 65 | Returns details of a previously-requested Organization export. 66 | 67 | ([more information](https://developers.asana.com/reference/getorganizationexport)) 68 | 69 | ### Example 70 | ```python 71 | import asana 72 | from asana.rest import ApiException 73 | from pprint import pprint 74 | 75 | configuration = asana.Configuration() 76 | configuration.access_token = '' 77 | api_client = asana.ApiClient(configuration) 78 | 79 | # create an instance of the API class 80 | organization_exports_api_instance = asana.OrganizationExportsApi(api_client) 81 | organization_export_gid = "12345" # str | Globally unique identifier for the organization export. 82 | opts = { 83 | 'opt_fields': "created_at,download_url,organization,organization.name,state", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 84 | } 85 | 86 | try: 87 | # Get details on an org export request 88 | api_response = organization_exports_api_instance.get_organization_export(organization_export_gid, opts) 89 | pprint(api_response) 90 | except ApiException as e: 91 | print("Exception when calling OrganizationExportsApi->get_organization_export: %s\n" % e) 92 | ``` 93 | 94 | ### Parameters 95 | 96 | Name | Type | Description | Notes 97 | ------------- | ------------- | ------------- | ------------- 98 | **organization_export_gid** | **str**| Globally unique identifier for the organization export. | 99 | **opt_fields** | **Dict**| This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. | [optional] 100 | 101 | ### Return type 102 | 103 | dict 104 | 105 | ### HTTP request headers 106 | 107 | - **Content-Type**: Not defined 108 | - **Accept**: application/json; charset=UTF-8 109 | 110 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 111 | 112 | -------------------------------------------------------------------------------- /docs/OrganizationExportsApi.yaml: -------------------------------------------------------------------------------- 1 | OrganizationExportsApi: 2 | create_organization_export: |- 3 | import asana 4 | from asana.rest import ApiException 5 | from pprint import pprint 6 | 7 | configuration = asana.Configuration() 8 | configuration.access_token = '' 9 | api_client = asana.ApiClient(configuration) 10 | 11 | # create an instance of the API class 12 | organization_exports_api_instance = asana.OrganizationExportsApi(api_client) 13 | body = {"data": {"": "", "": "",}} # dict | The organization to export. 14 | opts = { 15 | 'opt_fields': "created_at,download_url,organization,organization.name,state", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 16 | } 17 | 18 | try: 19 | # Create an organization export request 20 | api_response = organization_exports_api_instance.create_organization_export(body, opts) 21 | pprint(api_response) 22 | except ApiException as e: 23 | print("Exception when calling OrganizationExportsApi->create_organization_export: %s\n" % e) 24 | get_organization_export: |- 25 | import asana 26 | from asana.rest import ApiException 27 | from pprint import pprint 28 | 29 | configuration = asana.Configuration() 30 | configuration.access_token = '' 31 | api_client = asana.ApiClient(configuration) 32 | 33 | # create an instance of the API class 34 | organization_exports_api_instance = asana.OrganizationExportsApi(api_client) 35 | organization_export_gid = "12345" # str | Globally unique identifier for the organization export. 36 | opts = { 37 | 'opt_fields': "created_at,download_url,organization,organization.name,state", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 38 | } 39 | 40 | try: 41 | # Get details on an org export request 42 | api_response = organization_exports_api_instance.get_organization_export(organization_export_gid, opts) 43 | pprint(api_response) 44 | except ApiException as e: 45 | print("Exception when calling OrganizationExportsApi->get_organization_export: %s\n" % e) 46 | -------------------------------------------------------------------------------- /docs/PortfolioMembershipsApi.yaml: -------------------------------------------------------------------------------- 1 | PortfolioMembershipsApi: 2 | get_portfolio_membership: |- 3 | import asana 4 | from asana.rest import ApiException 5 | from pprint import pprint 6 | 7 | configuration = asana.Configuration() 8 | configuration.access_token = '' 9 | api_client = asana.ApiClient(configuration) 10 | 11 | # create an instance of the API class 12 | portfolio_memberships_api_instance = asana.PortfolioMembershipsApi(api_client) 13 | portfolio_membership_gid = "1331" # str | 14 | opts = { 15 | 'opt_fields': "access_level,portfolio,portfolio.name,user,user.name", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 16 | } 17 | 18 | try: 19 | # Get a portfolio membership 20 | api_response = portfolio_memberships_api_instance.get_portfolio_membership(portfolio_membership_gid, opts) 21 | pprint(api_response) 22 | except ApiException as e: 23 | print("Exception when calling PortfolioMembershipsApi->get_portfolio_membership: %s\n" % e) 24 | get_portfolio_memberships: |- 25 | import asana 26 | from asana.rest import ApiException 27 | from pprint import pprint 28 | 29 | configuration = asana.Configuration() 30 | configuration.access_token = '' 31 | api_client = asana.ApiClient(configuration) 32 | 33 | # create an instance of the API class 34 | portfolio_memberships_api_instance = asana.PortfolioMembershipsApi(api_client) 35 | opts = { 36 | 'portfolio': "12345", # str | The portfolio to filter results on. 37 | 'workspace': "12345", # str | The workspace to filter results on. 38 | 'user': "me", # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. 39 | 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. 40 | 'offset': "eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9", # str | 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.* 41 | 'opt_fields': "access_level,offset,path,portfolio,portfolio.name,uri,user,user.name", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 42 | } 43 | 44 | try: 45 | # Get multiple portfolio memberships 46 | api_response = portfolio_memberships_api_instance.get_portfolio_memberships(opts) 47 | for data in api_response: 48 | pprint(data) 49 | except ApiException as e: 50 | print("Exception when calling PortfolioMembershipsApi->get_portfolio_memberships: %s\n" % e) 51 | get_portfolio_memberships_for_portfolio: |- 52 | import asana 53 | from asana.rest import ApiException 54 | from pprint import pprint 55 | 56 | configuration = asana.Configuration() 57 | configuration.access_token = '' 58 | api_client = asana.ApiClient(configuration) 59 | 60 | # create an instance of the API class 61 | portfolio_memberships_api_instance = asana.PortfolioMembershipsApi(api_client) 62 | portfolio_gid = "12345" # str | Globally unique identifier for the portfolio. 63 | opts = { 64 | 'user': "me", # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. 65 | 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. 66 | 'offset': "eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9", # str | 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.* 67 | 'opt_fields': "access_level,offset,path,portfolio,portfolio.name,uri,user,user.name", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 68 | } 69 | 70 | try: 71 | # Get memberships from a portfolio 72 | api_response = portfolio_memberships_api_instance.get_portfolio_memberships_for_portfolio(portfolio_gid, opts) 73 | for data in api_response: 74 | pprint(data) 75 | except ApiException as e: 76 | print("Exception when calling PortfolioMembershipsApi->get_portfolio_memberships_for_portfolio: %s\n" % e) 77 | -------------------------------------------------------------------------------- /docs/ProjectBriefsApi.yaml: -------------------------------------------------------------------------------- 1 | ProjectBriefsApi: 2 | create_project_brief: |- 3 | import asana 4 | from asana.rest import ApiException 5 | from pprint import pprint 6 | 7 | configuration = asana.Configuration() 8 | configuration.access_token = '' 9 | api_client = asana.ApiClient(configuration) 10 | 11 | # create an instance of the API class 12 | project_briefs_api_instance = asana.ProjectBriefsApi(api_client) 13 | body = {"data": {"": "", "": "",}} # dict | The project brief to create. 14 | project_gid = "1331" # str | Globally unique identifier for the project. 15 | opts = { 16 | 'opt_fields': "html_text,permalink_url,project,project.name,text,title", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 17 | } 18 | 19 | try: 20 | # Create a project brief 21 | api_response = project_briefs_api_instance.create_project_brief(body, project_gid, opts) 22 | pprint(api_response) 23 | except ApiException as e: 24 | print("Exception when calling ProjectBriefsApi->create_project_brief: %s\n" % e) 25 | delete_project_brief: |- 26 | import asana 27 | from asana.rest import ApiException 28 | from pprint import pprint 29 | 30 | configuration = asana.Configuration() 31 | configuration.access_token = '' 32 | api_client = asana.ApiClient(configuration) 33 | 34 | # create an instance of the API class 35 | project_briefs_api_instance = asana.ProjectBriefsApi(api_client) 36 | project_brief_gid = "12345" # str | Globally unique identifier for the project brief. 37 | 38 | 39 | try: 40 | # Delete a project brief 41 | api_response = project_briefs_api_instance.delete_project_brief(project_brief_gid) 42 | pprint(api_response) 43 | except ApiException as e: 44 | print("Exception when calling ProjectBriefsApi->delete_project_brief: %s\n" % e) 45 | get_project_brief: |- 46 | import asana 47 | from asana.rest import ApiException 48 | from pprint import pprint 49 | 50 | configuration = asana.Configuration() 51 | configuration.access_token = '' 52 | api_client = asana.ApiClient(configuration) 53 | 54 | # create an instance of the API class 55 | project_briefs_api_instance = asana.ProjectBriefsApi(api_client) 56 | project_brief_gid = "12345" # str | Globally unique identifier for the project brief. 57 | opts = { 58 | 'opt_fields': "html_text,permalink_url,project,project.name,text,title", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 59 | } 60 | 61 | try: 62 | # Get a project brief 63 | api_response = project_briefs_api_instance.get_project_brief(project_brief_gid, opts) 64 | pprint(api_response) 65 | except ApiException as e: 66 | print("Exception when calling ProjectBriefsApi->get_project_brief: %s\n" % e) 67 | update_project_brief: |- 68 | import asana 69 | from asana.rest import ApiException 70 | from pprint import pprint 71 | 72 | configuration = asana.Configuration() 73 | configuration.access_token = '' 74 | api_client = asana.ApiClient(configuration) 75 | 76 | # create an instance of the API class 77 | project_briefs_api_instance = asana.ProjectBriefsApi(api_client) 78 | body = {"data": {"": "", "": "",}} # dict | The updated fields for the project brief. 79 | project_brief_gid = "12345" # str | Globally unique identifier for the project brief. 80 | opts = { 81 | 'opt_fields': "html_text,permalink_url,project,project.name,text,title", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 82 | } 83 | 84 | try: 85 | # Update a project brief 86 | api_response = project_briefs_api_instance.update_project_brief(body, project_brief_gid, opts) 87 | pprint(api_response) 88 | except ApiException as e: 89 | print("Exception when calling ProjectBriefsApi->update_project_brief: %s\n" % e) 90 | -------------------------------------------------------------------------------- /docs/ProjectMembershipsApi.yaml: -------------------------------------------------------------------------------- 1 | ProjectMembershipsApi: 2 | get_project_membership: |- 3 | import asana 4 | from asana.rest import ApiException 5 | from pprint import pprint 6 | 7 | configuration = asana.Configuration() 8 | configuration.access_token = '' 9 | api_client = asana.ApiClient(configuration) 10 | 11 | # create an instance of the API class 12 | project_memberships_api_instance = asana.ProjectMembershipsApi(api_client) 13 | project_membership_gid = "1331" # str | 14 | opts = { 15 | 'opt_fields': "access_level,member,member.name,parent,parent.name,project,project.name,user,user.name,write_access", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 16 | } 17 | 18 | try: 19 | # Get a project membership 20 | api_response = project_memberships_api_instance.get_project_membership(project_membership_gid, opts) 21 | pprint(api_response) 22 | except ApiException as e: 23 | print("Exception when calling ProjectMembershipsApi->get_project_membership: %s\n" % e) 24 | get_project_memberships_for_project: |- 25 | import asana 26 | from asana.rest import ApiException 27 | from pprint import pprint 28 | 29 | configuration = asana.Configuration() 30 | configuration.access_token = '' 31 | api_client = asana.ApiClient(configuration) 32 | 33 | # create an instance of the API class 34 | project_memberships_api_instance = asana.ProjectMembershipsApi(api_client) 35 | project_gid = "1331" # str | Globally unique identifier for the project. 36 | opts = { 37 | 'user': "me", # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. 38 | 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. 39 | 'offset': "eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9", # str | 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.* 40 | 'opt_fields': "access_level,member,member.name,offset,parent,parent.name,path,uri", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 41 | } 42 | 43 | try: 44 | # Get memberships from a project 45 | api_response = project_memberships_api_instance.get_project_memberships_for_project(project_gid, opts) 46 | for data in api_response: 47 | pprint(data) 48 | except ApiException as e: 49 | print("Exception when calling ProjectMembershipsApi->get_project_memberships_for_project: %s\n" % e) 50 | -------------------------------------------------------------------------------- /docs/ProjectStatusesApi.yaml: -------------------------------------------------------------------------------- 1 | ProjectStatusesApi: 2 | create_project_status_for_project: |- 3 | import asana 4 | from asana.rest import ApiException 5 | from pprint import pprint 6 | 7 | configuration = asana.Configuration() 8 | configuration.access_token = '' 9 | api_client = asana.ApiClient(configuration) 10 | 11 | # create an instance of the API class 12 | project_statuses_api_instance = asana.ProjectStatusesApi(api_client) 13 | body = {"data": {"": "", "": "",}} # dict | The project status to create. 14 | project_gid = "1331" # str | Globally unique identifier for the project. 15 | opts = { 16 | 'opt_fields': "author,author.name,color,created_at,created_by,created_by.name,html_text,modified_at,text,title", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 17 | } 18 | 19 | try: 20 | # Create a project status 21 | api_response = project_statuses_api_instance.create_project_status_for_project(body, project_gid, opts) 22 | pprint(api_response) 23 | except ApiException as e: 24 | print("Exception when calling ProjectStatusesApi->create_project_status_for_project: %s\n" % e) 25 | delete_project_status: |- 26 | import asana 27 | from asana.rest import ApiException 28 | from pprint import pprint 29 | 30 | configuration = asana.Configuration() 31 | configuration.access_token = '' 32 | api_client = asana.ApiClient(configuration) 33 | 34 | # create an instance of the API class 35 | project_statuses_api_instance = asana.ProjectStatusesApi(api_client) 36 | project_status_gid = "321654" # str | The project status update to get. 37 | 38 | 39 | try: 40 | # Delete a project status 41 | api_response = project_statuses_api_instance.delete_project_status(project_status_gid) 42 | pprint(api_response) 43 | except ApiException as e: 44 | print("Exception when calling ProjectStatusesApi->delete_project_status: %s\n" % e) 45 | get_project_status: |- 46 | import asana 47 | from asana.rest import ApiException 48 | from pprint import pprint 49 | 50 | configuration = asana.Configuration() 51 | configuration.access_token = '' 52 | api_client = asana.ApiClient(configuration) 53 | 54 | # create an instance of the API class 55 | project_statuses_api_instance = asana.ProjectStatusesApi(api_client) 56 | project_status_gid = "321654" # str | The project status update to get. 57 | opts = { 58 | 'opt_fields': "author,author.name,color,created_at,created_by,created_by.name,html_text,modified_at,text,title", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 59 | } 60 | 61 | try: 62 | # Get a project status 63 | api_response = project_statuses_api_instance.get_project_status(project_status_gid, opts) 64 | pprint(api_response) 65 | except ApiException as e: 66 | print("Exception when calling ProjectStatusesApi->get_project_status: %s\n" % e) 67 | get_project_statuses_for_project: |- 68 | import asana 69 | from asana.rest import ApiException 70 | from pprint import pprint 71 | 72 | configuration = asana.Configuration() 73 | configuration.access_token = '' 74 | api_client = asana.ApiClient(configuration) 75 | 76 | # create an instance of the API class 77 | project_statuses_api_instance = asana.ProjectStatusesApi(api_client) 78 | project_gid = "1331" # str | Globally unique identifier for the project. 79 | opts = { 80 | 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. 81 | 'offset': "eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9", # str | 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.* 82 | 'opt_fields': "author,author.name,color,created_at,created_by,created_by.name,html_text,modified_at,offset,path,text,title,uri", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 83 | } 84 | 85 | try: 86 | # Get statuses from a project 87 | api_response = project_statuses_api_instance.get_project_statuses_for_project(project_gid, opts) 88 | for data in api_response: 89 | pprint(data) 90 | except ApiException as e: 91 | print("Exception when calling ProjectStatusesApi->get_project_statuses_for_project: %s\n" % e) 92 | -------------------------------------------------------------------------------- /docs/RulesApi.md: -------------------------------------------------------------------------------- 1 | # asana.RulesApi 2 | 3 | All URIs are relative to *https://app.asana.com/api/1.0* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**trigger_rule**](RulesApi.md#trigger_rule) | **POST** /rule_triggers/{rule_trigger_gid}/run | Trigger a rule 8 | 9 | # **trigger_rule** 10 | 11 | Trigger a rule 12 | 13 | Trigger a rule which uses an [\"incoming web request\"](/docs/incoming-web-requests) trigger. 14 | 15 | ([more information](https://developers.asana.com/reference/triggerrule)) 16 | 17 | ### Example 18 | ```python 19 | import asana 20 | from asana.rest import ApiException 21 | from pprint import pprint 22 | 23 | configuration = asana.Configuration() 24 | configuration.access_token = '' 25 | api_client = asana.ApiClient(configuration) 26 | 27 | # create an instance of the API class 28 | rules_api_instance = asana.RulesApi(api_client) 29 | body = {"data": {"": "", "": "",}} # dict | A dictionary of variables accessible from within the rule. 30 | rule_trigger_gid = "12345" # str | The ID of the incoming web request trigger. This value is a path parameter that is automatically generated for the API endpoint. 31 | 32 | 33 | try: 34 | # Trigger a rule 35 | api_response = rules_api_instance.trigger_rule(body, rule_trigger_gid) 36 | pprint(api_response) 37 | except ApiException as e: 38 | print("Exception when calling RulesApi->trigger_rule: %s\n" % e) 39 | ``` 40 | 41 | ### Parameters 42 | 43 | Name | Type | Description | Notes 44 | ------------- | ------------- | ------------- | ------------- 45 | **body** | **Dict**| A dictionary of variables accessible from within the rule. | 46 | **rule_trigger_gid** | **str**| The ID of the incoming web request trigger. This value is a path parameter that is automatically generated for the API endpoint. | 47 | 48 | ### Return type 49 | 50 | dict 51 | 52 | ### HTTP request headers 53 | 54 | - **Content-Type**: application/json; charset=UTF-8 55 | - **Accept**: application/json; charset=UTF-8 56 | 57 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 58 | 59 | -------------------------------------------------------------------------------- /docs/RulesApi.yaml: -------------------------------------------------------------------------------- 1 | RulesApi: 2 | trigger_rule: |- 3 | import asana 4 | from asana.rest import ApiException 5 | from pprint import pprint 6 | 7 | configuration = asana.Configuration() 8 | configuration.access_token = '' 9 | api_client = asana.ApiClient(configuration) 10 | 11 | # create an instance of the API class 12 | rules_api_instance = asana.RulesApi(api_client) 13 | body = {"data": {"": "", "": "",}} # dict | A dictionary of variables accessible from within the rule. 14 | rule_trigger_gid = "12345" # str | The ID of the incoming web request trigger. This value is a path parameter that is automatically generated for the API endpoint. 15 | 16 | 17 | try: 18 | # Trigger a rule 19 | api_response = rules_api_instance.trigger_rule(body, rule_trigger_gid) 20 | pprint(api_response) 21 | except ApiException as e: 22 | print("Exception when calling RulesApi->trigger_rule: %s\n" % e) 23 | -------------------------------------------------------------------------------- /docs/TaskTemplatesApi.yaml: -------------------------------------------------------------------------------- 1 | TaskTemplatesApi: 2 | delete_task_template: |- 3 | import asana 4 | from asana.rest import ApiException 5 | from pprint import pprint 6 | 7 | configuration = asana.Configuration() 8 | configuration.access_token = '' 9 | api_client = asana.ApiClient(configuration) 10 | 11 | # create an instance of the API class 12 | task_templates_api_instance = asana.TaskTemplatesApi(api_client) 13 | task_template_gid = "1331" # str | Globally unique identifier for the task template. 14 | 15 | 16 | try: 17 | # Delete a task template 18 | api_response = task_templates_api_instance.delete_task_template(task_template_gid) 19 | pprint(api_response) 20 | except ApiException as e: 21 | print("Exception when calling TaskTemplatesApi->delete_task_template: %s\n" % e) 22 | get_task_template: |- 23 | import asana 24 | from asana.rest import ApiException 25 | from pprint import pprint 26 | 27 | configuration = asana.Configuration() 28 | configuration.access_token = '' 29 | api_client = asana.ApiClient(configuration) 30 | 31 | # create an instance of the API class 32 | task_templates_api_instance = asana.TaskTemplatesApi(api_client) 33 | task_template_gid = "1331" # str | Globally unique identifier for the task template. 34 | opts = { 35 | 'opt_fields': "created_at,created_by,name,project,template", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 36 | } 37 | 38 | try: 39 | # Get a task template 40 | api_response = task_templates_api_instance.get_task_template(task_template_gid, opts) 41 | pprint(api_response) 42 | except ApiException as e: 43 | print("Exception when calling TaskTemplatesApi->get_task_template: %s\n" % e) 44 | get_task_templates: |- 45 | import asana 46 | from asana.rest import ApiException 47 | from pprint import pprint 48 | 49 | configuration = asana.Configuration() 50 | configuration.access_token = '' 51 | api_client = asana.ApiClient(configuration) 52 | 53 | # create an instance of the API class 54 | task_templates_api_instance = asana.TaskTemplatesApi(api_client) 55 | opts = { 56 | 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. 57 | 'offset': "eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9", # str | 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.* 58 | 'project': "321654", # str | The project to filter task templates on. 59 | 'opt_fields': "created_at,created_by,name,project,template", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 60 | } 61 | 62 | try: 63 | # Get multiple task templates 64 | api_response = task_templates_api_instance.get_task_templates(opts) 65 | for data in api_response: 66 | pprint(data) 67 | except ApiException as e: 68 | print("Exception when calling TaskTemplatesApi->get_task_templates: %s\n" % e) 69 | instantiate_task: |- 70 | import asana 71 | from asana.rest import ApiException 72 | from pprint import pprint 73 | 74 | configuration = asana.Configuration() 75 | configuration.access_token = '' 76 | api_client = asana.ApiClient(configuration) 77 | 78 | # create an instance of the API class 79 | task_templates_api_instance = asana.TaskTemplatesApi(api_client) 80 | task_template_gid = "1331" # str | Globally unique identifier for the task template. 81 | opts = { 82 | 'body': {"data": {"": "", "": "",}}, # dict | Describes the inputs used for instantiating a task - the task's name. 83 | 'opt_fields': "new_project,new_project.name,new_project_template,new_project_template.name,new_task,new_task.created_by,new_task.name,new_task.resource_subtype,resource_subtype,status", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 84 | } 85 | 86 | try: 87 | # Instantiate a task from a task template 88 | api_response = task_templates_api_instance.instantiate_task(task_template_gid, opts) 89 | pprint(api_response) 90 | except ApiException as e: 91 | print("Exception when calling TaskTemplatesApi->instantiate_task: %s\n" % e) 92 | -------------------------------------------------------------------------------- /docs/TimePeriodsApi.md: -------------------------------------------------------------------------------- 1 | # asana.TimePeriodsApi 2 | 3 | All URIs are relative to *https://app.asana.com/api/1.0* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**get_time_period**](TimePeriodsApi.md#get_time_period) | **GET** /time_periods/{time_period_gid} | Get a time period 8 | [**get_time_periods**](TimePeriodsApi.md#get_time_periods) | **GET** /time_periods | Get time periods 9 | 10 | # **get_time_period** 11 | 12 | Get a time period 13 | 14 | Returns the full record for a single time period. 15 | 16 | ([more information](https://developers.asana.com/reference/gettimeperiod)) 17 | 18 | ### Example 19 | ```python 20 | import asana 21 | from asana.rest import ApiException 22 | from pprint import pprint 23 | 24 | configuration = asana.Configuration() 25 | configuration.access_token = '' 26 | api_client = asana.ApiClient(configuration) 27 | 28 | # create an instance of the API class 29 | time_periods_api_instance = asana.TimePeriodsApi(api_client) 30 | time_period_gid = "917392" # str | Globally unique identifier for the time period. 31 | opts = { 32 | 'opt_fields': "display_name,end_on,parent,parent.display_name,parent.end_on,parent.period,parent.start_on,period,start_on", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 33 | } 34 | 35 | try: 36 | # Get a time period 37 | api_response = time_periods_api_instance.get_time_period(time_period_gid, opts) 38 | pprint(api_response) 39 | except ApiException as e: 40 | print("Exception when calling TimePeriodsApi->get_time_period: %s\n" % e) 41 | ``` 42 | 43 | ### Parameters 44 | 45 | Name | Type | Description | Notes 46 | ------------- | ------------- | ------------- | ------------- 47 | **time_period_gid** | **str**| Globally unique identifier for the time period. | 48 | **opt_fields** | **Dict**| This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. | [optional] 49 | 50 | ### Return type 51 | 52 | dict 53 | 54 | ### HTTP request headers 55 | 56 | - **Content-Type**: Not defined 57 | - **Accept**: application/json; charset=UTF-8 58 | 59 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 60 | 61 | # **get_time_periods** 62 | 63 | Get time periods 64 | 65 | Returns compact time period records. 66 | 67 | ([more information](https://developers.asana.com/reference/gettimeperiods)) 68 | 69 | ### Example 70 | ```python 71 | import asana 72 | from asana.rest import ApiException 73 | from pprint import pprint 74 | 75 | configuration = asana.Configuration() 76 | configuration.access_token = '' 77 | api_client = asana.ApiClient(configuration) 78 | 79 | # create an instance of the API class 80 | time_periods_api_instance = asana.TimePeriodsApi(api_client) 81 | workspace = "31326" # str | Globally unique identifier for the workspace. 82 | opts = { 83 | 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. 84 | 'offset': "eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9", # str | 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.* 85 | 'start_on': '2019-09-15', # date | ISO 8601 date string 86 | 'end_on': '2019-09-15', # date | ISO 8601 date string 87 | 'opt_fields': "display_name,end_on,offset,parent,parent.display_name,parent.end_on,parent.period,parent.start_on,path,period,start_on,uri", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 88 | } 89 | 90 | try: 91 | # Get time periods 92 | api_response = time_periods_api_instance.get_time_periods(workspace, opts) 93 | for data in api_response: 94 | pprint(data) 95 | except ApiException as e: 96 | print("Exception when calling TimePeriodsApi->get_time_periods: %s\n" % e) 97 | ``` 98 | 99 | ### Parameters 100 | 101 | Name | Type | Description | Notes 102 | ------------- | ------------- | ------------- | ------------- 103 | **workspace** | **str**| Globally unique identifier for the workspace. | 104 | **limit** | **int**| Results per page. The number of objects to return per page. The value must be between 1 and 100. | [optional] 105 | **offset** | **str**| 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.* | [optional] 106 | **start_on** | **date**| ISO 8601 date string | [optional] 107 | **end_on** | **date**| ISO 8601 date string | [optional] 108 | **opt_fields** | **Dict**| This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. | [optional] 109 | 110 | ### Return type 111 | 112 | generator 113 | 114 | ### HTTP request headers 115 | 116 | - **Content-Type**: Not defined 117 | - **Accept**: application/json; charset=UTF-8 118 | 119 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 120 | 121 | -------------------------------------------------------------------------------- /docs/TimePeriodsApi.yaml: -------------------------------------------------------------------------------- 1 | TimePeriodsApi: 2 | get_time_period: |- 3 | import asana 4 | from asana.rest import ApiException 5 | from pprint import pprint 6 | 7 | configuration = asana.Configuration() 8 | configuration.access_token = '' 9 | api_client = asana.ApiClient(configuration) 10 | 11 | # create an instance of the API class 12 | time_periods_api_instance = asana.TimePeriodsApi(api_client) 13 | time_period_gid = "917392" # str | Globally unique identifier for the time period. 14 | opts = { 15 | 'opt_fields': "display_name,end_on,parent,parent.display_name,parent.end_on,parent.period,parent.start_on,period,start_on", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 16 | } 17 | 18 | try: 19 | # Get a time period 20 | api_response = time_periods_api_instance.get_time_period(time_period_gid, opts) 21 | pprint(api_response) 22 | except ApiException as e: 23 | print("Exception when calling TimePeriodsApi->get_time_period: %s\n" % e) 24 | get_time_periods: |- 25 | import asana 26 | from asana.rest import ApiException 27 | from pprint import pprint 28 | 29 | configuration = asana.Configuration() 30 | configuration.access_token = '' 31 | api_client = asana.ApiClient(configuration) 32 | 33 | # create an instance of the API class 34 | time_periods_api_instance = asana.TimePeriodsApi(api_client) 35 | workspace = "31326" # str | Globally unique identifier for the workspace. 36 | opts = { 37 | 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. 38 | 'offset': "eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9", # str | 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.* 39 | 'start_on': '2019-09-15', # date | ISO 8601 date string 40 | 'end_on': '2019-09-15', # date | ISO 8601 date string 41 | 'opt_fields': "display_name,end_on,offset,parent,parent.display_name,parent.end_on,parent.period,parent.start_on,path,period,start_on,uri", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 42 | } 43 | 44 | try: 45 | # Get time periods 46 | api_response = time_periods_api_instance.get_time_periods(workspace, opts) 47 | for data in api_response: 48 | pprint(data) 49 | except ApiException as e: 50 | print("Exception when calling TimePeriodsApi->get_time_periods: %s\n" % e) 51 | -------------------------------------------------------------------------------- /docs/TypeaheadApi.md: -------------------------------------------------------------------------------- 1 | # asana.TypeaheadApi 2 | 3 | All URIs are relative to *https://app.asana.com/api/1.0* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**typeahead_for_workspace**](TypeaheadApi.md#typeahead_for_workspace) | **GET** /workspaces/{workspace_gid}/typeahead | Get objects via typeahead 8 | 9 | # **typeahead_for_workspace** 10 | 11 | Get objects via typeahead 12 | 13 | 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. Resources with type `project_template` are returned with priority placed on favorited project templates. 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. 14 | 15 | ([more information](https://developers.asana.com/reference/typeaheadforworkspace)) 16 | 17 | ### Example 18 | ```python 19 | import asana 20 | from asana.rest import ApiException 21 | from pprint import pprint 22 | 23 | configuration = asana.Configuration() 24 | configuration.access_token = '' 25 | api_client = asana.ApiClient(configuration) 26 | 27 | # create an instance of the API class 28 | typeahead_api_instance = asana.TypeaheadApi(api_client) 29 | workspace_gid = "12345" # str | Globally unique identifier for the workspace or organization. 30 | resource_type = "user" # str | The type of values the typeahead should return. You can choose from one of the following: `custom_field`, `goal`, `project`, `project_template`, `portfolio`, `tag`, `task`, `team`, 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. 31 | opts = { 32 | 'type': "user", # str | *Deprecated: new integrations should prefer the resource_type field.* 33 | 'query': "Greg", # str | The string that will be used to search for relevant objects. If an empty string is passed in, the API will return results. 34 | 'count': 20, # int | 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. 35 | 'opt_fields': "name", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 36 | } 37 | 38 | try: 39 | # Get objects via typeahead 40 | api_response = typeahead_api_instance.typeahead_for_workspace(workspace_gid, resource_type, opts) 41 | for data in api_response: 42 | pprint(data) 43 | except ApiException as e: 44 | print("Exception when calling TypeaheadApi->typeahead_for_workspace: %s\n" % e) 45 | ``` 46 | 47 | ### Parameters 48 | 49 | Name | Type | Description | Notes 50 | ------------- | ------------- | ------------- | ------------- 51 | **workspace_gid** | **str**| Globally unique identifier for the workspace or organization. | 52 | **resource_type** | **str**| The type of values the typeahead should return. You can choose from one of the following: `custom_field`, `goal`, `project`, `project_template`, `portfolio`, `tag`, `task`, `team`, 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. | [default to user] 53 | **type** | **str**| *Deprecated: new integrations should prefer the resource_type field.* | [optional] [default to user] 54 | **query** | **str**| The string that will be used to search for relevant objects. If an empty string is passed in, the API will return results. | [optional] 55 | **count** | **int**| 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. | [optional] 56 | **opt_fields** | **Dict**| This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. | [optional] 57 | 58 | ### Return type 59 | 60 | generator 61 | 62 | ### HTTP request headers 63 | 64 | - **Content-Type**: Not defined 65 | - **Accept**: application/json; charset=UTF-8 66 | 67 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 68 | 69 | -------------------------------------------------------------------------------- /docs/TypeaheadApi.yaml: -------------------------------------------------------------------------------- 1 | TypeaheadApi: 2 | typeahead_for_workspace: |- 3 | import asana 4 | from asana.rest import ApiException 5 | from pprint import pprint 6 | 7 | configuration = asana.Configuration() 8 | configuration.access_token = '' 9 | api_client = asana.ApiClient(configuration) 10 | 11 | # create an instance of the API class 12 | typeahead_api_instance = asana.TypeaheadApi(api_client) 13 | workspace_gid = "12345" # str | Globally unique identifier for the workspace or organization. 14 | resource_type = "user" # str | The type of values the typeahead should return. You can choose from one of the following: `custom_field`, `goal`, `project`, `project_template`, `portfolio`, `tag`, `task`, `team`, 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. 15 | opts = { 16 | 'type': "user", # str | *Deprecated: new integrations should prefer the resource_type field.* 17 | 'query': "Greg", # str | The string that will be used to search for relevant objects. If an empty string is passed in, the API will return results. 18 | 'count': 20, # int | 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. 19 | 'opt_fields': "name", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 20 | } 21 | 22 | try: 23 | # Get objects via typeahead 24 | api_response = typeahead_api_instance.typeahead_for_workspace(workspace_gid, resource_type, opts) 25 | for data in api_response: 26 | pprint(data) 27 | except ApiException as e: 28 | print("Exception when calling TypeaheadApi->typeahead_for_workspace: %s\n" % e) 29 | -------------------------------------------------------------------------------- /docs/UserTaskListsApi.md: -------------------------------------------------------------------------------- 1 | # asana.UserTaskListsApi 2 | 3 | All URIs are relative to *https://app.asana.com/api/1.0* 4 | 5 | Method | HTTP request | Description 6 | ------------- | ------------- | ------------- 7 | [**get_user_task_list**](UserTaskListsApi.md#get_user_task_list) | **GET** /user_task_lists/{user_task_list_gid} | Get a user task list 8 | [**get_user_task_list_for_user**](UserTaskListsApi.md#get_user_task_list_for_user) | **GET** /users/{user_gid}/user_task_list | Get a user's task list 9 | 10 | # **get_user_task_list** 11 | 12 | Get a user task list 13 | 14 | Returns the full record for a user task list. 15 | 16 | ([more information](https://developers.asana.com/reference/getusertasklist)) 17 | 18 | ### Example 19 | ```python 20 | import asana 21 | from asana.rest import ApiException 22 | from pprint import pprint 23 | 24 | configuration = asana.Configuration() 25 | configuration.access_token = '' 26 | api_client = asana.ApiClient(configuration) 27 | 28 | # create an instance of the API class 29 | user_task_lists_api_instance = asana.UserTaskListsApi(api_client) 30 | user_task_list_gid = "12345" # str | Globally unique identifier for the user task list. 31 | opts = { 32 | 'opt_fields': "name,owner,workspace", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 33 | } 34 | 35 | try: 36 | # Get a user task list 37 | api_response = user_task_lists_api_instance.get_user_task_list(user_task_list_gid, opts) 38 | pprint(api_response) 39 | except ApiException as e: 40 | print("Exception when calling UserTaskListsApi->get_user_task_list: %s\n" % e) 41 | ``` 42 | 43 | ### Parameters 44 | 45 | Name | Type | Description | Notes 46 | ------------- | ------------- | ------------- | ------------- 47 | **user_task_list_gid** | **str**| Globally unique identifier for the user task list. | 48 | **opt_fields** | **Dict**| This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. | [optional] 49 | 50 | ### Return type 51 | 52 | dict 53 | 54 | ### HTTP request headers 55 | 56 | - **Content-Type**: Not defined 57 | - **Accept**: application/json; charset=UTF-8 58 | 59 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 60 | 61 | # **get_user_task_list_for_user** 62 | 63 | Get a user's task list 64 | 65 | Returns the full record for a user's task list. 66 | 67 | ([more information](https://developers.asana.com/reference/getusertasklistforuser)) 68 | 69 | ### Example 70 | ```python 71 | import asana 72 | from asana.rest import ApiException 73 | from pprint import pprint 74 | 75 | configuration = asana.Configuration() 76 | configuration.access_token = '' 77 | api_client = asana.ApiClient(configuration) 78 | 79 | # create an instance of the API class 80 | user_task_lists_api_instance = asana.UserTaskListsApi(api_client) 81 | user_gid = "me" # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. 82 | workspace = "1234" # str | The workspace in which to get the user task list. 83 | opts = { 84 | 'opt_fields': "name,owner,workspace", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 85 | } 86 | 87 | try: 88 | # Get a user's task list 89 | api_response = user_task_lists_api_instance.get_user_task_list_for_user(user_gid, workspace, opts) 90 | pprint(api_response) 91 | except ApiException as e: 92 | print("Exception when calling UserTaskListsApi->get_user_task_list_for_user: %s\n" % e) 93 | ``` 94 | 95 | ### Parameters 96 | 97 | Name | Type | Description | Notes 98 | ------------- | ------------- | ------------- | ------------- 99 | **user_gid** | **str**| A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. | 100 | **workspace** | **str**| The workspace in which to get the user task list. | 101 | **opt_fields** | **Dict**| This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. | [optional] 102 | 103 | ### Return type 104 | 105 | dict 106 | 107 | ### HTTP request headers 108 | 109 | - **Content-Type**: Not defined 110 | - **Accept**: application/json; charset=UTF-8 111 | 112 | [[Back to top]](#) [[Back to API list]](../README.md#documentation-for-api-endpoints) [[Back to README]](../README.md) 113 | 114 | -------------------------------------------------------------------------------- /docs/UserTaskListsApi.yaml: -------------------------------------------------------------------------------- 1 | UserTaskListsApi: 2 | get_user_task_list: |- 3 | import asana 4 | from asana.rest import ApiException 5 | from pprint import pprint 6 | 7 | configuration = asana.Configuration() 8 | configuration.access_token = '' 9 | api_client = asana.ApiClient(configuration) 10 | 11 | # create an instance of the API class 12 | user_task_lists_api_instance = asana.UserTaskListsApi(api_client) 13 | user_task_list_gid = "12345" # str | Globally unique identifier for the user task list. 14 | opts = { 15 | 'opt_fields': "name,owner,workspace", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 16 | } 17 | 18 | try: 19 | # Get a user task list 20 | api_response = user_task_lists_api_instance.get_user_task_list(user_task_list_gid, opts) 21 | pprint(api_response) 22 | except ApiException as e: 23 | print("Exception when calling UserTaskListsApi->get_user_task_list: %s\n" % e) 24 | get_user_task_list_for_user: |- 25 | import asana 26 | from asana.rest import ApiException 27 | from pprint import pprint 28 | 29 | configuration = asana.Configuration() 30 | configuration.access_token = '' 31 | api_client = asana.ApiClient(configuration) 32 | 33 | # create an instance of the API class 34 | user_task_lists_api_instance = asana.UserTaskListsApi(api_client) 35 | user_gid = "me" # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. 36 | workspace = "1234" # str | The workspace in which to get the user task list. 37 | opts = { 38 | 'opt_fields': "name,owner,workspace", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 39 | } 40 | 41 | try: 42 | # Get a user's task list 43 | api_response = user_task_lists_api_instance.get_user_task_list_for_user(user_gid, workspace, opts) 44 | pprint(api_response) 45 | except ApiException as e: 46 | print("Exception when calling UserTaskListsApi->get_user_task_list_for_user: %s\n" % e) 47 | -------------------------------------------------------------------------------- /docs/WorkspaceMembershipsApi.yaml: -------------------------------------------------------------------------------- 1 | WorkspaceMembershipsApi: 2 | get_workspace_membership: |- 3 | import asana 4 | from asana.rest import ApiException 5 | from pprint import pprint 6 | 7 | configuration = asana.Configuration() 8 | configuration.access_token = '' 9 | api_client = asana.ApiClient(configuration) 10 | 11 | # create an instance of the API class 12 | workspace_memberships_api_instance = asana.WorkspaceMembershipsApi(api_client) 13 | workspace_membership_gid = "12345" # str | 14 | opts = { 15 | 'opt_fields': "created_at,is_active,is_admin,is_guest,is_view_only,user,user.name,user_task_list,user_task_list.name,user_task_list.owner,user_task_list.workspace,vacation_dates,vacation_dates.end_on,vacation_dates.start_on,workspace,workspace.name", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 16 | } 17 | 18 | try: 19 | # Get a workspace membership 20 | api_response = workspace_memberships_api_instance.get_workspace_membership(workspace_membership_gid, opts) 21 | pprint(api_response) 22 | except ApiException as e: 23 | print("Exception when calling WorkspaceMembershipsApi->get_workspace_membership: %s\n" % e) 24 | get_workspace_memberships_for_user: |- 25 | import asana 26 | from asana.rest import ApiException 27 | from pprint import pprint 28 | 29 | configuration = asana.Configuration() 30 | configuration.access_token = '' 31 | api_client = asana.ApiClient(configuration) 32 | 33 | # create an instance of the API class 34 | workspace_memberships_api_instance = asana.WorkspaceMembershipsApi(api_client) 35 | user_gid = "me" # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. 36 | opts = { 37 | 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. 38 | 'offset': "eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9", # str | 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.* 39 | 'opt_fields': "created_at,is_active,is_admin,is_guest,is_view_only,offset,path,uri,user,user.name,user_task_list,user_task_list.name,user_task_list.owner,user_task_list.workspace,vacation_dates,vacation_dates.end_on,vacation_dates.start_on,workspace,workspace.name", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 40 | } 41 | 42 | try: 43 | # Get workspace memberships for a user 44 | api_response = workspace_memberships_api_instance.get_workspace_memberships_for_user(user_gid, opts) 45 | for data in api_response: 46 | pprint(data) 47 | except ApiException as e: 48 | print("Exception when calling WorkspaceMembershipsApi->get_workspace_memberships_for_user: %s\n" % e) 49 | get_workspace_memberships_for_workspace: |- 50 | import asana 51 | from asana.rest import ApiException 52 | from pprint import pprint 53 | 54 | configuration = asana.Configuration() 55 | configuration.access_token = '' 56 | api_client = asana.ApiClient(configuration) 57 | 58 | # create an instance of the API class 59 | workspace_memberships_api_instance = asana.WorkspaceMembershipsApi(api_client) 60 | workspace_gid = "12345" # str | Globally unique identifier for the workspace or organization. 61 | opts = { 62 | 'user': "me", # str | A string identifying a user. This can either be the string \"me\", an email, or the gid of a user. 63 | 'limit': 50, # int | Results per page. The number of objects to return per page. The value must be between 1 and 100. 64 | 'offset': "eyJ0eXAiOJiKV1iQLCJhbGciOiJIUzI1NiJ9", # str | 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.* 65 | 'opt_fields': "created_at,is_active,is_admin,is_guest,is_view_only,offset,path,uri,user,user.name,user_task_list,user_task_list.name,user_task_list.owner,user_task_list.workspace,vacation_dates,vacation_dates.end_on,vacation_dates.start_on,workspace,workspace.name", # list[str] | This endpoint returns a resource which excludes some properties by default. To include those optional properties, set this query parameter to a comma-separated list of the properties you wish to include. 66 | } 67 | 68 | try: 69 | # Get the workspace memberships for a workspace 70 | api_response = workspace_memberships_api_instance.get_workspace_memberships_for_workspace(workspace_gid, opts) 71 | for data in api_response: 72 | pprint(data) 73 | except ApiException as e: 74 | print("Exception when calling WorkspaceMembershipsApi->get_workspace_memberships_for_workspace: %s\n" % e) 75 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | certifi >= 14.05.14 2 | six >= 1.10 3 | python_dateutil >= 2.5.3 4 | setuptools >= 21.0.0 5 | urllib3 >= 1.15.1 6 | python-dotenv >= 1.0.1 7 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | import os 14 | from setuptools import setup, find_packages # noqa: H301 15 | 16 | NAME = "asana" 17 | VERSION = "5.1.0" 18 | with open(os.path.join(os.path.dirname(__file__), 'README.md')) as readme: 19 | LONG_DESCRIPTION = readme.read() 20 | # To install the library, run the following 21 | # 22 | # python setup.py install 23 | # 24 | # prerequisite: setuptools 25 | # http://pypi.python.org/pypi/setuptools 26 | 27 | REQUIRES = [ 28 | "certifi>=2017.4.17", 29 | "python-dateutil>=2.1", 30 | "six>=1.10", 31 | "urllib3>=1.23" 32 | ] 33 | 34 | 35 | setup( 36 | name=NAME, 37 | version=VERSION, 38 | description="Asana", 39 | long_description=LONG_DESCRIPTION, 40 | long_description_content_type='text/markdown', 41 | author='Asana, Inc', 42 | url="http://github.com/asana/python-asana", 43 | keywords=["asana", "Asana"], 44 | install_requires=REQUIRES, 45 | packages=find_packages(), 46 | include_package_data=True, 47 | license='MIT', 48 | ) 49 | -------------------------------------------------------------------------------- /test-requirements.txt: -------------------------------------------------------------------------------- 1 | coverage>=4.0.3 2 | nose>=1.3.7 3 | pluggy>=0.3.1 4 | py>=1.4.31 5 | randomize>=0.13 6 | -------------------------------------------------------------------------------- /test/__init__.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 -------------------------------------------------------------------------------- /test/test_allocations_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.allocations_api import AllocationsApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestAllocationsApi(unittest.TestCase): 23 | """AllocationsApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = AllocationsApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_create_allocation(self): 32 | """Test case for create_allocation 33 | 34 | Create an allocation # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_delete_allocation(self): 39 | """Test case for delete_allocation 40 | 41 | Delete an allocation # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_get_allocation(self): 46 | """Test case for get_allocation 47 | 48 | Get an allocation # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_get_allocations(self): 53 | """Test case for get_allocations 54 | 55 | Get multiple allocations # noqa: E501 56 | """ 57 | pass 58 | 59 | def test_update_allocation(self): 60 | """Test case for update_allocation 61 | 62 | Update an allocation # noqa: E501 63 | """ 64 | pass 65 | 66 | 67 | if __name__ == '__main__': 68 | unittest.main() 69 | -------------------------------------------------------------------------------- /test/test_attachments_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.attachments_api import AttachmentsApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestAttachmentsApi(unittest.TestCase): 23 | """AttachmentsApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = AttachmentsApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_create_attachment_for_object(self): 32 | """Test case for create_attachment_for_object 33 | 34 | Upload an attachment # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_delete_attachment(self): 39 | """Test case for delete_attachment 40 | 41 | Delete an attachment # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_get_attachment(self): 46 | """Test case for get_attachment 47 | 48 | Get an attachment # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_get_attachments_for_object(self): 53 | """Test case for get_attachments_for_object 54 | 55 | Get attachments from an object # noqa: E501 56 | """ 57 | pass 58 | 59 | 60 | if __name__ == '__main__': 61 | unittest.main() 62 | -------------------------------------------------------------------------------- /test/test_audit_log_api_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.audit_log_api_api import AuditLogAPIApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestAuditLogAPIApi(unittest.TestCase): 23 | """AuditLogAPIApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = AuditLogAPIApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_get_audit_log_events(self): 32 | """Test case for get_audit_log_events 33 | 34 | Get audit log events # noqa: E501 35 | """ 36 | pass 37 | 38 | 39 | if __name__ == '__main__': 40 | unittest.main() 41 | -------------------------------------------------------------------------------- /test/test_batch_api_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.batch_api_api import BatchAPIApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestBatchAPIApi(unittest.TestCase): 23 | """BatchAPIApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = BatchAPIApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_create_batch_request(self): 32 | """Test case for create_batch_request 33 | 34 | Submit parallel requests # noqa: E501 35 | """ 36 | pass 37 | 38 | 39 | if __name__ == '__main__': 40 | unittest.main() 41 | -------------------------------------------------------------------------------- /test/test_custom_field_settings_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.custom_field_settings_api import CustomFieldSettingsApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestCustomFieldSettingsApi(unittest.TestCase): 23 | """CustomFieldSettingsApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = CustomFieldSettingsApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_get_custom_field_settings_for_portfolio(self): 32 | """Test case for get_custom_field_settings_for_portfolio 33 | 34 | Get a portfolio's custom fields # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_get_custom_field_settings_for_project(self): 39 | """Test case for get_custom_field_settings_for_project 40 | 41 | Get a project's custom fields # noqa: E501 42 | """ 43 | pass 44 | 45 | 46 | if __name__ == '__main__': 47 | unittest.main() 48 | -------------------------------------------------------------------------------- /test/test_custom_fields_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.custom_fields_api import CustomFieldsApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestCustomFieldsApi(unittest.TestCase): 23 | """CustomFieldsApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = CustomFieldsApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_create_custom_field(self): 32 | """Test case for create_custom_field 33 | 34 | Create a custom field # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_create_enum_option_for_custom_field(self): 39 | """Test case for create_enum_option_for_custom_field 40 | 41 | Create an enum option # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_delete_custom_field(self): 46 | """Test case for delete_custom_field 47 | 48 | Delete a custom field # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_get_custom_field(self): 53 | """Test case for get_custom_field 54 | 55 | Get a custom field # noqa: E501 56 | """ 57 | pass 58 | 59 | def test_get_custom_fields_for_workspace(self): 60 | """Test case for get_custom_fields_for_workspace 61 | 62 | Get a workspace's custom fields # noqa: E501 63 | """ 64 | pass 65 | 66 | def test_insert_enum_option_for_custom_field(self): 67 | """Test case for insert_enum_option_for_custom_field 68 | 69 | Reorder a custom field's enum # noqa: E501 70 | """ 71 | pass 72 | 73 | def test_update_custom_field(self): 74 | """Test case for update_custom_field 75 | 76 | Update a custom field # noqa: E501 77 | """ 78 | pass 79 | 80 | def test_update_enum_option(self): 81 | """Test case for update_enum_option 82 | 83 | Update an enum option # noqa: E501 84 | """ 85 | pass 86 | 87 | 88 | if __name__ == '__main__': 89 | unittest.main() 90 | -------------------------------------------------------------------------------- /test/test_custom_types_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.custom_types_api import CustomTypesApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestCustomTypesApi(unittest.TestCase): 23 | """CustomTypesApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = CustomTypesApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_get_custom_types(self): 32 | """Test case for get_custom_types 33 | 34 | Get all custom types associated with an object # noqa: E501 35 | """ 36 | pass 37 | 38 | 39 | if __name__ == '__main__': 40 | unittest.main() 41 | -------------------------------------------------------------------------------- /test/test_events_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.events_api import EventsApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestEventsApi(unittest.TestCase): 23 | """EventsApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = EventsApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_get_events(self): 32 | """Test case for get_events 33 | 34 | Get events on a resource # noqa: E501 35 | """ 36 | pass 37 | 38 | 39 | if __name__ == '__main__': 40 | unittest.main() 41 | -------------------------------------------------------------------------------- /test/test_goal_relationships_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.goal_relationships_api import GoalRelationshipsApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestGoalRelationshipsApi(unittest.TestCase): 23 | """GoalRelationshipsApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = GoalRelationshipsApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_add_supporting_relationship(self): 32 | """Test case for add_supporting_relationship 33 | 34 | Add a supporting goal relationship # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_get_goal_relationship(self): 39 | """Test case for get_goal_relationship 40 | 41 | Get a goal relationship # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_get_goal_relationships(self): 46 | """Test case for get_goal_relationships 47 | 48 | Get goal relationships # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_remove_supporting_relationship(self): 53 | """Test case for remove_supporting_relationship 54 | 55 | Removes a supporting goal relationship # noqa: E501 56 | """ 57 | pass 58 | 59 | def test_update_goal_relationship(self): 60 | """Test case for update_goal_relationship 61 | 62 | Update a goal relationship # noqa: E501 63 | """ 64 | pass 65 | 66 | 67 | if __name__ == '__main__': 68 | unittest.main() 69 | -------------------------------------------------------------------------------- /test/test_goals_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.goals_api import GoalsApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestGoalsApi(unittest.TestCase): 23 | """GoalsApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = GoalsApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_add_followers(self): 32 | """Test case for add_followers 33 | 34 | Add a collaborator to a goal # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_create_goal(self): 39 | """Test case for create_goal 40 | 41 | Create a goal # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_create_goal_metric(self): 46 | """Test case for create_goal_metric 47 | 48 | Create a goal metric # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_delete_goal(self): 53 | """Test case for delete_goal 54 | 55 | Delete a goal # noqa: E501 56 | """ 57 | pass 58 | 59 | def test_get_goal(self): 60 | """Test case for get_goal 61 | 62 | Get a goal # noqa: E501 63 | """ 64 | pass 65 | 66 | def test_get_goals(self): 67 | """Test case for get_goals 68 | 69 | Get goals # noqa: E501 70 | """ 71 | pass 72 | 73 | def test_get_parent_goals_for_goal(self): 74 | """Test case for get_parent_goals_for_goal 75 | 76 | Get parent goals from a goal # noqa: E501 77 | """ 78 | pass 79 | 80 | def test_remove_followers(self): 81 | """Test case for remove_followers 82 | 83 | Remove a collaborator from a goal # noqa: E501 84 | """ 85 | pass 86 | 87 | def test_update_goal(self): 88 | """Test case for update_goal 89 | 90 | Update a goal # noqa: E501 91 | """ 92 | pass 93 | 94 | def test_update_goal_metric(self): 95 | """Test case for update_goal_metric 96 | 97 | Update a goal metric # noqa: E501 98 | """ 99 | pass 100 | 101 | 102 | if __name__ == '__main__': 103 | unittest.main() 104 | -------------------------------------------------------------------------------- /test/test_jobs_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.jobs_api import JobsApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestJobsApi(unittest.TestCase): 23 | """JobsApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = JobsApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_get_job(self): 32 | """Test case for get_job 33 | 34 | Get a job by id # noqa: E501 35 | """ 36 | pass 37 | 38 | 39 | if __name__ == '__main__': 40 | unittest.main() 41 | -------------------------------------------------------------------------------- /test/test_memberships_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.memberships_api import MembershipsApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestMembershipsApi(unittest.TestCase): 23 | """MembershipsApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = MembershipsApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_create_membership(self): 32 | """Test case for create_membership 33 | 34 | Create a membership # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_delete_membership(self): 39 | """Test case for delete_membership 40 | 41 | Delete a membership # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_get_membership(self): 46 | """Test case for get_membership 47 | 48 | Get a membership # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_get_memberships(self): 53 | """Test case for get_memberships 54 | 55 | Get multiple memberships # noqa: E501 56 | """ 57 | pass 58 | 59 | 60 | if __name__ == '__main__': 61 | unittest.main() 62 | -------------------------------------------------------------------------------- /test/test_organization_exports_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.organization_exports_api import OrganizationExportsApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestOrganizationExportsApi(unittest.TestCase): 23 | """OrganizationExportsApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = OrganizationExportsApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_create_organization_export(self): 32 | """Test case for create_organization_export 33 | 34 | Create an organization export request # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_get_organization_export(self): 39 | """Test case for get_organization_export 40 | 41 | Get details on an org export request # noqa: E501 42 | """ 43 | pass 44 | 45 | 46 | if __name__ == '__main__': 47 | unittest.main() 48 | -------------------------------------------------------------------------------- /test/test_portfolio_memberships_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.portfolio_memberships_api import PortfolioMembershipsApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestPortfolioMembershipsApi(unittest.TestCase): 23 | """PortfolioMembershipsApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = PortfolioMembershipsApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_get_portfolio_membership(self): 32 | """Test case for get_portfolio_membership 33 | 34 | Get a portfolio membership # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_get_portfolio_memberships(self): 39 | """Test case for get_portfolio_memberships 40 | 41 | Get multiple portfolio memberships # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_get_portfolio_memberships_for_portfolio(self): 46 | """Test case for get_portfolio_memberships_for_portfolio 47 | 48 | Get memberships from a portfolio # noqa: E501 49 | """ 50 | pass 51 | 52 | 53 | if __name__ == '__main__': 54 | unittest.main() 55 | -------------------------------------------------------------------------------- /test/test_portfolios_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.portfolios_api import PortfoliosApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestPortfoliosApi(unittest.TestCase): 23 | """PortfoliosApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = PortfoliosApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_add_custom_field_setting_for_portfolio(self): 32 | """Test case for add_custom_field_setting_for_portfolio 33 | 34 | Add a custom field to a portfolio # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_add_item_for_portfolio(self): 39 | """Test case for add_item_for_portfolio 40 | 41 | Add a portfolio item # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_add_members_for_portfolio(self): 46 | """Test case for add_members_for_portfolio 47 | 48 | Add users to a portfolio # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_create_portfolio(self): 53 | """Test case for create_portfolio 54 | 55 | Create a portfolio # noqa: E501 56 | """ 57 | pass 58 | 59 | def test_delete_portfolio(self): 60 | """Test case for delete_portfolio 61 | 62 | Delete a portfolio # noqa: E501 63 | """ 64 | pass 65 | 66 | def test_get_items_for_portfolio(self): 67 | """Test case for get_items_for_portfolio 68 | 69 | Get portfolio items # noqa: E501 70 | """ 71 | pass 72 | 73 | def test_get_portfolio(self): 74 | """Test case for get_portfolio 75 | 76 | Get a portfolio # noqa: E501 77 | """ 78 | pass 79 | 80 | def test_get_portfolios(self): 81 | """Test case for get_portfolios 82 | 83 | Get multiple portfolios # noqa: E501 84 | """ 85 | pass 86 | 87 | def test_remove_custom_field_setting_for_portfolio(self): 88 | """Test case for remove_custom_field_setting_for_portfolio 89 | 90 | Remove a custom field from a portfolio # noqa: E501 91 | """ 92 | pass 93 | 94 | def test_remove_item_for_portfolio(self): 95 | """Test case for remove_item_for_portfolio 96 | 97 | Remove a portfolio item # noqa: E501 98 | """ 99 | pass 100 | 101 | def test_remove_members_for_portfolio(self): 102 | """Test case for remove_members_for_portfolio 103 | 104 | Remove users from a portfolio # noqa: E501 105 | """ 106 | pass 107 | 108 | def test_update_portfolio(self): 109 | """Test case for update_portfolio 110 | 111 | Update a portfolio # noqa: E501 112 | """ 113 | pass 114 | 115 | 116 | if __name__ == '__main__': 117 | unittest.main() 118 | -------------------------------------------------------------------------------- /test/test_project_briefs_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.project_briefs_api import ProjectBriefsApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestProjectBriefsApi(unittest.TestCase): 23 | """ProjectBriefsApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = ProjectBriefsApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_create_project_brief(self): 32 | """Test case for create_project_brief 33 | 34 | Create a project brief # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_delete_project_brief(self): 39 | """Test case for delete_project_brief 40 | 41 | Delete a project brief # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_get_project_brief(self): 46 | """Test case for get_project_brief 47 | 48 | Get a project brief # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_update_project_brief(self): 53 | """Test case for update_project_brief 54 | 55 | Update a project brief # noqa: E501 56 | """ 57 | pass 58 | 59 | 60 | if __name__ == '__main__': 61 | unittest.main() 62 | -------------------------------------------------------------------------------- /test/test_project_memberships_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.project_memberships_api import ProjectMembershipsApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestProjectMembershipsApi(unittest.TestCase): 23 | """ProjectMembershipsApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = ProjectMembershipsApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_get_project_membership(self): 32 | """Test case for get_project_membership 33 | 34 | Get a project membership # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_get_project_memberships_for_project(self): 39 | """Test case for get_project_memberships_for_project 40 | 41 | Get memberships from a project # noqa: E501 42 | """ 43 | pass 44 | 45 | 46 | if __name__ == '__main__': 47 | unittest.main() 48 | -------------------------------------------------------------------------------- /test/test_project_statuses_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.project_statuses_api import ProjectStatusesApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestProjectStatusesApi(unittest.TestCase): 23 | """ProjectStatusesApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = ProjectStatusesApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_create_project_status_for_project(self): 32 | """Test case for create_project_status_for_project 33 | 34 | Create a project status # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_delete_project_status(self): 39 | """Test case for delete_project_status 40 | 41 | Delete a project status # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_get_project_status(self): 46 | """Test case for get_project_status 47 | 48 | Get a project status # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_get_project_statuses_for_project(self): 53 | """Test case for get_project_statuses_for_project 54 | 55 | Get statuses from a project # noqa: E501 56 | """ 57 | pass 58 | 59 | 60 | if __name__ == '__main__': 61 | unittest.main() 62 | -------------------------------------------------------------------------------- /test/test_project_templates_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.project_templates_api import ProjectTemplatesApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestProjectTemplatesApi(unittest.TestCase): 23 | """ProjectTemplatesApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = ProjectTemplatesApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_delete_project_template(self): 32 | """Test case for delete_project_template 33 | 34 | Delete a project template # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_get_project_template(self): 39 | """Test case for get_project_template 40 | 41 | Get a project template # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_get_project_templates(self): 46 | """Test case for get_project_templates 47 | 48 | Get multiple project templates # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_get_project_templates_for_team(self): 53 | """Test case for get_project_templates_for_team 54 | 55 | Get a team's project templates # noqa: E501 56 | """ 57 | pass 58 | 59 | def test_instantiate_project(self): 60 | """Test case for instantiate_project 61 | 62 | Instantiate a project from a project template # noqa: E501 63 | """ 64 | pass 65 | 66 | 67 | if __name__ == '__main__': 68 | unittest.main() 69 | -------------------------------------------------------------------------------- /test/test_projects_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.projects_api import ProjectsApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestProjectsApi(unittest.TestCase): 23 | """ProjectsApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = ProjectsApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_add_custom_field_setting_for_project(self): 32 | """Test case for add_custom_field_setting_for_project 33 | 34 | Add a custom field to a project # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_add_followers_for_project(self): 39 | """Test case for add_followers_for_project 40 | 41 | Add followers to a project # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_add_members_for_project(self): 46 | """Test case for add_members_for_project 47 | 48 | Add users to a project # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_create_project(self): 53 | """Test case for create_project 54 | 55 | Create a project # noqa: E501 56 | """ 57 | pass 58 | 59 | def test_create_project_for_team(self): 60 | """Test case for create_project_for_team 61 | 62 | Create a project in a team # noqa: E501 63 | """ 64 | pass 65 | 66 | def test_create_project_for_workspace(self): 67 | """Test case for create_project_for_workspace 68 | 69 | Create a project in a workspace # noqa: E501 70 | """ 71 | pass 72 | 73 | def test_delete_project(self): 74 | """Test case for delete_project 75 | 76 | Delete a project # noqa: E501 77 | """ 78 | pass 79 | 80 | def test_duplicate_project(self): 81 | """Test case for duplicate_project 82 | 83 | Duplicate a project # noqa: E501 84 | """ 85 | pass 86 | 87 | def test_get_project(self): 88 | """Test case for get_project 89 | 90 | Get a project # noqa: E501 91 | """ 92 | pass 93 | 94 | def test_get_projects(self): 95 | """Test case for get_projects 96 | 97 | Get multiple projects # noqa: E501 98 | """ 99 | pass 100 | 101 | def test_get_projects_for_task(self): 102 | """Test case for get_projects_for_task 103 | 104 | Get projects a task is in # noqa: E501 105 | """ 106 | pass 107 | 108 | def test_get_projects_for_team(self): 109 | """Test case for get_projects_for_team 110 | 111 | Get a team's projects # noqa: E501 112 | """ 113 | pass 114 | 115 | def test_get_projects_for_workspace(self): 116 | """Test case for get_projects_for_workspace 117 | 118 | Get all projects in a workspace # noqa: E501 119 | """ 120 | pass 121 | 122 | def test_get_task_counts_for_project(self): 123 | """Test case for get_task_counts_for_project 124 | 125 | Get task count of a project # noqa: E501 126 | """ 127 | pass 128 | 129 | def test_project_save_as_template(self): 130 | """Test case for project_save_as_template 131 | 132 | Create a project template from a project # noqa: E501 133 | """ 134 | pass 135 | 136 | def test_remove_custom_field_setting_for_project(self): 137 | """Test case for remove_custom_field_setting_for_project 138 | 139 | Remove a custom field from a project # noqa: E501 140 | """ 141 | pass 142 | 143 | def test_remove_followers_for_project(self): 144 | """Test case for remove_followers_for_project 145 | 146 | Remove followers from a project # noqa: E501 147 | """ 148 | pass 149 | 150 | def test_remove_members_for_project(self): 151 | """Test case for remove_members_for_project 152 | 153 | Remove users from a project # noqa: E501 154 | """ 155 | pass 156 | 157 | def test_update_project(self): 158 | """Test case for update_project 159 | 160 | Update a project # noqa: E501 161 | """ 162 | pass 163 | 164 | 165 | if __name__ == '__main__': 166 | unittest.main() 167 | -------------------------------------------------------------------------------- /test/test_rules_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.rules_api import RulesApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestRulesApi(unittest.TestCase): 23 | """RulesApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = RulesApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_trigger_rule(self): 32 | """Test case for trigger_rule 33 | 34 | Trigger a rule # noqa: E501 35 | """ 36 | pass 37 | 38 | 39 | if __name__ == '__main__': 40 | unittest.main() 41 | -------------------------------------------------------------------------------- /test/test_sections_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.sections_api import SectionsApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestSectionsApi(unittest.TestCase): 23 | """SectionsApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = SectionsApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_add_task_for_section(self): 32 | """Test case for add_task_for_section 33 | 34 | Add task to section # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_create_section_for_project(self): 39 | """Test case for create_section_for_project 40 | 41 | Create a section in a project # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_delete_section(self): 46 | """Test case for delete_section 47 | 48 | Delete a section # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_get_section(self): 53 | """Test case for get_section 54 | 55 | Get a section # noqa: E501 56 | """ 57 | pass 58 | 59 | def test_get_sections_for_project(self): 60 | """Test case for get_sections_for_project 61 | 62 | Get sections in a project # noqa: E501 63 | """ 64 | pass 65 | 66 | def test_insert_section_for_project(self): 67 | """Test case for insert_section_for_project 68 | 69 | Move or Insert sections # noqa: E501 70 | """ 71 | pass 72 | 73 | def test_update_section(self): 74 | """Test case for update_section 75 | 76 | Update a section # noqa: E501 77 | """ 78 | pass 79 | 80 | 81 | if __name__ == '__main__': 82 | unittest.main() 83 | -------------------------------------------------------------------------------- /test/test_status_updates_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.status_updates_api import StatusUpdatesApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestStatusUpdatesApi(unittest.TestCase): 23 | """StatusUpdatesApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = StatusUpdatesApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_create_status_for_object(self): 32 | """Test case for create_status_for_object 33 | 34 | Create a status update # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_delete_status(self): 39 | """Test case for delete_status 40 | 41 | Delete a status update # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_get_status(self): 46 | """Test case for get_status 47 | 48 | Get a status update # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_get_statuses_for_object(self): 53 | """Test case for get_statuses_for_object 54 | 55 | Get status updates from an object # noqa: E501 56 | """ 57 | pass 58 | 59 | 60 | if __name__ == '__main__': 61 | unittest.main() 62 | -------------------------------------------------------------------------------- /test/test_stories_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.stories_api import StoriesApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestStoriesApi(unittest.TestCase): 23 | """StoriesApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = StoriesApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_create_story_for_task(self): 32 | """Test case for create_story_for_task 33 | 34 | Create a story on a task # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_delete_story(self): 39 | """Test case for delete_story 40 | 41 | Delete a story # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_get_stories_for_task(self): 46 | """Test case for get_stories_for_task 47 | 48 | Get stories from a task # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_get_story(self): 53 | """Test case for get_story 54 | 55 | Get a story # noqa: E501 56 | """ 57 | pass 58 | 59 | def test_update_story(self): 60 | """Test case for update_story 61 | 62 | Update a story # noqa: E501 63 | """ 64 | pass 65 | 66 | 67 | if __name__ == '__main__': 68 | unittest.main() 69 | -------------------------------------------------------------------------------- /test/test_tags_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.tags_api import TagsApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestTagsApi(unittest.TestCase): 23 | """TagsApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = TagsApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_create_tag(self): 32 | """Test case for create_tag 33 | 34 | Create a tag # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_create_tag_for_workspace(self): 39 | """Test case for create_tag_for_workspace 40 | 41 | Create a tag in a workspace # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_delete_tag(self): 46 | """Test case for delete_tag 47 | 48 | Delete a tag # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_get_tag(self): 53 | """Test case for get_tag 54 | 55 | Get a tag # noqa: E501 56 | """ 57 | pass 58 | 59 | def test_get_tags(self): 60 | """Test case for get_tags 61 | 62 | Get multiple tags # noqa: E501 63 | """ 64 | pass 65 | 66 | def test_get_tags_for_task(self): 67 | """Test case for get_tags_for_task 68 | 69 | Get a task's tags # noqa: E501 70 | """ 71 | pass 72 | 73 | def test_get_tags_for_workspace(self): 74 | """Test case for get_tags_for_workspace 75 | 76 | Get tags in a workspace # noqa: E501 77 | """ 78 | pass 79 | 80 | def test_update_tag(self): 81 | """Test case for update_tag 82 | 83 | Update a tag # noqa: E501 84 | """ 85 | pass 86 | 87 | 88 | if __name__ == '__main__': 89 | unittest.main() 90 | -------------------------------------------------------------------------------- /test/test_task_templates_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.task_templates_api import TaskTemplatesApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestTaskTemplatesApi(unittest.TestCase): 23 | """TaskTemplatesApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = TaskTemplatesApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_get_task_template(self): 32 | """Test case for get_task_template 33 | 34 | Get a task template # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_get_task_templates(self): 39 | """Test case for get_task_templates 40 | 41 | Get multiple task templates # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_instantiate_task(self): 46 | """Test case for instantiate_task 47 | 48 | Instantiate a task from a task template # noqa: E501 49 | """ 50 | pass 51 | 52 | 53 | if __name__ == '__main__': 54 | unittest.main() 55 | -------------------------------------------------------------------------------- /test/test_team_memberships_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.team_memberships_api import TeamMembershipsApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestTeamMembershipsApi(unittest.TestCase): 23 | """TeamMembershipsApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = TeamMembershipsApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_get_team_membership(self): 32 | """Test case for get_team_membership 33 | 34 | Get a team membership # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_get_team_memberships(self): 39 | """Test case for get_team_memberships 40 | 41 | Get team memberships # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_get_team_memberships_for_team(self): 46 | """Test case for get_team_memberships_for_team 47 | 48 | Get memberships from a team # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_get_team_memberships_for_user(self): 53 | """Test case for get_team_memberships_for_user 54 | 55 | Get memberships from a user # noqa: E501 56 | """ 57 | pass 58 | 59 | 60 | if __name__ == '__main__': 61 | unittest.main() 62 | -------------------------------------------------------------------------------- /test/test_teams_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.teams_api import TeamsApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestTeamsApi(unittest.TestCase): 23 | """TeamsApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = TeamsApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_add_user_for_team(self): 32 | """Test case for add_user_for_team 33 | 34 | Add a user to a team # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_create_team(self): 39 | """Test case for create_team 40 | 41 | Create a team # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_get_team(self): 46 | """Test case for get_team 47 | 48 | Get a team # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_get_teams_for_user(self): 53 | """Test case for get_teams_for_user 54 | 55 | Get teams for a user # noqa: E501 56 | """ 57 | pass 58 | 59 | def test_get_teams_for_workspace(self): 60 | """Test case for get_teams_for_workspace 61 | 62 | Get teams in a workspace # noqa: E501 63 | """ 64 | pass 65 | 66 | def test_remove_user_for_team(self): 67 | """Test case for remove_user_for_team 68 | 69 | Remove a user from a team # noqa: E501 70 | """ 71 | pass 72 | 73 | def test_update_team(self): 74 | """Test case for update_team 75 | 76 | Update a team # noqa: E501 77 | """ 78 | pass 79 | 80 | 81 | if __name__ == '__main__': 82 | unittest.main() 83 | -------------------------------------------------------------------------------- /test/test_time_periods_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.time_periods_api import TimePeriodsApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestTimePeriodsApi(unittest.TestCase): 23 | """TimePeriodsApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = TimePeriodsApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_get_time_period(self): 32 | """Test case for get_time_period 33 | 34 | Get a time period # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_get_time_periods(self): 39 | """Test case for get_time_periods 40 | 41 | Get time periods # noqa: E501 42 | """ 43 | pass 44 | 45 | 46 | if __name__ == '__main__': 47 | unittest.main() 48 | -------------------------------------------------------------------------------- /test/test_time_tracking_entries_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.time_tracking_entries_api import TimeTrackingEntriesApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestTimeTrackingEntriesApi(unittest.TestCase): 23 | """TimeTrackingEntriesApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = TimeTrackingEntriesApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_create_time_tracking_entry(self): 32 | """Test case for create_time_tracking_entry 33 | 34 | Create a time tracking entry # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_delete_time_tracking_entry(self): 39 | """Test case for delete_time_tracking_entry 40 | 41 | Delete a time tracking entry # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_get_time_tracking_entries_for_task(self): 46 | """Test case for get_time_tracking_entries_for_task 47 | 48 | Get time tracking entries for a task # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_get_time_tracking_entry(self): 53 | """Test case for get_time_tracking_entry 54 | 55 | Get a time tracking entry # noqa: E501 56 | """ 57 | pass 58 | 59 | def test_update_time_tracking_entry(self): 60 | """Test case for update_time_tracking_entry 61 | 62 | Update a time tracking entry # noqa: E501 63 | """ 64 | pass 65 | 66 | 67 | if __name__ == '__main__': 68 | unittest.main() 69 | -------------------------------------------------------------------------------- /test/test_typeahead_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.typeahead_api import TypeaheadApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestTypeaheadApi(unittest.TestCase): 23 | """TypeaheadApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = TypeaheadApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_typeahead_for_workspace(self): 32 | """Test case for typeahead_for_workspace 33 | 34 | Get objects via typeahead # noqa: E501 35 | """ 36 | pass 37 | 38 | 39 | if __name__ == '__main__': 40 | unittest.main() 41 | -------------------------------------------------------------------------------- /test/test_user_task_lists_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.user_task_lists_api import UserTaskListsApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestUserTaskListsApi(unittest.TestCase): 23 | """UserTaskListsApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = UserTaskListsApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_get_user_task_list(self): 32 | """Test case for get_user_task_list 33 | 34 | Get a user task list # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_get_user_task_list_for_user(self): 39 | """Test case for get_user_task_list_for_user 40 | 41 | Get a user's task list # noqa: E501 42 | """ 43 | pass 44 | 45 | 46 | if __name__ == '__main__': 47 | unittest.main() 48 | -------------------------------------------------------------------------------- /test/test_users_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.users_api import UsersApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestUsersApi(unittest.TestCase): 23 | """UsersApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = UsersApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_get_favorites_for_user(self): 32 | """Test case for get_favorites_for_user 33 | 34 | Get a user's favorites # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_get_user(self): 39 | """Test case for get_user 40 | 41 | Get a user # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_get_users(self): 46 | """Test case for get_users 47 | 48 | Get multiple users # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_get_users_for_team(self): 53 | """Test case for get_users_for_team 54 | 55 | Get users in a team # noqa: E501 56 | """ 57 | pass 58 | 59 | def test_get_users_for_workspace(self): 60 | """Test case for get_users_for_workspace 61 | 62 | Get users in a workspace or organization # noqa: E501 63 | """ 64 | pass 65 | 66 | 67 | if __name__ == '__main__': 68 | unittest.main() 69 | -------------------------------------------------------------------------------- /test/test_webhooks_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.webhooks_api import WebhooksApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestWebhooksApi(unittest.TestCase): 23 | """WebhooksApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = WebhooksApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_create_webhook(self): 32 | """Test case for create_webhook 33 | 34 | Establish a webhook # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_delete_webhook(self): 39 | """Test case for delete_webhook 40 | 41 | Delete a webhook # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_get_webhook(self): 46 | """Test case for get_webhook 47 | 48 | Get a webhook # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_get_webhooks(self): 53 | """Test case for get_webhooks 54 | 55 | Get multiple webhooks # noqa: E501 56 | """ 57 | pass 58 | 59 | def test_update_webhook(self): 60 | """Test case for update_webhook 61 | 62 | Update a webhook # noqa: E501 63 | """ 64 | pass 65 | 66 | 67 | if __name__ == '__main__': 68 | unittest.main() 69 | -------------------------------------------------------------------------------- /test/test_workspace_memberships_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.workspace_memberships_api import WorkspaceMembershipsApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestWorkspaceMembershipsApi(unittest.TestCase): 23 | """WorkspaceMembershipsApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = WorkspaceMembershipsApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_get_workspace_membership(self): 32 | """Test case for get_workspace_membership 33 | 34 | Get a workspace membership # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_get_workspace_memberships_for_user(self): 39 | """Test case for get_workspace_memberships_for_user 40 | 41 | Get workspace memberships for a user # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_get_workspace_memberships_for_workspace(self): 46 | """Test case for get_workspace_memberships_for_workspace 47 | 48 | Get the workspace memberships for a workspace # noqa: E501 49 | """ 50 | pass 51 | 52 | 53 | if __name__ == '__main__': 54 | unittest.main() 55 | -------------------------------------------------------------------------------- /test/test_workspaces_api.py: -------------------------------------------------------------------------------- 1 | # coding: utf-8 2 | 3 | """ 4 | Asana 5 | 6 | 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/openapi/master/defs/asana_oas.yaml). # noqa: E501 7 | 8 | OpenAPI spec version: 1.0 9 | 10 | Generated by: https://github.com/swagger-api/swagger-codegen.git 11 | """ 12 | 13 | from __future__ import absolute_import 14 | 15 | import unittest 16 | 17 | import asana 18 | from asana.api.workspaces_api import WorkspacesApi # noqa: E501 19 | from asana.rest import ApiException 20 | 21 | 22 | class TestWorkspacesApi(unittest.TestCase): 23 | """WorkspacesApi unit test stubs""" 24 | 25 | def setUp(self): 26 | self.api = WorkspacesApi() # noqa: E501 27 | 28 | def tearDown(self): 29 | pass 30 | 31 | def test_add_user_for_workspace(self): 32 | """Test case for add_user_for_workspace 33 | 34 | Add a user to a workspace or organization # noqa: E501 35 | """ 36 | pass 37 | 38 | def test_get_workspace(self): 39 | """Test case for get_workspace 40 | 41 | Get a workspace # noqa: E501 42 | """ 43 | pass 44 | 45 | def test_get_workspaces(self): 46 | """Test case for get_workspaces 47 | 48 | Get multiple workspaces # noqa: E501 49 | """ 50 | pass 51 | 52 | def test_remove_user_for_workspace(self): 53 | """Test case for remove_user_for_workspace 54 | 55 | Remove a user from a workspace or organization # noqa: E501 56 | """ 57 | pass 58 | 59 | def test_update_workspace(self): 60 | """Test case for update_workspace 61 | 62 | Update a workspace # noqa: E501 63 | """ 64 | pass 65 | 66 | 67 | if __name__ == '__main__': 68 | unittest.main() 69 | -------------------------------------------------------------------------------- /tox.ini: -------------------------------------------------------------------------------- 1 | [tox] 2 | envlist = py3 3 | 4 | [testenv] 5 | deps=-r{toxinidir}/requirements.txt 6 | -r{toxinidir}/test-requirements.txt 7 | 8 | commands= 9 | nosetests \ 10 | [] 11 | --------------------------------------------------------------------------------