asana-api-cli 1.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. asana_api_cli/__init__.py +3 -0
  2. asana_api_cli/cli/__init__.py +140 -0
  3. asana_api_cli/cli/access_requests.py +66 -0
  4. asana_api_cli/cli/allocations.py +101 -0
  5. asana_api_cli/cli/attachments.py +92 -0
  6. asana_api_cli/cli/audit_log_api.py +52 -0
  7. asana_api_cli/cli/batch_api.py +30 -0
  8. asana_api_cli/cli/budgets.py +79 -0
  9. asana_api_cli/cli/custom_field_settings.py +92 -0
  10. asana_api_cli/cli/custom_fields.py +133 -0
  11. asana_api_cli/cli/custom_types.py +50 -0
  12. asana_api_cli/cli/events.py +32 -0
  13. asana_api_cli/cli/exports.py +39 -0
  14. asana_api_cli/cli/goal_relationships.py +98 -0
  15. asana_api_cli/cli/goals.py +217 -0
  16. asana_api_cli/cli/jobs.py +29 -0
  17. asana_api_cli/cli/memberships.py +89 -0
  18. asana_api_cli/cli/organization_exports.py +44 -0
  19. asana_api_cli/cli/portfolio_memberships.py +83 -0
  20. asana_api_cli/cli/portfolios.py +215 -0
  21. asana_api_cli/cli/project_briefs.py +72 -0
  22. asana_api_cli/cli/project_memberships.py +53 -0
  23. asana_api_cli/cli/project_portfolio_settings.py +87 -0
  24. asana_api_cli/cli/project_statuses.py +77 -0
  25. asana_api_cli/cli/project_templates.py +102 -0
  26. asana_api_cli/cli/projects.py +380 -0
  27. asana_api_cli/cli/rates.py +97 -0
  28. asana_api_cli/cli/reactions.py +34 -0
  29. asana_api_cli/cli/roles.py +98 -0
  30. asana_api_cli/cli/rules.py +28 -0
  31. asana_api_cli/cli/sections.py +111 -0
  32. asana_api_cli/cli/status_updates.py +86 -0
  33. asana_api_cli/cli/stories.py +130 -0
  34. asana_api_cli/cli/tags.py +155 -0
  35. asana_api_cli/cli/task_templates.py +77 -0
  36. asana_api_cli/cli/tasks.py +520 -0
  37. asana_api_cli/cli/team_memberships.py +103 -0
  38. asana_api_cli/cli/teams.py +133 -0
  39. asana_api_cli/cli/time_periods.py +57 -0
  40. asana_api_cli/cli/time_tracking_categories.py +123 -0
  41. asana_api_cli/cli/time_tracking_entries.py +138 -0
  42. asana_api_cli/cli/timesheet_approval_statuses.py +94 -0
  43. asana_api_cli/cli/typeahead.py +40 -0
  44. asana_api_cli/cli/user_task_lists.py +45 -0
  45. asana_api_cli/cli/users.py +173 -0
  46. asana_api_cli/cli/webhooks.py +96 -0
  47. asana_api_cli/cli/workspace_memberships.py +75 -0
  48. asana_api_cli/cli/workspaces.py +113 -0
  49. asana_api_cli/formatter.py +161 -0
  50. asana_api_cli/session.py +173 -0
  51. asana_api_cli/version.py +11 -0
  52. asana_api_cli-1.2.0.dist-info/METADATA +105 -0
  53. asana_api_cli-1.2.0.dist-info/RECORD +57 -0
  54. asana_api_cli-1.2.0.dist-info/WHEEL +5 -0
  55. asana_api_cli-1.2.0.dist-info/entry_points.txt +2 -0
  56. asana_api_cli-1.2.0.dist-info/licenses/LICENSE +190 -0
  57. asana_api_cli-1.2.0.dist-info/top_level.txt +1 -0
@@ -0,0 +1,77 @@
1
+ # This file is auto-generated by tools/codegen.py — do not edit manually.
2
+ from __future__ import annotations
3
+
4
+ from typing import Any
5
+
6
+ import click
7
+ from asana import ProjectStatusesApi
8
+
9
+ from asana_api_cli.formatter import formatted
10
+ from asana_api_cli.session import AsanaSession, resolve_body, resolve_workspace
11
+
12
+
13
+ @click.group("project-statuses")
14
+ def project_statuses_group() -> None:
15
+ """ProjectStatuses commands."""
16
+
17
+
18
+ @project_statuses_group.command("create-project-status-for-project")
19
+ @click.option("--project", required=True, help="Globally unique identifier for the project.")
20
+ @click.option("--body", required=True, help="The project status to create.")
21
+ @click.option("--opt-fields", default=None, help="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 in...")
22
+ @formatted
23
+ def create_project_status_for_project(project: str, body: str, opt_fields: str | None) -> Any:
24
+ """Create a project status"""
25
+ parsed_body = resolve_body(body)
26
+ session = AsanaSession.from_env()
27
+ api = ProjectStatusesApi(session.client)
28
+ opts: dict[str, Any] = {}
29
+ if opt_fields is not None:
30
+ opts["opt_fields"] = opt_fields
31
+ return api.create_project_status_for_project(parsed_body, project, opts)
32
+
33
+
34
+ @project_statuses_group.command("delete-project-status")
35
+ @click.option("--project-status", required=True, help="The project status update to get. If the method is called asynchronously, returns the request thread.")
36
+ @formatted
37
+ def delete_project_status(project_status: str) -> Any:
38
+ """Delete a project status"""
39
+ session = AsanaSession.from_env()
40
+ api = ProjectStatusesApi(session.client)
41
+ opts: dict[str, Any] = {}
42
+ return api.delete_project_status(project_status)
43
+
44
+
45
+ @project_statuses_group.command("get-project-status")
46
+ @click.option("--project-status", required=True, help="The project status update to get.")
47
+ @click.option("--opt-fields", default=None, help="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 in...")
48
+ @formatted
49
+ def get_project_status(project_status: str, opt_fields: str | None) -> Any:
50
+ """Get a project status"""
51
+ session = AsanaSession.from_env()
52
+ api = ProjectStatusesApi(session.client)
53
+ opts: dict[str, Any] = {}
54
+ if opt_fields is not None:
55
+ opts["opt_fields"] = opt_fields
56
+ return api.get_project_status(project_status, opts)
57
+
58
+
59
+ @project_statuses_group.command("get-project-statuses-for-project")
60
+ @click.option("--project", required=True, help="Globally unique identifier for the project.")
61
+ @click.option("--limit", type=int, default=None, help="Results per page. The number of objects to return per page. The value must be between 1 and 100.")
62
+ @click.option("--offset", default=None, help="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 pass...")
63
+ @click.option("--opt-fields", default=None, help="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 in...")
64
+ @click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
65
+ @formatted
66
+ def get_project_statuses_for_project(project: str, limit: int | None, offset: str | None, opt_fields: str | None, paginate: bool) -> Any:
67
+ """Get statuses from a project"""
68
+ session = AsanaSession.from_env(paginate=paginate)
69
+ api = ProjectStatusesApi(session.client)
70
+ opts: dict[str, Any] = {}
71
+ if limit is not None:
72
+ opts["limit"] = limit
73
+ if offset is not None:
74
+ opts["offset"] = offset
75
+ if opt_fields is not None:
76
+ opts["opt_fields"] = opt_fields
77
+ return api.get_project_statuses_for_project(project, opts)
@@ -0,0 +1,102 @@
1
+ # This file is auto-generated by tools/codegen.py — do not edit manually.
2
+ from __future__ import annotations
3
+
4
+ from typing import Any
5
+
6
+ import click
7
+ from asana import ProjectTemplatesApi
8
+
9
+ from asana_api_cli.formatter import formatted
10
+ from asana_api_cli.session import AsanaSession, resolve_body, resolve_workspace
11
+
12
+
13
+ @click.group("project-templates")
14
+ def project_templates_group() -> None:
15
+ """ProjectTemplates commands."""
16
+
17
+
18
+ @project_templates_group.command("delete-project-template")
19
+ @click.option("--project-template", required=True, help="Globally unique identifier for the project template. If the method is called asynchronously, returns the request thread.")
20
+ @formatted
21
+ def delete_project_template(project_template: str) -> Any:
22
+ """Delete a project template"""
23
+ session = AsanaSession.from_env()
24
+ api = ProjectTemplatesApi(session.client)
25
+ opts: dict[str, Any] = {}
26
+ return api.delete_project_template(project_template)
27
+
28
+
29
+ @project_templates_group.command("get-project-template")
30
+ @click.option("--project-template", required=True, help="Globally unique identifier for the project template.")
31
+ @click.option("--opt-fields", default=None, help="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 in...")
32
+ @formatted
33
+ def get_project_template(project_template: str, opt_fields: str | None) -> Any:
34
+ """Get a project template"""
35
+ session = AsanaSession.from_env()
36
+ api = ProjectTemplatesApi(session.client)
37
+ opts: dict[str, Any] = {}
38
+ if opt_fields is not None:
39
+ opts["opt_fields"] = opt_fields
40
+ return api.get_project_template(project_template, opts)
41
+
42
+
43
+ @project_templates_group.command("get-project-templates")
44
+ @click.option("--workspace", default=None, help="Workspace GID (falls back to ASANA_DEFAULT_WORKSPACE)")
45
+ @click.option("--limit", type=int, default=None, help="Results per page. The number of objects to return per page. The value must be between 1 and 100.")
46
+ @click.option("--offset", default=None, help="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 pass...")
47
+ @click.option("--opt-fields", default=None, help="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 in...")
48
+ @click.option("--team", default=None, help="The team to filter projects on.")
49
+ @click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
50
+ @formatted
51
+ def get_project_templates(workspace: str | None, limit: int | None, offset: str | None, opt_fields: str | None, team: str | None, paginate: bool) -> Any:
52
+ """Get multiple project templates"""
53
+ resolved_workspace = resolve_workspace(workspace, required=False)
54
+ session = AsanaSession.from_env(paginate=paginate)
55
+ api = ProjectTemplatesApi(session.client)
56
+ opts: dict[str, Any] = {}
57
+ if limit is not None:
58
+ opts["limit"] = limit
59
+ if offset is not None:
60
+ opts["offset"] = offset
61
+ if opt_fields is not None:
62
+ opts["opt_fields"] = opt_fields
63
+ if team is not None:
64
+ opts["team"] = team
65
+ if resolved_workspace is not None:
66
+ opts["workspace"] = resolved_workspace
67
+ return api.get_project_templates(opts)
68
+
69
+
70
+ @project_templates_group.command("get-project-templates-for-team")
71
+ @click.option("--team", required=True, help="Globally unique identifier for the team.")
72
+ @click.option("--limit", type=int, default=None, help="Results per page. The number of objects to return per page. The value must be between 1 and 100.")
73
+ @click.option("--offset", default=None, help="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 pass...")
74
+ @click.option("--opt-fields", default=None, help="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 in...")
75
+ @click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
76
+ @formatted
77
+ def get_project_templates_for_team(team: str, limit: int | None, offset: str | None, opt_fields: str | None, paginate: bool) -> Any:
78
+ """Get a team's project templates"""
79
+ session = AsanaSession.from_env(paginate=paginate)
80
+ api = ProjectTemplatesApi(session.client)
81
+ opts: dict[str, Any] = {}
82
+ if limit is not None:
83
+ opts["limit"] = limit
84
+ if offset is not None:
85
+ opts["offset"] = offset
86
+ if opt_fields is not None:
87
+ opts["opt_fields"] = opt_fields
88
+ return api.get_project_templates_for_team(team, opts)
89
+
90
+
91
+ @project_templates_group.command("instantiate-project")
92
+ @click.option("--project-template", required=True, help="Globally unique identifier for the project template.")
93
+ @click.option("--opt-fields", default=None, help="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 in...")
94
+ @formatted
95
+ def instantiate_project(project_template: str, opt_fields: str | None) -> Any:
96
+ """Instantiate a project from a project template"""
97
+ session = AsanaSession.from_env()
98
+ api = ProjectTemplatesApi(session.client)
99
+ opts: dict[str, Any] = {}
100
+ if opt_fields is not None:
101
+ opts["opt_fields"] = opt_fields
102
+ return api.instantiate_project(project_template, opts)
@@ -0,0 +1,380 @@
1
+ # This file is auto-generated by tools/codegen.py — do not edit manually.
2
+ from __future__ import annotations
3
+
4
+ from typing import Any
5
+
6
+ import click
7
+ from asana import ProjectsApi
8
+
9
+ from asana_api_cli.formatter import formatted
10
+ from asana_api_cli.session import AsanaSession, resolve_body, resolve_workspace
11
+
12
+
13
+ @click.group("projects")
14
+ def projects_group() -> None:
15
+ """Projects commands."""
16
+
17
+
18
+ @projects_group.command("add-custom-field-setting-for-project")
19
+ @click.option("--project", required=True, help="Globally unique identifier for the project.")
20
+ @click.option("--body", required=True, help="Information about the custom field setting.")
21
+ @click.option("--opt-fields", default=None, help="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 in...")
22
+ @formatted
23
+ def add_custom_field_setting_for_project(project: str, body: str, opt_fields: str | None) -> Any:
24
+ """Add a custom field to a project"""
25
+ parsed_body = resolve_body(body)
26
+ session = AsanaSession.from_env()
27
+ api = ProjectsApi(session.client)
28
+ opts: dict[str, Any] = {}
29
+ if opt_fields is not None:
30
+ opts["opt_fields"] = opt_fields
31
+ return api.add_custom_field_setting_for_project(parsed_body, project, opts)
32
+
33
+
34
+ @projects_group.command("add-followers-for-project")
35
+ @click.option("--project", required=True, help="Globally unique identifier for the project.")
36
+ @click.option("--body", required=True, help="Information about the followers being added.")
37
+ @click.option("--opt-fields", default=None, help="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 in...")
38
+ @formatted
39
+ def add_followers_for_project(project: str, body: str, opt_fields: str | None) -> Any:
40
+ """Add followers to a project"""
41
+ parsed_body = resolve_body(body)
42
+ session = AsanaSession.from_env()
43
+ api = ProjectsApi(session.client)
44
+ opts: dict[str, Any] = {}
45
+ if opt_fields is not None:
46
+ opts["opt_fields"] = opt_fields
47
+ return api.add_followers_for_project(parsed_body, project, opts)
48
+
49
+
50
+ @projects_group.command("add-members-for-project")
51
+ @click.option("--project", required=True, help="Globally unique identifier for the project.")
52
+ @click.option("--body", required=True, help="Information about the members being added.")
53
+ @click.option("--opt-fields", default=None, help="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 in...")
54
+ @formatted
55
+ def add_members_for_project(project: str, body: str, opt_fields: str | None) -> Any:
56
+ """Add users to a project"""
57
+ parsed_body = resolve_body(body)
58
+ session = AsanaSession.from_env()
59
+ api = ProjectsApi(session.client)
60
+ opts: dict[str, Any] = {}
61
+ if opt_fields is not None:
62
+ opts["opt_fields"] = opt_fields
63
+ return api.add_members_for_project(parsed_body, project, opts)
64
+
65
+
66
+ @projects_group.command("create-project")
67
+ @click.option("--body", required=True, help="The project to create.")
68
+ @click.option("--opt-fields", default=None, help="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 in...")
69
+ @formatted
70
+ def create_project(body: str, opt_fields: str | None) -> Any:
71
+ """Create a project"""
72
+ parsed_body = resolve_body(body)
73
+ session = AsanaSession.from_env()
74
+ api = ProjectsApi(session.client)
75
+ opts: dict[str, Any] = {}
76
+ if opt_fields is not None:
77
+ opts["opt_fields"] = opt_fields
78
+ return api.create_project(parsed_body, opts)
79
+
80
+
81
+ @projects_group.command("create-project-for-team")
82
+ @click.option("--team", required=True, help="Globally unique identifier for the team.")
83
+ @click.option("--body", required=True, help="The new project to create.")
84
+ @click.option("--opt-fields", default=None, help="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 in...")
85
+ @formatted
86
+ def create_project_for_team(team: str, body: str, opt_fields: str | None) -> Any:
87
+ """Create a project in a team"""
88
+ parsed_body = resolve_body(body)
89
+ session = AsanaSession.from_env()
90
+ api = ProjectsApi(session.client)
91
+ opts: dict[str, Any] = {}
92
+ if opt_fields is not None:
93
+ opts["opt_fields"] = opt_fields
94
+ return api.create_project_for_team(parsed_body, team, opts)
95
+
96
+
97
+ @projects_group.command("create-project-for-workspace")
98
+ @click.option("--workspace", default=None, help="Workspace GID (falls back to ASANA_DEFAULT_WORKSPACE)")
99
+ @click.option("--body", required=True, help="The new project to create.")
100
+ @click.option("--opt-fields", default=None, help="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 in...")
101
+ @formatted
102
+ def create_project_for_workspace(workspace: str | None, body: str, opt_fields: str | None) -> Any:
103
+ """Create a project in a workspace"""
104
+ parsed_body = resolve_body(body)
105
+ resolved_workspace = resolve_workspace(workspace, required=True)
106
+ session = AsanaSession.from_env()
107
+ api = ProjectsApi(session.client)
108
+ opts: dict[str, Any] = {}
109
+ if opt_fields is not None:
110
+ opts["opt_fields"] = opt_fields
111
+ return api.create_project_for_workspace(parsed_body, resolved_workspace, opts)
112
+
113
+
114
+ @projects_group.command("delete-project")
115
+ @click.option("--project", required=True, help="Globally unique identifier for the project. If the method is called asynchronously, returns the request thread.")
116
+ @formatted
117
+ def delete_project(project: str) -> Any:
118
+ """Delete a project"""
119
+ session = AsanaSession.from_env()
120
+ api = ProjectsApi(session.client)
121
+ opts: dict[str, Any] = {}
122
+ return api.delete_project(project)
123
+
124
+
125
+ @projects_group.command("duplicate-project")
126
+ @click.option("--project", required=True, help="Globally unique identifier for the project.")
127
+ @click.option("--opt-fields", default=None, help="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 in...")
128
+ @formatted
129
+ def duplicate_project(project: str, opt_fields: str | None) -> Any:
130
+ """Duplicate a project"""
131
+ session = AsanaSession.from_env()
132
+ api = ProjectsApi(session.client)
133
+ opts: dict[str, Any] = {}
134
+ if opt_fields is not None:
135
+ opts["opt_fields"] = opt_fields
136
+ return api.duplicate_project(project, opts)
137
+
138
+
139
+ @projects_group.command("get-project")
140
+ @click.option("--project", required=True, help="Globally unique identifier for the project.")
141
+ @click.option("--opt-fields", default=None, help="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 in...")
142
+ @formatted
143
+ def get_project(project: str, opt_fields: str | None) -> Any:
144
+ """Get a project"""
145
+ session = AsanaSession.from_env()
146
+ api = ProjectsApi(session.client)
147
+ opts: dict[str, Any] = {}
148
+ if opt_fields is not None:
149
+ opts["opt_fields"] = opt_fields
150
+ return api.get_project(project, opts)
151
+
152
+
153
+ @projects_group.command("get-projects")
154
+ @click.option("--workspace", default=None, help="Workspace GID (falls back to ASANA_DEFAULT_WORKSPACE)")
155
+ @click.option("--archived", type=bool, default=None, help="Only return projects whose `archived` field takes on the value of this parameter.")
156
+ @click.option("--limit", type=int, default=None, help="Results per page. The number of objects to return per page. The value must be between 1 and 100.")
157
+ @click.option("--offset", default=None, help="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 pass...")
158
+ @click.option("--opt-fields", default=None, help="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 in...")
159
+ @click.option("--team", default=None, help="**Deprecated.** The team to filter projects on. Please use `GET /memberships` with `{ member: team, resource_subtype: project_membership }` instead.")
160
+ @click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
161
+ @formatted
162
+ def get_projects(workspace: str | None, archived: bool | None, limit: int | None, offset: str | None, opt_fields: str | None, team: str | None, paginate: bool) -> Any:
163
+ """Get multiple projects"""
164
+ resolved_workspace = resolve_workspace(workspace, required=False)
165
+ session = AsanaSession.from_env(paginate=paginate)
166
+ api = ProjectsApi(session.client)
167
+ opts: dict[str, Any] = {}
168
+ if archived is not None:
169
+ opts["archived"] = archived
170
+ if limit is not None:
171
+ opts["limit"] = limit
172
+ if offset is not None:
173
+ opts["offset"] = offset
174
+ if opt_fields is not None:
175
+ opts["opt_fields"] = opt_fields
176
+ if team is not None:
177
+ opts["team"] = team
178
+ if resolved_workspace is not None:
179
+ opts["workspace"] = resolved_workspace
180
+ return api.get_projects(opts)
181
+
182
+
183
+ @projects_group.command("get-projects-for-task")
184
+ @click.option("--task", required=True, help="The task to operate on.")
185
+ @click.option("--limit", type=int, default=None, help="Results per page. The number of objects to return per page. The value must be between 1 and 100.")
186
+ @click.option("--offset", default=None, help="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 pass...")
187
+ @click.option("--opt-fields", default=None, help="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 in...")
188
+ @click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
189
+ @formatted
190
+ def get_projects_for_task(task: str, limit: int | None, offset: str | None, opt_fields: str | None, paginate: bool) -> Any:
191
+ """Get projects a task is in"""
192
+ session = AsanaSession.from_env(paginate=paginate)
193
+ api = ProjectsApi(session.client)
194
+ opts: dict[str, Any] = {}
195
+ if limit is not None:
196
+ opts["limit"] = limit
197
+ if offset is not None:
198
+ opts["offset"] = offset
199
+ if opt_fields is not None:
200
+ opts["opt_fields"] = opt_fields
201
+ return api.get_projects_for_task(task, opts)
202
+
203
+
204
+ @projects_group.command("get-projects-for-team")
205
+ @click.option("--team", required=True, help="Globally unique identifier for the team.")
206
+ @click.option("--archived", type=bool, default=None, help="Only return projects whose `archived` field takes on the value of this parameter.")
207
+ @click.option("--limit", type=int, default=None, help="Results per page. The number of objects to return per page. The value must be between 1 and 100.")
208
+ @click.option("--offset", default=None, help="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 pass...")
209
+ @click.option("--opt-fields", default=None, help="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 in...")
210
+ @click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
211
+ @formatted
212
+ def get_projects_for_team(team: str, archived: bool | None, limit: int | None, offset: str | None, opt_fields: str | None, paginate: bool) -> Any:
213
+ """Get a team's projects"""
214
+ session = AsanaSession.from_env(paginate=paginate)
215
+ api = ProjectsApi(session.client)
216
+ opts: dict[str, Any] = {}
217
+ if archived is not None:
218
+ opts["archived"] = archived
219
+ if limit is not None:
220
+ opts["limit"] = limit
221
+ if offset is not None:
222
+ opts["offset"] = offset
223
+ if opt_fields is not None:
224
+ opts["opt_fields"] = opt_fields
225
+ return api.get_projects_for_team(team, opts)
226
+
227
+
228
+ @projects_group.command("get-projects-for-workspace")
229
+ @click.option("--workspace", default=None, help="Workspace GID (falls back to ASANA_DEFAULT_WORKSPACE)")
230
+ @click.option("--archived", type=bool, default=None, help="Only return projects whose `archived` field takes on the value of this parameter.")
231
+ @click.option("--limit", type=int, default=None, help="Results per page. The number of objects to return per page. The value must be between 1 and 100.")
232
+ @click.option("--offset", default=None, help="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 pass...")
233
+ @click.option("--opt-fields", default=None, help="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 in...")
234
+ @click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
235
+ @formatted
236
+ def get_projects_for_workspace(workspace: str | None, archived: bool | None, limit: int | None, offset: str | None, opt_fields: str | None, paginate: bool) -> Any:
237
+ """Get all projects in a workspace"""
238
+ resolved_workspace = resolve_workspace(workspace, required=True)
239
+ session = AsanaSession.from_env(paginate=paginate)
240
+ api = ProjectsApi(session.client)
241
+ opts: dict[str, Any] = {}
242
+ if archived is not None:
243
+ opts["archived"] = archived
244
+ if limit is not None:
245
+ opts["limit"] = limit
246
+ if offset is not None:
247
+ opts["offset"] = offset
248
+ if opt_fields is not None:
249
+ opts["opt_fields"] = opt_fields
250
+ return api.get_projects_for_workspace(resolved_workspace, opts)
251
+
252
+
253
+ @projects_group.command("get-task-counts-for-project")
254
+ @click.option("--project", required=True, help="Globally unique identifier for the project.")
255
+ @click.option("--opt-fields", default=None, help="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 in...")
256
+ @formatted
257
+ def get_task_counts_for_project(project: str, opt_fields: str | None) -> Any:
258
+ """Get task count of a project"""
259
+ session = AsanaSession.from_env()
260
+ api = ProjectsApi(session.client)
261
+ opts: dict[str, Any] = {}
262
+ if opt_fields is not None:
263
+ opts["opt_fields"] = opt_fields
264
+ return api.get_task_counts_for_project(project, opts)
265
+
266
+
267
+ @projects_group.command("project-save-as-template")
268
+ @click.option("--project", required=True, help="Globally unique identifier for the project.")
269
+ @click.option("--body", required=True, help="Describes the inputs used for creating a project template, such as the resulting project template's name, which team it should be created in.")
270
+ @click.option("--opt-fields", default=None, help="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 in...")
271
+ @formatted
272
+ def project_save_as_template(project: str, body: str, opt_fields: str | None) -> Any:
273
+ """Create a project template from a project"""
274
+ parsed_body = resolve_body(body)
275
+ session = AsanaSession.from_env()
276
+ api = ProjectsApi(session.client)
277
+ opts: dict[str, Any] = {}
278
+ if opt_fields is not None:
279
+ opts["opt_fields"] = opt_fields
280
+ return api.project_save_as_template(parsed_body, project, opts)
281
+
282
+
283
+ @projects_group.command("remove-custom-field-setting-for-project")
284
+ @click.option("--project", required=True, help="Globally unique identifier for the project. If the method is called asynchronously, returns the request thread.")
285
+ @click.option("--body", required=True, help="Information about the custom field setting being removed.")
286
+ @formatted
287
+ def remove_custom_field_setting_for_project(project: str, body: str) -> Any:
288
+ """Remove a custom field from a project"""
289
+ parsed_body = resolve_body(body)
290
+ session = AsanaSession.from_env()
291
+ api = ProjectsApi(session.client)
292
+ opts: dict[str, Any] = {}
293
+ return api.remove_custom_field_setting_for_project(parsed_body, project)
294
+
295
+
296
+ @projects_group.command("remove-followers-for-project")
297
+ @click.option("--project", required=True, help="Globally unique identifier for the project.")
298
+ @click.option("--body", required=True, help="Information about the followers being removed.")
299
+ @click.option("--opt-fields", default=None, help="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 in...")
300
+ @formatted
301
+ def remove_followers_for_project(project: str, body: str, opt_fields: str | None) -> Any:
302
+ """Remove followers from a project"""
303
+ parsed_body = resolve_body(body)
304
+ session = AsanaSession.from_env()
305
+ api = ProjectsApi(session.client)
306
+ opts: dict[str, Any] = {}
307
+ if opt_fields is not None:
308
+ opts["opt_fields"] = opt_fields
309
+ return api.remove_followers_for_project(parsed_body, project, opts)
310
+
311
+
312
+ @projects_group.command("remove-members-for-project")
313
+ @click.option("--project", required=True, help="Globally unique identifier for the project.")
314
+ @click.option("--body", required=True, help="Information about the members being removed.")
315
+ @click.option("--opt-fields", default=None, help="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 in...")
316
+ @formatted
317
+ def remove_members_for_project(project: str, body: str, opt_fields: str | None) -> Any:
318
+ """Remove users from a project"""
319
+ parsed_body = resolve_body(body)
320
+ session = AsanaSession.from_env()
321
+ api = ProjectsApi(session.client)
322
+ opts: dict[str, Any] = {}
323
+ if opt_fields is not None:
324
+ opts["opt_fields"] = opt_fields
325
+ return api.remove_members_for_project(parsed_body, project, opts)
326
+
327
+
328
+ @projects_group.command("search-projects-for-workspace")
329
+ @click.option("--workspace", default=None, help="Workspace GID (falls back to ASANA_DEFAULT_WORKSPACE)")
330
+ @click.option("--completed", type=bool, default=None, help="Filter on project completion status.")
331
+ @click.option("--completed-on", default=None, help="ISO 8601 date string or `null`.")
332
+ @click.option("--created-on", default=None, help="ISO 8601 date string or `null`.")
333
+ @click.option("--due-on", default=None, help="ISO 8601 date string or `null`.")
334
+ @click.option("--opt-fields", default=None, help="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 in...")
335
+ @click.option("--sort-ascending", type=bool, default=None, help="Default `false`.")
336
+ @click.option("--sort-by", default=None, help="One of `due_date`, `created_at`, `completed_at`, or `modified_at`, defaults to `modified_at`.")
337
+ @click.option("--start-on", default=None, help="ISO 8601 date string or `null`.")
338
+ @click.option("--text", default=None, help="Performs full-text search on the project name.")
339
+ @formatted
340
+ def search_projects_for_workspace(workspace: str | None, completed: bool | None, completed_on: str | None, created_on: str | None, due_on: str | None, opt_fields: str | None, sort_ascending: bool | None, sort_by: str | None, start_on: str | None, text: str | None) -> Any:
341
+ """Search projects in a workspace"""
342
+ resolved_workspace = resolve_workspace(workspace, required=True)
343
+ session = AsanaSession.from_env()
344
+ api = ProjectsApi(session.client)
345
+ opts: dict[str, Any] = {}
346
+ if completed is not None:
347
+ opts["completed"] = completed
348
+ if completed_on is not None:
349
+ opts["completed_on"] = completed_on
350
+ if created_on is not None:
351
+ opts["created_on"] = created_on
352
+ if due_on is not None:
353
+ opts["due_on"] = due_on
354
+ if opt_fields is not None:
355
+ opts["opt_fields"] = opt_fields
356
+ if sort_ascending is not None:
357
+ opts["sort_ascending"] = sort_ascending
358
+ if sort_by is not None:
359
+ opts["sort_by"] = sort_by
360
+ if start_on is not None:
361
+ opts["start_on"] = start_on
362
+ if text is not None:
363
+ opts["text"] = text
364
+ return api.search_projects_for_workspace(resolved_workspace, opts)
365
+
366
+
367
+ @projects_group.command("update-project")
368
+ @click.option("--project", required=True, help="Globally unique identifier for the project.")
369
+ @click.option("--body", required=True, help="The updated fields for the project.")
370
+ @click.option("--opt-fields", default=None, help="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 in...")
371
+ @formatted
372
+ def update_project(project: str, body: str, opt_fields: str | None) -> Any:
373
+ """Update a project"""
374
+ parsed_body = resolve_body(body)
375
+ session = AsanaSession.from_env()
376
+ api = ProjectsApi(session.client)
377
+ opts: dict[str, Any] = {}
378
+ if opt_fields is not None:
379
+ opts["opt_fields"] = opt_fields
380
+ return api.update_project(parsed_body, project, opts)
@@ -0,0 +1,97 @@
1
+ # This file is auto-generated by tools/codegen.py — do not edit manually.
2
+ from __future__ import annotations
3
+
4
+ from typing import Any
5
+
6
+ import click
7
+ from asana import RatesApi
8
+
9
+ from asana_api_cli.formatter import formatted
10
+ from asana_api_cli.session import AsanaSession, resolve_body, resolve_workspace
11
+
12
+
13
+ @click.group("rates")
14
+ def rates_group() -> None:
15
+ """Rates commands."""
16
+
17
+
18
+ @rates_group.command("create-rate")
19
+ @click.option("--body", required=True, help="The rate to create.")
20
+ @click.option("--opt-fields", default=None, help="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 in...")
21
+ @formatted
22
+ def create_rate(body: str, opt_fields: str | None) -> Any:
23
+ """Create a rate"""
24
+ parsed_body = resolve_body(body)
25
+ session = AsanaSession.from_env()
26
+ api = RatesApi(session.client)
27
+ opts: dict[str, Any] = {}
28
+ if opt_fields is not None:
29
+ opts["opt_fields"] = opt_fields
30
+ return api.create_rate(parsed_body, opts)
31
+
32
+
33
+ @rates_group.command("delete-rate")
34
+ @click.option("--rate", required=True, help="Globally unique identifier for the rate. If the method is called asynchronously, returns the request thread.")
35
+ @formatted
36
+ def delete_rate(rate: str) -> Any:
37
+ """Delete a rate"""
38
+ session = AsanaSession.from_env()
39
+ api = RatesApi(session.client)
40
+ opts: dict[str, Any] = {}
41
+ return api.delete_rate(rate)
42
+
43
+
44
+ @rates_group.command("get-rate")
45
+ @click.option("--rate", required=True, help="Globally unique identifier for the rate.")
46
+ @click.option("--opt-fields", default=None, help="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 in...")
47
+ @formatted
48
+ def get_rate(rate: str, opt_fields: str | None) -> Any:
49
+ """Get a rate"""
50
+ session = AsanaSession.from_env()
51
+ api = RatesApi(session.client)
52
+ opts: dict[str, Any] = {}
53
+ if opt_fields is not None:
54
+ opts["opt_fields"] = opt_fields
55
+ return api.get_rate(rate, opts)
56
+
57
+
58
+ @rates_group.command("get-rates")
59
+ @click.option("--limit", type=int, default=None, help="Results per page. The number of objects to return per page. The value must be between 1 and 100.")
60
+ @click.option("--offset", default=None, help="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 pass...")
61
+ @click.option("--opt-fields", default=None, help="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 in...")
62
+ @click.option("--parent", default=None, help="Globally unique identifier for `project`.")
63
+ @click.option("--resource", default=None, help="Globally unique identifier for `user` or `placeholder`.")
64
+ @click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
65
+ @formatted
66
+ def get_rates(limit: int | None, offset: str | None, opt_fields: str | None, parent: str | None, resource: str | None, paginate: bool) -> Any:
67
+ """Get multiple rates"""
68
+ session = AsanaSession.from_env(paginate=paginate)
69
+ api = RatesApi(session.client)
70
+ opts: dict[str, Any] = {}
71
+ if limit is not None:
72
+ opts["limit"] = limit
73
+ if offset is not None:
74
+ opts["offset"] = offset
75
+ if opt_fields is not None:
76
+ opts["opt_fields"] = opt_fields
77
+ if parent is not None:
78
+ opts["parent"] = parent
79
+ if resource is not None:
80
+ opts["resource"] = resource
81
+ return api.get_rates(opts)
82
+
83
+
84
+ @rates_group.command("update-rate")
85
+ @click.option("--rate", required=True, help="Globally unique identifier for the rate.")
86
+ @click.option("--body", required=True, help="The updated fields for the rate.")
87
+ @click.option("--opt-fields", default=None, help="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 in...")
88
+ @formatted
89
+ def update_rate(rate: str, body: str, opt_fields: str | None) -> Any:
90
+ """Update a rate"""
91
+ parsed_body = resolve_body(body)
92
+ session = AsanaSession.from_env()
93
+ api = RatesApi(session.client)
94
+ opts: dict[str, Any] = {}
95
+ if opt_fields is not None:
96
+ opts["opt_fields"] = opt_fields
97
+ return api.update_rate(parsed_body, rate, opts)