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,89 @@
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 MembershipsApi
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("memberships")
14
+ def memberships_group() -> None:
15
+ """Memberships commands."""
16
+
17
+
18
+ @memberships_group.command("create-membership")
19
+ @formatted
20
+ def create_membership() -> Any:
21
+ """Create a membership"""
22
+ session = AsanaSession.from_env()
23
+ api = MembershipsApi(session.client)
24
+ opts: dict[str, Any] = {}
25
+ return api.create_membership(opts)
26
+
27
+
28
+ @memberships_group.command("delete-membership")
29
+ @click.option("--membership", required=True, help="Globally unique identifier for the membership. If the method is called asynchronously, returns the request thread.")
30
+ @formatted
31
+ def delete_membership(membership: str) -> Any:
32
+ """Delete a membership"""
33
+ session = AsanaSession.from_env()
34
+ api = MembershipsApi(session.client)
35
+ opts: dict[str, Any] = {}
36
+ return api.delete_membership(membership)
37
+
38
+
39
+ @memberships_group.command("get-membership")
40
+ @click.option("--membership", required=True, help="Globally unique identifier for the membership. If the method is called asynchronously, returns the request thread.")
41
+ @formatted
42
+ def get_membership(membership: str) -> Any:
43
+ """Get a membership"""
44
+ session = AsanaSession.from_env()
45
+ api = MembershipsApi(session.client)
46
+ opts: dict[str, Any] = {}
47
+ return api.get_membership(membership)
48
+
49
+
50
+ @memberships_group.command("get-memberships")
51
+ @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.")
52
+ @click.option("--member", default=None, help="Globally unique identifier for `team` or `user`. When used with `resource_subtype` and without `parent`, returns all memberships of the specified subtype for this member.")
53
+ @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...")
54
+ @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...")
55
+ @click.option("--parent", default=None, help="Globally unique identifier for `goal`, `project`, `portfolio`, `custom_type`, or `custom_field`. This parameter is optional when `resource_subtype` is provided along with `member`.")
56
+ @click.option("--resource-subtype", default=None, help="The type of membership to return. Required when `parent` is absent. Currently supported value is `project_membership` (when `member` is a team GID, returns all project memberships for that team).")
57
+ @click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
58
+ @formatted
59
+ def get_memberships(limit: int | None, member: str | None, offset: str | None, opt_fields: str | None, parent: str | None, resource_subtype: str | None, paginate: bool) -> Any:
60
+ """Get multiple memberships"""
61
+ session = AsanaSession.from_env(paginate=paginate)
62
+ api = MembershipsApi(session.client)
63
+ opts: dict[str, Any] = {}
64
+ if limit is not None:
65
+ opts["limit"] = limit
66
+ if member is not None:
67
+ opts["member"] = member
68
+ if offset is not None:
69
+ opts["offset"] = offset
70
+ if opt_fields is not None:
71
+ opts["opt_fields"] = opt_fields
72
+ if parent is not None:
73
+ opts["parent"] = parent
74
+ if resource_subtype is not None:
75
+ opts["resource_subtype"] = resource_subtype
76
+ return api.get_memberships(opts)
77
+
78
+
79
+ @memberships_group.command("update-membership")
80
+ @click.option("--membership", required=True, help="Globally unique identifier for the membership. If the method is called asynchronously, returns the request thread.")
81
+ @click.option("--body", required=True, help="The membership to update.")
82
+ @formatted
83
+ def update_membership(membership: str, body: str) -> Any:
84
+ """Update a membership"""
85
+ parsed_body = resolve_body(body)
86
+ session = AsanaSession.from_env()
87
+ api = MembershipsApi(session.client)
88
+ opts: dict[str, Any] = {}
89
+ return api.update_membership(parsed_body, membership)
@@ -0,0 +1,44 @@
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 OrganizationExportsApi
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("organization-exports")
14
+ def organization_exports_group() -> None:
15
+ """OrganizationExports commands."""
16
+
17
+
18
+ @organization_exports_group.command("create-organization-export")
19
+ @click.option("--body", required=True, help="The organization to export.")
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_organization_export(body: str, opt_fields: str | None) -> Any:
23
+ """Create an organization export request"""
24
+ parsed_body = resolve_body(body)
25
+ session = AsanaSession.from_env()
26
+ api = OrganizationExportsApi(session.client)
27
+ opts: dict[str, Any] = {}
28
+ if opt_fields is not None:
29
+ opts["opt_fields"] = opt_fields
30
+ return api.create_organization_export(parsed_body, opts)
31
+
32
+
33
+ @organization_exports_group.command("get-organization-export")
34
+ @click.option("--organization-export", required=True, help="Globally unique identifier for the organization export.")
35
+ @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...")
36
+ @formatted
37
+ def get_organization_export(organization_export: str, opt_fields: str | None) -> Any:
38
+ """Get details on an org export request"""
39
+ session = AsanaSession.from_env()
40
+ api = OrganizationExportsApi(session.client)
41
+ opts: dict[str, Any] = {}
42
+ if opt_fields is not None:
43
+ opts["opt_fields"] = opt_fields
44
+ return api.get_organization_export(organization_export, opts)
@@ -0,0 +1,83 @@
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 PortfolioMembershipsApi
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("portfolio-memberships")
14
+ def portfolio_memberships_group() -> None:
15
+ """PortfolioMemberships commands."""
16
+
17
+
18
+ @portfolio_memberships_group.command("get-portfolio-membership")
19
+ @click.option("--portfolio-membership", required=True)
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 get_portfolio_membership(portfolio_membership: str, opt_fields: str | None) -> Any:
23
+ """Get a portfolio membership"""
24
+ session = AsanaSession.from_env()
25
+ api = PortfolioMembershipsApi(session.client)
26
+ opts: dict[str, Any] = {}
27
+ if opt_fields is not None:
28
+ opts["opt_fields"] = opt_fields
29
+ return api.get_portfolio_membership(portfolio_membership, opts)
30
+
31
+
32
+ @portfolio_memberships_group.command("get-portfolio-memberships")
33
+ @click.option("--workspace", default=None, help="Workspace GID (falls back to ASANA_DEFAULT_WORKSPACE)")
34
+ @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.")
35
+ @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...")
36
+ @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...")
37
+ @click.option("--portfolio", default=None, help="The portfolio to filter results on.")
38
+ @click.option("--user", default=None, help="A string identifying a user. This can either be the string \"me\", an email, or the gid of a user.")
39
+ @click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
40
+ @formatted
41
+ def get_portfolio_memberships(workspace: str | None, limit: int | None, offset: str | None, opt_fields: str | None, portfolio: str | None, user: str | None, paginate: bool) -> Any:
42
+ """Get multiple portfolio memberships"""
43
+ resolved_workspace = resolve_workspace(workspace, required=False)
44
+ session = AsanaSession.from_env(paginate=paginate)
45
+ api = PortfolioMembershipsApi(session.client)
46
+ opts: dict[str, Any] = {}
47
+ if limit is not None:
48
+ opts["limit"] = limit
49
+ if offset is not None:
50
+ opts["offset"] = offset
51
+ if opt_fields is not None:
52
+ opts["opt_fields"] = opt_fields
53
+ if portfolio is not None:
54
+ opts["portfolio"] = portfolio
55
+ if user is not None:
56
+ opts["user"] = user
57
+ if resolved_workspace is not None:
58
+ opts["workspace"] = resolved_workspace
59
+ return api.get_portfolio_memberships(opts)
60
+
61
+
62
+ @portfolio_memberships_group.command("get-portfolio-memberships-for-portfolio")
63
+ @click.option("--portfolio", required=True, help="Globally unique identifier for the portfolio.")
64
+ @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.")
65
+ @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...")
66
+ @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...")
67
+ @click.option("--user", default=None, help="A string identifying a user. This can either be the string \"me\", an email, or the gid of a user.")
68
+ @click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
69
+ @formatted
70
+ def get_portfolio_memberships_for_portfolio(portfolio: str, limit: int | None, offset: str | None, opt_fields: str | None, user: str | None, paginate: bool) -> Any:
71
+ """Get memberships from a portfolio"""
72
+ session = AsanaSession.from_env(paginate=paginate)
73
+ api = PortfolioMembershipsApi(session.client)
74
+ opts: dict[str, Any] = {}
75
+ if limit is not None:
76
+ opts["limit"] = limit
77
+ if offset is not None:
78
+ opts["offset"] = offset
79
+ if opt_fields is not None:
80
+ opts["opt_fields"] = opt_fields
81
+ if user is not None:
82
+ opts["user"] = user
83
+ return api.get_portfolio_memberships_for_portfolio(portfolio, opts)
@@ -0,0 +1,215 @@
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 PortfoliosApi
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("portfolios")
14
+ def portfolios_group() -> None:
15
+ """Portfolios commands."""
16
+
17
+
18
+ @portfolios_group.command("add-custom-field-setting-for-portfolio")
19
+ @click.option("--portfolio", required=True, help="Globally unique identifier for the portfolio. If the method is called asynchronously, returns the request thread.")
20
+ @click.option("--body", required=True, help="Information about the custom field setting.")
21
+ @formatted
22
+ def add_custom_field_setting_for_portfolio(portfolio: str, body: str) -> Any:
23
+ """Add a custom field to a portfolio"""
24
+ parsed_body = resolve_body(body)
25
+ session = AsanaSession.from_env()
26
+ api = PortfoliosApi(session.client)
27
+ opts: dict[str, Any] = {}
28
+ return api.add_custom_field_setting_for_portfolio(parsed_body, portfolio)
29
+
30
+
31
+ @portfolios_group.command("add-item-for-portfolio")
32
+ @click.option("--portfolio", required=True, help="Globally unique identifier for the portfolio. If the method is called asynchronously, returns the request thread.")
33
+ @click.option("--body", required=True, help="Information about the item being inserted.")
34
+ @formatted
35
+ def add_item_for_portfolio(portfolio: str, body: str) -> Any:
36
+ """Add a portfolio item"""
37
+ parsed_body = resolve_body(body)
38
+ session = AsanaSession.from_env()
39
+ api = PortfoliosApi(session.client)
40
+ opts: dict[str, Any] = {}
41
+ return api.add_item_for_portfolio(parsed_body, portfolio)
42
+
43
+
44
+ @portfolios_group.command("add-members-for-portfolio")
45
+ @click.option("--portfolio", required=True, help="Globally unique identifier for the portfolio.")
46
+ @click.option("--body", required=True, help="Information about the members being added.")
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 add_members_for_portfolio(portfolio: str, body: str, opt_fields: str | None) -> Any:
50
+ """Add users to a portfolio"""
51
+ parsed_body = resolve_body(body)
52
+ session = AsanaSession.from_env()
53
+ api = PortfoliosApi(session.client)
54
+ opts: dict[str, Any] = {}
55
+ if opt_fields is not None:
56
+ opts["opt_fields"] = opt_fields
57
+ return api.add_members_for_portfolio(parsed_body, portfolio, opts)
58
+
59
+
60
+ @portfolios_group.command("create-portfolio")
61
+ @click.option("--body", required=True, help="The portfolio to create.")
62
+ @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...")
63
+ @formatted
64
+ def create_portfolio(body: str, opt_fields: str | None) -> Any:
65
+ """Create a portfolio"""
66
+ parsed_body = resolve_body(body)
67
+ session = AsanaSession.from_env()
68
+ api = PortfoliosApi(session.client)
69
+ opts: dict[str, Any] = {}
70
+ if opt_fields is not None:
71
+ opts["opt_fields"] = opt_fields
72
+ return api.create_portfolio(parsed_body, opts)
73
+
74
+
75
+ @portfolios_group.command("delete-portfolio")
76
+ @click.option("--portfolio", required=True, help="Globally unique identifier for the portfolio. If the method is called asynchronously, returns the request thread.")
77
+ @formatted
78
+ def delete_portfolio(portfolio: str) -> Any:
79
+ """Delete a portfolio"""
80
+ session = AsanaSession.from_env()
81
+ api = PortfoliosApi(session.client)
82
+ opts: dict[str, Any] = {}
83
+ return api.delete_portfolio(portfolio)
84
+
85
+
86
+ @portfolios_group.command("duplicate-portfolio")
87
+ @click.option("--portfolio", required=True, help="Globally unique identifier for the portfolio.")
88
+ @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...")
89
+ @formatted
90
+ def duplicate_portfolio(portfolio: str, opt_fields: str | None) -> Any:
91
+ """Duplicate a portfolio"""
92
+ session = AsanaSession.from_env()
93
+ api = PortfoliosApi(session.client)
94
+ opts: dict[str, Any] = {}
95
+ if opt_fields is not None:
96
+ opts["opt_fields"] = opt_fields
97
+ return api.duplicate_portfolio(portfolio, opts)
98
+
99
+
100
+ @portfolios_group.command("get-items-for-portfolio")
101
+ @click.option("--portfolio", required=True, help="Globally unique identifier for the portfolio.")
102
+ @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.")
103
+ @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...")
104
+ @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...")
105
+ @click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
106
+ @formatted
107
+ def get_items_for_portfolio(portfolio: str, limit: int | None, offset: str | None, opt_fields: str | None, paginate: bool) -> Any:
108
+ """Get portfolio items"""
109
+ session = AsanaSession.from_env(paginate=paginate)
110
+ api = PortfoliosApi(session.client)
111
+ opts: dict[str, Any] = {}
112
+ if limit is not None:
113
+ opts["limit"] = limit
114
+ if offset is not None:
115
+ opts["offset"] = offset
116
+ if opt_fields is not None:
117
+ opts["opt_fields"] = opt_fields
118
+ return api.get_items_for_portfolio(portfolio, opts)
119
+
120
+
121
+ @portfolios_group.command("get-portfolio")
122
+ @click.option("--portfolio", required=True, help="Globally unique identifier for the portfolio.")
123
+ @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...")
124
+ @formatted
125
+ def get_portfolio(portfolio: str, opt_fields: str | None) -> Any:
126
+ """Get a portfolio"""
127
+ session = AsanaSession.from_env()
128
+ api = PortfoliosApi(session.client)
129
+ opts: dict[str, Any] = {}
130
+ if opt_fields is not None:
131
+ opts["opt_fields"] = opt_fields
132
+ return api.get_portfolio(portfolio, opts)
133
+
134
+
135
+ @portfolios_group.command("get-portfolios")
136
+ @click.option("--workspace", default=None, help="Workspace GID (falls back to ASANA_DEFAULT_WORKSPACE)")
137
+ @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.")
138
+ @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...")
139
+ @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...")
140
+ @click.option("--owner", default=None, help="The user who owns the portfolio. Currently, API users can only get a list of portfolios that they themselves own, unless the request is made from a Service Account. In the case of a Service Account...")
141
+ @click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
142
+ @formatted
143
+ def get_portfolios(workspace: str | None, limit: int | None, offset: str | None, opt_fields: str | None, owner: str | None, paginate: bool) -> Any:
144
+ """Get multiple portfolios"""
145
+ resolved_workspace = resolve_workspace(workspace, required=True)
146
+ session = AsanaSession.from_env(paginate=paginate)
147
+ api = PortfoliosApi(session.client)
148
+ opts: dict[str, Any] = {}
149
+ if limit is not None:
150
+ opts["limit"] = limit
151
+ if offset is not None:
152
+ opts["offset"] = offset
153
+ if opt_fields is not None:
154
+ opts["opt_fields"] = opt_fields
155
+ if owner is not None:
156
+ opts["owner"] = owner
157
+ return api.get_portfolios(resolved_workspace, opts)
158
+
159
+
160
+ @portfolios_group.command("remove-custom-field-setting-for-portfolio")
161
+ @click.option("--portfolio", required=True, help="Globally unique identifier for the portfolio. If the method is called asynchronously, returns the request thread.")
162
+ @click.option("--body", required=True, help="Information about the custom field setting being removed.")
163
+ @formatted
164
+ def remove_custom_field_setting_for_portfolio(portfolio: str, body: str) -> Any:
165
+ """Remove a custom field from a portfolio"""
166
+ parsed_body = resolve_body(body)
167
+ session = AsanaSession.from_env()
168
+ api = PortfoliosApi(session.client)
169
+ opts: dict[str, Any] = {}
170
+ return api.remove_custom_field_setting_for_portfolio(parsed_body, portfolio)
171
+
172
+
173
+ @portfolios_group.command("remove-item-for-portfolio")
174
+ @click.option("--portfolio", required=True, help="Globally unique identifier for the portfolio. If the method is called asynchronously, returns the request thread.")
175
+ @click.option("--body", required=True, help="Information about the item being removed.")
176
+ @formatted
177
+ def remove_item_for_portfolio(portfolio: str, body: str) -> Any:
178
+ """Remove a portfolio item"""
179
+ parsed_body = resolve_body(body)
180
+ session = AsanaSession.from_env()
181
+ api = PortfoliosApi(session.client)
182
+ opts: dict[str, Any] = {}
183
+ return api.remove_item_for_portfolio(parsed_body, portfolio)
184
+
185
+
186
+ @portfolios_group.command("remove-members-for-portfolio")
187
+ @click.option("--portfolio", required=True, help="Globally unique identifier for the portfolio.")
188
+ @click.option("--body", required=True, help="Information about the members being removed.")
189
+ @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...")
190
+ @formatted
191
+ def remove_members_for_portfolio(portfolio: str, body: str, opt_fields: str | None) -> Any:
192
+ """Remove users from a portfolio"""
193
+ parsed_body = resolve_body(body)
194
+ session = AsanaSession.from_env()
195
+ api = PortfoliosApi(session.client)
196
+ opts: dict[str, Any] = {}
197
+ if opt_fields is not None:
198
+ opts["opt_fields"] = opt_fields
199
+ return api.remove_members_for_portfolio(parsed_body, portfolio, opts)
200
+
201
+
202
+ @portfolios_group.command("update-portfolio")
203
+ @click.option("--portfolio", required=True, help="Globally unique identifier for the portfolio.")
204
+ @click.option("--body", required=True, help="The updated fields for the portfolio.")
205
+ @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...")
206
+ @formatted
207
+ def update_portfolio(portfolio: str, body: str, opt_fields: str | None) -> Any:
208
+ """Update a portfolio"""
209
+ parsed_body = resolve_body(body)
210
+ session = AsanaSession.from_env()
211
+ api = PortfoliosApi(session.client)
212
+ opts: dict[str, Any] = {}
213
+ if opt_fields is not None:
214
+ opts["opt_fields"] = opt_fields
215
+ return api.update_portfolio(parsed_body, portfolio, opts)
@@ -0,0 +1,72 @@
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 ProjectBriefsApi
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-briefs")
14
+ def project_briefs_group() -> None:
15
+ """ProjectBriefs commands."""
16
+
17
+
18
+ @project_briefs_group.command("create-project-brief")
19
+ @click.option("--project", required=True, help="Globally unique identifier for the project.")
20
+ @click.option("--body", required=True, help="The project brief 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_brief(project: str, body: str, opt_fields: str | None) -> Any:
24
+ """Create a project brief"""
25
+ parsed_body = resolve_body(body)
26
+ session = AsanaSession.from_env()
27
+ api = ProjectBriefsApi(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_brief(parsed_body, project, opts)
32
+
33
+
34
+ @project_briefs_group.command("delete-project-brief")
35
+ @click.option("--project-brief", required=True, help="Globally unique identifier for the project brief. If the method is called asynchronously, returns the request thread.")
36
+ @formatted
37
+ def delete_project_brief(project_brief: str) -> Any:
38
+ """Delete a project brief"""
39
+ session = AsanaSession.from_env()
40
+ api = ProjectBriefsApi(session.client)
41
+ opts: dict[str, Any] = {}
42
+ return api.delete_project_brief(project_brief)
43
+
44
+
45
+ @project_briefs_group.command("get-project-brief")
46
+ @click.option("--project-brief", required=True, help="Globally unique identifier for the project brief.")
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_brief(project_brief: str, opt_fields: str | None) -> Any:
50
+ """Get a project brief"""
51
+ session = AsanaSession.from_env()
52
+ api = ProjectBriefsApi(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_brief(project_brief, opts)
57
+
58
+
59
+ @project_briefs_group.command("update-project-brief")
60
+ @click.option("--project-brief", required=True, help="Globally unique identifier for the project brief.")
61
+ @click.option("--body", required=True, help="The updated fields for the project brief.")
62
+ @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...")
63
+ @formatted
64
+ def update_project_brief(project_brief: str, body: str, opt_fields: str | None) -> Any:
65
+ """Update a project brief"""
66
+ parsed_body = resolve_body(body)
67
+ session = AsanaSession.from_env()
68
+ api = ProjectBriefsApi(session.client)
69
+ opts: dict[str, Any] = {}
70
+ if opt_fields is not None:
71
+ opts["opt_fields"] = opt_fields
72
+ return api.update_project_brief(parsed_body, project_brief, opts)
@@ -0,0 +1,53 @@
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 ProjectMembershipsApi
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-memberships")
14
+ def project_memberships_group() -> None:
15
+ """ProjectMemberships commands."""
16
+
17
+
18
+ @project_memberships_group.command("get-project-membership")
19
+ @click.option("--project-membership", required=True)
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 get_project_membership(project_membership: str, opt_fields: str | None) -> Any:
23
+ """Get a project membership"""
24
+ session = AsanaSession.from_env()
25
+ api = ProjectMembershipsApi(session.client)
26
+ opts: dict[str, Any] = {}
27
+ if opt_fields is not None:
28
+ opts["opt_fields"] = opt_fields
29
+ return api.get_project_membership(project_membership, opts)
30
+
31
+
32
+ @project_memberships_group.command("get-project-memberships-for-project")
33
+ @click.option("--project", required=True, help="Globally unique identifier for the project.")
34
+ @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.")
35
+ @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...")
36
+ @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...")
37
+ @click.option("--user", default=None, help="A string identifying a user. This can either be the string \"me\", an email, or the gid of a user.")
38
+ @click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
39
+ @formatted
40
+ def get_project_memberships_for_project(project: str, limit: int | None, offset: str | None, opt_fields: str | None, user: str | None, paginate: bool) -> Any:
41
+ """Get memberships from a project"""
42
+ session = AsanaSession.from_env(paginate=paginate)
43
+ api = ProjectMembershipsApi(session.client)
44
+ opts: dict[str, Any] = {}
45
+ if limit is not None:
46
+ opts["limit"] = limit
47
+ if offset is not None:
48
+ opts["offset"] = offset
49
+ if opt_fields is not None:
50
+ opts["opt_fields"] = opt_fields
51
+ if user is not None:
52
+ opts["user"] = user
53
+ return api.get_project_memberships_for_project(project, opts)
@@ -0,0 +1,87 @@
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 ProjectPortfolioSettingsApi
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-portfolio-settings")
14
+ def project_portfolio_settings_group() -> None:
15
+ """ProjectPortfolioSettings commands."""
16
+
17
+
18
+ @project_portfolio_settings_group.command("get-project-portfolio-setting")
19
+ @click.option("--project-portfolio-setting", required=True, help="Globally unique identifier for the project portfolio setting.")
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 get_project_portfolio_setting(project_portfolio_setting: str, opt_fields: str | None) -> Any:
23
+ """Get a project portfolio setting"""
24
+ session = AsanaSession.from_env()
25
+ api = ProjectPortfolioSettingsApi(session.client)
26
+ opts: dict[str, Any] = {}
27
+ if opt_fields is not None:
28
+ opts["opt_fields"] = opt_fields
29
+ return api.get_project_portfolio_setting(project_portfolio_setting, opts)
30
+
31
+
32
+ @project_portfolio_settings_group.command("get-project-portfolio-settings-for-portfolio")
33
+ @click.option("--portfolio", required=True, help="Globally unique identifier for the portfolio.")
34
+ @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.")
35
+ @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...")
36
+ @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...")
37
+ @click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
38
+ @formatted
39
+ def get_project_portfolio_settings_for_portfolio(portfolio: str, limit: int | None, offset: str | None, opt_fields: str | None, paginate: bool) -> Any:
40
+ """Get project portfolio settings for a portfolio"""
41
+ session = AsanaSession.from_env(paginate=paginate)
42
+ api = ProjectPortfolioSettingsApi(session.client)
43
+ opts: dict[str, Any] = {}
44
+ if limit is not None:
45
+ opts["limit"] = limit
46
+ if offset is not None:
47
+ opts["offset"] = offset
48
+ if opt_fields is not None:
49
+ opts["opt_fields"] = opt_fields
50
+ return api.get_project_portfolio_settings_for_portfolio(portfolio, opts)
51
+
52
+
53
+ @project_portfolio_settings_group.command("get-project-portfolio-settings-for-project")
54
+ @click.option("--project", required=True, help="Globally unique identifier for the project.")
55
+ @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.")
56
+ @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...")
57
+ @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...")
58
+ @click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
59
+ @formatted
60
+ def get_project_portfolio_settings_for_project(project: str, limit: int | None, offset: str | None, opt_fields: str | None, paginate: bool) -> Any:
61
+ """Get project portfolio settings for a project"""
62
+ session = AsanaSession.from_env(paginate=paginate)
63
+ api = ProjectPortfolioSettingsApi(session.client)
64
+ opts: dict[str, Any] = {}
65
+ if limit is not None:
66
+ opts["limit"] = limit
67
+ if offset is not None:
68
+ opts["offset"] = offset
69
+ if opt_fields is not None:
70
+ opts["opt_fields"] = opt_fields
71
+ return api.get_project_portfolio_settings_for_project(project, opts)
72
+
73
+
74
+ @project_portfolio_settings_group.command("update-project-portfolio-setting")
75
+ @click.option("--project-portfolio-setting", required=True, help="Globally unique identifier for the project portfolio setting.")
76
+ @click.option("--body", required=True, help="The updated fields for the project portfolio setting.")
77
+ @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...")
78
+ @formatted
79
+ def update_project_portfolio_setting(project_portfolio_setting: str, body: str, opt_fields: str | None) -> Any:
80
+ """Update a project portfolio setting"""
81
+ parsed_body = resolve_body(body)
82
+ session = AsanaSession.from_env()
83
+ api = ProjectPortfolioSettingsApi(session.client)
84
+ opts: dict[str, Any] = {}
85
+ if opt_fields is not None:
86
+ opts["opt_fields"] = opt_fields
87
+ return api.update_project_portfolio_setting(parsed_body, project_portfolio_setting, opts)