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.
- asana_api_cli/__init__.py +3 -0
- asana_api_cli/cli/__init__.py +140 -0
- asana_api_cli/cli/access_requests.py +66 -0
- asana_api_cli/cli/allocations.py +101 -0
- asana_api_cli/cli/attachments.py +92 -0
- asana_api_cli/cli/audit_log_api.py +52 -0
- asana_api_cli/cli/batch_api.py +30 -0
- asana_api_cli/cli/budgets.py +79 -0
- asana_api_cli/cli/custom_field_settings.py +92 -0
- asana_api_cli/cli/custom_fields.py +133 -0
- asana_api_cli/cli/custom_types.py +50 -0
- asana_api_cli/cli/events.py +32 -0
- asana_api_cli/cli/exports.py +39 -0
- asana_api_cli/cli/goal_relationships.py +98 -0
- asana_api_cli/cli/goals.py +217 -0
- asana_api_cli/cli/jobs.py +29 -0
- asana_api_cli/cli/memberships.py +89 -0
- asana_api_cli/cli/organization_exports.py +44 -0
- asana_api_cli/cli/portfolio_memberships.py +83 -0
- asana_api_cli/cli/portfolios.py +215 -0
- asana_api_cli/cli/project_briefs.py +72 -0
- asana_api_cli/cli/project_memberships.py +53 -0
- asana_api_cli/cli/project_portfolio_settings.py +87 -0
- asana_api_cli/cli/project_statuses.py +77 -0
- asana_api_cli/cli/project_templates.py +102 -0
- asana_api_cli/cli/projects.py +380 -0
- asana_api_cli/cli/rates.py +97 -0
- asana_api_cli/cli/reactions.py +34 -0
- asana_api_cli/cli/roles.py +98 -0
- asana_api_cli/cli/rules.py +28 -0
- asana_api_cli/cli/sections.py +111 -0
- asana_api_cli/cli/status_updates.py +86 -0
- asana_api_cli/cli/stories.py +130 -0
- asana_api_cli/cli/tags.py +155 -0
- asana_api_cli/cli/task_templates.py +77 -0
- asana_api_cli/cli/tasks.py +520 -0
- asana_api_cli/cli/team_memberships.py +103 -0
- asana_api_cli/cli/teams.py +133 -0
- asana_api_cli/cli/time_periods.py +57 -0
- asana_api_cli/cli/time_tracking_categories.py +123 -0
- asana_api_cli/cli/time_tracking_entries.py +138 -0
- asana_api_cli/cli/timesheet_approval_statuses.py +94 -0
- asana_api_cli/cli/typeahead.py +40 -0
- asana_api_cli/cli/user_task_lists.py +45 -0
- asana_api_cli/cli/users.py +173 -0
- asana_api_cli/cli/webhooks.py +96 -0
- asana_api_cli/cli/workspace_memberships.py +75 -0
- asana_api_cli/cli/workspaces.py +113 -0
- asana_api_cli/formatter.py +161 -0
- asana_api_cli/session.py +173 -0
- asana_api_cli/version.py +11 -0
- asana_api_cli-1.2.0.dist-info/METADATA +105 -0
- asana_api_cli-1.2.0.dist-info/RECORD +57 -0
- asana_api_cli-1.2.0.dist-info/WHEEL +5 -0
- asana_api_cli-1.2.0.dist-info/entry_points.txt +2 -0
- asana_api_cli-1.2.0.dist-info/licenses/LICENSE +190 -0
- asana_api_cli-1.2.0.dist-info/top_level.txt +1 -0
|
@@ -0,0 +1,103 @@
|
|
|
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 TeamMembershipsApi
|
|
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("team-memberships")
|
|
14
|
+
def team_memberships_group() -> None:
|
|
15
|
+
"""TeamMemberships commands."""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@team_memberships_group.command("get-team-membership")
|
|
19
|
+
@click.option("--team-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_team_membership(team_membership: str, opt_fields: str | None) -> Any:
|
|
23
|
+
"""Get a team membership"""
|
|
24
|
+
session = AsanaSession.from_env()
|
|
25
|
+
api = TeamMembershipsApi(session.client)
|
|
26
|
+
opts: dict[str, Any] = {}
|
|
27
|
+
if opt_fields is not None:
|
|
28
|
+
opts["opt_fields"] = opt_fields
|
|
29
|
+
return api.get_team_membership(team_membership, opts)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@team_memberships_group.command("get-team-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("--team", default=None, help="Globally unique identifier for the team.")
|
|
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. This parameter must be used with the workspace parameter.")
|
|
39
|
+
@click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
|
|
40
|
+
@formatted
|
|
41
|
+
def get_team_memberships(workspace: str | None, limit: int | None, offset: str | None, opt_fields: str | None, team: str | None, user: str | None, paginate: bool) -> Any:
|
|
42
|
+
"""Get team memberships"""
|
|
43
|
+
resolved_workspace = resolve_workspace(workspace, required=False)
|
|
44
|
+
session = AsanaSession.from_env(paginate=paginate)
|
|
45
|
+
api = TeamMembershipsApi(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 team is not None:
|
|
54
|
+
opts["team"] = team
|
|
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_team_memberships(opts)
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
@team_memberships_group.command("get-team-memberships-for-team")
|
|
63
|
+
@click.option("--team", required=True, help="Globally unique identifier for the team.")
|
|
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("--paginate", is_flag=True, default=False, help="Fetch all pages")
|
|
68
|
+
@formatted
|
|
69
|
+
def get_team_memberships_for_team(team: str, limit: int | None, offset: str | None, opt_fields: str | None, paginate: bool) -> Any:
|
|
70
|
+
"""Get memberships from a team"""
|
|
71
|
+
session = AsanaSession.from_env(paginate=paginate)
|
|
72
|
+
api = TeamMembershipsApi(session.client)
|
|
73
|
+
opts: dict[str, Any] = {}
|
|
74
|
+
if limit is not None:
|
|
75
|
+
opts["limit"] = limit
|
|
76
|
+
if offset is not None:
|
|
77
|
+
opts["offset"] = offset
|
|
78
|
+
if opt_fields is not None:
|
|
79
|
+
opts["opt_fields"] = opt_fields
|
|
80
|
+
return api.get_team_memberships_for_team(team, opts)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
@team_memberships_group.command("get-team-memberships-for-user")
|
|
84
|
+
@click.option("--user", required=True, help="A string identifying a user. This can either be the string \"me\", an email, or the gid of a user.")
|
|
85
|
+
@click.option("--workspace", default=None, help="Workspace GID (falls back to ASANA_DEFAULT_WORKSPACE)")
|
|
86
|
+
@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.")
|
|
87
|
+
@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...")
|
|
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
|
+
@click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
|
|
90
|
+
@formatted
|
|
91
|
+
def get_team_memberships_for_user(user: str, workspace: str | None, limit: int | None, offset: str | None, opt_fields: str | None, paginate: bool) -> Any:
|
|
92
|
+
"""Get memberships from a user"""
|
|
93
|
+
resolved_workspace = resolve_workspace(workspace, required=True)
|
|
94
|
+
session = AsanaSession.from_env(paginate=paginate)
|
|
95
|
+
api = TeamMembershipsApi(session.client)
|
|
96
|
+
opts: dict[str, Any] = {}
|
|
97
|
+
if limit is not None:
|
|
98
|
+
opts["limit"] = limit
|
|
99
|
+
if offset is not None:
|
|
100
|
+
opts["offset"] = offset
|
|
101
|
+
if opt_fields is not None:
|
|
102
|
+
opts["opt_fields"] = opt_fields
|
|
103
|
+
return api.get_team_memberships_for_user(user, resolved_workspace, opts)
|
|
@@ -0,0 +1,133 @@
|
|
|
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 TeamsApi
|
|
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("teams")
|
|
14
|
+
def teams_group() -> None:
|
|
15
|
+
"""Teams commands."""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@teams_group.command("add-user-for-team")
|
|
19
|
+
@click.option("--team", required=True, help="Globally unique identifier for the team.")
|
|
20
|
+
@click.option("--body", required=True, help="The user to add to the team.")
|
|
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_user_for_team(team: str, body: str, opt_fields: str | None) -> Any:
|
|
24
|
+
"""Add a user to a team"""
|
|
25
|
+
parsed_body = resolve_body(body)
|
|
26
|
+
session = AsanaSession.from_env()
|
|
27
|
+
api = TeamsApi(session.client)
|
|
28
|
+
opts: dict[str, Any] = {}
|
|
29
|
+
if opt_fields is not None:
|
|
30
|
+
opts["opt_fields"] = opt_fields
|
|
31
|
+
return api.add_user_for_team(parsed_body, team, opts)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@teams_group.command("create-team")
|
|
35
|
+
@click.option("--body", required=True, help="The team to create.")
|
|
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
|
+
@formatted
|
|
38
|
+
def create_team(body: str, opt_fields: str | None) -> Any:
|
|
39
|
+
"""Create a team"""
|
|
40
|
+
parsed_body = resolve_body(body)
|
|
41
|
+
session = AsanaSession.from_env()
|
|
42
|
+
api = TeamsApi(session.client)
|
|
43
|
+
opts: dict[str, Any] = {}
|
|
44
|
+
if opt_fields is not None:
|
|
45
|
+
opts["opt_fields"] = opt_fields
|
|
46
|
+
return api.create_team(parsed_body, opts)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@teams_group.command("get-team")
|
|
50
|
+
@click.option("--team", required=True, help="Globally unique identifier for the team.")
|
|
51
|
+
@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...")
|
|
52
|
+
@formatted
|
|
53
|
+
def get_team(team: str, opt_fields: str | None) -> Any:
|
|
54
|
+
"""Get a team"""
|
|
55
|
+
session = AsanaSession.from_env()
|
|
56
|
+
api = TeamsApi(session.client)
|
|
57
|
+
opts: dict[str, Any] = {}
|
|
58
|
+
if opt_fields is not None:
|
|
59
|
+
opts["opt_fields"] = opt_fields
|
|
60
|
+
return api.get_team(team, opts)
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
@teams_group.command("get-teams-for-user")
|
|
64
|
+
@click.option("--user", required=True, help="A string identifying a user. This can either be the string \"me\", an email, or the gid of a user.")
|
|
65
|
+
@click.option("--organization", required=True, help="The workspace or organization to filter teams on.")
|
|
66
|
+
@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.")
|
|
67
|
+
@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...")
|
|
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
|
+
@click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
|
|
70
|
+
@formatted
|
|
71
|
+
def get_teams_for_user(user: str, organization: str, limit: int | None, offset: str | None, opt_fields: str | None, paginate: bool) -> Any:
|
|
72
|
+
"""Get teams for a user"""
|
|
73
|
+
session = AsanaSession.from_env(paginate=paginate)
|
|
74
|
+
api = TeamsApi(session.client)
|
|
75
|
+
opts: dict[str, Any] = {}
|
|
76
|
+
if limit is not None:
|
|
77
|
+
opts["limit"] = limit
|
|
78
|
+
if offset is not None:
|
|
79
|
+
opts["offset"] = offset
|
|
80
|
+
if opt_fields is not None:
|
|
81
|
+
opts["opt_fields"] = opt_fields
|
|
82
|
+
return api.get_teams_for_user(user, organization, opts)
|
|
83
|
+
|
|
84
|
+
|
|
85
|
+
@teams_group.command("get-teams-for-workspace")
|
|
86
|
+
@click.option("--workspace", default=None, help="Workspace GID (falls back to ASANA_DEFAULT_WORKSPACE)")
|
|
87
|
+
@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.")
|
|
88
|
+
@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...")
|
|
89
|
+
@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...")
|
|
90
|
+
@click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
|
|
91
|
+
@formatted
|
|
92
|
+
def get_teams_for_workspace(workspace: str | None, limit: int | None, offset: str | None, opt_fields: str | None, paginate: bool) -> Any:
|
|
93
|
+
"""Get teams in a workspace"""
|
|
94
|
+
resolved_workspace = resolve_workspace(workspace, required=True)
|
|
95
|
+
session = AsanaSession.from_env(paginate=paginate)
|
|
96
|
+
api = TeamsApi(session.client)
|
|
97
|
+
opts: dict[str, Any] = {}
|
|
98
|
+
if limit is not None:
|
|
99
|
+
opts["limit"] = limit
|
|
100
|
+
if offset is not None:
|
|
101
|
+
opts["offset"] = offset
|
|
102
|
+
if opt_fields is not None:
|
|
103
|
+
opts["opt_fields"] = opt_fields
|
|
104
|
+
return api.get_teams_for_workspace(resolved_workspace, opts)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
@teams_group.command("remove-user-for-team")
|
|
108
|
+
@click.option("--team", required=True, help="Globally unique identifier for the team. If the method is called asynchronously, returns the request thread.")
|
|
109
|
+
@click.option("--body", required=True, help="The user to remove from the team.")
|
|
110
|
+
@formatted
|
|
111
|
+
def remove_user_for_team(team: str, body: str) -> Any:
|
|
112
|
+
"""Remove a user from a team"""
|
|
113
|
+
parsed_body = resolve_body(body)
|
|
114
|
+
session = AsanaSession.from_env()
|
|
115
|
+
api = TeamsApi(session.client)
|
|
116
|
+
opts: dict[str, Any] = {}
|
|
117
|
+
return api.remove_user_for_team(parsed_body, team)
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
@teams_group.command("update-team")
|
|
121
|
+
@click.option("--team", required=True, help="Globally unique identifier for the team.")
|
|
122
|
+
@click.option("--body", required=True, help="The team to update.")
|
|
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 update_team(team: str, body: str, opt_fields: str | None) -> Any:
|
|
126
|
+
"""Update a team"""
|
|
127
|
+
parsed_body = resolve_body(body)
|
|
128
|
+
session = AsanaSession.from_env()
|
|
129
|
+
api = TeamsApi(session.client)
|
|
130
|
+
opts: dict[str, Any] = {}
|
|
131
|
+
if opt_fields is not None:
|
|
132
|
+
opts["opt_fields"] = opt_fields
|
|
133
|
+
return api.update_team(parsed_body, team, opts)
|
|
@@ -0,0 +1,57 @@
|
|
|
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 TimePeriodsApi
|
|
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("time-periods")
|
|
14
|
+
def time_periods_group() -> None:
|
|
15
|
+
"""TimePeriods commands."""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@time_periods_group.command("get-time-period")
|
|
19
|
+
@click.option("--time-period", required=True, help="Globally unique identifier for the time period.")
|
|
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_time_period(time_period: str, opt_fields: str | None) -> Any:
|
|
23
|
+
"""Get a time period"""
|
|
24
|
+
session = AsanaSession.from_env()
|
|
25
|
+
api = TimePeriodsApi(session.client)
|
|
26
|
+
opts: dict[str, Any] = {}
|
|
27
|
+
if opt_fields is not None:
|
|
28
|
+
opts["opt_fields"] = opt_fields
|
|
29
|
+
return api.get_time_period(time_period, opts)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
@time_periods_group.command("get-time-periods")
|
|
33
|
+
@click.option("--workspace", default=None, help="Workspace GID (falls back to ASANA_DEFAULT_WORKSPACE)")
|
|
34
|
+
@click.option("--end-on", default=None, help="ISO 8601 date string")
|
|
35
|
+
@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.")
|
|
36
|
+
@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...")
|
|
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
|
+
@click.option("--start-on", default=None, help="ISO 8601 date string")
|
|
39
|
+
@click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
|
|
40
|
+
@formatted
|
|
41
|
+
def get_time_periods(workspace: str | None, end_on: str | None, limit: int | None, offset: str | None, opt_fields: str | None, start_on: str | None, paginate: bool) -> Any:
|
|
42
|
+
"""Get time periods"""
|
|
43
|
+
resolved_workspace = resolve_workspace(workspace, required=True)
|
|
44
|
+
session = AsanaSession.from_env(paginate=paginate)
|
|
45
|
+
api = TimePeriodsApi(session.client)
|
|
46
|
+
opts: dict[str, Any] = {}
|
|
47
|
+
if end_on is not None:
|
|
48
|
+
opts["end_on"] = end_on
|
|
49
|
+
if limit is not None:
|
|
50
|
+
opts["limit"] = limit
|
|
51
|
+
if offset is not None:
|
|
52
|
+
opts["offset"] = offset
|
|
53
|
+
if opt_fields is not None:
|
|
54
|
+
opts["opt_fields"] = opt_fields
|
|
55
|
+
if start_on is not None:
|
|
56
|
+
opts["start_on"] = start_on
|
|
57
|
+
return api.get_time_periods(resolved_workspace, opts)
|
|
@@ -0,0 +1,123 @@
|
|
|
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 TimeTrackingCategoriesApi
|
|
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("time-tracking-categories")
|
|
14
|
+
def time_tracking_categories_group() -> None:
|
|
15
|
+
"""TimeTrackingCategories commands."""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@time_tracking_categories_group.command("create-time-tracking-category")
|
|
19
|
+
@click.option("--body", required=True, help="Information about the time tracking category.")
|
|
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_time_tracking_category(body: str, opt_fields: str | None) -> Any:
|
|
23
|
+
"""Create a time tracking category"""
|
|
24
|
+
parsed_body = resolve_body(body)
|
|
25
|
+
session = AsanaSession.from_env()
|
|
26
|
+
api = TimeTrackingCategoriesApi(session.client)
|
|
27
|
+
opts: dict[str, Any] = {}
|
|
28
|
+
if opt_fields is not None:
|
|
29
|
+
opts["opt_fields"] = opt_fields
|
|
30
|
+
return api.create_time_tracking_category(parsed_body, opts)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@time_tracking_categories_group.command("delete-time-tracking-category")
|
|
34
|
+
@click.option("--time-tracking-category", required=True, help="Globally unique identifier for the time tracking category. If the method is called asynchronously, returns the request thread.")
|
|
35
|
+
@formatted
|
|
36
|
+
def delete_time_tracking_category(time_tracking_category: str) -> Any:
|
|
37
|
+
"""Delete a time tracking category"""
|
|
38
|
+
session = AsanaSession.from_env()
|
|
39
|
+
api = TimeTrackingCategoriesApi(session.client)
|
|
40
|
+
opts: dict[str, Any] = {}
|
|
41
|
+
return api.delete_time_tracking_category(time_tracking_category)
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
@time_tracking_categories_group.command("get-time-tracking-categories")
|
|
45
|
+
@click.option("--workspace", default=None, help="Workspace GID (falls back to ASANA_DEFAULT_WORKSPACE)")
|
|
46
|
+
@click.option("--is-archived", type=bool, default=None, help="Filter by archived status. If not provided, defaults to returning non-archived categories.")
|
|
47
|
+
@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.")
|
|
48
|
+
@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...")
|
|
49
|
+
@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...")
|
|
50
|
+
@click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
|
|
51
|
+
@formatted
|
|
52
|
+
def get_time_tracking_categories(workspace: str | None, is_archived: bool | None, limit: int | None, offset: str | None, opt_fields: str | None, paginate: bool) -> Any:
|
|
53
|
+
"""Get time tracking categories for a workspace"""
|
|
54
|
+
resolved_workspace = resolve_workspace(workspace, required=True)
|
|
55
|
+
session = AsanaSession.from_env(paginate=paginate)
|
|
56
|
+
api = TimeTrackingCategoriesApi(session.client)
|
|
57
|
+
opts: dict[str, Any] = {}
|
|
58
|
+
if is_archived is not None:
|
|
59
|
+
opts["is_archived"] = is_archived
|
|
60
|
+
if limit is not None:
|
|
61
|
+
opts["limit"] = limit
|
|
62
|
+
if offset is not None:
|
|
63
|
+
opts["offset"] = offset
|
|
64
|
+
if opt_fields is not None:
|
|
65
|
+
opts["opt_fields"] = opt_fields
|
|
66
|
+
return api.get_time_tracking_categories(resolved_workspace, opts)
|
|
67
|
+
|
|
68
|
+
|
|
69
|
+
@time_tracking_categories_group.command("get-time-tracking-category")
|
|
70
|
+
@click.option("--time-tracking-category", required=True, help="Globally unique identifier for the time tracking category.")
|
|
71
|
+
@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...")
|
|
72
|
+
@formatted
|
|
73
|
+
def get_time_tracking_category(time_tracking_category: str, opt_fields: str | None) -> Any:
|
|
74
|
+
"""Get a time tracking category"""
|
|
75
|
+
session = AsanaSession.from_env()
|
|
76
|
+
api = TimeTrackingCategoriesApi(session.client)
|
|
77
|
+
opts: dict[str, Any] = {}
|
|
78
|
+
if opt_fields is not None:
|
|
79
|
+
opts["opt_fields"] = opt_fields
|
|
80
|
+
return api.get_time_tracking_category(time_tracking_category, opts)
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
@time_tracking_categories_group.command("get-time-tracking-entries-for-time-tracking-category")
|
|
84
|
+
@click.option("--time-tracking-category", required=True, help="Globally unique identifier for the time tracking category.")
|
|
85
|
+
@click.option("--end-date", default=None, help="The end date for filtering time tracking entries by their entry date.")
|
|
86
|
+
@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.")
|
|
87
|
+
@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...")
|
|
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
|
+
@click.option("--start-date", default=None, help="The start date for filtering time tracking entries by their entry date.")
|
|
90
|
+
@click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
|
|
91
|
+
@formatted
|
|
92
|
+
def get_time_tracking_entries_for_time_tracking_category(time_tracking_category: str, end_date: str | None, limit: int | None, offset: str | None, opt_fields: str | None, start_date: str | None, paginate: bool) -> Any:
|
|
93
|
+
"""Get time tracking entries for a time tracking category"""
|
|
94
|
+
session = AsanaSession.from_env(paginate=paginate)
|
|
95
|
+
api = TimeTrackingCategoriesApi(session.client)
|
|
96
|
+
opts: dict[str, Any] = {}
|
|
97
|
+
if end_date is not None:
|
|
98
|
+
opts["end_date"] = end_date
|
|
99
|
+
if limit is not None:
|
|
100
|
+
opts["limit"] = limit
|
|
101
|
+
if offset is not None:
|
|
102
|
+
opts["offset"] = offset
|
|
103
|
+
if opt_fields is not None:
|
|
104
|
+
opts["opt_fields"] = opt_fields
|
|
105
|
+
if start_date is not None:
|
|
106
|
+
opts["start_date"] = start_date
|
|
107
|
+
return api.get_time_tracking_entries_for_time_tracking_category(time_tracking_category, opts)
|
|
108
|
+
|
|
109
|
+
|
|
110
|
+
@time_tracking_categories_group.command("update-time-tracking-category")
|
|
111
|
+
@click.option("--time-tracking-category", required=True, help="Globally unique identifier for the time tracking category.")
|
|
112
|
+
@click.option("--body", required=True, help="The updated fields for the time tracking category.")
|
|
113
|
+
@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...")
|
|
114
|
+
@formatted
|
|
115
|
+
def update_time_tracking_category(time_tracking_category: str, body: str, opt_fields: str | None) -> Any:
|
|
116
|
+
"""Update a time tracking category"""
|
|
117
|
+
parsed_body = resolve_body(body)
|
|
118
|
+
session = AsanaSession.from_env()
|
|
119
|
+
api = TimeTrackingCategoriesApi(session.client)
|
|
120
|
+
opts: dict[str, Any] = {}
|
|
121
|
+
if opt_fields is not None:
|
|
122
|
+
opts["opt_fields"] = opt_fields
|
|
123
|
+
return api.update_time_tracking_category(parsed_body, time_tracking_category, opts)
|
|
@@ -0,0 +1,138 @@
|
|
|
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 TimeTrackingEntriesApi
|
|
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("time-tracking-entries")
|
|
14
|
+
def time_tracking_entries_group() -> None:
|
|
15
|
+
"""TimeTrackingEntries commands."""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@time_tracking_entries_group.command("create-time-tracking-entry")
|
|
19
|
+
@click.option("--task", required=True, help="The task to operate on.")
|
|
20
|
+
@click.option("--body", required=True, help="Information about the time tracking entry.")
|
|
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_time_tracking_entry(task: str, body: str, opt_fields: str | None) -> Any:
|
|
24
|
+
"""Create a time tracking entry"""
|
|
25
|
+
parsed_body = resolve_body(body)
|
|
26
|
+
session = AsanaSession.from_env()
|
|
27
|
+
api = TimeTrackingEntriesApi(session.client)
|
|
28
|
+
opts: dict[str, Any] = {}
|
|
29
|
+
if opt_fields is not None:
|
|
30
|
+
opts["opt_fields"] = opt_fields
|
|
31
|
+
return api.create_time_tracking_entry(parsed_body, task, opts)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
@time_tracking_entries_group.command("delete-time-tracking-entry")
|
|
35
|
+
@click.option("--time-tracking-entry", required=True, help="Globally unique identifier for the time tracking entry. If the method is called asynchronously, returns the request thread.")
|
|
36
|
+
@formatted
|
|
37
|
+
def delete_time_tracking_entry(time_tracking_entry: str) -> Any:
|
|
38
|
+
"""Delete a time tracking entry"""
|
|
39
|
+
session = AsanaSession.from_env()
|
|
40
|
+
api = TimeTrackingEntriesApi(session.client)
|
|
41
|
+
opts: dict[str, Any] = {}
|
|
42
|
+
return api.delete_time_tracking_entry(time_tracking_entry)
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
@time_tracking_entries_group.command("get-time-tracking-entries")
|
|
46
|
+
@click.option("--workspace", default=None, help="Workspace GID (falls back to ASANA_DEFAULT_WORKSPACE)")
|
|
47
|
+
@click.option("--attributable-to", default=None, help="Globally unique identifier for the project the time tracking entries are attributed to.")
|
|
48
|
+
@click.option("--entered-on-end-date", default=None, help="The end date for filtering time tracking entries by when they were entered.")
|
|
49
|
+
@click.option("--entered-on-start-date", default=None, help="The start date for filtering time tracking entries by when they were entered.")
|
|
50
|
+
@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.")
|
|
51
|
+
@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...")
|
|
52
|
+
@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...")
|
|
53
|
+
@click.option("--portfolio", default=None, help="Globally unique identifier for the portfolio to filter time tracking entries by.")
|
|
54
|
+
@click.option("--task", default=None, help="Globally unique identifier for the task to filter time tracking entries by.")
|
|
55
|
+
@click.option("--timesheet-approval-status", default=None, help="Globally unique identifier for the timesheet approval status to filter time tracking entries by.")
|
|
56
|
+
@click.option("--user", default=None, help="Globally unique identifier for the user to filter time tracking entries by.")
|
|
57
|
+
@click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
|
|
58
|
+
@formatted
|
|
59
|
+
def get_time_tracking_entries(workspace: str | None, attributable_to: str | None, entered_on_end_date: str | None, entered_on_start_date: str | None, limit: int | None, offset: str | None, opt_fields: str | None, portfolio: str | None, task: str | None, timesheet_approval_status: str | None, user: str | None, paginate: bool) -> Any:
|
|
60
|
+
"""Get multiple time tracking entries"""
|
|
61
|
+
resolved_workspace = resolve_workspace(workspace, required=False)
|
|
62
|
+
session = AsanaSession.from_env(paginate=paginate)
|
|
63
|
+
api = TimeTrackingEntriesApi(session.client)
|
|
64
|
+
opts: dict[str, Any] = {}
|
|
65
|
+
if attributable_to is not None:
|
|
66
|
+
opts["attributable_to"] = attributable_to
|
|
67
|
+
if entered_on_end_date is not None:
|
|
68
|
+
opts["entered_on_end_date"] = entered_on_end_date
|
|
69
|
+
if entered_on_start_date is not None:
|
|
70
|
+
opts["entered_on_start_date"] = entered_on_start_date
|
|
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 portfolio is not None:
|
|
78
|
+
opts["portfolio"] = portfolio
|
|
79
|
+
if task is not None:
|
|
80
|
+
opts["task"] = task
|
|
81
|
+
if timesheet_approval_status is not None:
|
|
82
|
+
opts["timesheet_approval_status"] = timesheet_approval_status
|
|
83
|
+
if user is not None:
|
|
84
|
+
opts["user"] = user
|
|
85
|
+
if resolved_workspace is not None:
|
|
86
|
+
opts["workspace"] = resolved_workspace
|
|
87
|
+
return api.get_time_tracking_entries(opts)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
@time_tracking_entries_group.command("get-time-tracking-entries-for-task")
|
|
91
|
+
@click.option("--task", required=True, help="The task to operate on.")
|
|
92
|
+
@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.")
|
|
93
|
+
@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...")
|
|
94
|
+
@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...")
|
|
95
|
+
@click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
|
|
96
|
+
@formatted
|
|
97
|
+
def get_time_tracking_entries_for_task(task: str, limit: int | None, offset: str | None, opt_fields: str | None, paginate: bool) -> Any:
|
|
98
|
+
"""Get time tracking entries for a task"""
|
|
99
|
+
session = AsanaSession.from_env(paginate=paginate)
|
|
100
|
+
api = TimeTrackingEntriesApi(session.client)
|
|
101
|
+
opts: dict[str, Any] = {}
|
|
102
|
+
if limit is not None:
|
|
103
|
+
opts["limit"] = limit
|
|
104
|
+
if offset is not None:
|
|
105
|
+
opts["offset"] = offset
|
|
106
|
+
if opt_fields is not None:
|
|
107
|
+
opts["opt_fields"] = opt_fields
|
|
108
|
+
return api.get_time_tracking_entries_for_task(task, opts)
|
|
109
|
+
|
|
110
|
+
|
|
111
|
+
@time_tracking_entries_group.command("get-time-tracking-entry")
|
|
112
|
+
@click.option("--time-tracking-entry", required=True, help="Globally unique identifier for the time tracking entry.")
|
|
113
|
+
@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...")
|
|
114
|
+
@formatted
|
|
115
|
+
def get_time_tracking_entry(time_tracking_entry: str, opt_fields: str | None) -> Any:
|
|
116
|
+
"""Get a time tracking entry"""
|
|
117
|
+
session = AsanaSession.from_env()
|
|
118
|
+
api = TimeTrackingEntriesApi(session.client)
|
|
119
|
+
opts: dict[str, Any] = {}
|
|
120
|
+
if opt_fields is not None:
|
|
121
|
+
opts["opt_fields"] = opt_fields
|
|
122
|
+
return api.get_time_tracking_entry(time_tracking_entry, opts)
|
|
123
|
+
|
|
124
|
+
|
|
125
|
+
@time_tracking_entries_group.command("update-time-tracking-entry")
|
|
126
|
+
@click.option("--time-tracking-entry", required=True, help="Globally unique identifier for the time tracking entry.")
|
|
127
|
+
@click.option("--body", required=True, help="The updated fields for the time tracking entry.")
|
|
128
|
+
@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...")
|
|
129
|
+
@formatted
|
|
130
|
+
def update_time_tracking_entry(time_tracking_entry: str, body: str, opt_fields: str | None) -> Any:
|
|
131
|
+
"""Update a time tracking entry"""
|
|
132
|
+
parsed_body = resolve_body(body)
|
|
133
|
+
session = AsanaSession.from_env()
|
|
134
|
+
api = TimeTrackingEntriesApi(session.client)
|
|
135
|
+
opts: dict[str, Any] = {}
|
|
136
|
+
if opt_fields is not None:
|
|
137
|
+
opts["opt_fields"] = opt_fields
|
|
138
|
+
return api.update_time_tracking_entry(parsed_body, time_tracking_entry, opts)
|
|
@@ -0,0 +1,94 @@
|
|
|
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 TimesheetApprovalStatusesApi
|
|
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("timesheet-approval-statuses")
|
|
14
|
+
def timesheet_approval_statuses_group() -> None:
|
|
15
|
+
"""TimesheetApprovalStatuses commands."""
|
|
16
|
+
|
|
17
|
+
|
|
18
|
+
@timesheet_approval_statuses_group.command("create-timesheet-approval-status")
|
|
19
|
+
@click.option("--body", required=True, help="The timesheet approval status 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_timesheet_approval_status(body: str, opt_fields: str | None) -> Any:
|
|
23
|
+
"""Create a timesheet approval status"""
|
|
24
|
+
parsed_body = resolve_body(body)
|
|
25
|
+
session = AsanaSession.from_env()
|
|
26
|
+
api = TimesheetApprovalStatusesApi(session.client)
|
|
27
|
+
opts: dict[str, Any] = {}
|
|
28
|
+
if opt_fields is not None:
|
|
29
|
+
opts["opt_fields"] = opt_fields
|
|
30
|
+
return api.create_timesheet_approval_status(parsed_body, opts)
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
@timesheet_approval_statuses_group.command("get-timesheet-approval-status")
|
|
34
|
+
@click.option("--timesheet-approval-status", required=True, help="Globally unique identifier for the timesheet approval status.")
|
|
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_timesheet_approval_status(timesheet_approval_status: str, opt_fields: str | None) -> Any:
|
|
38
|
+
"""Get a timesheet approval status"""
|
|
39
|
+
session = AsanaSession.from_env()
|
|
40
|
+
api = TimesheetApprovalStatusesApi(session.client)
|
|
41
|
+
opts: dict[str, Any] = {}
|
|
42
|
+
if opt_fields is not None:
|
|
43
|
+
opts["opt_fields"] = opt_fields
|
|
44
|
+
return api.get_timesheet_approval_status(timesheet_approval_status, opts)
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
@timesheet_approval_statuses_group.command("get-timesheet-approval-statuses")
|
|
48
|
+
@click.option("--workspace", default=None, help="Workspace GID (falls back to ASANA_DEFAULT_WORKSPACE)")
|
|
49
|
+
@click.option("--approval-statuses", default=None, help="Filter by approval status. Can be one or more of draft, submitted, approved, or rejected.")
|
|
50
|
+
@click.option("--from-date", default=None, help="The start date for filtering timesheet approval statuses.")
|
|
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("--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...")
|
|
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
|
+
@click.option("--to-date", default=None, help="The end date for filtering timesheet approval statuses.")
|
|
55
|
+
@click.option("--user", default=None, help="Globally unique identifier for the user to filter timesheet approval statuses by.")
|
|
56
|
+
@click.option("--paginate", is_flag=True, default=False, help="Fetch all pages")
|
|
57
|
+
@formatted
|
|
58
|
+
def get_timesheet_approval_statuses(workspace: str | None, approval_statuses: str | None, from_date: str | None, limit: int | None, offset: str | None, opt_fields: str | None, to_date: str | None, user: str | None, paginate: bool) -> Any:
|
|
59
|
+
"""Get multiple timesheet approval statuses"""
|
|
60
|
+
resolved_workspace = resolve_workspace(workspace, required=True)
|
|
61
|
+
session = AsanaSession.from_env(paginate=paginate)
|
|
62
|
+
api = TimesheetApprovalStatusesApi(session.client)
|
|
63
|
+
opts: dict[str, Any] = {}
|
|
64
|
+
if approval_statuses is not None:
|
|
65
|
+
opts["approval_statuses"] = approval_statuses
|
|
66
|
+
if from_date is not None:
|
|
67
|
+
opts["from_date"] = from_date
|
|
68
|
+
if limit is not None:
|
|
69
|
+
opts["limit"] = limit
|
|
70
|
+
if offset is not None:
|
|
71
|
+
opts["offset"] = offset
|
|
72
|
+
if opt_fields is not None:
|
|
73
|
+
opts["opt_fields"] = opt_fields
|
|
74
|
+
if to_date is not None:
|
|
75
|
+
opts["to_date"] = to_date
|
|
76
|
+
if user is not None:
|
|
77
|
+
opts["user"] = user
|
|
78
|
+
return api.get_timesheet_approval_statuses(resolved_workspace, opts)
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
@timesheet_approval_statuses_group.command("update-timesheet-approval-status")
|
|
82
|
+
@click.option("--timesheet-approval-status", required=True, help="Globally unique identifier for the timesheet approval status.")
|
|
83
|
+
@click.option("--body", required=True, help="The fields to update on the timesheet approval status.")
|
|
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 update_timesheet_approval_status(timesheet_approval_status: str, body: str, opt_fields: str | None) -> Any:
|
|
87
|
+
"""Update a timesheet approval status"""
|
|
88
|
+
parsed_body = resolve_body(body)
|
|
89
|
+
session = AsanaSession.from_env()
|
|
90
|
+
api = TimesheetApprovalStatusesApi(session.client)
|
|
91
|
+
opts: dict[str, Any] = {}
|
|
92
|
+
if opt_fields is not None:
|
|
93
|
+
opts["opt_fields"] = opt_fields
|
|
94
|
+
return api.update_timesheet_approval_status(parsed_body, timesheet_approval_status, opts)
|