diff --git a/pyproject.toml b/pyproject.toml index e0f3721..9e15d75 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "ProjectManagerSdk" -version = "98.0.2363" +version = "99.0.2541" authors = [ { name = "ProjectManager.com", email = "support@projectmanager.com" } ] diff --git a/src/ProjectManagerSdk/__init__.py b/src/ProjectManagerSdk/__init__.py index d7563da..cde0aa7 100644 --- a/src/ProjectManagerSdk/__init__.py +++ b/src/ProjectManagerSdk/__init__.py @@ -50,10 +50,9 @@ from ProjectManagerSdk.models.createprojectfieldresponsedto import CreateProjectFieldResponseDto from ProjectManagerSdk.models.createresourceskilldto import CreateResourceSkillDto from ProjectManagerSdk.models.createresourceteamdto import CreateResourceTeamDto -from ProjectManagerSdk.models.createtaskfieldrequestdto import CreateTaskFieldRequestDto +from ProjectManagerSdk.models.createtaskfielddto import CreateTaskFieldDto from ProjectManagerSdk.models.dashboardsettingcreatedto import DashboardSettingCreateDto from ProjectManagerSdk.models.dashboardsettingdto import DashboardSettingDto -from ProjectManagerSdk.models.deleteprojectfielddto import DeleteProjectFieldDto from ProjectManagerSdk.models.directlinkdto import DirectLinkDto from ProjectManagerSdk.models.discussioncreatedto import DiscussionCreateDto from ProjectManagerSdk.models.discussioncreateresponsedto import DiscussionCreateResponseDto @@ -61,14 +60,15 @@ from ProjectManagerSdk.models.discussionemoji import DiscussionEmoji from ProjectManagerSdk.models.filedto import FileDto from ProjectManagerSdk.models.getprojectfieldsresponsedto import GetProjectFieldsResponseDto -from ProjectManagerSdk.models.gettaskfieldsresponsedto import GetTaskFieldsResponseDto from ProjectManagerSdk.models.iddto import IdDto from ProjectManagerSdk.models.integrationauthsetupdto import IntegrationAuthSetupDto from ProjectManagerSdk.models.integrationcategorydto import IntegrationCategoryDto +from ProjectManagerSdk.models.integrationconnectionschemeobjectdto import IntegrationConnectionSchemeObjectDto from ProjectManagerSdk.models.integrationdto import IntegrationDto from ProjectManagerSdk.models.integrationinstancedto import IntegrationInstanceDto from ProjectManagerSdk.models.integrationproviderdto import IntegrationProviderDto from ProjectManagerSdk.models.licensedto import LicenseDto +from ProjectManagerSdk.models.masterconnectionschemedto import MasterConnectionSchemeDto from ProjectManagerSdk.models.namedto import NameDto from ProjectManagerSdk.models.odataentitysetinfo import ODataEntitySetInfo from ProjectManagerSdk.models.odatafunctionimportinfo import ODataFunctionImportInfo @@ -105,10 +105,11 @@ from ProjectManagerSdk.models.tagupdatedto import TagUpdateDto from ProjectManagerSdk.models.taskassigneedto import TaskAssigneeDto from ProjectManagerSdk.models.taskcreatedto import TaskCreateDto -from ProjectManagerSdk.models.taskdetailsdto import TaskDetailsDto from ProjectManagerSdk.models.taskdto import TaskDto from ProjectManagerSdk.models.taskfielddto import TaskFieldDto -from ProjectManagerSdk.models.taskfieldsvalueresponsedto import TaskFieldsValueResponseDto +from ProjectManagerSdk.models.taskfieldprojectdto import TaskFieldProjectDto +from ProjectManagerSdk.models.taskfieldvaluedto import TaskFieldValueDto +from ProjectManagerSdk.models.taskfieldvaluetaskdto import TaskFieldValueTaskDto from ProjectManagerSdk.models.taskprioritydto import TaskPriorityDto from ProjectManagerSdk.models.taskprojectdto import TaskProjectDto from ProjectManagerSdk.models.taskstatuscreatedto import TaskStatusCreateDto diff --git a/src/ProjectManagerSdk/clients/projectcustomerclient.py b/src/ProjectManagerSdk/clients/projectcustomerclient.py index 9d380c5..ce369ca 100644 --- a/src/ProjectManagerSdk/clients/projectcustomerclient.py +++ b/src/ProjectManagerSdk/clients/projectcustomerclient.py @@ -28,10 +28,10 @@ def retrieve_project_customers(self) -> AstroResult[list[ProjectCustomerDto]]: """ Retrieves all ProjectCustomers defined within your Workspace. - A ProjectCustomer is a code used to identify costs within your - Projects. Each ProjectCustomer has a name and a unique - identifier. ProjectCustomers are defined per Workspace and are - shared among Projects. + A ProjectCustomer is a code used to identify customers + associated with your Projects. Each ProjectCustomer has a name + and a unique identifier. ProjectCustomers are defined per + Workspace and are shared among Projects. Parameters ---------- diff --git a/src/ProjectManagerSdk/clients/projectfieldclient.py b/src/ProjectManagerSdk/clients/projectfieldclient.py index 7625a21..7558ec8 100644 --- a/src/ProjectManagerSdk/clients/projectfieldclient.py +++ b/src/ProjectManagerSdk/clients/projectfieldclient.py @@ -14,7 +14,6 @@ from ProjectManagerSdk.models.astroresult import AstroResult from ProjectManagerSdk.models.createprojectfielddto import CreateProjectFieldDto from ProjectManagerSdk.models.createprojectfieldresponsedto import CreateProjectFieldResponseDto -from ProjectManagerSdk.models.deleteprojectfielddto import DeleteProjectFieldDto from ProjectManagerSdk.models.getprojectfieldsresponsedto import GetProjectFieldsResponseDto from ProjectManagerSdk.models.projectfieldsvalueresponsedto import ProjectFieldsValueResponseDto from ProjectManagerSdk.models.updateprojectfieldvaluedto import UpdateProjectFieldValueDto @@ -76,7 +75,7 @@ def create_project_field(self, body: CreateProjectFieldDto) -> AstroResult[Creat else: return AstroResult[CreateProjectFieldResponseDto](result.json(), False, True, result.status_code, None) - def delete_project_field(self, body: DeleteProjectFieldDto) -> AstroResult[object]: + def delete_project_field(self, fieldId: str) -> AstroResult[object]: """ Deletes an existing ProjectField within your Workspace. @@ -88,20 +87,21 @@ def delete_project_field(self, body: DeleteProjectFieldDto) -> AstroResult[objec Parameters ---------- - body : DeleteProjectFieldDto - The identity of the ProjectField to delete + fieldId : str + The unique identifier or short ID of this ProjectField """ - path = "/api/data/projects/fields" + path = f"/api/data/projects/fields/{fieldId}" queryParams = {} - result = self.client.send_request("DELETE", path, body, queryParams, None) + result = self.client.send_request("DELETE", path, None, queryParams, None) if result.status_code >= 200 and result.status_code < 300: return AstroResult[object](None, True, False, result.status_code, object(**json.loads(result.content)['data'])) else: return AstroResult[object](result.json(), False, True, result.status_code, None) - def update_project_field(self, projectId: str, fieldId: str, body: UpdateProjectFieldValueDto) -> AstroResult[object]: + def update_projectfield_value(self, projectId: str, fieldId: str, body: UpdateProjectFieldValueDto) -> AstroResult[object]: """ - Updates an existing ProjectField with new information. + Replaces the current value of a ProjectField for a specific + Project within your Workspace. A ProjectField is a custom field defined within your Workspace. You can define ProjectFields for any integration purpose that is @@ -115,7 +115,7 @@ def update_project_field(self, projectId: str, fieldId: str, body: UpdateProject The unique identifier of the Project that contains this ProjectField fieldId : str - The unique identifier of this ProjectField + The unique identifier or short ID of this ProjectField body : UpdateProjectFieldValueDto The new information for this ProjectField """ @@ -132,14 +132,20 @@ def retrieve_projectfield_value(self, projectId: str, fieldId: str) -> AstroResu Retrieves the current ProjectField value for a particular Project and ProjectField. + A ProjectField is a custom field defined within your Workspace. + You can define ProjectFields for any integration purpose that is + important to your business. Each ProjectField has a data type as + well as options in how it is handled. ProjectFields can be + edited for each Project within your Workspace. + Parameters ---------- projectId : str The unique identifier of the Project of the value to retrieve fieldId : str - The unique identifier of the ProjectField of the value to - retrieve + The unique identifier or short ID of the ProjectField of the + value to retrieve """ path = f"/api/data/projects/{projectId}/fields/{fieldId}" queryParams = {} @@ -153,6 +159,12 @@ def retrieve_all_projectfield_values(self, projectId: str) -> AstroResult[list[P """ Retrieves all ProjectField values for a particular Project. + A ProjectField is a custom field defined within your Workspace. + You can define ProjectFields for any integration purpose that is + important to your business. Each ProjectField has a data type as + well as options in how it is handled. ProjectFields can be + edited for each Project within your Workspace. + Parameters ---------- projectId : str diff --git a/src/ProjectManagerSdk/clients/projectmembersclient.py b/src/ProjectManagerSdk/clients/projectmembersclient.py index d822605..f5ef6b2 100644 --- a/src/ProjectManagerSdk/clients/projectmembersclient.py +++ b/src/ProjectManagerSdk/clients/projectmembersclient.py @@ -27,7 +27,14 @@ def __init__(self, client: ProjectManagerClient): def retrieve_new_project_members(self) -> AstroResult[list[ProjectMemberDto]]: """ - Returns a list of membership options for new projects. + Returns a list of users that can be added as members of a new + project, as well as their available project security roles. + + A project member is a user who has access to a specific project. + Project members are assigned a project security role, which + controls the level of access they have to the project. Possible + project security roles include manage, edit, collaborate, + creator, and guest. Parameters ---------- @@ -45,8 +52,17 @@ def retrieve_new_project_members(self) -> AstroResult[list[ProjectMemberDto]]: def retrieve_project_members(self, projectId: str, includeAllUsers: bool) -> AstroResult[list[ProjectMemberDto]]: """ - Returns a list of membership options for existing members. - Optionally include users who are not a member yet. + Returns a list of users that are currently members of a + specified project, as well as their current project security + roles and available project security roles. Optionally include + users who are not currently members of the project, but who are + available to be added. + + A project member is a user who has access to a specific project. + Project members are assigned a project security role, which + controls the level of access they have to the project. Possible + project security roles include manage, edit, collaborate, + creator, and guest. Parameters ---------- @@ -70,7 +86,14 @@ def retrieve_project_members(self, projectId: str, includeAllUsers: bool) -> Ast def retrieve_user_project_membership(self, projectId: str, userId: str) -> AstroResult[ProjectMemberDto]: """ - Return the membership of a project for a user. + Returns the project security role in a specified project for a + current project member. + + A project member is a user who has access to a specific project. + Project members are assigned a project security role, which + controls the level of access they have to the project. Possible + project security roles include manage, edit, collaborate, + creator, and guest. Parameters ---------- @@ -89,8 +112,15 @@ def retrieve_user_project_membership(self, projectId: str, userId: str) -> Astro def create_user_project_membership(self, projectId: str, userId: str, body: ProjectMemberRoleDto) -> AstroResult[ProjectMemberDto]: """ - Creates a membership for a user in a project and assigns the - user appropriate permissions + Creates a membership for a user in a specified project, and + assigns the user the appropriate project access based on the + specified project security role. + + A project member is a user who has access to a specific project. + Project members are assigned a project security role, which + controls the level of access they have to the project. Possible + project security roles include manage, edit, collaborate, + creator, and guest. Parameters ---------- @@ -111,7 +141,14 @@ def create_user_project_membership(self, projectId: str, userId: str, body: Proj def update_user_project_membership(self, projectId: str, userId: str, body: ProjectMemberRoleDto) -> AstroResult[ProjectMemberDto]: """ - Update existing Project Access Control for user for project + Updates the project access for a current member of a specified + project by giving the user a new project security role. + + A project member is a user who has access to a specific project. + Project members are assigned a project security role, which + controls the level of access they have to the project. Possible + project security roles include manage, edit, collaborate, + creator, and guest. Parameters ---------- @@ -132,7 +169,14 @@ def update_user_project_membership(self, projectId: str, userId: str, body: Proj def remove_user_project_membership(self, projectId: str, userId: str) -> AstroResult[object]: """ - Deletes Project Member + Removes a current project member from a specified project. This + removes the user's access to that project. + + A project member is a user who has access to a specific project. + Project members are assigned a project security role, which + controls the level of access they have to the project. Possible + project security roles include manage, edit, collaborate, + creator, and guest. Parameters ---------- diff --git a/src/ProjectManagerSdk/clients/taskclient.py b/src/ProjectManagerSdk/clients/taskclient.py index 8c1d262..209e5a8 100644 --- a/src/ProjectManagerSdk/clients/taskclient.py +++ b/src/ProjectManagerSdk/clients/taskclient.py @@ -14,7 +14,6 @@ from ProjectManagerSdk.models.astroresult import AstroResult from ProjectManagerSdk.models.changesetstatusdto import ChangeSetStatusDto from ProjectManagerSdk.models.taskcreatedto import TaskCreateDto -from ProjectManagerSdk.models.taskdetailsdto import TaskDetailsDto from ProjectManagerSdk.models.taskdto import TaskDto from ProjectManagerSdk.models.taskprioritydto import TaskPriorityDto from ProjectManagerSdk.models.taskupdatedto import TaskUpdateDto @@ -78,7 +77,7 @@ def query_tasks(self, top: int, skip: int, filter: str, select: str, orderby: st else: return AstroResult[list[TaskDto]](result.json(), False, True, result.status_code, None) - def retrieve_task(self, taskId: str) -> AstroResult[TaskDetailsDto]: + def retrieve_task(self, taskId: str) -> AstroResult[TaskDto]: """ Retrieve a Task by its unique identifier or by its short ID. A Task has both a unique identifier, which is a GUID, and a short @@ -99,9 +98,9 @@ def retrieve_task(self, taskId: str) -> AstroResult[TaskDetailsDto]: queryParams = {} result = self.client.send_request("GET", path, None, queryParams, None) if result.status_code >= 200 and result.status_code < 300: - return AstroResult[TaskDetailsDto](None, True, False, result.status_code, TaskDetailsDto(**json.loads(result.content)['data'])) + return AstroResult[TaskDto](None, True, False, result.status_code, TaskDto(**json.loads(result.content)['data'])) else: - return AstroResult[TaskDetailsDto](result.json(), False, True, result.status_code, None) + return AstroResult[TaskDto](result.json(), False, True, result.status_code, None) def update_task(self, taskId: str, body: TaskUpdateDto) -> AstroResult[ChangeSetStatusDto]: """ diff --git a/src/ProjectManagerSdk/clients/taskfieldclient.py b/src/ProjectManagerSdk/clients/taskfieldclient.py index fb60ed5..69d36e5 100644 --- a/src/ProjectManagerSdk/clients/taskfieldclient.py +++ b/src/ProjectManagerSdk/clients/taskfieldclient.py @@ -13,9 +13,9 @@ from ProjectManagerSdk.models.astroresult import AstroResult from ProjectManagerSdk.models.changesetstatusdto import ChangeSetStatusDto -from ProjectManagerSdk.models.createtaskfieldrequestdto import CreateTaskFieldRequestDto -from ProjectManagerSdk.models.gettaskfieldsresponsedto import GetTaskFieldsResponseDto -from ProjectManagerSdk.models.taskfieldsvalueresponsedto import TaskFieldsValueResponseDto +from ProjectManagerSdk.models.createtaskfielddto import CreateTaskFieldDto +from ProjectManagerSdk.models.taskfielddto import TaskFieldDto +from ProjectManagerSdk.models.taskfieldvaluedto import TaskFieldValueDto from ProjectManagerSdk.models.updatetaskfieldvaluedto import UpdateTaskFieldValueDto import json @@ -28,7 +28,7 @@ class TaskFieldClient: def __init__(self, client: ProjectManagerClient): self.client = client - def retrieve_task_fields(self, projectId: str) -> AstroResult[list[GetTaskFieldsResponseDto]]: + def retrieve_task_fields(self, projectId: str) -> AstroResult[list[TaskFieldDto]]: """ Retrieves all TaskFields defined for a specific Project within your Workspace. @@ -51,14 +51,14 @@ def retrieve_task_fields(self, projectId: str) -> AstroResult[list[GetTaskFields if result.status_code >= 200 and result.status_code < 300: data = [] for dict in json.loads(result.content)['data']: - data.append(GetTaskFieldsResponseDto(**dict)) - return AstroResult[list[GetTaskFieldsResponseDto]](None, True, False, result.status_code, data) + data.append(TaskFieldDto(**dict)) + return AstroResult[list[TaskFieldDto]](None, True, False, result.status_code, data) else: - return AstroResult[list[GetTaskFieldsResponseDto]](result.json(), False, True, result.status_code, None) + return AstroResult[list[TaskFieldDto]](result.json(), False, True, result.status_code, None) - def create_task_field(self, projectId: str, body: CreateTaskFieldRequestDto) -> AstroResult[ChangeSetStatusDto]: + def create_task_field(self, projectId: str, body: CreateTaskFieldDto) -> AstroResult[ChangeSetStatusDto]: """ - Creates a new TaskFields for a specific Project within your + Creates a new TaskField for a specific Project within your Workspace. A TaskField is a custom field defined within your Workspace for @@ -73,7 +73,7 @@ def create_task_field(self, projectId: str, body: CreateTaskFieldRequestDto) -> projectId : str The unique identifier of the Project within which to create this TaskField - body : CreateTaskFieldRequestDto + body : CreateTaskFieldDto Information about the TaskField to create """ path = f"/api/data/projects/{projectId}/tasks/fields" @@ -84,6 +84,57 @@ def create_task_field(self, projectId: str, body: CreateTaskFieldRequestDto) -> else: return AstroResult[ChangeSetStatusDto](result.json(), False, True, result.status_code, None) + def query_task_fields(self, top: int, skip: int, filter: str, select: str, orderby: str, expand: str) -> AstroResult[list[TaskFieldDto]]: + """ + Retrieve a list of TaskFields that match an [OData formatted + query](https://www.odata.org/). + + A TaskField is a custom field defined within your Workspace for + a specific Project. You can define TaskFields for any + integration purpose that is important to your business. Each + TaskField has a data type as well as options in how it is + handled. TaskFields can be edited for each Task inside a + Project. + + Parameters + ---------- + $top : int + The number of records to return + $skip : int + Skips the given number of records and then returns $top + records + $filter : str + Filter the expression according to oData queries + $select : str + Specify which properties should be returned + $orderby : str + Order collection by this field. + $expand : str + Include related data in the response + """ + path = "/api/data/projects/tasks/fields" + queryParams = {} + if top: + queryParams['$top'] = top + if skip: + queryParams['$skip'] = skip + if filter: + queryParams['$filter'] = filter + if select: + queryParams['$select'] = select + if orderby: + queryParams['$orderby'] = orderby + if expand: + queryParams['$expand'] = expand + result = self.client.send_request("GET", path, None, queryParams, None) + if result.status_code >= 200 and result.status_code < 300: + data = [] + for dict in json.loads(result.content)['data']: + data.append(TaskFieldDto(**dict)) + return AstroResult[list[TaskFieldDto]](None, True, False, result.status_code, data) + else: + return AstroResult[list[TaskFieldDto]](result.json(), False, True, result.status_code, None) + def delete_task_field(self, projectId: str, fieldId: str) -> AstroResult[object]: """ Deletes a TaskField for a specific Project within your @@ -112,10 +163,9 @@ def delete_task_field(self, projectId: str, fieldId: str) -> AstroResult[object] else: return AstroResult[object](result.json(), False, True, result.status_code, None) - def retrieve_taskfield_value(self, taskId: str, fieldId: str) -> AstroResult[TaskFieldsValueResponseDto]: + def retrieve_all_taskfield_values(self, taskId: str) -> AstroResult[list[TaskFieldValueDto]]: """ - Retrieves the current TaskField value for a particular Task and - TaskField. + Retrieves all TaskField values for a particular Task. A TaskField is a custom field defined within your Workspace for a specific Project. You can define TaskFields for any @@ -127,23 +177,75 @@ def retrieve_taskfield_value(self, taskId: str, fieldId: str) -> AstroResult[Tas Parameters ---------- taskId : str - The unique identifier of the Task of the value to retrieve - fieldId : str - The unique identifier of the TaskField of the value to - retrieve + The unique identifier of the Task for which we want + TaskField values """ - path = f"/api/data/tasks/{taskId}/fields/{fieldId}" + path = f"/api/data/tasks/{taskId}/fields/values" queryParams = {} result = self.client.send_request("GET", path, None, queryParams, None) if result.status_code >= 200 and result.status_code < 300: - return AstroResult[TaskFieldsValueResponseDto](None, True, False, result.status_code, TaskFieldsValueResponseDto(**json.loads(result.content)['data'])) + data = [] + for dict in json.loads(result.content)['data']: + data.append(TaskFieldValueDto(**dict)) + return AstroResult[list[TaskFieldValueDto]](None, True, False, result.status_code, data) else: - return AstroResult[TaskFieldsValueResponseDto](result.json(), False, True, result.status_code, None) + return AstroResult[list[TaskFieldValueDto]](result.json(), False, True, result.status_code, None) - def update_taskfield_value(self, taskId: str, fieldId: str, body: UpdateTaskFieldValueDto) -> AstroResult[ChangeSetStatusDto]: + def query_task_field_values(self, top: int, skip: int, filter: str, select: str, orderby: str, expand: str) -> AstroResult[list[TaskFieldValueDto]]: """ - Replaces the current value of a TaskFields for a specific Task - within your Workspace. + Retrieve a list of TaskFieldValues that match an [OData + formatted query](https://www.odata.org/). + + A TaskField is a custom field defined within your Workspace for + a specific Project. You can define TaskFields for any + integration purpose that is important to your business. Each + TaskField has a data type as well as options in how it is + handled. TaskFields can be edited for each Task inside this + Project. + + Parameters + ---------- + $top : int + The number of records to return + $skip : int + Skips the given number of records and then returns $top + records + $filter : str + Filter the expression according to oData queries + $select : str + Specify which properties should be returned + $orderby : str + Order collection by this field. + $expand : str + Include related data in the response + """ + path = "/api/data/tasks/fields/values" + queryParams = {} + if top: + queryParams['$top'] = top + if skip: + queryParams['$skip'] = skip + if filter: + queryParams['$filter'] = filter + if select: + queryParams['$select'] = select + if orderby: + queryParams['$orderby'] = orderby + if expand: + queryParams['$expand'] = expand + result = self.client.send_request("GET", path, None, queryParams, None) + if result.status_code >= 200 and result.status_code < 300: + data = [] + for dict in json.loads(result.content)['data']: + data.append(TaskFieldValueDto(**dict)) + return AstroResult[list[TaskFieldValueDto]](None, True, False, result.status_code, data) + else: + return AstroResult[list[TaskFieldValueDto]](result.json(), False, True, result.status_code, None) + + def retrieve_task_field_value(self, taskId: str, fieldId: str) -> AstroResult[TaskFieldValueDto]: + """ + Retrieves the current TaskField value for a particular Task and + TaskField. A TaskField is a custom field defined within your Workspace for a specific Project. You can define TaskFields for any @@ -155,25 +257,23 @@ def update_taskfield_value(self, taskId: str, fieldId: str, body: UpdateTaskFiel Parameters ---------- taskId : str - The unique identifier of the Task whose value you wish to - update + The unique identifier of the Task of the value to retrieve fieldId : str - The unique identifier of the TaskField whose value you wish - to update - body : UpdateTaskFieldValueDto - The new value for this TaskField for this Task + The unique identifier of the TaskField of the value to + retrieve """ - path = f"/api/data/tasks/{taskId}/fields/{fieldId}" + path = f"/api/data/tasks/{taskId}/fields/{fieldId}/values" queryParams = {} - result = self.client.send_request("PUT", path, body, queryParams, None) + result = self.client.send_request("GET", path, None, queryParams, None) if result.status_code >= 200 and result.status_code < 300: - return AstroResult[ChangeSetStatusDto](None, True, False, result.status_code, ChangeSetStatusDto(**json.loads(result.content)['data'])) + return AstroResult[TaskFieldValueDto](None, True, False, result.status_code, TaskFieldValueDto(**json.loads(result.content)['data'])) else: - return AstroResult[ChangeSetStatusDto](result.json(), False, True, result.status_code, None) + return AstroResult[TaskFieldValueDto](result.json(), False, True, result.status_code, None) - def retrieve_all_taskfield_values(self, taskId: str) -> AstroResult[list[TaskFieldsValueResponseDto]]: + def update_task_field_value(self, taskId: str, fieldId: str, body: UpdateTaskFieldValueDto) -> AstroResult[ChangeSetStatusDto]: """ - Retrieves all TaskField values for a particular Task. + Replaces the current value of a TaskField for a specific Task + within your Workspace. A TaskField is a custom field defined within your Workspace for a specific Project. You can define TaskFields for any @@ -185,16 +285,18 @@ def retrieve_all_taskfield_values(self, taskId: str) -> AstroResult[list[TaskFie Parameters ---------- taskId : str - The unique identifier of the Task for which we want - TaskField values + The unique identifier of the Task whose value you wish to + update + fieldId : str + The unique identifier of the TaskField whose value you wish + to update + body : UpdateTaskFieldValueDto + The new value for this TaskField for this Task """ - path = f"/api/data/tasks/{taskId}/fields" + path = f"/api/data/tasks/{taskId}/fields/{fieldId}/values" queryParams = {} - result = self.client.send_request("GET", path, None, queryParams, None) + result = self.client.send_request("PUT", path, body, queryParams, None) if result.status_code >= 200 and result.status_code < 300: - data = [] - for dict in json.loads(result.content)['data']: - data.append(TaskFieldsValueResponseDto(**dict)) - return AstroResult[list[TaskFieldsValueResponseDto]](None, True, False, result.status_code, data) + return AstroResult[ChangeSetStatusDto](None, True, False, result.status_code, ChangeSetStatusDto(**json.loads(result.content)['data'])) else: - return AstroResult[list[TaskFieldsValueResponseDto]](result.json(), False, True, result.status_code, None) + return AstroResult[ChangeSetStatusDto](result.json(), False, True, result.status_code, None) diff --git a/src/ProjectManagerSdk/models/connectionschemadto.py b/src/ProjectManagerSdk/models/connectionschemadto.py index 2463bcb..c84211b 100644 --- a/src/ProjectManagerSdk/models/connectionschemadto.py +++ b/src/ProjectManagerSdk/models/connectionschemadto.py @@ -21,6 +21,11 @@ class ConnectionSchemaDto: with the Integration Provider. """ + connected: bool | None = None + """ + Whether or not the Integration Provider is connected. + """ + url: str | None = None """ The URL to use to authenticate with the Integration Provider. diff --git a/src/ProjectManagerSdk/models/gettaskfieldsresponsedto.py b/src/ProjectManagerSdk/models/createtaskfielddto.py similarity index 79% rename from src/ProjectManagerSdk/models/gettaskfieldsresponsedto.py rename to src/ProjectManagerSdk/models/createtaskfielddto.py index f0a9726..029679b 100644 --- a/src/ProjectManagerSdk/models/gettaskfieldsresponsedto.py +++ b/src/ProjectManagerSdk/models/createtaskfielddto.py @@ -15,7 +15,7 @@ from dataclasses import dataclass @dataclass -class GetTaskFieldsResponseDto: +class CreateTaskFieldDto: """ A TaskField is a custom field defined within your Workspace for a specific Project. You can define TaskFields for any integration @@ -24,23 +24,15 @@ class GetTaskFieldsResponseDto: edited for each Task inside this Project. """ - id: str | None = None - """ - The unique identifier of this TaskField - """ - name: str | None = None """ - The name of this TaskField + The name of the TaskField """ type: str | None = None """ The type of this TaskField. Valid types are the following: * Text * - Number * Date * Checkbox * Currency * Dropdown Attempting to create - a field with any Type other than these will return an error. For - Dropdown TaskFields, specify the list of choices in the `Options` - field. + Number * Date * Checkbox * Currency * DropdownSingle * DropdownMulti """ options: list[str] | None = None @@ -51,6 +43,11 @@ class GetTaskFieldsResponseDto: able to choose one of the `Options` in this list. """ + shortId: str | None = None + """ + The short Id of this field - human readable identity + """ + def to_dict(self) -> dict: return dataclass.asdict(self) diff --git a/src/ProjectManagerSdk/models/getprojectfieldsresponsedto.py b/src/ProjectManagerSdk/models/getprojectfieldsresponsedto.py index ef2c2c9..38791a6 100644 --- a/src/ProjectManagerSdk/models/getprojectfieldsresponsedto.py +++ b/src/ProjectManagerSdk/models/getprojectfieldsresponsedto.py @@ -61,6 +61,11 @@ class GetProjectFieldsResponseDto: to choose one of the `Options` in this list. """ + shortId: str | None = None + """ + The short Id of this field - human readable identity + """ + def to_dict(self) -> dict: return dataclass.asdict(self) diff --git a/src/ProjectManagerSdk/models/integrationconnectionschemeobjectdto.py b/src/ProjectManagerSdk/models/integrationconnectionschemeobjectdto.py new file mode 100644 index 0000000..ce8e9bf --- /dev/null +++ b/src/ProjectManagerSdk/models/integrationconnectionschemeobjectdto.py @@ -0,0 +1,40 @@ +# +# ProjectManager API for Python +# +# (c) 2023-2023 ProjectManager.com, Inc. +# +# For the full copyright and license information, please view the LICENSE +# file that was distributed with this source code. +# +# @author ProjectManager.com +# @copyright 2023-2023 ProjectManager.com, Inc. +# @link https://github.com/projectmgr/projectmanager-sdk-python +# + + +from dataclasses import dataclass + +@dataclass +class IntegrationConnectionSchemeObjectDto: + """ + Master Connection Scheme for Providers + """ + + value: str | None = None + """ + The value of the property + """ + + type: str | None = None + """ + The type of the property + """ + + sendToClient: bool | None = None + """ + Send to the client true/false + """ + + + def to_dict(self) -> dict: + return dataclass.asdict(self) diff --git a/src/ProjectManagerSdk/models/integrationdto.py b/src/ProjectManagerSdk/models/integrationdto.py index 1e1027b..206f983 100644 --- a/src/ProjectManagerSdk/models/integrationdto.py +++ b/src/ProjectManagerSdk/models/integrationdto.py @@ -76,6 +76,11 @@ class IntegrationDto: True if the user has authenticated """ + autoEnabled: bool | None = None + """ + True if the integration is auto-enabled + """ + def to_dict(self) -> dict: return dataclass.asdict(self) diff --git a/src/ProjectManagerSdk/models/integrationproviderdto.py b/src/ProjectManagerSdk/models/integrationproviderdto.py index ab5a317..2ee8e91 100644 --- a/src/ProjectManagerSdk/models/integrationproviderdto.py +++ b/src/ProjectManagerSdk/models/integrationproviderdto.py @@ -79,6 +79,11 @@ class IntegrationProviderDto: The list of available AuthSetup for this Provider. """ + createInWorkato: bool | None = None + """ + Flag whether user/workspace needs to be setup in Workato + """ + def to_dict(self) -> dict: return dataclass.asdict(self) diff --git a/src/ProjectManagerSdk/models/masterconnectionschemedto.py b/src/ProjectManagerSdk/models/masterconnectionschemedto.py new file mode 100644 index 0000000..442a4d6 --- /dev/null +++ b/src/ProjectManagerSdk/models/masterconnectionschemedto.py @@ -0,0 +1,40 @@ +# +# ProjectManager API for Python +# +# (c) 2023-2023 ProjectManager.com, Inc. +# +# For the full copyright and license information, please view the LICENSE +# file that was distributed with this source code. +# +# @author ProjectManager.com +# @copyright 2023-2023 ProjectManager.com, Inc. +# @link https://github.com/projectmgr/projectmanager-sdk-python +# + + +from dataclasses import dataclass + +@dataclass +class MasterConnectionSchemeDto: + """ + Master Connection Scheme for Providers + """ + + value: str | None = None + """ + The value of the property + """ + + type: str | None = None + """ + The type of the property + """ + + sendToClient: bool | None = None + """ + Send to the client true/false + """ + + + def to_dict(self) -> dict: + return dataclass.asdict(self) diff --git a/src/ProjectManagerSdk/models/projectfieldsvalueresponsedto.py b/src/ProjectManagerSdk/models/projectfieldsvalueresponsedto.py index e4753be..eca8ccb 100644 --- a/src/ProjectManagerSdk/models/projectfieldsvalueresponsedto.py +++ b/src/ProjectManagerSdk/models/projectfieldsvalueresponsedto.py @@ -17,8 +17,8 @@ @dataclass class ProjectFieldsValueResponseDto: """ - A Project Field is a custom field defined within your Workspace for - each Project. Each Project Field has a data type as well as options + A ProjectField is a custom field defined within your Workspace for + each Project. Each ProjectField has a data type as well as options in how it is handled. """ @@ -43,6 +43,21 @@ class ProjectFieldsValueResponseDto: Text * Number * Date * Checkbox * Currency * Dropdown """ + shortId: str | None = None + """ + The short Id of this field - human readable identity + """ + + createdDate: str | None = None + """ + Date and time (in UTC) that this TaskField was created. + """ + + modifiedDate: str | None = None + """ + Date and time (in UTC) that this TaskField was last modified. + """ + def to_dict(self) -> dict: return dataclass.asdict(self) diff --git a/src/ProjectManagerSdk/models/taskdetailsdto.py b/src/ProjectManagerSdk/models/taskdetailsdto.py deleted file mode 100644 index 0c9124c..0000000 --- a/src/ProjectManagerSdk/models/taskdetailsdto.py +++ /dev/null @@ -1,160 +0,0 @@ -# -# ProjectManager API for Python -# -# (c) 2023-2023 ProjectManager.com, Inc. -# -# For the full copyright and license information, please view the LICENSE -# file that was distributed with this source code. -# -# @author ProjectManager.com -# @copyright 2023-2023 ProjectManager.com, Inc. -# @link https://github.com/projectmgr/projectmanager-sdk-python -# - - -from ProjectManagerSdk.models.taskassigneedto import TaskAssigneeDto -from ProjectManagerSdk.models.taskprojectdto import TaskProjectDto -from ProjectManagerSdk.models.taskstatusdto import TaskStatusDto -from ProjectManagerSdk.models.tasktagdto import TaskTagDto -from ProjectManagerSdk.models.tasktododto import TaskTodoDto -from dataclasses import dataclass - -@dataclass -class TaskDetailsDto: - """ - A Task is an individual element of work that must be performed to - complete a Project. A Task can have one or more Resources assigned - to it. Tasks can be linked to other Tasks to indicate whether they - have a dependency or a connection. - """ - - id: str | None = None - """ - The unique identifier of this Task. - """ - - project: TaskProjectDto | None = None - """ - The Project to which this Task belongs. - """ - - tags: list[TaskTagDto] | None = None - """ - The TaskTags that apply to this Task. - """ - - assignees: list[TaskAssigneeDto] | None = None - """ - The list of assignees who are to work on this Task, if any. - """ - - todos: list[TaskTodoDto] | None = None - """ - A list of TaskTodo items, which are sub-tasks within this Task. - """ - - shortId: str | None = None - """ - A short ID that can be used to refer to this Task. This short ID is - guaranteed to be unique within your Workspace. - """ - - name: str | None = None - """ - The common name of this Task. - """ - - description: str | None = None - """ - A description of the work to be performed in this Task. - """ - - status: TaskStatusDto | None = None - """ - The TaskStatus assigned to this Task. - """ - - priorityId: int | None = None - """ - The unique identifier of the TaskPriority - """ - - plannedStartDate: str | None = None - """ - The date when work on this Task is planned to begin. - """ - - plannedFinishDate: str | None = None - """ - The date when work on this Task is expected to complete. - """ - - actualStartDate: str | None = None - """ - If set, this is the actual date when work began on the Task. - """ - - actualFinishDate: str | None = None - """ - If set, this is the actual date when work was completed on this - Task. - """ - - modifyDate: str | None = None - """ - The timestamp in UTC when this Task was most recently modified. - """ - - createDate: str | None = None - """ - The timestamp in UTC when this Task was created. - """ - - percentComplete: int | None = None - """ - The numerical percentage, from 0-100, representing the percentage - completion for this Task. Any numbers below zero or above 100 will - be clamped to the minimum or maximum value. This value can be edited - manually in the Gantt chart view of the application, or can be - selected on the Task Detail page within the Kanban board. - """ - - isSummary: bool | None = None - """ - True if this Task is the parent of multiple Tasks underneath it. A - parent Task is a "rolled-up" view of multiple children that allows - you to view a section of work at a glance. You can create a summary - Task in the Gantt chart view of the application by adding child - tasks underneath a parent Task. - """ - - wbs: str | None = None - """ - The WBS (Work Breakdown Structure) number for this task within the - Gantt chart hierarchy. See [What Is a Work Breakdown Structure - (WBS)?](https://www.projectmanager.com/guides/work-breakdown-structure) - on Project Manager for more information. The WBS number is an - outline number in the form `#.#.#.#` which indicates how tasks are - organized and sorted. The WBS value is only available to users at - certain edition levels. This value can only be changed if you are a - Project Editor. - """ - - actualCost: float | None = None - """ - The actual cost of this Task to date, if known. - """ - - plannedCost: float | None = None - """ - The planned cost for this Task. Cannot be negative. - """ - - fields: object | None = None - """ - Task fields array with values - """ - - - def to_dict(self) -> dict: - return dataclass.asdict(self) diff --git a/src/ProjectManagerSdk/models/taskdto.py b/src/ProjectManagerSdk/models/taskdto.py index e102c82..bd8064d 100644 --- a/src/ProjectManagerSdk/models/taskdto.py +++ b/src/ProjectManagerSdk/models/taskdto.py @@ -13,7 +13,7 @@ from ProjectManagerSdk.models.taskassigneedto import TaskAssigneeDto -from ProjectManagerSdk.models.taskfielddto import TaskFieldDto +from ProjectManagerSdk.models.taskfieldvaluedto import TaskFieldValueDto from ProjectManagerSdk.models.taskprojectdto import TaskProjectDto from ProjectManagerSdk.models.taskstatusdto import TaskStatusDto from ProjectManagerSdk.models.tasktagdto import TaskTagDto @@ -202,7 +202,7 @@ class TaskDto: The planned effort (in minutes) for this Task. """ - fields: list[TaskFieldDto] | None = None + fields: list[TaskFieldValueDto] | None = None """ Task fields array with values """ diff --git a/src/ProjectManagerSdk/models/taskfielddto.py b/src/ProjectManagerSdk/models/taskfielddto.py index 60a4517..34df1df 100644 --- a/src/ProjectManagerSdk/models/taskfielddto.py +++ b/src/ProjectManagerSdk/models/taskfielddto.py @@ -12,22 +12,64 @@ # +from ProjectManagerSdk.models.taskfieldprojectdto import TaskFieldProjectDto from dataclasses import dataclass @dataclass class TaskFieldDto: """ - A model that contains the value for a TaskField. + A TaskField is a custom field defined within your Workspace for a + specific Project. You can define TaskFields for any integration + purpose that is important to your business. Each TaskField has a + data type as well as options in how it is handled. TaskFields can be + edited for each Task inside this Project. + """ + + id: str | None = None + """ + The unique identifier of this TaskField + """ + + name: str | None = None + """ + The name of this TaskField + """ + + type: str | None = None + """ + The type of this TaskField. Valid types are the following: * Text * + Number * Date * Checkbox * Currency * Dropdown Attempting to create + a field with any Type other than these will return an error. For + Dropdown TaskFields, specify the list of choices in the `Options` + field. + """ + + options: list[str] | None = None + """ + A list of options for use of this TaskField. This is only valid if + the `Type` value is set to `Dropdown`. When a custom TaskField of + type `DropDown` is shown to a user in the application, they will be + able to choose one of the `Options` in this list. """ shortId: str | None = None """ - The unique Short Id of this TaskField. + The short Id of this TaskField - human readable identity + """ + + project: TaskFieldProjectDto | None = None + """ + The Project to which this TaskField belongs. + """ + + createdDate: str | None = None + """ + Date and time (in UTC) that this TaskField was created. """ - value: str | None = None + modifiedDate: str | None = None """ - The value currently set for this TaskField for this Task. + Date and time (in UTC) that this TaskField was last modified. """ diff --git a/src/ProjectManagerSdk/models/deleteprojectfielddto.py b/src/ProjectManagerSdk/models/taskfieldprojectdto.py similarity index 57% rename from src/ProjectManagerSdk/models/deleteprojectfielddto.py rename to src/ProjectManagerSdk/models/taskfieldprojectdto.py index f52bf31..d7e1038 100644 --- a/src/ProjectManagerSdk/models/deleteprojectfielddto.py +++ b/src/ProjectManagerSdk/models/taskfieldprojectdto.py @@ -15,23 +15,25 @@ from dataclasses import dataclass @dataclass -class DeleteProjectFieldDto: +class TaskFieldProjectDto: """ - A ProjectField is a custom field defined within your Workspace. You - can define ProjectFields for any integration purpose that is - important to your business. Each ProjectField has a data type as - well as options in how it is handled. ProjectFields can be edited - for each Project within your Workspace. + The TaskFieldProject is a summary of the Project that this TaskField + relates to. """ id: str | None = None """ - The unique identifier of the ProjectField being deleted + The unique identifier of this Project. + """ + + shortId: str | None = None + """ + The ShortId of this Project. """ name: str | None = None """ - The name of the ProjectField being deleted + The common name of this Project. """ diff --git a/src/ProjectManagerSdk/models/taskfieldsvalueresponsedto.py b/src/ProjectManagerSdk/models/taskfieldvaluedto.py similarity index 52% rename from src/ProjectManagerSdk/models/taskfieldsvalueresponsedto.py rename to src/ProjectManagerSdk/models/taskfieldvaluedto.py index 1e68eb1..fa4570f 100644 --- a/src/ProjectManagerSdk/models/taskfieldsvalueresponsedto.py +++ b/src/ProjectManagerSdk/models/taskfieldvaluedto.py @@ -12,16 +12,13 @@ # +from ProjectManagerSdk.models.taskfieldvaluetaskdto import TaskFieldValueTaskDto from dataclasses import dataclass @dataclass -class TaskFieldsValueResponseDto: +class TaskFieldValueDto: """ - A TaskField is a custom field defined within your Workspace for a - specific Project. You can define TaskFields for any integration - purpose that is important to your business. Each TaskField has a - data type as well as options in how it is handled. TaskFields can be - edited for each Task inside this Project. + A model that contains the value for a TaskField. """ id: str | None = None @@ -29,20 +26,29 @@ class TaskFieldsValueResponseDto: The unique identifier of this TaskField. """ + shortId: str | None = None + """ + The unique Short Id of this TaskField. + """ + value: str | None = None """ - The value currently set for this TaskField for this Task. + The value currently set for this TaskFieldValue. + """ + + createdDate: str | None = None + """ + Date and time (in UTC) that this TaskField was created. """ - name: str | None = None + modifiedDate: str | None = None """ - The name of this TaskField. + Date and time (in UTC) that this TaskField was last modified. """ - type: str | None = None + task: TaskFieldValueTaskDto | None = None """ - The type of this TaskField. Valid types are the following: * Text * - Number * Date * Checkbox * Currency * Dropdown + The Task to which this Value belongs. """ diff --git a/src/ProjectManagerSdk/models/createtaskfieldrequestdto.py b/src/ProjectManagerSdk/models/taskfieldvaluetaskdto.py similarity index 51% rename from src/ProjectManagerSdk/models/createtaskfieldrequestdto.py rename to src/ProjectManagerSdk/models/taskfieldvaluetaskdto.py index ac50b54..354c02c 100644 --- a/src/ProjectManagerSdk/models/createtaskfieldrequestdto.py +++ b/src/ProjectManagerSdk/models/taskfieldvaluetaskdto.py @@ -15,29 +15,25 @@ from dataclasses import dataclass @dataclass -class CreateTaskFieldRequestDto: +class TaskFieldValueTaskDto: """ - A TaskField is a custom field defined within your Workspace for a - specific Project. You can define TaskFields for any integration - purpose that is important to your business. Each TaskField has a - data type as well as options in how it is handled. TaskFields can be - edited for each Task inside this Project. + The TaskFieldTask is a summary of the Task that this TaskFieldValue + relates to. """ - name: str | None = None + id: str | None = None """ - The name of the TaskField + The unique identifier of this Task. """ - type: str | None = None + shortId: str | None = None """ - The type of this TaskField. Valid types are the following: * Text * - Number * Date * Checkbox * Currency * Dropdown + The unique Short Id of this Task. """ - shortId: str | None = None + name: str | None = None """ - The short Id of this field - human readable identity + The common name of this Task. """ diff --git a/src/ProjectManagerSdk/models/timesheetdto.py b/src/ProjectManagerSdk/models/timesheetdto.py index 52ec8d8..751c798 100644 --- a/src/ProjectManagerSdk/models/timesheetdto.py +++ b/src/ProjectManagerSdk/models/timesheetdto.py @@ -12,6 +12,7 @@ # +from ProjectManagerSdk.models.timesheetadmintypedto import TimesheetAdminTypeDto from ProjectManagerSdk.models.timesheetprojectdto import TimeSheetProjectDto from ProjectManagerSdk.models.timesheetresourcedto import TimesheetResourceDto from ProjectManagerSdk.models.timesheettaskdto import TimesheetTaskDto @@ -68,6 +69,11 @@ class TimesheetDto: The resource associated with this timesheet entry """ + adminType: TimesheetAdminTypeDto | None = None + """ + The administration type associated with this timesheet entry + """ + def to_dict(self) -> dict: return dataclass.asdict(self) diff --git a/src/ProjectManagerSdk/models/workspacelinksdto.py b/src/ProjectManagerSdk/models/workspacelinksdto.py index 0989a17..f87ae91 100644 --- a/src/ProjectManagerSdk/models/workspacelinksdto.py +++ b/src/ProjectManagerSdk/models/workspacelinksdto.py @@ -17,18 +17,18 @@ @dataclass class WorkSpaceLinksDto: """ - TODO - What is this? + A shortcut link within the currently logged in Workspace. """ project: str | None = None """ - TODO - What is this? + The name of the project for this link. """ workSpaceApi: str | None = None """ - This is the link to the api for this business, some legacy endpoints - may need this. + This is the link to the api for this business. Some endpoints may + need this value. """ diff --git a/src/ProjectManagerSdk/models/workspaceuserinfodto.py b/src/ProjectManagerSdk/models/workspaceuserinfodto.py index 52dff6c..37cb0cb 100644 --- a/src/ProjectManagerSdk/models/workspaceuserinfodto.py +++ b/src/ProjectManagerSdk/models/workspaceuserinfodto.py @@ -18,32 +18,52 @@ @dataclass class WorkSpaceUserInfoDto: """ - TODO - What is this? + Information about a currently logged in user. You can call the + RetrieveMe API to gather information about the current user. """ links: WorkSpaceLinksDto | None = None """ - TODO - What is this? + A collection of shortcut links for the currently logged in + Workspace. """ emailAddress: str | None = None """ - TODO - What is this? + The email address of the currently logged in user. """ id: str | None = None """ - TODO - What is this? + The unique identity of the currently logged in user. """ fullName: str | None = None """ - TODO - What is this? + The full name of the currently logged in user. """ workSpaceName: str | None = None """ - TODO - What is this? + The name of the Workspace that the current user has logged onto. For + most companies, the workspace name will be the name of the business. + """ + + roleName: str | None = None + """ + The user's role within the current Workspace. + """ + + isGlobalAdmin: bool | None = None + """ + True if this user is considered a global administrator of the + current Workspace. + """ + + isAccountAdministrator: bool | None = None + """ + True if this user is considered an account administrator of the + current Workspace. """ diff --git a/src/ProjectManagerSdk/projectmanagerclient.py b/src/ProjectManagerSdk/projectmanagerclient.py index 3b42c29..b06ad72 100644 --- a/src/ProjectManagerSdk/projectmanagerclient.py +++ b/src/ProjectManagerSdk/projectmanagerclient.py @@ -9,7 +9,7 @@ # @author ProjectManager.com # # @copyright 2023-2023 ProjectManager.com, Inc. -# @version 98.0.2363 +# @version 99.0.2541 # @link https://github.com/projectmgr/projectmanager-sdk-python # @@ -113,7 +113,7 @@ def __init__(self, env: str, appname: str): if env == "production": self.serverUrl = "https://api.projectmanager.com" self.sdkName = "Python" - self.sdkVersion = "98.0.2363" + self.sdkVersion = "99.0.2541" self.machineName = platform.uname().node self.applicationName = appname self.bearerToken = None