From a499f5c9b9e8d3a35f216150debc59d9e0e8ff7d Mon Sep 17 00:00:00 2001 From: Surya Prashanth Date: Thu, 28 Aug 2025 23:28:52 +0530 Subject: [PATCH] feat!: upgrade sdk to use pydantic v2 BREAKING CHANGE: requires upgrading pydantic and python version --- .gitlab-ci.yml | 12 +- .travis.yml | 6 +- README.md | 6 +- docs/AssetsApi.md | 30 +- docs/Cycle.md | 3 +- docs/CycleCreateRequest.md | 3 +- docs/CycleIssue.md | 3 +- docs/CycleIssueRequestRequest.md | 3 +- docs/CycleLite.md | 3 +- docs/CyclesApi.md | 65 +- docs/GenericAssetUploadRequest.md | 3 +- docs/GetWorkspaceMembers200ResponseInner.md | 3 +- docs/IntakeApi.md | 25 +- docs/IntakeIssue.md | 3 +- docs/IntakeIssueCreateRequest.md | 3 +- docs/Issue.md | 3 +- docs/IssueActivity.md | 5 +- docs/IssueAttachment.md | 3 +- docs/IssueAttachmentUploadRequest.md | 3 +- docs/IssueComment.md | 3 +- docs/IssueCommentCreateRequest.md | 3 +- docs/IssueDetail.md | 3 +- docs/IssueExpand.md | 3 +- docs/IssueForIntakeRequest.md | 3 +- docs/IssueLink.md | 3 +- docs/IssueLinkCreateRequest.md | 3 +- docs/IssuePropertyAPI.md | 3 +- docs/IssuePropertyAPIRequest.md | 3 +- docs/IssuePropertyOptionAPI.md | 3 +- docs/IssuePropertyOptionAPIRequest.md | 3 +- docs/IssuePropertyValueAPI.md | 3 +- docs/IssuePropertyValueAPIDetail.md | 3 +- docs/IssuePropertyValueAPIRequest.md | 3 +- docs/IssueRequest.md | 3 +- docs/IssueSearch.md | 3 +- docs/IssueSearchItem.md | 3 +- docs/IssueTypeAPI.md | 3 +- docs/IssueTypeAPIRequest.md | 3 +- docs/IssueWorkLogAPI.md | 3 +- docs/IssueWorkLogAPIRequest.md | 3 +- docs/Label.md | 3 +- docs/LabelCreateUpdateRequest.md | 3 +- docs/LabelsApi.md | 25 +- docs/MembersApi.md | 10 +- docs/Module.md | 3 +- docs/ModuleCreateRequest.md | 3 +- docs/ModuleIssue.md | 3 +- docs/ModuleIssueRequestRequest.md | 3 +- docs/ModuleLite.md | 3 +- docs/ModulesApi.md | 55 +- docs/PaginatedArchivedCycleResponse.md | 3 +- docs/PaginatedArchivedModuleResponse.md | 3 +- docs/PaginatedCycleIssueResponse.md | 3 +- docs/PaginatedCycleResponse.md | 3 +- docs/PaginatedIntakeIssueResponse.md | 3 +- docs/PaginatedIssueActivityDetailResponse.md | 3 +- docs/PaginatedIssueActivityResponse.md | 3 +- docs/PaginatedIssueCommentResponse.md | 3 +- docs/PaginatedIssueLinkDetailResponse.md | 3 +- docs/PaginatedIssueLinkResponse.md | 3 +- docs/PaginatedLabelResponse.md | 3 +- docs/PaginatedModuleIssueResponse.md | 3 +- docs/PaginatedModuleResponse.md | 3 +- docs/PaginatedProjectResponse.md | 3 +- docs/PaginatedStateResponse.md | 3 +- docs/PaginatedWorkItemResponse.md | 3 +- docs/PatchedAssetUpdateRequest.md | 3 +- docs/PatchedCycleUpdateRequest.md | 3 +- docs/PatchedGenericAssetUpdateRequest.md | 3 +- docs/PatchedIntakeIssueUpdateRequest.md | 3 +- docs/PatchedIssueCommentCreateRequest.md | 3 +- docs/PatchedIssueLinkUpdateRequest.md | 3 +- docs/PatchedIssuePropertyAPIRequest.md | 3 +- docs/PatchedIssuePropertyOptionAPIRequest.md | 3 +- docs/PatchedIssueRequest.md | 3 +- docs/PatchedIssueTypeAPIRequest.md | 3 +- docs/PatchedIssueWorkLogAPIRequest.md | 3 +- docs/PatchedLabelCreateUpdateRequest.md | 3 +- docs/PatchedModuleUpdateRequest.md | 3 +- docs/PatchedProjectUpdateRequest.md | 3 +- docs/PatchedStateRequest.md | 3 +- docs/Project.md | 3 +- docs/ProjectCreateRequest.md | 3 +- docs/ProjectWorklogSummary.md | 3 +- docs/ProjectsApi.md | 35 +- docs/RetrieveWorkItemAttachment400Response.md | 3 +- docs/State.md | 3 +- docs/StateLite.md | 3 +- docs/StateRequest.md | 3 +- docs/StatesApi.md | 25 +- docs/TransferCycleIssueRequestRequest.md | 3 +- docs/TransferCycleWorkItems200Response.md | 3 +- docs/TransferCycleWorkItems400Response.md | 3 +- docs/UserAssetUploadRequest.md | 3 +- docs/UserLite.md | 3 +- docs/UsersApi.md | 5 +- docs/WorkItemActivityApi.md | 10 +- docs/WorkItemAttachmentsApi.md | 20 +- docs/WorkItemCommentsApi.md | 25 +- docs/WorkItemLinksApi.md | 25 +- docs/WorkItemPropertiesApi.md | 60 +- docs/WorkItemTypesApi.md | 25 +- docs/WorkItemWorklogsApi.md | 25 +- docs/WorkItemsApi.md | 37 +- plane/__init__.py | 2 +- plane/api/assets_api.py | 2117 +++++-- plane/api/cycles_api.py | 5278 ++++++++++++----- plane/api/intake_api.py | 1940 ++++-- plane/api/labels_api.py | 1969 ++++-- plane/api/members_api.py | 704 ++- plane/api/modules_api.py | 4455 +++++++++----- plane/api/projects_api.py | 2562 +++++--- plane/api/states_api.py | 1951 ++++-- plane/api/users_api.py | 332 +- plane/api/work_item_activity_api.py | 946 ++- plane/api/work_item_attachments_api.py | 1521 +++-- plane/api/work_item_comments_api.py | 2054 +++++-- plane/api/work_item_links_api.py | 2114 +++++-- plane/api/work_item_properties_api.py | 4686 ++++++++++----- plane/api/work_item_types_api.py | 1871 ++++-- plane/api/work_item_worklogs_api.py | 1919 ++++-- plane/api/work_items_api.py | 2886 ++++++--- plane/api_client.py | 590 +- plane/api_response.py | 28 +- plane/configuration.py | 215 +- plane/exceptions.py | 98 +- plane/models/access_enum.py | 12 +- plane/models/cycle.py | 164 +- plane/models/cycle_create_request.py | 82 +- plane/models/cycle_issue.py | 94 +- plane/models/cycle_issue_request_request.py | 59 +- plane/models/cycle_lite.py | 125 +- plane/models/entity_type_enum.py | 12 +- plane/models/generic_asset_upload_request.py | 69 +- ...get_workspace_members200_response_inner.py | 81 +- plane/models/group_enum.py | 12 +- plane/models/intake_issue.py | 138 +- plane/models/intake_issue_create_request.py | 82 +- plane/models/intake_work_item_status_enum.py | 12 +- plane/models/issue.py | 157 +- plane/models/issue_activity.py | 119 +- plane/models/issue_attachment.py | 153 +- .../models/issue_attachment_upload_request.py | 71 +- plane/models/issue_comment.py | 119 +- plane/models/issue_comment_create_request.py | 75 +- plane/models/issue_detail.py | 177 +- plane/models/issue_expand.py | 177 +- plane/models/issue_for_intake_request.py | 65 +- plane/models/issue_link.py | 106 +- plane/models/issue_link_create_request.py | 61 +- plane/models/issue_property_api.py | 142 +- plane/models/issue_property_api_request.py | 87 +- plane/models/issue_property_option_api.py | 129 +- .../issue_property_option_api_request.py | 75 +- plane/models/issue_property_value_api.py | 126 +- .../models/issue_property_value_api_detail.py | 61 +- .../issue_property_value_api_request.py | 86 +- plane/models/issue_request.py | 132 +- plane/models/issue_search.py | 67 +- plane/models/issue_search_item.py | 72 +- plane/models/issue_type_api.py | 118 +- plane/models/issue_type_api_request.py | 73 +- plane/models/issue_work_log_api.py | 84 +- plane/models/issue_work_log_api_request.py | 67 +- plane/models/label.py | 118 +- plane/models/label_create_update_request.py | 79 +- plane/models/module.py | 158 +- plane/models/module_create_request.py | 86 +- plane/models/module_issue.py | 100 +- plane/models/module_issue_request_request.py | 59 +- plane/models/module_lite.py | 136 +- plane/models/module_status_enum.py | 12 +- plane/models/network_enum.py | 12 +- .../paginated_archived_cycle_response.py | 102 +- .../paginated_archived_module_response.py | 102 +- .../models/paginated_cycle_issue_response.py | 102 +- plane/models/paginated_cycle_response.py | 102 +- .../models/paginated_intake_issue_response.py | 102 +- ...aginated_issue_activity_detail_response.py | 102 +- .../paginated_issue_activity_response.py | 102 +- .../paginated_issue_comment_response.py | 102 +- .../paginated_issue_link_detail_response.py | 102 +- plane/models/paginated_issue_link_response.py | 102 +- plane/models/paginated_label_response.py | 102 +- .../models/paginated_module_issue_response.py | 102 +- plane/models/paginated_module_response.py | 102 +- plane/models/paginated_project_response.py | 102 +- plane/models/paginated_state_response.py | 102 +- plane/models/paginated_work_item_response.py | 102 +- plane/models/patched_asset_update_request.py | 62 +- plane/models/patched_cycle_update_request.py | 80 +- .../patched_generic_asset_update_request.py | 58 +- .../patched_intake_issue_update_request.py | 78 +- .../patched_issue_comment_create_request.py | 75 +- .../patched_issue_link_update_request.py | 61 +- .../patched_issue_property_api_request.py | 85 +- ...tched_issue_property_option_api_request.py | 75 +- plane/models/patched_issue_request.py | 132 +- .../models/patched_issue_type_api_request.py | 73 +- .../patched_issue_work_log_api_request.py | 67 +- .../patched_label_create_update_request.py | 79 +- plane/models/patched_module_update_request.py | 86 +- .../models/patched_project_update_request.py | 97 +- plane/models/patched_state_request.py | 75 +- plane/models/priority_enum.py | 12 +- plane/models/project.py | 186 +- plane/models/project_create_request.py | 89 +- plane/models/project_worklog_summary.py | 62 +- plane/models/property_type_enum.py | 12 +- plane/models/relation_type_enum.py | 12 +- ...trieve_work_item_attachment400_response.py | 56 +- plane/models/state.py | 110 +- plane/models/state_lite.py | 70 +- plane/models/state_request.py | 75 +- plane/models/timezone_enum.py | 12 +- .../transfer_cycle_issue_request_request.py | 60 +- .../transfer_cycle_work_items200_response.py | 56 +- .../transfer_cycle_work_items400_response.py | 56 +- plane/models/type_enum.py | 12 +- plane/models/user_asset_upload_request.py | 65 +- plane/models/user_lite.py | 83 +- plane/oauth/api.py | 58 +- plane/rest.py | 290 +- pyproject.toml | 77 +- requirements.txt | 9 +- setup.py | 24 +- test-requirements.txt | 9 +- 227 files changed, 33550 insertions(+), 16079 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 194c4e6..78d7a9f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -14,12 +14,6 @@ stages: - pip install -r test-requirements.txt - pytest --cov=plane -pytest-3.7: - extends: .pytest - image: python:3.7-alpine -pytest-3.8: - extends: .pytest - image: python:3.8-alpine pytest-3.9: extends: .pytest image: python:3.9-alpine @@ -29,3 +23,9 @@ pytest-3.10: pytest-3.11: extends: .pytest image: python:3.11-alpine +pytest-3.12: + extends: .pytest + image: python:3.12-alpine +pytest-3.13: + extends: .pytest + image: python:3.13-alpine diff --git a/.travis.yml b/.travis.yml index 9b71e96..c97003d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,13 @@ # ref: https://docs.travis-ci.com/user/languages/python language: python python: - - "3.7" - - "3.8" - "3.9" - "3.10" - "3.11" + - "3.12" + - "3.13" # uncomment the following if needed - #- "3.11-dev" # 3.11 development branch + #- "3.13-dev" # 3.13 development branch #- "nightly" # nightly build # command to install dependencies install: diff --git a/README.md b/README.md index 34dda6e..2c4527e 100644 --- a/README.md +++ b/README.md @@ -4,14 +4,14 @@ The Plane REST API Visit our quick start guide and full API documentation at [developers.plane.so](https://developers.plane.so/api-reference/introduction). - API version: 0.0.1 -- Package version: 0.1.6 +- Package version: 0.1.7 - Generator version: 7.13.0 -- Build package: org.openapitools.codegen.languages.PythonPydanticV1ClientCodegen +- Build package: org.openapitools.codegen.languages.PythonClientCodegen For more information, please visit [https://plane.so](https://plane.so) ## Requirements. -Python 3.7+ +Python 3.9+ ## Installation & Usage ### pip install diff --git a/docs/AssetsApi.md b/docs/AssetsApi.md index e48bda3..05317d6 100644 --- a/docs/AssetsApi.md +++ b/docs/AssetsApi.md @@ -24,9 +24,8 @@ Generate presigned URL for generic asset upload * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.generic_asset_upload_request import GenericAssetUploadRequest from plane.rest import ApiException @@ -71,6 +70,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **slug** | **str**| Workspace slug | @@ -90,6 +90,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -113,9 +114,8 @@ Generate presigned URL for user asset upload * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.user_asset_upload_request import UserAssetUploadRequest from plane.rest import ApiException @@ -159,6 +159,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **user_asset_upload_request** | [**UserAssetUploadRequest**](UserAssetUploadRequest.md)| | @@ -177,6 +178,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -201,9 +203,8 @@ This performs a soft delete by marking the asset as deleted and updating the use * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -246,6 +247,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **asset_id** | **str**| Asset ID | @@ -264,6 +266,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -285,9 +288,8 @@ Get presigned URL for asset download * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -331,6 +333,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **asset_id** | **str**| | @@ -350,6 +353,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -372,9 +376,8 @@ Update generic asset after upload completion * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.patched_generic_asset_update_request import PatchedGenericAssetUpdateRequest from plane.rest import ApiException @@ -420,6 +423,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **asset_id** | **str**| Asset ID | @@ -440,6 +444,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -461,9 +466,8 @@ Mark user asset as uploaded * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.patched_asset_update_request import PatchedAssetUpdateRequest from plane.rest import ApiException @@ -508,6 +512,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **asset_id** | **str**| Asset ID | @@ -527,6 +532,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | diff --git a/docs/Cycle.md b/docs/Cycle.md index 2bb88d1..63539ea 100644 --- a/docs/Cycle.md +++ b/docs/Cycle.md @@ -3,6 +3,7 @@ Cycle serializer with comprehensive project metrics and time tracking. Provides cycle details including work item counts by status, progress estimates, and time-bound iteration data for project management and sprint planning. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -47,7 +48,7 @@ json = "{}" # create an instance of Cycle from a JSON string cycle_instance = Cycle.from_json(json) # print the JSON string representation of the object -print Cycle.to_json() +print(Cycle.to_json()) # convert the object into a dict cycle_dict = cycle_instance.to_dict() diff --git a/docs/CycleCreateRequest.md b/docs/CycleCreateRequest.md index 39f65d7..02d0b93 100644 --- a/docs/CycleCreateRequest.md +++ b/docs/CycleCreateRequest.md @@ -3,6 +3,7 @@ Serializer for creating cycles with timezone handling and date validation. Manages cycle creation including project timezone conversion, date range validation, and UTC normalization for time-bound iteration planning and sprint management. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | @@ -24,7 +25,7 @@ json = "{}" # create an instance of CycleCreateRequest from a JSON string cycle_create_request_instance = CycleCreateRequest.from_json(json) # print the JSON string representation of the object -print CycleCreateRequest.to_json() +print(CycleCreateRequest.to_json()) # convert the object into a dict cycle_create_request_dict = cycle_create_request_instance.to_dict() diff --git a/docs/CycleIssue.md b/docs/CycleIssue.md index 635908b..8116cfb 100644 --- a/docs/CycleIssue.md +++ b/docs/CycleIssue.md @@ -3,6 +3,7 @@ Serializer for cycle-issue relationships with sub-issue counting. Manages the association between cycles and work items, including hierarchical issue tracking for nested work item structures. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -27,7 +28,7 @@ json = "{}" # create an instance of CycleIssue from a JSON string cycle_issue_instance = CycleIssue.from_json(json) # print the JSON string representation of the object -print CycleIssue.to_json() +print(CycleIssue.to_json()) # convert the object into a dict cycle_issue_dict = cycle_issue_instance.to_dict() diff --git a/docs/CycleIssueRequestRequest.md b/docs/CycleIssueRequestRequest.md index 9cb6433..dc74493 100644 --- a/docs/CycleIssueRequestRequest.md +++ b/docs/CycleIssueRequestRequest.md @@ -3,6 +3,7 @@ Serializer for bulk work item assignment to cycles. Validates work item ID lists for batch operations including cycle assignment and sprint planning workflows. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **issues** | **List[str]** | List of issue IDs to add to the cycle | @@ -17,7 +18,7 @@ json = "{}" # create an instance of CycleIssueRequestRequest from a JSON string cycle_issue_request_request_instance = CycleIssueRequestRequest.from_json(json) # print the JSON string representation of the object -print CycleIssueRequestRequest.to_json() +print(CycleIssueRequestRequest.to_json()) # convert the object into a dict cycle_issue_request_request_dict = cycle_issue_request_request_instance.to_dict() diff --git a/docs/CycleLite.md b/docs/CycleLite.md index e158d20..03f47c4 100644 --- a/docs/CycleLite.md +++ b/docs/CycleLite.md @@ -3,6 +3,7 @@ Lightweight cycle serializer for minimal data transfer. Provides essential cycle information without computed metrics, optimized for list views and reference lookups. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -38,7 +39,7 @@ json = "{}" # create an instance of CycleLite from a JSON string cycle_lite_instance = CycleLite.from_json(json) # print the JSON string representation of the object -print CycleLite.to_json() +print(CycleLite.to_json()) # convert the object into a dict cycle_lite_dict = cycle_lite_instance.to_dict() diff --git a/docs/CyclesApi.md b/docs/CyclesApi.md index 1a0ced8..c5f444b 100644 --- a/docs/CyclesApi.md +++ b/docs/CyclesApi.md @@ -31,9 +31,8 @@ Assign multiple work items to a cycle. Automatically handles bulk creation and u * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.cycle_issue import CycleIssue from plane.models.cycle_issue_request_request import CycleIssueRequestRequest @@ -83,6 +82,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **cycle_id** | **str**| | @@ -104,6 +104,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -126,9 +127,8 @@ Move a completed cycle to archived status for historical tracking. Only cycles t * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -173,6 +173,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **cycle_id** | **str**| | @@ -193,6 +194,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -215,9 +217,8 @@ Create a new development cycle with specified name, description, and date range. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.cycle import Cycle from plane.models.cycle_create_request import CycleCreateRequest @@ -266,6 +267,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -286,6 +288,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -307,9 +310,8 @@ Permanently remove a cycle and all its associated issue relationships * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -354,6 +356,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pk** | **str**| | @@ -374,6 +377,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -395,9 +399,8 @@ Remove a work item from a cycle while keeping the work item in the project. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -443,6 +446,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **cycle_id** | **str**| | @@ -464,6 +468,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -485,9 +490,8 @@ Retrieve all cycles that have been archived in the project. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.paginated_archived_cycle_response import PaginatedArchivedCycleResponse from plane.rest import ApiException @@ -536,6 +540,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -557,6 +562,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -578,9 +584,8 @@ Retrieve all work items assigned to a cycle. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.paginated_cycle_issue_response import PaginatedCycleIssueResponse from plane.rest import ApiException @@ -630,6 +635,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **cycle_id** | **str**| | @@ -652,6 +658,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -673,9 +680,8 @@ Retrieve all cycles in a project. Supports filtering by cycle status like curren * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.paginated_cycle_response import PaginatedCycleResponse from plane.rest import ApiException @@ -728,6 +734,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -753,6 +760,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -774,9 +782,8 @@ Retrieve details of a specific cycle by its ID. Supports cycle status filtering. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.cycle import Cycle from plane.rest import ApiException @@ -824,6 +831,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pk** | **str**| | @@ -844,6 +852,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -865,9 +874,8 @@ Retrieve details of a specific cycle work item. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.cycle_issue import CycleIssue from plane.rest import ApiException @@ -916,6 +924,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **cycle_id** | **str**| | @@ -937,6 +946,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -958,9 +968,8 @@ Move incomplete work items from the current cycle to a new target cycle. Capture * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.transfer_cycle_issue_request_request import TransferCycleIssueRequestRequest from plane.models.transfer_cycle_work_items200_response import TransferCycleWorkItems200Response @@ -1010,6 +1019,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **cycle_id** | **str**| | @@ -1031,6 +1041,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -1053,9 +1064,8 @@ Restore an archived cycle to active status, making it available for regular use. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -1100,6 +1110,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pk** | **str**| | @@ -1120,6 +1131,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -1141,9 +1153,8 @@ Modify an existing cycle's properties like name, description, or date range. Com * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.cycle import Cycle from plane.models.patched_cycle_update_request import PatchedCycleUpdateRequest @@ -1193,6 +1204,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pk** | **str**| | @@ -1214,6 +1226,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | diff --git a/docs/GenericAssetUploadRequest.md b/docs/GenericAssetUploadRequest.md index 80b0d19..e36e26b 100644 --- a/docs/GenericAssetUploadRequest.md +++ b/docs/GenericAssetUploadRequest.md @@ -3,6 +3,7 @@ Serializer for generic asset upload requests with project association. Validates metadata for generating presigned URLs for workspace assets including project association, external system tracking, and file validation for document management and content storage workflows. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Original filename of the asset | @@ -22,7 +23,7 @@ json = "{}" # create an instance of GenericAssetUploadRequest from a JSON string generic_asset_upload_request_instance = GenericAssetUploadRequest.from_json(json) # print the JSON string representation of the object -print GenericAssetUploadRequest.to_json() +print(GenericAssetUploadRequest.to_json()) # convert the object into a dict generic_asset_upload_request_dict = generic_asset_upload_request_instance.to_dict() diff --git a/docs/GetWorkspaceMembers200ResponseInner.md b/docs/GetWorkspaceMembers200ResponseInner.md index 14eface..8fd8775 100644 --- a/docs/GetWorkspaceMembers200ResponseInner.md +++ b/docs/GetWorkspaceMembers200ResponseInner.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -23,7 +24,7 @@ json = "{}" # create an instance of GetWorkspaceMembers200ResponseInner from a JSON string get_workspace_members200_response_inner_instance = GetWorkspaceMembers200ResponseInner.from_json(json) # print the JSON string representation of the object -print GetWorkspaceMembers200ResponseInner.to_json() +print(GetWorkspaceMembers200ResponseInner.to_json()) # convert the object into a dict get_workspace_members200_response_inner_dict = get_workspace_members200_response_inner_instance.to_dict() diff --git a/docs/IntakeApi.md b/docs/IntakeApi.md index e14640d..2a5a790 100644 --- a/docs/IntakeApi.md +++ b/docs/IntakeApi.md @@ -23,9 +23,8 @@ Submit a new work item to the project's intake queue for review and triage. Auto * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.intake_issue import IntakeIssue from plane.models.intake_issue_create_request import IntakeIssueCreateRequest @@ -74,6 +73,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -94,6 +94,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -116,9 +117,8 @@ Permanently remove an intake work item from the triage queue. Also deletes the u * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -163,6 +163,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| Issue ID | @@ -183,6 +184,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -204,9 +206,8 @@ Retrieve all work items in the project's intake queue. Returns paginated results * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.paginated_intake_issue_response import PaginatedIntakeIssueResponse from plane.rest import ApiException @@ -257,6 +258,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -280,6 +282,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -301,9 +304,8 @@ Retrieve details of a specific intake work item. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.intake_issue import IntakeIssue from plane.rest import ApiException @@ -351,6 +353,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| Issue ID | @@ -371,6 +374,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -392,9 +396,8 @@ Modify an existing intake work item's properties or status for triage processing * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.intake_issue import IntakeIssue from plane.models.patched_intake_issue_update_request import PatchedIntakeIssueUpdateRequest @@ -444,6 +447,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| Issue ID | @@ -465,6 +469,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | diff --git a/docs/IntakeIssue.md b/docs/IntakeIssue.md index e5b5843..76475de 100644 --- a/docs/IntakeIssue.md +++ b/docs/IntakeIssue.md @@ -3,6 +3,7 @@ Comprehensive serializer for intake work items with expanded issue details. Provides full intake work item data including embedded issue information, status tracking, and triage metadata for issue queue management. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -36,7 +37,7 @@ json = "{}" # create an instance of IntakeIssue from a JSON string intake_issue_instance = IntakeIssue.from_json(json) # print the JSON string representation of the object -print IntakeIssue.to_json() +print(IntakeIssue.to_json()) # convert the object into a dict intake_issue_dict = intake_issue_instance.to_dict() diff --git a/docs/IntakeIssueCreateRequest.md b/docs/IntakeIssueCreateRequest.md index 3a2bb1b..62514f3 100644 --- a/docs/IntakeIssueCreateRequest.md +++ b/docs/IntakeIssueCreateRequest.md @@ -3,6 +3,7 @@ Serializer for creating intake work items with embedded issue data. Manages intake work item creation including nested issue creation, status assignment, and source tracking for issue queue management. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **issue** | [**IssueForIntakeRequest**](IssueForIntakeRequest.md) | Issue data for the intake issue | @@ -23,7 +24,7 @@ json = "{}" # create an instance of IntakeIssueCreateRequest from a JSON string intake_issue_create_request_instance = IntakeIssueCreateRequest.from_json(json) # print the JSON string representation of the object -print IntakeIssueCreateRequest.to_json() +print(IntakeIssueCreateRequest.to_json()) # convert the object into a dict intake_issue_create_request_dict = intake_issue_create_request_instance.to_dict() diff --git a/docs/Issue.md b/docs/Issue.md index 7f29d5d..6f7c452 100644 --- a/docs/Issue.md +++ b/docs/Issue.md @@ -3,6 +3,7 @@ Comprehensive work item serializer with full relationship management. Handles complete work item lifecycle including assignees, labels, validation, and related model updates. Supports dynamic field expansion and HTML content processing. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -44,7 +45,7 @@ json = "{}" # create an instance of Issue from a JSON string issue_instance = Issue.from_json(json) # print the JSON string representation of the object -print Issue.to_json() +print(Issue.to_json()) # convert the object into a dict issue_dict = issue_instance.to_dict() diff --git a/docs/IssueActivity.md b/docs/IssueActivity.md index ae63b0d..39a3b36 100644 --- a/docs/IssueActivity.md +++ b/docs/IssueActivity.md @@ -3,6 +3,7 @@ Serializer for work item activity and change history. Tracks and represents work item modifications, state changes, and user interactions for audit trails and activity feeds. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -10,7 +11,7 @@ Name | Type | Description | Notes **updated_at** | **datetime** | | [optional] [readonly] **deleted_at** | **datetime** | | [optional] **verb** | **str** | | [optional] -**field** | **str** | | [optional] +**var_field** | **str** | | [optional] **old_value** | **str** | | [optional] **new_value** | **str** | | [optional] **comment** | **str** | | [optional] @@ -34,7 +35,7 @@ json = "{}" # create an instance of IssueActivity from a JSON string issue_activity_instance = IssueActivity.from_json(json) # print the JSON string representation of the object -print IssueActivity.to_json() +print(IssueActivity.to_json()) # convert the object into a dict issue_activity_dict = issue_activity_instance.to_dict() diff --git a/docs/IssueAttachment.md b/docs/IssueAttachment.md index fcb4176..5d0f8b2 100644 --- a/docs/IssueAttachment.md +++ b/docs/IssueAttachment.md @@ -3,6 +3,7 @@ Serializer for work item file attachments. Manages file asset associations with work items including metadata, storage information, and access control for document management. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -40,7 +41,7 @@ json = "{}" # create an instance of IssueAttachment from a JSON string issue_attachment_instance = IssueAttachment.from_json(json) # print the JSON string representation of the object -print IssueAttachment.to_json() +print(IssueAttachment.to_json()) # convert the object into a dict issue_attachment_dict = issue_attachment_instance.to_dict() diff --git a/docs/IssueAttachmentUploadRequest.md b/docs/IssueAttachmentUploadRequest.md index 87d451e..1df2aec 100644 --- a/docs/IssueAttachmentUploadRequest.md +++ b/docs/IssueAttachmentUploadRequest.md @@ -3,6 +3,7 @@ Serializer for work item attachment upload request validation. Handles file upload metadata validation including size, type, and external integration tracking for secure work item document attachment workflows. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Original filename of the asset | @@ -21,7 +22,7 @@ json = "{}" # create an instance of IssueAttachmentUploadRequest from a JSON string issue_attachment_upload_request_instance = IssueAttachmentUploadRequest.from_json(json) # print the JSON string representation of the object -print IssueAttachmentUploadRequest.to_json() +print(IssueAttachmentUploadRequest.to_json()) # convert the object into a dict issue_attachment_upload_request_dict = issue_attachment_upload_request_instance.to_dict() diff --git a/docs/IssueComment.md b/docs/IssueComment.md index 51a0e48..9858e3a 100644 --- a/docs/IssueComment.md +++ b/docs/IssueComment.md @@ -3,6 +3,7 @@ Full serializer for work item comments with membership context. Provides complete comment data including member status, content formatting, and edit tracking for collaborative work item discussions. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -34,7 +35,7 @@ json = "{}" # create an instance of IssueComment from a JSON string issue_comment_instance = IssueComment.from_json(json) # print the JSON string representation of the object -print IssueComment.to_json() +print(IssueComment.to_json()) # convert the object into a dict issue_comment_dict = issue_comment_instance.to_dict() diff --git a/docs/IssueCommentCreateRequest.md b/docs/IssueCommentCreateRequest.md index 29d2ff2..3003212 100644 --- a/docs/IssueCommentCreateRequest.md +++ b/docs/IssueCommentCreateRequest.md @@ -3,6 +3,7 @@ Serializer for creating work item comments. Handles comment creation with JSON and HTML content support, access control, and external integration tracking. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **comment_json** | **object** | | [optional] @@ -21,7 +22,7 @@ json = "{}" # create an instance of IssueCommentCreateRequest from a JSON string issue_comment_create_request_instance = IssueCommentCreateRequest.from_json(json) # print the JSON string representation of the object -print IssueCommentCreateRequest.to_json() +print(IssueCommentCreateRequest.to_json()) # convert the object into a dict issue_comment_create_request_dict = issue_comment_create_request_instance.to_dict() diff --git a/docs/IssueDetail.md b/docs/IssueDetail.md index da00a26..86d6b04 100644 --- a/docs/IssueDetail.md +++ b/docs/IssueDetail.md @@ -3,6 +3,7 @@ Comprehensive work item serializer with full relationship management. Handles complete work item lifecycle including assignees, labels, validation, and related model updates. Supports dynamic field expansion and HTML content processing. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -46,7 +47,7 @@ json = "{}" # create an instance of IssueDetail from a JSON string issue_detail_instance = IssueDetail.from_json(json) # print the JSON string representation of the object -print IssueDetail.to_json() +print(IssueDetail.to_json()) # convert the object into a dict issue_detail_dict = issue_detail_instance.to_dict() diff --git a/docs/IssueExpand.md b/docs/IssueExpand.md index 09b5ddf..b56c227 100644 --- a/docs/IssueExpand.md +++ b/docs/IssueExpand.md @@ -3,6 +3,7 @@ Extended work item serializer with full relationship expansion. Provides work items with expanded related data including cycles, modules, labels, assignees, and states for comprehensive data representation. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -48,7 +49,7 @@ json = "{}" # create an instance of IssueExpand from a JSON string issue_expand_instance = IssueExpand.from_json(json) # print the JSON string representation of the object -print IssueExpand.to_json() +print(IssueExpand.to_json()) # convert the object into a dict issue_expand_dict = issue_expand_instance.to_dict() diff --git a/docs/IssueForIntakeRequest.md b/docs/IssueForIntakeRequest.md index b73cd63..568e3cf 100644 --- a/docs/IssueForIntakeRequest.md +++ b/docs/IssueForIntakeRequest.md @@ -3,6 +3,7 @@ Serializer for work item data within intake submissions. Handles essential work item fields for intake processing including content validation and priority assignment for triage workflows. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | @@ -20,7 +21,7 @@ json = "{}" # create an instance of IssueForIntakeRequest from a JSON string issue_for_intake_request_instance = IssueForIntakeRequest.from_json(json) # print the JSON string representation of the object -print IssueForIntakeRequest.to_json() +print(IssueForIntakeRequest.to_json()) # convert the object into a dict issue_for_intake_request_dict = issue_for_intake_request_instance.to_dict() diff --git a/docs/IssueLink.md b/docs/IssueLink.md index 0e59ffb..5d5f13b 100644 --- a/docs/IssueLink.md +++ b/docs/IssueLink.md @@ -3,6 +3,7 @@ Full serializer for work item external links. Provides complete link information including metadata and timestamps for managing external resource associations with work items. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -28,7 +29,7 @@ json = "{}" # create an instance of IssueLink from a JSON string issue_link_instance = IssueLink.from_json(json) # print the JSON string representation of the object -print IssueLink.to_json() +print(IssueLink.to_json()) # convert the object into a dict issue_link_dict = issue_link_instance.to_dict() diff --git a/docs/IssueLinkCreateRequest.md b/docs/IssueLinkCreateRequest.md index 56d703e..9ee4279 100644 --- a/docs/IssueLinkCreateRequest.md +++ b/docs/IssueLinkCreateRequest.md @@ -3,6 +3,7 @@ Serializer for creating work item external links with validation. Handles URL validation, format checking, and duplicate prevention for attaching external resources to work items. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **url** | **str** | | @@ -17,7 +18,7 @@ json = "{}" # create an instance of IssueLinkCreateRequest from a JSON string issue_link_create_request_instance = IssueLinkCreateRequest.from_json(json) # print the JSON string representation of the object -print IssueLinkCreateRequest.to_json() +print(IssueLinkCreateRequest.to_json()) # convert the object into a dict issue_link_create_request_dict = issue_link_create_request_instance.to_dict() diff --git a/docs/IssuePropertyAPI.md b/docs/IssuePropertyAPI.md index c1fa48b..b92b85e 100644 --- a/docs/IssuePropertyAPI.md +++ b/docs/IssuePropertyAPI.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -39,7 +40,7 @@ json = "{}" # create an instance of IssuePropertyAPI from a JSON string issue_property_api_instance = IssuePropertyAPI.from_json(json) # print the JSON string representation of the object -print IssuePropertyAPI.to_json() +print(IssuePropertyAPI.to_json()) # convert the object into a dict issue_property_api_dict = issue_property_api_instance.to_dict() diff --git a/docs/IssuePropertyAPIRequest.md b/docs/IssuePropertyAPIRequest.md index c3ad65b..bfdd426 100644 --- a/docs/IssuePropertyAPIRequest.md +++ b/docs/IssuePropertyAPIRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **relation_type** | [**RelationTypeEnum**](RelationTypeEnum.md) | | [optional] @@ -27,7 +28,7 @@ json = "{}" # create an instance of IssuePropertyAPIRequest from a JSON string issue_property_api_request_instance = IssuePropertyAPIRequest.from_json(json) # print the JSON string representation of the object -print IssuePropertyAPIRequest.to_json() +print(IssuePropertyAPIRequest.to_json()) # convert the object into a dict issue_property_api_request_dict = issue_property_api_request_instance.to_dict() diff --git a/docs/IssuePropertyOptionAPI.md b/docs/IssuePropertyOptionAPI.md index 630e04f..0517267 100644 --- a/docs/IssuePropertyOptionAPI.md +++ b/docs/IssuePropertyOptionAPI.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -33,7 +34,7 @@ json = "{}" # create an instance of IssuePropertyOptionAPI from a JSON string issue_property_option_api_instance = IssuePropertyOptionAPI.from_json(json) # print the JSON string representation of the object -print IssuePropertyOptionAPI.to_json() +print(IssuePropertyOptionAPI.to_json()) # convert the object into a dict issue_property_option_api_dict = issue_property_option_api_instance.to_dict() diff --git a/docs/IssuePropertyOptionAPIRequest.md b/docs/IssuePropertyOptionAPIRequest.md index a269aa3..f7434cb 100644 --- a/docs/IssuePropertyOptionAPIRequest.md +++ b/docs/IssuePropertyOptionAPIRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | @@ -22,7 +23,7 @@ json = "{}" # create an instance of IssuePropertyOptionAPIRequest from a JSON string issue_property_option_api_request_instance = IssuePropertyOptionAPIRequest.from_json(json) # print the JSON string representation of the object -print IssuePropertyOptionAPIRequest.to_json() +print(IssuePropertyOptionAPIRequest.to_json()) # convert the object into a dict issue_property_option_api_request_dict = issue_property_option_api_request_instance.to_dict() diff --git a/docs/IssuePropertyValueAPI.md b/docs/IssuePropertyValueAPI.md index 7d01063..395b5ed 100644 --- a/docs/IssuePropertyValueAPI.md +++ b/docs/IssuePropertyValueAPI.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -33,7 +34,7 @@ json = "{}" # create an instance of IssuePropertyValueAPI from a JSON string issue_property_value_api_instance = IssuePropertyValueAPI.from_json(json) # print the JSON string representation of the object -print IssuePropertyValueAPI.to_json() +print(IssuePropertyValueAPI.to_json()) # convert the object into a dict issue_property_value_api_dict = issue_property_value_api_instance.to_dict() diff --git a/docs/IssuePropertyValueAPIDetail.md b/docs/IssuePropertyValueAPIDetail.md index 79e6bab..4834817 100644 --- a/docs/IssuePropertyValueAPIDetail.md +++ b/docs/IssuePropertyValueAPIDetail.md @@ -3,6 +3,7 @@ Serializer for aggregated issue property values response. This serializer handles the response format from the query_annotator method which returns property_id and values (ArrayAgg of property values). ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **property_id** | **str** | The ID of the issue property | @@ -18,7 +19,7 @@ json = "{}" # create an instance of IssuePropertyValueAPIDetail from a JSON string issue_property_value_api_detail_instance = IssuePropertyValueAPIDetail.from_json(json) # print the JSON string representation of the object -print IssuePropertyValueAPIDetail.to_json() +print(IssuePropertyValueAPIDetail.to_json()) # convert the object into a dict issue_property_value_api_detail_dict = issue_property_value_api_detail_instance.to_dict() diff --git a/docs/IssuePropertyValueAPIRequest.md b/docs/IssuePropertyValueAPIRequest.md index 9635980..734db96 100644 --- a/docs/IssuePropertyValueAPIRequest.md +++ b/docs/IssuePropertyValueAPIRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **value_text** | **str** | | [optional] @@ -25,7 +26,7 @@ json = "{}" # create an instance of IssuePropertyValueAPIRequest from a JSON string issue_property_value_api_request_instance = IssuePropertyValueAPIRequest.from_json(json) # print the JSON string representation of the object -print IssuePropertyValueAPIRequest.to_json() +print(IssuePropertyValueAPIRequest.to_json()) # convert the object into a dict issue_property_value_api_request_dict = issue_property_value_api_request_instance.to_dict() diff --git a/docs/IssueRequest.md b/docs/IssueRequest.md index 967b907..43048ca 100644 --- a/docs/IssueRequest.md +++ b/docs/IssueRequest.md @@ -3,6 +3,7 @@ Comprehensive work item serializer with full relationship management. Handles complete work item lifecycle including assignees, labels, validation, and related model updates. Supports dynamic field expansion and HTML content processing. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **assignees** | **List[str]** | | [optional] @@ -39,7 +40,7 @@ json = "{}" # create an instance of IssueRequest from a JSON string issue_request_instance = IssueRequest.from_json(json) # print the JSON string representation of the object -print IssueRequest.to_json() +print(IssueRequest.to_json()) # convert the object into a dict issue_request_dict = issue_request_instance.to_dict() diff --git a/docs/IssueSearch.md b/docs/IssueSearch.md index fb6b828..6dec3a8 100644 --- a/docs/IssueSearch.md +++ b/docs/IssueSearch.md @@ -3,6 +3,7 @@ Search results for work items. Provides list of issues with their identifiers, names, and project context. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **issues** | [**List[IssueSearchItem]**](IssueSearchItem.md) | | @@ -17,7 +18,7 @@ json = "{}" # create an instance of IssueSearch from a JSON string issue_search_instance = IssueSearch.from_json(json) # print the JSON string representation of the object -print IssueSearch.to_json() +print(IssueSearch.to_json()) # convert the object into a dict issue_search_dict = issue_search_instance.to_dict() diff --git a/docs/IssueSearchItem.md b/docs/IssueSearchItem.md index c119aae..0d85012 100644 --- a/docs/IssueSearchItem.md +++ b/docs/IssueSearchItem.md @@ -3,6 +3,7 @@ Individual issue component for search results. Provides standardized search result structure including work item identifiers, project context, and workspace information for search API responses. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | Issue ID | @@ -22,7 +23,7 @@ json = "{}" # create an instance of IssueSearchItem from a JSON string issue_search_item_instance = IssueSearchItem.from_json(json) # print the JSON string representation of the object -print IssueSearchItem.to_json() +print(IssueSearchItem.to_json()) # convert the object into a dict issue_search_item_dict = issue_search_item_instance.to_dict() diff --git a/docs/IssueTypeAPI.md b/docs/IssueTypeAPI.md index 0a497cc..94865b8 100644 --- a/docs/IssueTypeAPI.md +++ b/docs/IssueTypeAPI.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -32,7 +33,7 @@ json = "{}" # create an instance of IssueTypeAPI from a JSON string issue_type_api_instance = IssueTypeAPI.from_json(json) # print the JSON string representation of the object -print IssueTypeAPI.to_json() +print(IssueTypeAPI.to_json()) # convert the object into a dict issue_type_api_dict = issue_type_api_instance.to_dict() diff --git a/docs/IssueTypeAPIRequest.md b/docs/IssueTypeAPIRequest.md index 280403b..376a95d 100644 --- a/docs/IssueTypeAPIRequest.md +++ b/docs/IssueTypeAPIRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **project_ids** | **List[str]** | | [optional] @@ -22,7 +23,7 @@ json = "{}" # create an instance of IssueTypeAPIRequest from a JSON string issue_type_api_request_instance = IssueTypeAPIRequest.from_json(json) # print the JSON string representation of the object -print IssueTypeAPIRequest.to_json() +print(IssueTypeAPIRequest.to_json()) # convert the object into a dict issue_type_api_request_dict = issue_type_api_request_instance.to_dict() diff --git a/docs/IssueWorkLogAPI.md b/docs/IssueWorkLogAPI.md index d63bab9..9de2d2e 100644 --- a/docs/IssueWorkLogAPI.md +++ b/docs/IssueWorkLogAPI.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -25,7 +26,7 @@ json = "{}" # create an instance of IssueWorkLogAPI from a JSON string issue_work_log_api_instance = IssueWorkLogAPI.from_json(json) # print the JSON string representation of the object -print IssueWorkLogAPI.to_json() +print(IssueWorkLogAPI.to_json()) # convert the object into a dict issue_work_log_api_dict = issue_work_log_api_instance.to_dict() diff --git a/docs/IssueWorkLogAPIRequest.md b/docs/IssueWorkLogAPIRequest.md index e715f97..f1491db 100644 --- a/docs/IssueWorkLogAPIRequest.md +++ b/docs/IssueWorkLogAPIRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **description** | **str** | | [optional] @@ -19,7 +20,7 @@ json = "{}" # create an instance of IssueWorkLogAPIRequest from a JSON string issue_work_log_api_request_instance = IssueWorkLogAPIRequest.from_json(json) # print the JSON string representation of the object -print IssueWorkLogAPIRequest.to_json() +print(IssueWorkLogAPIRequest.to_json()) # convert the object into a dict issue_work_log_api_request_dict = issue_work_log_api_request_instance.to_dict() diff --git a/docs/Label.md b/docs/Label.md index 3158f8d..2fb55d5 100644 --- a/docs/Label.md +++ b/docs/Label.md @@ -3,6 +3,7 @@ Full serializer for work item labels with complete metadata. Provides comprehensive label information including hierarchical relationships, visual properties, and organizational data for work item tagging. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -31,7 +32,7 @@ json = "{}" # create an instance of Label from a JSON string label_instance = Label.from_json(json) # print the JSON string representation of the object -print Label.to_json() +print(Label.to_json()) # convert the object into a dict label_dict = label_instance.to_dict() diff --git a/docs/LabelCreateUpdateRequest.md b/docs/LabelCreateUpdateRequest.md index aba2238..ee16487 100644 --- a/docs/LabelCreateUpdateRequest.md +++ b/docs/LabelCreateUpdateRequest.md @@ -3,6 +3,7 @@ Serializer for creating and updating work item labels. Manages label metadata including colors, descriptions, hierarchy, and sorting for work item categorization and filtering. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | @@ -23,7 +24,7 @@ json = "{}" # create an instance of LabelCreateUpdateRequest from a JSON string label_create_update_request_instance = LabelCreateUpdateRequest.from_json(json) # print the JSON string representation of the object -print LabelCreateUpdateRequest.to_json() +print(LabelCreateUpdateRequest.to_json()) # convert the object into a dict label_create_update_request_dict = label_create_update_request_instance.to_dict() diff --git a/docs/LabelsApi.md b/docs/LabelsApi.md index ed9e89b..43d8c0c 100644 --- a/docs/LabelsApi.md +++ b/docs/LabelsApi.md @@ -23,9 +23,8 @@ Create a new label in the specified project with name, color, and description. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.label import Label from plane.models.label_create_update_request import LabelCreateUpdateRequest @@ -74,6 +73,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -94,6 +94,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -117,9 +118,8 @@ Permanently remove a label from the project. This action cannot be undone. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -164,6 +164,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pk** | **str**| Label ID | @@ -184,6 +185,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -205,9 +207,8 @@ Retrieve details of a specific label. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.label import Label from plane.rest import ApiException @@ -255,6 +256,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pk** | **str**| Label ID | @@ -275,6 +277,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -296,9 +299,8 @@ Retrieve all labels in a project. Supports filtering by name and color. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.paginated_label_response import PaginatedLabelResponse from plane.rest import ApiException @@ -350,6 +352,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -374,6 +377,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -396,9 +400,8 @@ Partially update an existing label's properties like name, color, or description * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.label import Label from plane.models.patched_label_create_update_request import PatchedLabelCreateUpdateRequest @@ -448,6 +451,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pk** | **str**| Label ID | @@ -469,6 +473,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | diff --git a/docs/MembersApi.md b/docs/MembersApi.md index f5c3fd3..fc967e4 100644 --- a/docs/MembersApi.md +++ b/docs/MembersApi.md @@ -20,9 +20,8 @@ Retrieve all users who are members of the specified project. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.user_lite import UserLite from plane.rest import ApiException @@ -69,6 +68,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -88,6 +88,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | List of project members with their roles | - | @@ -109,9 +110,8 @@ Retrieve all users who are members of the specified workspace. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.get_workspace_members200_response_inner import GetWorkspaceMembers200ResponseInner from plane.rest import ApiException @@ -157,6 +157,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **slug** | **str**| Workspace slug | @@ -175,6 +176,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | List of workspace members with their roles | - | diff --git a/docs/Module.md b/docs/Module.md index 2fa317b..52795f5 100644 --- a/docs/Module.md +++ b/docs/Module.md @@ -3,6 +3,7 @@ Comprehensive module serializer with work item metrics and member management. Provides complete module data including work item counts by status, member relationships, and progress tracking for feature-based project organization. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -44,7 +45,7 @@ json = "{}" # create an instance of Module from a JSON string module_instance = Module.from_json(json) # print the JSON string representation of the object -print Module.to_json() +print(Module.to_json()) # convert the object into a dict module_dict = module_instance.to_dict() diff --git a/docs/ModuleCreateRequest.md b/docs/ModuleCreateRequest.md index 9752ee1..6e960ab 100644 --- a/docs/ModuleCreateRequest.md +++ b/docs/ModuleCreateRequest.md @@ -3,6 +3,7 @@ Serializer for creating modules with member validation and date checking. Handles module creation including member assignment validation, date range verification, and duplicate name prevention for feature-based project organization setup. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | @@ -25,7 +26,7 @@ json = "{}" # create an instance of ModuleCreateRequest from a JSON string module_create_request_instance = ModuleCreateRequest.from_json(json) # print the JSON string representation of the object -print ModuleCreateRequest.to_json() +print(ModuleCreateRequest.to_json()) # convert the object into a dict module_create_request_dict = module_create_request_instance.to_dict() diff --git a/docs/ModuleIssue.md b/docs/ModuleIssue.md index a62c7ba..923ac79 100644 --- a/docs/ModuleIssue.md +++ b/docs/ModuleIssue.md @@ -3,6 +3,7 @@ Serializer for module-work item relationships with sub-item counting. Manages the association between modules and work items, including hierarchical issue tracking for nested work item structures. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -27,7 +28,7 @@ json = "{}" # create an instance of ModuleIssue from a JSON string module_issue_instance = ModuleIssue.from_json(json) # print the JSON string representation of the object -print ModuleIssue.to_json() +print(ModuleIssue.to_json()) # convert the object into a dict module_issue_dict = module_issue_instance.to_dict() diff --git a/docs/ModuleIssueRequestRequest.md b/docs/ModuleIssueRequestRequest.md index 78fc6a0..25a655c 100644 --- a/docs/ModuleIssueRequestRequest.md +++ b/docs/ModuleIssueRequestRequest.md @@ -3,6 +3,7 @@ Serializer for bulk work item assignment to modules. Validates work item ID lists for batch operations including module assignment and work item organization workflows. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **issues** | **List[str]** | List of issue IDs to add to the module | @@ -17,7 +18,7 @@ json = "{}" # create an instance of ModuleIssueRequestRequest from a JSON string module_issue_request_request_instance = ModuleIssueRequestRequest.from_json(json) # print the JSON string representation of the object -print ModuleIssueRequestRequest.to_json() +print(ModuleIssueRequestRequest.to_json()) # convert the object into a dict module_issue_request_request_dict = module_issue_request_request_instance.to_dict() diff --git a/docs/ModuleLite.md b/docs/ModuleLite.md index 6ab075d..69fe2c7 100644 --- a/docs/ModuleLite.md +++ b/docs/ModuleLite.md @@ -3,6 +3,7 @@ Lightweight module serializer for minimal data transfer. Provides essential module information without computed metrics, optimized for list views and reference lookups. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -39,7 +40,7 @@ json = "{}" # create an instance of ModuleLite from a JSON string module_lite_instance = ModuleLite.from_json(json) # print the JSON string representation of the object -print ModuleLite.to_json() +print(ModuleLite.to_json()) # convert the object into a dict module_lite_dict = module_lite_instance.to_dict() diff --git a/docs/ModulesApi.md b/docs/ModulesApi.md index 7cb871b..617674e 100644 --- a/docs/ModulesApi.md +++ b/docs/ModulesApi.md @@ -29,9 +29,8 @@ Assign multiple work items to a module or move them from another module. Automat * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.module_issue import ModuleIssue from plane.models.module_issue_request_request import ModuleIssueRequestRequest @@ -81,6 +80,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **module_id** | **str**| Module ID | @@ -102,6 +102,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -124,9 +125,8 @@ Move a module to archived status for historical tracking. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -171,6 +171,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pk** | **str**| Module ID | @@ -191,6 +192,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -213,9 +215,8 @@ Create a new project module with specified name, description, and timeline. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.module import Module from plane.models.module_create_request import ModuleCreateRequest @@ -264,6 +265,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -284,6 +286,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -307,9 +310,8 @@ Permanently remove a module and all its associated issue relationships. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -354,6 +356,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pk** | **str**| Module ID | @@ -374,6 +377,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -395,9 +399,8 @@ Remove a work item from a module while keeping the work item in the project. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -443,6 +446,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| Issue ID | @@ -464,6 +468,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -485,9 +490,8 @@ Retrieve all modules that have been archived in the project. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.paginated_archived_module_response import PaginatedArchivedModuleResponse from plane.rest import ApiException @@ -539,6 +543,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -563,6 +568,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -584,9 +590,8 @@ Retrieve all work items assigned to a module with detailed information. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.paginated_module_issue_response import PaginatedModuleIssueResponse from plane.rest import ApiException @@ -639,6 +644,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **module_id** | **str**| Module ID | @@ -664,6 +670,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -685,9 +692,8 @@ Retrieve all modules in a project. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.paginated_module_response import PaginatedModuleResponse from plane.rest import ApiException @@ -739,6 +745,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -763,6 +770,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -784,9 +792,8 @@ Retrieve details of a specific module. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.module import Module from plane.rest import ApiException @@ -834,6 +841,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pk** | **str**| Module ID | @@ -854,6 +862,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -875,9 +884,8 @@ Restore an archived module to active status, making it available for regular use * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -922,6 +930,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pk** | **str**| Module ID | @@ -942,6 +951,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -963,9 +973,8 @@ Modify an existing module's properties like name, description, status, or timeli * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.module import Module from plane.models.patched_module_update_request import PatchedModuleUpdateRequest @@ -1015,6 +1024,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pk** | **str**| Module ID | @@ -1036,6 +1046,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | diff --git a/docs/PaginatedArchivedCycleResponse.md b/docs/PaginatedArchivedCycleResponse.md index c78509d..043b3ce 100644 --- a/docs/PaginatedArchivedCycleResponse.md +++ b/docs/PaginatedArchivedCycleResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **grouped_by** | **str** | | @@ -27,7 +28,7 @@ json = "{}" # create an instance of PaginatedArchivedCycleResponse from a JSON string paginated_archived_cycle_response_instance = PaginatedArchivedCycleResponse.from_json(json) # print the JSON string representation of the object -print PaginatedArchivedCycleResponse.to_json() +print(PaginatedArchivedCycleResponse.to_json()) # convert the object into a dict paginated_archived_cycle_response_dict = paginated_archived_cycle_response_instance.to_dict() diff --git a/docs/PaginatedArchivedModuleResponse.md b/docs/PaginatedArchivedModuleResponse.md index 4372b55..11feef8 100644 --- a/docs/PaginatedArchivedModuleResponse.md +++ b/docs/PaginatedArchivedModuleResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **grouped_by** | **str** | | @@ -27,7 +28,7 @@ json = "{}" # create an instance of PaginatedArchivedModuleResponse from a JSON string paginated_archived_module_response_instance = PaginatedArchivedModuleResponse.from_json(json) # print the JSON string representation of the object -print PaginatedArchivedModuleResponse.to_json() +print(PaginatedArchivedModuleResponse.to_json()) # convert the object into a dict paginated_archived_module_response_dict = paginated_archived_module_response_instance.to_dict() diff --git a/docs/PaginatedCycleIssueResponse.md b/docs/PaginatedCycleIssueResponse.md index 17d6bb7..64d096f 100644 --- a/docs/PaginatedCycleIssueResponse.md +++ b/docs/PaginatedCycleIssueResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **grouped_by** | **str** | | @@ -27,7 +28,7 @@ json = "{}" # create an instance of PaginatedCycleIssueResponse from a JSON string paginated_cycle_issue_response_instance = PaginatedCycleIssueResponse.from_json(json) # print the JSON string representation of the object -print PaginatedCycleIssueResponse.to_json() +print(PaginatedCycleIssueResponse.to_json()) # convert the object into a dict paginated_cycle_issue_response_dict = paginated_cycle_issue_response_instance.to_dict() diff --git a/docs/PaginatedCycleResponse.md b/docs/PaginatedCycleResponse.md index f5e9518..117ae20 100644 --- a/docs/PaginatedCycleResponse.md +++ b/docs/PaginatedCycleResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **grouped_by** | **str** | | @@ -27,7 +28,7 @@ json = "{}" # create an instance of PaginatedCycleResponse from a JSON string paginated_cycle_response_instance = PaginatedCycleResponse.from_json(json) # print the JSON string representation of the object -print PaginatedCycleResponse.to_json() +print(PaginatedCycleResponse.to_json()) # convert the object into a dict paginated_cycle_response_dict = paginated_cycle_response_instance.to_dict() diff --git a/docs/PaginatedIntakeIssueResponse.md b/docs/PaginatedIntakeIssueResponse.md index 6e2bcae..93245bd 100644 --- a/docs/PaginatedIntakeIssueResponse.md +++ b/docs/PaginatedIntakeIssueResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **grouped_by** | **str** | | @@ -27,7 +28,7 @@ json = "{}" # create an instance of PaginatedIntakeIssueResponse from a JSON string paginated_intake_issue_response_instance = PaginatedIntakeIssueResponse.from_json(json) # print the JSON string representation of the object -print PaginatedIntakeIssueResponse.to_json() +print(PaginatedIntakeIssueResponse.to_json()) # convert the object into a dict paginated_intake_issue_response_dict = paginated_intake_issue_response_instance.to_dict() diff --git a/docs/PaginatedIssueActivityDetailResponse.md b/docs/PaginatedIssueActivityDetailResponse.md index af2148b..34d4d46 100644 --- a/docs/PaginatedIssueActivityDetailResponse.md +++ b/docs/PaginatedIssueActivityDetailResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **grouped_by** | **str** | | @@ -27,7 +28,7 @@ json = "{}" # create an instance of PaginatedIssueActivityDetailResponse from a JSON string paginated_issue_activity_detail_response_instance = PaginatedIssueActivityDetailResponse.from_json(json) # print the JSON string representation of the object -print PaginatedIssueActivityDetailResponse.to_json() +print(PaginatedIssueActivityDetailResponse.to_json()) # convert the object into a dict paginated_issue_activity_detail_response_dict = paginated_issue_activity_detail_response_instance.to_dict() diff --git a/docs/PaginatedIssueActivityResponse.md b/docs/PaginatedIssueActivityResponse.md index 24759e5..7f36b26 100644 --- a/docs/PaginatedIssueActivityResponse.md +++ b/docs/PaginatedIssueActivityResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **grouped_by** | **str** | | @@ -27,7 +28,7 @@ json = "{}" # create an instance of PaginatedIssueActivityResponse from a JSON string paginated_issue_activity_response_instance = PaginatedIssueActivityResponse.from_json(json) # print the JSON string representation of the object -print PaginatedIssueActivityResponse.to_json() +print(PaginatedIssueActivityResponse.to_json()) # convert the object into a dict paginated_issue_activity_response_dict = paginated_issue_activity_response_instance.to_dict() diff --git a/docs/PaginatedIssueCommentResponse.md b/docs/PaginatedIssueCommentResponse.md index f200106..f5e6b52 100644 --- a/docs/PaginatedIssueCommentResponse.md +++ b/docs/PaginatedIssueCommentResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **grouped_by** | **str** | | @@ -27,7 +28,7 @@ json = "{}" # create an instance of PaginatedIssueCommentResponse from a JSON string paginated_issue_comment_response_instance = PaginatedIssueCommentResponse.from_json(json) # print the JSON string representation of the object -print PaginatedIssueCommentResponse.to_json() +print(PaginatedIssueCommentResponse.to_json()) # convert the object into a dict paginated_issue_comment_response_dict = paginated_issue_comment_response_instance.to_dict() diff --git a/docs/PaginatedIssueLinkDetailResponse.md b/docs/PaginatedIssueLinkDetailResponse.md index a9d9d70..d1568fa 100644 --- a/docs/PaginatedIssueLinkDetailResponse.md +++ b/docs/PaginatedIssueLinkDetailResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **grouped_by** | **str** | | @@ -27,7 +28,7 @@ json = "{}" # create an instance of PaginatedIssueLinkDetailResponse from a JSON string paginated_issue_link_detail_response_instance = PaginatedIssueLinkDetailResponse.from_json(json) # print the JSON string representation of the object -print PaginatedIssueLinkDetailResponse.to_json() +print(PaginatedIssueLinkDetailResponse.to_json()) # convert the object into a dict paginated_issue_link_detail_response_dict = paginated_issue_link_detail_response_instance.to_dict() diff --git a/docs/PaginatedIssueLinkResponse.md b/docs/PaginatedIssueLinkResponse.md index 1850ce5..e83eca8 100644 --- a/docs/PaginatedIssueLinkResponse.md +++ b/docs/PaginatedIssueLinkResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **grouped_by** | **str** | | @@ -27,7 +28,7 @@ json = "{}" # create an instance of PaginatedIssueLinkResponse from a JSON string paginated_issue_link_response_instance = PaginatedIssueLinkResponse.from_json(json) # print the JSON string representation of the object -print PaginatedIssueLinkResponse.to_json() +print(PaginatedIssueLinkResponse.to_json()) # convert the object into a dict paginated_issue_link_response_dict = paginated_issue_link_response_instance.to_dict() diff --git a/docs/PaginatedLabelResponse.md b/docs/PaginatedLabelResponse.md index 79f8a35..c942371 100644 --- a/docs/PaginatedLabelResponse.md +++ b/docs/PaginatedLabelResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **grouped_by** | **str** | | @@ -27,7 +28,7 @@ json = "{}" # create an instance of PaginatedLabelResponse from a JSON string paginated_label_response_instance = PaginatedLabelResponse.from_json(json) # print the JSON string representation of the object -print PaginatedLabelResponse.to_json() +print(PaginatedLabelResponse.to_json()) # convert the object into a dict paginated_label_response_dict = paginated_label_response_instance.to_dict() diff --git a/docs/PaginatedModuleIssueResponse.md b/docs/PaginatedModuleIssueResponse.md index 1847eeb..7bf571a 100644 --- a/docs/PaginatedModuleIssueResponse.md +++ b/docs/PaginatedModuleIssueResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **grouped_by** | **str** | | @@ -27,7 +28,7 @@ json = "{}" # create an instance of PaginatedModuleIssueResponse from a JSON string paginated_module_issue_response_instance = PaginatedModuleIssueResponse.from_json(json) # print the JSON string representation of the object -print PaginatedModuleIssueResponse.to_json() +print(PaginatedModuleIssueResponse.to_json()) # convert the object into a dict paginated_module_issue_response_dict = paginated_module_issue_response_instance.to_dict() diff --git a/docs/PaginatedModuleResponse.md b/docs/PaginatedModuleResponse.md index 7b79ee0..ec34b4e 100644 --- a/docs/PaginatedModuleResponse.md +++ b/docs/PaginatedModuleResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **grouped_by** | **str** | | @@ -27,7 +28,7 @@ json = "{}" # create an instance of PaginatedModuleResponse from a JSON string paginated_module_response_instance = PaginatedModuleResponse.from_json(json) # print the JSON string representation of the object -print PaginatedModuleResponse.to_json() +print(PaginatedModuleResponse.to_json()) # convert the object into a dict paginated_module_response_dict = paginated_module_response_instance.to_dict() diff --git a/docs/PaginatedProjectResponse.md b/docs/PaginatedProjectResponse.md index 8851fe8..e270014 100644 --- a/docs/PaginatedProjectResponse.md +++ b/docs/PaginatedProjectResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **grouped_by** | **str** | | @@ -27,7 +28,7 @@ json = "{}" # create an instance of PaginatedProjectResponse from a JSON string paginated_project_response_instance = PaginatedProjectResponse.from_json(json) # print the JSON string representation of the object -print PaginatedProjectResponse.to_json() +print(PaginatedProjectResponse.to_json()) # convert the object into a dict paginated_project_response_dict = paginated_project_response_instance.to_dict() diff --git a/docs/PaginatedStateResponse.md b/docs/PaginatedStateResponse.md index f8f2f14..68d26e4 100644 --- a/docs/PaginatedStateResponse.md +++ b/docs/PaginatedStateResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **grouped_by** | **str** | | @@ -27,7 +28,7 @@ json = "{}" # create an instance of PaginatedStateResponse from a JSON string paginated_state_response_instance = PaginatedStateResponse.from_json(json) # print the JSON string representation of the object -print PaginatedStateResponse.to_json() +print(PaginatedStateResponse.to_json()) # convert the object into a dict paginated_state_response_dict = paginated_state_response_instance.to_dict() diff --git a/docs/PaginatedWorkItemResponse.md b/docs/PaginatedWorkItemResponse.md index 881613c..df04e4c 100644 --- a/docs/PaginatedWorkItemResponse.md +++ b/docs/PaginatedWorkItemResponse.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **grouped_by** | **str** | | @@ -27,7 +28,7 @@ json = "{}" # create an instance of PaginatedWorkItemResponse from a JSON string paginated_work_item_response_instance = PaginatedWorkItemResponse.from_json(json) # print the JSON string representation of the object -print PaginatedWorkItemResponse.to_json() +print(PaginatedWorkItemResponse.to_json()) # convert the object into a dict paginated_work_item_response_dict = paginated_work_item_response_instance.to_dict() diff --git a/docs/PatchedAssetUpdateRequest.md b/docs/PatchedAssetUpdateRequest.md index ea0b539..1a83448 100644 --- a/docs/PatchedAssetUpdateRequest.md +++ b/docs/PatchedAssetUpdateRequest.md @@ -3,6 +3,7 @@ Serializer for asset status updates after successful upload completion. Handles post-upload asset metadata updates including attribute modifications and upload confirmation for S3-based file storage workflows. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **attributes** | **object** | Additional attributes to update for the asset | [optional] @@ -17,7 +18,7 @@ json = "{}" # create an instance of PatchedAssetUpdateRequest from a JSON string patched_asset_update_request_instance = PatchedAssetUpdateRequest.from_json(json) # print the JSON string representation of the object -print PatchedAssetUpdateRequest.to_json() +print(PatchedAssetUpdateRequest.to_json()) # convert the object into a dict patched_asset_update_request_dict = patched_asset_update_request_instance.to_dict() diff --git a/docs/PatchedCycleUpdateRequest.md b/docs/PatchedCycleUpdateRequest.md index 130c177..e74472f 100644 --- a/docs/PatchedCycleUpdateRequest.md +++ b/docs/PatchedCycleUpdateRequest.md @@ -3,6 +3,7 @@ Serializer for updating cycles with enhanced ownership management. Extends cycle creation with update-specific features including ownership assignment and modification tracking for cycle lifecycle management. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | [optional] @@ -24,7 +25,7 @@ json = "{}" # create an instance of PatchedCycleUpdateRequest from a JSON string patched_cycle_update_request_instance = PatchedCycleUpdateRequest.from_json(json) # print the JSON string representation of the object -print PatchedCycleUpdateRequest.to_json() +print(PatchedCycleUpdateRequest.to_json()) # convert the object into a dict patched_cycle_update_request_dict = patched_cycle_update_request_instance.to_dict() diff --git a/docs/PatchedGenericAssetUpdateRequest.md b/docs/PatchedGenericAssetUpdateRequest.md index 9cc1e6c..66f96df 100644 --- a/docs/PatchedGenericAssetUpdateRequest.md +++ b/docs/PatchedGenericAssetUpdateRequest.md @@ -3,6 +3,7 @@ Serializer for generic asset upload confirmation and status management. Handles post-upload status updates for workspace assets including upload completion marking and metadata finalization. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **is_uploaded** | **bool** | Whether the asset has been successfully uploaded | [optional] [default to True] @@ -17,7 +18,7 @@ json = "{}" # create an instance of PatchedGenericAssetUpdateRequest from a JSON string patched_generic_asset_update_request_instance = PatchedGenericAssetUpdateRequest.from_json(json) # print the JSON string representation of the object -print PatchedGenericAssetUpdateRequest.to_json() +print(PatchedGenericAssetUpdateRequest.to_json()) # convert the object into a dict patched_generic_asset_update_request_dict = patched_generic_asset_update_request_instance.to_dict() diff --git a/docs/PatchedIntakeIssueUpdateRequest.md b/docs/PatchedIntakeIssueUpdateRequest.md index 99eed1d..f1b0151 100644 --- a/docs/PatchedIntakeIssueUpdateRequest.md +++ b/docs/PatchedIntakeIssueUpdateRequest.md @@ -3,6 +3,7 @@ Serializer for updating intake work items and their associated issues. Handles intake work item modifications including status changes, triage decisions, and embedded issue updates for issue queue processing workflows. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **status** | [**IntakeWorkItemStatusEnum**](IntakeWorkItemStatusEnum.md) | | [optional] @@ -22,7 +23,7 @@ json = "{}" # create an instance of PatchedIntakeIssueUpdateRequest from a JSON string patched_intake_issue_update_request_instance = PatchedIntakeIssueUpdateRequest.from_json(json) # print the JSON string representation of the object -print PatchedIntakeIssueUpdateRequest.to_json() +print(PatchedIntakeIssueUpdateRequest.to_json()) # convert the object into a dict patched_intake_issue_update_request_dict = patched_intake_issue_update_request_instance.to_dict() diff --git a/docs/PatchedIssueCommentCreateRequest.md b/docs/PatchedIssueCommentCreateRequest.md index 416272f..5d41564 100644 --- a/docs/PatchedIssueCommentCreateRequest.md +++ b/docs/PatchedIssueCommentCreateRequest.md @@ -3,6 +3,7 @@ Serializer for creating work item comments. Handles comment creation with JSON and HTML content support, access control, and external integration tracking. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **comment_json** | **object** | | [optional] @@ -21,7 +22,7 @@ json = "{}" # create an instance of PatchedIssueCommentCreateRequest from a JSON string patched_issue_comment_create_request_instance = PatchedIssueCommentCreateRequest.from_json(json) # print the JSON string representation of the object -print PatchedIssueCommentCreateRequest.to_json() +print(PatchedIssueCommentCreateRequest.to_json()) # convert the object into a dict patched_issue_comment_create_request_dict = patched_issue_comment_create_request_instance.to_dict() diff --git a/docs/PatchedIssueLinkUpdateRequest.md b/docs/PatchedIssueLinkUpdateRequest.md index 1a54581..e788d0b 100644 --- a/docs/PatchedIssueLinkUpdateRequest.md +++ b/docs/PatchedIssueLinkUpdateRequest.md @@ -3,6 +3,7 @@ Serializer for updating work item external links. Extends link creation with update-specific validation to prevent URL conflicts and maintain link integrity during modifications. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **url** | **str** | | [optional] @@ -17,7 +18,7 @@ json = "{}" # create an instance of PatchedIssueLinkUpdateRequest from a JSON string patched_issue_link_update_request_instance = PatchedIssueLinkUpdateRequest.from_json(json) # print the JSON string representation of the object -print PatchedIssueLinkUpdateRequest.to_json() +print(PatchedIssueLinkUpdateRequest.to_json()) # convert the object into a dict patched_issue_link_update_request_dict = patched_issue_link_update_request_instance.to_dict() diff --git a/docs/PatchedIssuePropertyAPIRequest.md b/docs/PatchedIssuePropertyAPIRequest.md index 8222e42..5bd70d8 100644 --- a/docs/PatchedIssuePropertyAPIRequest.md +++ b/docs/PatchedIssuePropertyAPIRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **relation_type** | [**RelationTypeEnum**](RelationTypeEnum.md) | | [optional] @@ -27,7 +28,7 @@ json = "{}" # create an instance of PatchedIssuePropertyAPIRequest from a JSON string patched_issue_property_api_request_instance = PatchedIssuePropertyAPIRequest.from_json(json) # print the JSON string representation of the object -print PatchedIssuePropertyAPIRequest.to_json() +print(PatchedIssuePropertyAPIRequest.to_json()) # convert the object into a dict patched_issue_property_api_request_dict = patched_issue_property_api_request_instance.to_dict() diff --git a/docs/PatchedIssuePropertyOptionAPIRequest.md b/docs/PatchedIssuePropertyOptionAPIRequest.md index 2fee3bd..0df7c16 100644 --- a/docs/PatchedIssuePropertyOptionAPIRequest.md +++ b/docs/PatchedIssuePropertyOptionAPIRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | [optional] @@ -22,7 +23,7 @@ json = "{}" # create an instance of PatchedIssuePropertyOptionAPIRequest from a JSON string patched_issue_property_option_api_request_instance = PatchedIssuePropertyOptionAPIRequest.from_json(json) # print the JSON string representation of the object -print PatchedIssuePropertyOptionAPIRequest.to_json() +print(PatchedIssuePropertyOptionAPIRequest.to_json()) # convert the object into a dict patched_issue_property_option_api_request_dict = patched_issue_property_option_api_request_instance.to_dict() diff --git a/docs/PatchedIssueRequest.md b/docs/PatchedIssueRequest.md index ff6dc37..1d161a6 100644 --- a/docs/PatchedIssueRequest.md +++ b/docs/PatchedIssueRequest.md @@ -3,6 +3,7 @@ Comprehensive work item serializer with full relationship management. Handles complete work item lifecycle including assignees, labels, validation, and related model updates. Supports dynamic field expansion and HTML content processing. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **assignees** | **List[str]** | | [optional] @@ -39,7 +40,7 @@ json = "{}" # create an instance of PatchedIssueRequest from a JSON string patched_issue_request_instance = PatchedIssueRequest.from_json(json) # print the JSON string representation of the object -print PatchedIssueRequest.to_json() +print(PatchedIssueRequest.to_json()) # convert the object into a dict patched_issue_request_dict = patched_issue_request_instance.to_dict() diff --git a/docs/PatchedIssueTypeAPIRequest.md b/docs/PatchedIssueTypeAPIRequest.md index e80c45b..a9f943d 100644 --- a/docs/PatchedIssueTypeAPIRequest.md +++ b/docs/PatchedIssueTypeAPIRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **project_ids** | **List[str]** | | [optional] @@ -22,7 +23,7 @@ json = "{}" # create an instance of PatchedIssueTypeAPIRequest from a JSON string patched_issue_type_api_request_instance = PatchedIssueTypeAPIRequest.from_json(json) # print the JSON string representation of the object -print PatchedIssueTypeAPIRequest.to_json() +print(PatchedIssueTypeAPIRequest.to_json()) # convert the object into a dict patched_issue_type_api_request_dict = patched_issue_type_api_request_instance.to_dict() diff --git a/docs/PatchedIssueWorkLogAPIRequest.md b/docs/PatchedIssueWorkLogAPIRequest.md index 48a3919..30e1218 100644 --- a/docs/PatchedIssueWorkLogAPIRequest.md +++ b/docs/PatchedIssueWorkLogAPIRequest.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **description** | **str** | | [optional] @@ -19,7 +20,7 @@ json = "{}" # create an instance of PatchedIssueWorkLogAPIRequest from a JSON string patched_issue_work_log_api_request_instance = PatchedIssueWorkLogAPIRequest.from_json(json) # print the JSON string representation of the object -print PatchedIssueWorkLogAPIRequest.to_json() +print(PatchedIssueWorkLogAPIRequest.to_json()) # convert the object into a dict patched_issue_work_log_api_request_dict = patched_issue_work_log_api_request_instance.to_dict() diff --git a/docs/PatchedLabelCreateUpdateRequest.md b/docs/PatchedLabelCreateUpdateRequest.md index 0f7c0b5..2d00428 100644 --- a/docs/PatchedLabelCreateUpdateRequest.md +++ b/docs/PatchedLabelCreateUpdateRequest.md @@ -3,6 +3,7 @@ Serializer for creating and updating work item labels. Manages label metadata including colors, descriptions, hierarchy, and sorting for work item categorization and filtering. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | [optional] @@ -23,7 +24,7 @@ json = "{}" # create an instance of PatchedLabelCreateUpdateRequest from a JSON string patched_label_create_update_request_instance = PatchedLabelCreateUpdateRequest.from_json(json) # print the JSON string representation of the object -print PatchedLabelCreateUpdateRequest.to_json() +print(PatchedLabelCreateUpdateRequest.to_json()) # convert the object into a dict patched_label_create_update_request_dict = patched_label_create_update_request_instance.to_dict() diff --git a/docs/PatchedModuleUpdateRequest.md b/docs/PatchedModuleUpdateRequest.md index 6b5ab49..21211ea 100644 --- a/docs/PatchedModuleUpdateRequest.md +++ b/docs/PatchedModuleUpdateRequest.md @@ -3,6 +3,7 @@ Serializer for updating modules with enhanced validation and member management. Extends module creation with update-specific validations including member reassignment, name conflict checking, and relationship management for module modifications. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | [optional] @@ -25,7 +26,7 @@ json = "{}" # create an instance of PatchedModuleUpdateRequest from a JSON string patched_module_update_request_instance = PatchedModuleUpdateRequest.from_json(json) # print the JSON string representation of the object -print PatchedModuleUpdateRequest.to_json() +print(PatchedModuleUpdateRequest.to_json()) # convert the object into a dict patched_module_update_request_dict = patched_module_update_request_instance.to_dict() diff --git a/docs/PatchedProjectUpdateRequest.md b/docs/PatchedProjectUpdateRequest.md index b3f3dbb..f6e1d0e 100644 --- a/docs/PatchedProjectUpdateRequest.md +++ b/docs/PatchedProjectUpdateRequest.md @@ -3,6 +3,7 @@ Serializer for updating projects with enhanced state and estimation management. Extends project creation with update-specific validations including default state assignment, estimation configuration, and project setting modifications. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | [optional] @@ -35,7 +36,7 @@ json = "{}" # create an instance of PatchedProjectUpdateRequest from a JSON string patched_project_update_request_instance = PatchedProjectUpdateRequest.from_json(json) # print the JSON string representation of the object -print PatchedProjectUpdateRequest.to_json() +print(PatchedProjectUpdateRequest.to_json()) # convert the object into a dict patched_project_update_request_dict = patched_project_update_request_instance.to_dict() diff --git a/docs/PatchedStateRequest.md b/docs/PatchedStateRequest.md index 676254f..0e067b9 100644 --- a/docs/PatchedStateRequest.md +++ b/docs/PatchedStateRequest.md @@ -3,6 +3,7 @@ Serializer for work item states with default state management. Handles state creation and updates including default state validation and automatic default state switching for workflow management. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | [optional] @@ -25,7 +26,7 @@ json = "{}" # create an instance of PatchedStateRequest from a JSON string patched_state_request_instance = PatchedStateRequest.from_json(json) # print the JSON string representation of the object -print PatchedStateRequest.to_json() +print(PatchedStateRequest.to_json()) # convert the object into a dict patched_state_request_dict = patched_state_request_instance.to_dict() diff --git a/docs/Project.md b/docs/Project.md index ef8ccf3..7384d24 100644 --- a/docs/Project.md +++ b/docs/Project.md @@ -3,6 +3,7 @@ Comprehensive project serializer with metrics and member context. Provides complete project data including member counts, cycle/module totals, deployment status, and user-specific context for project management. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -60,7 +61,7 @@ json = "{}" # create an instance of Project from a JSON string project_instance = Project.from_json(json) # print the JSON string representation of the object -print Project.to_json() +print(Project.to_json()) # convert the object into a dict project_dict = project_instance.to_dict() diff --git a/docs/ProjectCreateRequest.md b/docs/ProjectCreateRequest.md index 9be34a3..d390f8f 100644 --- a/docs/ProjectCreateRequest.md +++ b/docs/ProjectCreateRequest.md @@ -3,6 +3,7 @@ Serializer for creating projects with workspace validation. Handles project creation including identifier validation, member verification, and workspace association for new project initialization. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | @@ -33,7 +34,7 @@ json = "{}" # create an instance of ProjectCreateRequest from a JSON string project_create_request_instance = ProjectCreateRequest.from_json(json) # print the JSON string representation of the object -print ProjectCreateRequest.to_json() +print(ProjectCreateRequest.to_json()) # convert the object into a dict project_create_request_dict = project_create_request_instance.to_dict() diff --git a/docs/ProjectWorklogSummary.md b/docs/ProjectWorklogSummary.md index 49924a7..7121d9a 100644 --- a/docs/ProjectWorklogSummary.md +++ b/docs/ProjectWorklogSummary.md @@ -3,6 +3,7 @@ Serializer for project worklog summary with aggregated duration per issue ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **issue_id** | **str** | ID of the work item | @@ -18,7 +19,7 @@ json = "{}" # create an instance of ProjectWorklogSummary from a JSON string project_worklog_summary_instance = ProjectWorklogSummary.from_json(json) # print the JSON string representation of the object -print ProjectWorklogSummary.to_json() +print(ProjectWorklogSummary.to_json()) # convert the object into a dict project_worklog_summary_dict = project_worklog_summary_instance.to_dict() diff --git a/docs/ProjectsApi.md b/docs/ProjectsApi.md index d0f79c9..093e82b 100644 --- a/docs/ProjectsApi.md +++ b/docs/ProjectsApi.md @@ -25,9 +25,8 @@ Move a project to archived status, hiding it from active project lists. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -71,6 +70,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -90,6 +90,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -111,9 +112,8 @@ Create a new project in the workspace with default states and member assignments * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.project import Project from plane.models.project_create_request import ProjectCreateRequest @@ -161,6 +161,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **slug** | **str**| Workspace slug | @@ -180,6 +181,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -202,9 +204,8 @@ Permanently remove a project and all its associated data from the workspace. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -248,6 +249,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pk** | **str**| Project ID | @@ -267,6 +269,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -288,9 +291,8 @@ Retrieve all projects in a workspace or get details of a specific project. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.paginated_project_response import PaginatedProjectResponse from plane.rest import ApiException @@ -341,6 +343,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **slug** | **str**| Workspace slug | @@ -364,6 +367,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -385,9 +389,8 @@ Retrieve details of a specific project. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.project import Project from plane.rest import ApiException @@ -434,6 +437,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pk** | **str**| Project ID | @@ -453,6 +457,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -474,9 +479,8 @@ Restore an archived project to active status, making it available in regular wor * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -520,6 +524,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -539,6 +544,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -560,9 +566,8 @@ Partially update an existing project's properties like name, description, or set * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.patched_project_update_request import PatchedProjectUpdateRequest from plane.models.project import Project @@ -611,6 +616,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pk** | **str**| Project ID | @@ -631,6 +637,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | diff --git a/docs/RetrieveWorkItemAttachment400Response.md b/docs/RetrieveWorkItemAttachment400Response.md index 10f74b2..c33aa26 100644 --- a/docs/RetrieveWorkItemAttachment400Response.md +++ b/docs/RetrieveWorkItemAttachment400Response.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **error** | **str** | Error message | [optional] @@ -17,7 +18,7 @@ json = "{}" # create an instance of RetrieveWorkItemAttachment400Response from a JSON string retrieve_work_item_attachment400_response_instance = RetrieveWorkItemAttachment400Response.from_json(json) # print the JSON string representation of the object -print RetrieveWorkItemAttachment400Response.to_json() +print(RetrieveWorkItemAttachment400Response.to_json()) # convert the object into a dict retrieve_work_item_attachment400_response_dict = retrieve_work_item_attachment400_response_instance.to_dict() diff --git a/docs/State.md b/docs/State.md index f63249e..733e7fe 100644 --- a/docs/State.md +++ b/docs/State.md @@ -3,6 +3,7 @@ Serializer for work item states with default state management. Handles state creation and updates including default state validation and automatic default state switching for workflow management. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -33,7 +34,7 @@ json = "{}" # create an instance of State from a JSON string state_instance = State.from_json(json) # print the JSON string representation of the object -print State.to_json() +print(State.to_json()) # convert the object into a dict state_dict = state_instance.to_dict() diff --git a/docs/StateLite.md b/docs/StateLite.md index ad765b3..9a7dbe0 100644 --- a/docs/StateLite.md +++ b/docs/StateLite.md @@ -3,6 +3,7 @@ Lightweight state serializer for minimal data transfer. Provides essential state information including visual properties and grouping data optimized for UI display and filtering. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -20,7 +21,7 @@ json = "{}" # create an instance of StateLite from a JSON string state_lite_instance = StateLite.from_json(json) # print the JSON string representation of the object -print StateLite.to_json() +print(StateLite.to_json()) # convert the object into a dict state_lite_dict = state_lite_instance.to_dict() diff --git a/docs/StateRequest.md b/docs/StateRequest.md index 977cb64..25ee0e3 100644 --- a/docs/StateRequest.md +++ b/docs/StateRequest.md @@ -3,6 +3,7 @@ Serializer for work item states with default state management. Handles state creation and updates including default state validation and automatic default state switching for workflow management. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | | @@ -25,7 +26,7 @@ json = "{}" # create an instance of StateRequest from a JSON string state_request_instance = StateRequest.from_json(json) # print the JSON string representation of the object -print StateRequest.to_json() +print(StateRequest.to_json()) # convert the object into a dict state_request_dict = state_request_instance.to_dict() diff --git a/docs/StatesApi.md b/docs/StatesApi.md index 7f88590..658b61d 100644 --- a/docs/StatesApi.md +++ b/docs/StatesApi.md @@ -23,9 +23,8 @@ Create a new workflow state for a project with specified name, color, and group. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.state import State from plane.models.state_request import StateRequest @@ -74,6 +73,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -94,6 +94,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -117,9 +118,8 @@ Permanently remove a workflow state from a project. Default states and states wi * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -164,6 +164,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -184,6 +185,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -206,9 +208,8 @@ Retrieve all workflow states for a project. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.paginated_state_response import PaginatedStateResponse from plane.rest import ApiException @@ -259,6 +260,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -282,6 +284,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -303,9 +306,8 @@ Retrieve details of a specific state. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.state import State from plane.rest import ApiException @@ -353,6 +355,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -373,6 +376,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -394,9 +398,8 @@ Partially update an existing workflow state's properties like name, color, or gr * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.patched_state_request import PatchedStateRequest from plane.models.state import State @@ -446,6 +449,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -467,6 +471,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | diff --git a/docs/TransferCycleIssueRequestRequest.md b/docs/TransferCycleIssueRequestRequest.md index 6f3e449..f3345eb 100644 --- a/docs/TransferCycleIssueRequestRequest.md +++ b/docs/TransferCycleIssueRequestRequest.md @@ -3,6 +3,7 @@ Serializer for transferring work items between cycles. Handles work item migration between cycles including validation and relationship updates for sprint reallocation workflows. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **new_cycle_id** | **str** | ID of the target cycle to transfer issues to | @@ -17,7 +18,7 @@ json = "{}" # create an instance of TransferCycleIssueRequestRequest from a JSON string transfer_cycle_issue_request_request_instance = TransferCycleIssueRequestRequest.from_json(json) # print the JSON string representation of the object -print TransferCycleIssueRequestRequest.to_json() +print(TransferCycleIssueRequestRequest.to_json()) # convert the object into a dict transfer_cycle_issue_request_request_dict = transfer_cycle_issue_request_request_instance.to_dict() diff --git a/docs/TransferCycleWorkItems200Response.md b/docs/TransferCycleWorkItems200Response.md index c701d70..49e9c4e 100644 --- a/docs/TransferCycleWorkItems200Response.md +++ b/docs/TransferCycleWorkItems200Response.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **message** | **str** | Success message | [optional] @@ -16,7 +17,7 @@ json = "{}" # create an instance of TransferCycleWorkItems200Response from a JSON string transfer_cycle_work_items200_response_instance = TransferCycleWorkItems200Response.from_json(json) # print the JSON string representation of the object -print TransferCycleWorkItems200Response.to_json() +print(TransferCycleWorkItems200Response.to_json()) # convert the object into a dict transfer_cycle_work_items200_response_dict = transfer_cycle_work_items200_response_instance.to_dict() diff --git a/docs/TransferCycleWorkItems400Response.md b/docs/TransferCycleWorkItems400Response.md index bd08a49..2cc382b 100644 --- a/docs/TransferCycleWorkItems400Response.md +++ b/docs/TransferCycleWorkItems400Response.md @@ -2,6 +2,7 @@ ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **error** | **str** | Error message | [optional] @@ -16,7 +17,7 @@ json = "{}" # create an instance of TransferCycleWorkItems400Response from a JSON string transfer_cycle_work_items400_response_instance = TransferCycleWorkItems400Response.from_json(json) # print the JSON string representation of the object -print TransferCycleWorkItems400Response.to_json() +print(TransferCycleWorkItems400Response.to_json()) # convert the object into a dict transfer_cycle_work_items400_response_dict = transfer_cycle_work_items400_response_instance.to_dict() diff --git a/docs/UserAssetUploadRequest.md b/docs/UserAssetUploadRequest.md index 79e9ffe..b28b4ad 100644 --- a/docs/UserAssetUploadRequest.md +++ b/docs/UserAssetUploadRequest.md @@ -3,6 +3,7 @@ Serializer for user asset upload requests. This serializer validates the metadata required to generate a presigned URL for uploading user profile assets (avatar or cover image) directly to S3 storage. Supports JPEG, PNG, WebP, JPG, and GIF image formats with size validation. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **name** | **str** | Original filename of the asset | @@ -20,7 +21,7 @@ json = "{}" # create an instance of UserAssetUploadRequest from a JSON string user_asset_upload_request_instance = UserAssetUploadRequest.from_json(json) # print the JSON string representation of the object -print UserAssetUploadRequest.to_json() +print(UserAssetUploadRequest.to_json()) # convert the object into a dict user_asset_upload_request_dict = user_asset_upload_request_instance.to_dict() diff --git a/docs/UserLite.md b/docs/UserLite.md index 1d5f5df..1e8bf45 100644 --- a/docs/UserLite.md +++ b/docs/UserLite.md @@ -3,6 +3,7 @@ Lightweight user serializer for minimal data transfer. Provides essential user information including names, avatar, and contact details optimized for member lists, assignee displays, and user references. ## Properties + Name | Type | Description | Notes ------------ | ------------- | ------------- | ------------- **id** | **str** | | [optional] [readonly] @@ -23,7 +24,7 @@ json = "{}" # create an instance of UserLite from a JSON string user_lite_instance = UserLite.from_json(json) # print the JSON string representation of the object -print UserLite.to_json() +print(UserLite.to_json()) # convert the object into a dict user_lite_dict = user_lite_instance.to_dict() diff --git a/docs/UsersApi.md b/docs/UsersApi.md index 662a1cf..23f4254 100644 --- a/docs/UsersApi.md +++ b/docs/UsersApi.md @@ -19,9 +19,8 @@ Retrieve the authenticated user's profile information including basic details. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.user_lite import UserLite from plane.rest import ApiException @@ -65,6 +64,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + This endpoint does not need any parameter. ### Return type @@ -81,6 +81,7 @@ This endpoint does not need any parameter. - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | diff --git a/docs/WorkItemActivityApi.md b/docs/WorkItemActivityApi.md index 1c0ec5d..4314d89 100644 --- a/docs/WorkItemActivityApi.md +++ b/docs/WorkItemActivityApi.md @@ -20,9 +20,8 @@ Retrieve all activities for a work item. Supports filtering by activity type and * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.paginated_issue_activity_response import PaginatedIssueActivityResponse from plane.rest import ApiException @@ -75,6 +74,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| Issue ID | @@ -100,6 +100,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -122,9 +123,8 @@ Retrieve details of a specific activity. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.paginated_issue_activity_detail_response import PaginatedIssueActivityDetailResponse from plane.rest import ApiException @@ -178,6 +178,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| Issue ID | @@ -204,6 +205,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | diff --git a/docs/WorkItemAttachmentsApi.md b/docs/WorkItemAttachmentsApi.md index 00f6632..b80aa47 100644 --- a/docs/WorkItemAttachmentsApi.md +++ b/docs/WorkItemAttachmentsApi.md @@ -22,9 +22,8 @@ Generate presigned URL for uploading file attachments to a work item. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_attachment_upload_request import IssueAttachmentUploadRequest from plane.rest import ApiException @@ -71,6 +70,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| Issue ID | @@ -92,6 +92,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -114,9 +115,8 @@ Permanently remove an attachment from a work item. Records deletion activity for * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -162,6 +162,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| | @@ -183,6 +184,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -204,9 +206,8 @@ Retrieve all attachments for a work item. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_attachment import IssueAttachment from plane.rest import ApiException @@ -254,6 +255,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| Issue ID | @@ -274,6 +276,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -296,9 +299,8 @@ Download attachment file. Returns a redirect to the presigned download URL. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -344,6 +346,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| | @@ -365,6 +368,7 @@ void (empty response body) - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | diff --git a/docs/WorkItemCommentsApi.md b/docs/WorkItemCommentsApi.md index 1c9eb24..0922bb0 100644 --- a/docs/WorkItemCommentsApi.md +++ b/docs/WorkItemCommentsApi.md @@ -23,9 +23,8 @@ Add a new comment to a work item with HTML content. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_comment import IssueComment from plane.models.issue_comment_create_request import IssueCommentCreateRequest @@ -75,6 +74,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| Issue ID | @@ -96,6 +96,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -119,9 +120,8 @@ Permanently remove a comment from a work item. Records deletion activity for aud * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -167,6 +167,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| Issue ID | @@ -188,6 +189,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -209,9 +211,8 @@ Retrieve all comments for a work item. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.paginated_issue_comment_response import PaginatedIssueCommentResponse from plane.rest import ApiException @@ -264,6 +265,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| Issue ID | @@ -289,6 +291,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -310,9 +313,8 @@ Retrieve details of a specific comment. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_comment import IssueComment from plane.rest import ApiException @@ -361,6 +363,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| Issue ID | @@ -382,6 +385,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -404,9 +408,8 @@ Modify the content of an existing comment on a work item. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_comment import IssueComment from plane.models.patched_issue_comment_create_request import PatchedIssueCommentCreateRequest @@ -457,6 +460,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| Issue ID | @@ -479,6 +483,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | diff --git a/docs/WorkItemLinksApi.md b/docs/WorkItemLinksApi.md index 8953d99..98ab2cc 100644 --- a/docs/WorkItemLinksApi.md +++ b/docs/WorkItemLinksApi.md @@ -23,9 +23,8 @@ Add a new external link to a work item with URL, title, and metadata. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_link import IssueLink from plane.models.issue_link_create_request import IssueLinkCreateRequest @@ -75,6 +74,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| Issue ID | @@ -96,6 +96,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -118,9 +119,8 @@ Permanently remove an external link from a work item. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -166,6 +166,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| Issue ID | @@ -187,6 +188,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -208,9 +210,8 @@ Retrieve all links associated with a work item. Supports filtering by URL, title * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.paginated_issue_link_response import PaginatedIssueLinkResponse from plane.rest import ApiException @@ -263,6 +264,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| Issue ID | @@ -288,6 +290,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -310,9 +313,8 @@ Retrieve details of a specific work item link. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.paginated_issue_link_detail_response import PaginatedIssueLinkDetailResponse from plane.rest import ApiException @@ -365,6 +367,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| Issue ID | @@ -390,6 +393,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -411,9 +415,8 @@ Modify the URL, title, or metadata of an existing issue link. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_link import IssueLink from plane.models.patched_issue_link_update_request import PatchedIssueLinkUpdateRequest @@ -464,6 +467,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| Issue ID | @@ -486,6 +490,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | diff --git a/docs/WorkItemPropertiesApi.md b/docs/WorkItemPropertiesApi.md index fbf8dce..d682bff 100644 --- a/docs/WorkItemPropertiesApi.md +++ b/docs/WorkItemPropertiesApi.md @@ -30,9 +30,8 @@ Create a new issue property * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_property_api import IssuePropertyAPI from plane.models.issue_property_api_request import IssuePropertyAPIRequest @@ -82,6 +81,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -103,6 +103,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -125,9 +126,8 @@ Create a new issue property option * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_property_option_api import IssuePropertyOptionAPI from plane.models.issue_property_option_api_request import IssuePropertyOptionAPIRequest @@ -177,6 +177,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -198,6 +199,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -221,9 +223,8 @@ Create/update an issue property value * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_property_value_api import IssuePropertyValueAPI from plane.models.issue_property_value_api_request import IssuePropertyValueAPIRequest @@ -274,6 +275,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| | @@ -296,6 +298,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -318,9 +321,8 @@ Delete an issue property * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -366,6 +368,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -387,6 +390,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -408,9 +412,8 @@ Delete an issue property option * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -456,6 +459,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **option_id** | **str**| | @@ -477,6 +481,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -498,9 +503,8 @@ List issue properties * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_property_api import IssuePropertyAPI from plane.rest import ApiException @@ -548,6 +552,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -568,6 +573,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -589,9 +595,8 @@ List issue property options * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_property_option_api import IssuePropertyOptionAPI from plane.rest import ApiException @@ -639,6 +644,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -659,6 +665,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -680,9 +687,8 @@ List issue property values * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_property_value_api_detail import IssuePropertyValueAPIDetail from plane.rest import ApiException @@ -731,6 +737,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| | @@ -752,6 +759,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -773,9 +781,8 @@ Get issue property by id * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_property_api import IssuePropertyAPI from plane.rest import ApiException @@ -824,6 +831,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -845,6 +853,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -866,9 +875,8 @@ Get issue property option by id * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_property_option_api import IssuePropertyOptionAPI from plane.rest import ApiException @@ -917,6 +925,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **option_id** | **str**| | @@ -938,6 +947,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -959,9 +969,8 @@ Update an issue property * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_property_api import IssuePropertyAPI from plane.models.patched_issue_property_api_request import PatchedIssuePropertyAPIRequest @@ -1012,6 +1021,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -1034,6 +1044,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -1055,9 +1066,8 @@ Update an issue property option * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_property_option_api import IssuePropertyOptionAPI from plane.models.patched_issue_property_option_api_request import PatchedIssuePropertyOptionAPIRequest @@ -1108,6 +1118,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **option_id** | **str**| | @@ -1130,6 +1141,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | diff --git a/docs/WorkItemTypesApi.md b/docs/WorkItemTypesApi.md index 90d174f..0598ad6 100644 --- a/docs/WorkItemTypesApi.md +++ b/docs/WorkItemTypesApi.md @@ -23,9 +23,8 @@ Create a new issue type for a project * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_type_api import IssueTypeAPI from plane.models.issue_type_api_request import IssueTypeAPIRequest @@ -74,6 +73,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -94,6 +94,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -116,9 +117,8 @@ Delete an issue type * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -163,6 +163,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -183,6 +184,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -205,9 +207,8 @@ List all issue types for a project * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_type_api import IssueTypeAPI from plane.rest import ApiException @@ -254,6 +255,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -273,6 +275,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -294,9 +297,8 @@ Retrieve an issue type by id * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_type_api import IssueTypeAPI from plane.rest import ApiException @@ -344,6 +346,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -364,6 +367,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -385,9 +389,8 @@ Update an issue type * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_type_api import IssueTypeAPI from plane.models.patched_issue_type_api_request import PatchedIssueTypeAPIRequest @@ -437,6 +440,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -458,6 +462,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | diff --git a/docs/WorkItemWorklogsApi.md b/docs/WorkItemWorklogsApi.md index 1c30f25..43b75b2 100644 --- a/docs/WorkItemWorklogsApi.md +++ b/docs/WorkItemWorklogsApi.md @@ -23,9 +23,8 @@ Create a new worklog entry * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_work_log_api import IssueWorkLogAPI from plane.models.issue_work_log_api_request import IssueWorkLogAPIRequest @@ -75,6 +74,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| | @@ -96,6 +96,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -118,9 +119,8 @@ Delete a worklog entry * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -166,6 +166,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| | @@ -187,6 +188,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -208,9 +210,8 @@ Get project worklog summary * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.project_worklog_summary import ProjectWorklogSummary from plane.rest import ApiException @@ -257,6 +258,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -276,6 +278,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -297,9 +300,8 @@ List worklog entries * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_work_log_api import IssueWorkLogAPI from plane.rest import ApiException @@ -347,6 +349,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| | @@ -367,6 +370,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -388,9 +392,8 @@ Update a worklog entry * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_work_log_api import IssueWorkLogAPI from plane.models.patched_issue_work_log_api_request import PatchedIssueWorkLogAPIRequest @@ -441,6 +444,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_id** | **str**| | @@ -463,6 +467,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | diff --git a/docs/WorkItemsApi.md b/docs/WorkItemsApi.md index 3669edf..94deae1 100644 --- a/docs/WorkItemsApi.md +++ b/docs/WorkItemsApi.md @@ -25,9 +25,8 @@ Create a new work item in the specified project with the provided details. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue import Issue from plane.models.issue_request import IssueRequest @@ -76,6 +75,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -96,6 +96,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -119,9 +120,8 @@ Permanently delete an existing work item from the project. Only admins or the it * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.rest import ApiException from pprint import pprint @@ -166,6 +166,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pk** | **str**| | @@ -186,6 +187,7 @@ void (empty response body) - **Accept**: Not defined ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -207,9 +209,8 @@ Retrieve a specific work item using workspace slug, project identifier, and issu * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue import Issue from plane.rest import ApiException @@ -257,6 +258,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **issue_identifier** | **int**| Issue sequence ID (numeric identifier within project) | @@ -277,6 +279,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Work item details | - | @@ -296,9 +299,8 @@ Retrieve a paginated list of all work items in a project. Supports filtering, or * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.paginated_work_item_response import PaginatedWorkItemResponse from plane.rest import ApiException @@ -352,6 +354,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **project_id** | **str**| Project ID | @@ -378,6 +381,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -400,9 +404,8 @@ Retrieve details of a specific work item. * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_detail import IssueDetail from plane.rest import ApiException @@ -455,6 +458,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pk** | **str**| | @@ -480,6 +484,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | @@ -493,8 +498,6 @@ Name | Type | Description | Notes # **search_work_items** > IssueSearch search_work_items(search, slug, limit=limit, project_id=project_id, workspace_search=workspace_search) - - Perform semantic search across issue names, sequence IDs, and project identifiers. ### Example @@ -502,9 +505,8 @@ Perform semantic search across issue names, sequence IDs, and project identifier * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue_search import IssueSearch from plane.rest import ApiException @@ -553,6 +555,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **search** | **str**| Search query to filter results by name, description, or identifier | @@ -575,6 +578,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **200** | Work item search results | - | @@ -597,9 +601,8 @@ Partially update an existing work item with the provided fields. Supports extern * Api Key Authentication (ApiKeyAuthentication): * OAuth Authentication (OAuth2Authentication): * OAuth Authentication (OAuth2Authentication): + ```python -import time -import os import plane from plane.models.issue import Issue from plane.models.patched_issue_request import PatchedIssueRequest @@ -649,6 +652,7 @@ with plane.ApiClient(configuration) as api_client: ### Parameters + Name | Type | Description | Notes ------------- | ------------- | ------------- | ------------- **pk** | **str**| | @@ -670,6 +674,7 @@ Name | Type | Description | Notes - **Accept**: application/json ### HTTP response details + | Status code | Description | Response headers | |-------------|-------------|------------------| **401** | Authentication credentials were not provided or are invalid. | - | diff --git a/plane/__init__.py b/plane/__init__.py index cee8b5b..6329f1f 100644 --- a/plane/__init__.py +++ b/plane/__init__.py @@ -15,7 +15,7 @@ """ # noqa: E501 -__version__ = "0.1.6" +__version__ = "0.1.7" # import apis into sdk package from plane.api.assets_api import AssetsApi diff --git a/plane/api/assets_api.py b/plane/api/assets_api.py index 16f3b9f..1c39f9c 100644 --- a/plane/api/assets_api.py +++ b/plane/api/assets_api.py @@ -12,27 +12,18 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 - -from pydantic import validate_arguments - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr - -from typing import Optional from plane.models.generic_asset_upload_request import GenericAssetUploadRequest from plane.models.patched_asset_update_request import PatchedAssetUpdateRequest from plane.models.patched_generic_asset_update_request import PatchedGenericAssetUpdateRequest from plane.models.user_asset_upload_request import UserAssetUploadRequest -from plane.api_client import ApiClient +from plane.api_client import ApiClient, RequestSerialized from plane.api_response import ApiResponse -from plane.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from plane.rest import RESTResponseType class AssetsApi: @@ -47,582 +38,1158 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def create_generic_asset_upload(self, slug : Annotated[StrictStr, Field(..., description="Workspace slug")], generic_asset_upload_request : GenericAssetUploadRequest, **kwargs) -> None: # noqa: E501 - """Generate presigned URL for generic asset upload # noqa: E501 - Generate presigned URL for generic asset upload # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_generic_asset_upload( + self, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + generic_asset_upload_request: GenericAssetUploadRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Generate presigned URL for generic asset upload - >>> thread = api.create_generic_asset_upload(slug, generic_asset_upload_request, async_req=True) - >>> result = thread.get() + Generate presigned URL for generic asset upload :param slug: Workspace slug (required) :type slug: str :param generic_asset_upload_request: (required) :type generic_asset_upload_request: GenericAssetUploadRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the create_generic_asset_upload_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.create_generic_asset_upload_with_http_info(slug, generic_asset_upload_request, **kwargs) # noqa: E501 - - @validate_arguments - def create_generic_asset_upload_with_http_info(self, slug : Annotated[StrictStr, Field(..., description="Workspace slug")], generic_asset_upload_request : GenericAssetUploadRequest, **kwargs) -> ApiResponse: # noqa: E501 - """Generate presigned URL for generic asset upload # noqa: E501 - - Generate presigned URL for generic asset upload # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_generic_asset_upload_with_http_info(slug, generic_asset_upload_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._create_generic_asset_upload_serialize( + slug=slug, + generic_asset_upload_request=generic_asset_upload_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '200': None, + '400': None, + '404': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_generic_asset_upload_with_http_info( + self, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + generic_asset_upload_request: GenericAssetUploadRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Generate presigned URL for generic asset upload + + Generate presigned URL for generic asset upload :param slug: Workspace slug (required) :type slug: str :param generic_asset_upload_request: (required) :type generic_asset_upload_request: GenericAssetUploadRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._create_generic_asset_upload_serialize( + slug=slug, + generic_asset_upload_request=generic_asset_upload_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '200': None, + '400': None, + '404': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'slug', - 'generic_asset_upload_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def create_generic_asset_upload_without_preload_content( + self, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + generic_asset_upload_request: GenericAssetUploadRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Generate presigned URL for generic asset upload + + Generate presigned URL for generic asset upload + + :param slug: Workspace slug (required) + :type slug: str + :param generic_asset_upload_request: (required) + :type generic_asset_upload_request: GenericAssetUploadRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_generic_asset_upload_serialize( + slug=slug, + generic_asset_upload_request=generic_asset_upload_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_generic_asset_upload" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '200': None, + '400': None, + '404': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + def _create_generic_asset_upload_serialize( + self, + slug, + generic_asset_upload_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['generic_asset_upload_request'] is not None: - _body_params = _params['generic_asset_upload_request'] + if generic_asset_upload_request is not None: + _body_params = generic_asset_upload_request + + # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/assets/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{slug}/assets/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def create_user_asset_upload(self, user_asset_upload_request : UserAssetUploadRequest, **kwargs) -> None: # noqa: E501 - """Generate presigned URL for user asset upload # noqa: E501 - Generate presigned URL for user asset upload # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_user_asset_upload(user_asset_upload_request, async_req=True) - >>> result = thread.get() + + @validate_call + def create_user_asset_upload( + self, + user_asset_upload_request: UserAssetUploadRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Generate presigned URL for user asset upload + + Generate presigned URL for user asset upload :param user_asset_upload_request: (required) :type user_asset_upload_request: UserAssetUploadRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the create_user_asset_upload_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.create_user_asset_upload_with_http_info(user_asset_upload_request, **kwargs) # noqa: E501 - - @validate_arguments - def create_user_asset_upload_with_http_info(self, user_asset_upload_request : UserAssetUploadRequest, **kwargs) -> ApiResponse: # noqa: E501 - """Generate presigned URL for user asset upload # noqa: E501 - - Generate presigned URL for user asset upload # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_user_asset_upload_with_http_info(user_asset_upload_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._create_user_asset_upload_serialize( + user_asset_upload_request=user_asset_upload_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '200': None, + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_user_asset_upload_with_http_info( + self, + user_asset_upload_request: UserAssetUploadRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Generate presigned URL for user asset upload + + Generate presigned URL for user asset upload :param user_asset_upload_request: (required) :type user_asset_upload_request: UserAssetUploadRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._create_user_asset_upload_serialize( + user_asset_upload_request=user_asset_upload_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '200': None, + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'user_asset_upload_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def create_user_asset_upload_without_preload_content( + self, + user_asset_upload_request: UserAssetUploadRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Generate presigned URL for user asset upload + + Generate presigned URL for user asset upload + + :param user_asset_upload_request: (required) + :type user_asset_upload_request: UserAssetUploadRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_user_asset_upload_serialize( + user_asset_upload_request=user_asset_upload_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_user_asset_upload" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '200': None, + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} + def _create_user_asset_upload_serialize( + self, + user_asset_upload_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['user_asset_upload_request'] is not None: - _body_params = _params['user_asset_upload_request'] + if user_asset_upload_request is not None: + _body_params = user_asset_upload_request + + # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/assets/user-assets/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/assets/user-assets/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def delete_user_asset(self, asset_id : Annotated[StrictStr, Field(..., description="Asset ID")], **kwargs) -> None: # noqa: E501 - """Delete user asset # noqa: E501 - Delete user asset. Delete a user profile asset (avatar or cover image) and remove its reference from the user profile. This performs a soft delete by marking the asset as deleted and updating the user's profile. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_user_asset(asset_id, async_req=True) - >>> result = thread.get() + @validate_call + def delete_user_asset( + self, + asset_id: Annotated[StrictStr, Field(description="Asset ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete user asset + + Delete user asset. Delete a user profile asset (avatar or cover image) and remove its reference from the user profile. This performs a soft delete by marking the asset as deleted and updating the user's profile. :param asset_id: Asset ID (required) :type asset_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the delete_user_asset_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.delete_user_asset_with_http_info(asset_id, **kwargs) # noqa: E501 - - @validate_arguments - def delete_user_asset_with_http_info(self, asset_id : Annotated[StrictStr, Field(..., description="Asset ID")], **kwargs) -> ApiResponse: # noqa: E501 - """Delete user asset # noqa: E501 - - Delete user asset. Delete a user profile asset (avatar or cover image) and remove its reference from the user profile. This performs a soft delete by marking the asset as deleted and updating the user's profile. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_user_asset_with_http_info(asset_id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._delete_user_asset_serialize( + asset_id=asset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '204': None, + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_user_asset_with_http_info( + self, + asset_id: Annotated[StrictStr, Field(description="Asset ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete user asset + + Delete user asset. Delete a user profile asset (avatar or cover image) and remove its reference from the user profile. This performs a soft delete by marking the asset as deleted and updating the user's profile. :param asset_id: Asset ID (required) :type asset_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._delete_user_asset_serialize( + asset_id=asset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '204': None, + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'asset_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def delete_user_asset_without_preload_content( + self, + asset_id: Annotated[StrictStr, Field(description="Asset ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete user asset + + Delete user asset. Delete a user profile asset (avatar or cover image) and remove its reference from the user profile. This performs a soft delete by marking the asset as deleted and updating the user's profile. + + :param asset_id: Asset ID (required) + :type asset_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_user_asset_serialize( + asset_id=asset_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_user_asset" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '204': None, + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['asset_id'] is not None: - _path_params['asset_id'] = _params['asset_id'] + def _delete_user_asset_serialize( + self, + asset_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if asset_id is not None: + _path_params['asset_id'] = asset_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v1/assets/user-assets/{asset_id}/', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v1/assets/user-assets/{asset_id}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def get_generic_asset(self, asset_id : StrictStr, slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> None: # noqa: E501 - """Get presigned URL for asset download # noqa: E501 - Get presigned URL for asset download # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_generic_asset(asset_id, slug, async_req=True) - >>> result = thread.get() + @validate_call + def get_generic_asset( + self, + asset_id: StrictStr, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Get presigned URL for asset download + + Get presigned URL for asset download :param asset_id: (required) :type asset_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the get_generic_asset_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.get_generic_asset_with_http_info(asset_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def get_generic_asset_with_http_info(self, asset_id : StrictStr, slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Get presigned URL for asset download # noqa: E501 - - Get presigned URL for asset download # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_generic_asset_with_http_info(asset_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._get_generic_asset_serialize( + asset_id=asset_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '200': None, + '400': None, + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_generic_asset_with_http_info( + self, + asset_id: StrictStr, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Get presigned URL for asset download + + Get presigned URL for asset download :param asset_id: (required) :type asset_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._get_generic_asset_serialize( + asset_id=asset_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '200': None, + '400': None, + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'asset_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def get_generic_asset_without_preload_content( + self, + asset_id: StrictStr, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get presigned URL for asset download + + Get presigned URL for asset download + + :param asset_id: (required) + :type asset_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_generic_asset_serialize( + asset_id=asset_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_generic_asset" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '200': None, + '400': None, + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['asset_id'] is not None: - _path_params['asset_id'] = _params['asset_id'] + def _get_generic_asset_serialize( + self, + asset_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _host = None + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if asset_id is not None: + _path_params['asset_id'] = asset_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/assets/{asset_id}/', 'GET', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/assets/{asset_id}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def update_generic_asset(self, asset_id : Annotated[StrictStr, Field(..., description="Asset ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], patched_generic_asset_update_request : Optional[PatchedGenericAssetUpdateRequest] = None, **kwargs) -> None: # noqa: E501 - """Update generic asset after upload completion # noqa: E501 - Update generic asset after upload completion # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_generic_asset(asset_id, slug, patched_generic_asset_update_request, async_req=True) - >>> result = thread.get() + @validate_call + def update_generic_asset( + self, + asset_id: Annotated[StrictStr, Field(description="Asset ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_generic_asset_update_request: Optional[PatchedGenericAssetUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Update generic asset after upload completion + + Update generic asset after upload completion :param asset_id: Asset ID (required) :type asset_id: str @@ -630,33 +1197,77 @@ def update_generic_asset(self, asset_id : Annotated[StrictStr, Field(..., descri :type slug: str :param patched_generic_asset_update_request: :type patched_generic_asset_update_request: PatchedGenericAssetUpdateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the update_generic_asset_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.update_generic_asset_with_http_info(asset_id, slug, patched_generic_asset_update_request, **kwargs) # noqa: E501 - - @validate_arguments - def update_generic_asset_with_http_info(self, asset_id : Annotated[StrictStr, Field(..., description="Asset ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], patched_generic_asset_update_request : Optional[PatchedGenericAssetUpdateRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update generic asset after upload completion # noqa: E501 - - Update generic asset after upload completion # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_generic_asset_with_http_info(asset_id, slug, patched_generic_asset_update_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._update_generic_asset_serialize( + asset_id=asset_id, + slug=slug, + patched_generic_asset_update_request=patched_generic_asset_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '204': None, + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_generic_asset_with_http_info( + self, + asset_id: Annotated[StrictStr, Field(description="Asset ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_generic_asset_update_request: Optional[PatchedGenericAssetUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Update generic asset after upload completion + + Update generic asset after upload completion :param asset_id: Asset ID (required) :type asset_id: str @@ -664,257 +1275,499 @@ def update_generic_asset_with_http_info(self, asset_id : Annotated[StrictStr, Fi :type slug: str :param patched_generic_asset_update_request: :type patched_generic_asset_update_request: PatchedGenericAssetUpdateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() + """ # noqa: E501 + + _param = self._update_generic_asset_serialize( + asset_id=asset_id, + slug=slug, + patched_generic_asset_update_request=patched_generic_asset_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - 'asset_id', - 'slug', - 'patched_generic_asset_update_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '204': None, + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_generic_asset" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + @validate_call + def update_generic_asset_without_preload_content( + self, + asset_id: Annotated[StrictStr, Field(description="Asset ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_generic_asset_update_request: Optional[PatchedGenericAssetUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update generic asset after upload completion - # process the path parameters - _path_params = {} - if _params['asset_id'] is not None: - _path_params['asset_id'] = _params['asset_id'] + Update generic asset after upload completion - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + :param asset_id: Asset ID (required) + :type asset_id: str + :param slug: Workspace slug (required) + :type slug: str + :param patched_generic_asset_update_request: + :type patched_generic_asset_update_request: PatchedGenericAssetUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_generic_asset_serialize( + asset_id=asset_id, + slug=slug, + patched_generic_asset_update_request=patched_generic_asset_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '204': None, + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _update_generic_asset_serialize( + self, + asset_id, + slug, + patched_generic_asset_update_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if asset_id is not None: + _path_params['asset_id'] = asset_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_generic_asset_update_request'] is not None: - _body_params = _params['patched_generic_asset_update_request'] + if patched_generic_asset_update_request is not None: + _body_params = patched_generic_asset_update_request + + # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/assets/{asset_id}/', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v1/workspaces/{slug}/assets/{asset_id}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def update_user_asset(self, asset_id : Annotated[StrictStr, Field(..., description="Asset ID")], patched_asset_update_request : Optional[PatchedAssetUpdateRequest] = None, **kwargs) -> None: # noqa: E501 - """Mark user asset as uploaded # noqa: E501 - Mark user asset as uploaded # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_user_asset(asset_id, patched_asset_update_request, async_req=True) - >>> result = thread.get() + + @validate_call + def update_user_asset( + self, + asset_id: Annotated[StrictStr, Field(description="Asset ID")], + patched_asset_update_request: Optional[PatchedAssetUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Mark user asset as uploaded + + Mark user asset as uploaded :param asset_id: Asset ID (required) :type asset_id: str :param patched_asset_update_request: :type patched_asset_update_request: PatchedAssetUpdateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the update_user_asset_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.update_user_asset_with_http_info(asset_id, patched_asset_update_request, **kwargs) # noqa: E501 - - @validate_arguments - def update_user_asset_with_http_info(self, asset_id : Annotated[StrictStr, Field(..., description="Asset ID")], patched_asset_update_request : Optional[PatchedAssetUpdateRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Mark user asset as uploaded # noqa: E501 - - Mark user asset as uploaded # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_user_asset_with_http_info(asset_id, patched_asset_update_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._update_user_asset_serialize( + asset_id=asset_id, + patched_asset_update_request=patched_asset_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '204': None, + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_user_asset_with_http_info( + self, + asset_id: Annotated[StrictStr, Field(description="Asset ID")], + patched_asset_update_request: Optional[PatchedAssetUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Mark user asset as uploaded + + Mark user asset as uploaded :param asset_id: Asset ID (required) :type asset_id: str :param patched_asset_update_request: :type patched_asset_update_request: PatchedAssetUpdateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._update_user_asset_serialize( + asset_id=asset_id, + patched_asset_update_request=patched_asset_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '204': None, + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'asset_id', - 'patched_asset_update_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def update_user_asset_without_preload_content( + self, + asset_id: Annotated[StrictStr, Field(description="Asset ID")], + patched_asset_update_request: Optional[PatchedAssetUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Mark user asset as uploaded + + Mark user asset as uploaded + + :param asset_id: Asset ID (required) + :type asset_id: str + :param patched_asset_update_request: + :type patched_asset_update_request: PatchedAssetUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_user_asset_serialize( + asset_id=asset_id, + patched_asset_update_request=patched_asset_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_user_asset" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '204': None, + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['asset_id'] is not None: - _path_params['asset_id'] = _params['asset_id'] + def _update_user_asset_serialize( + self, + asset_id, + patched_asset_update_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if asset_id is not None: + _path_params['asset_id'] = asset_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_asset_update_request'] is not None: - _body_params = _params['patched_asset_update_request'] + if patched_asset_update_request is not None: + _body_params = patched_asset_update_request + + # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/assets/user-assets/{asset_id}/', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v1/assets/user-assets/{asset_id}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/plane/api/cycles_api.py b/plane/api/cycles_api.py index dd3f71d..1529505 100644 --- a/plane/api/cycles_api.py +++ b/plane/api/cycles_api.py @@ -12,15 +12,9 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 - -from pydantic import validate_arguments - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr - -from typing import Optional from plane.models.cycle import Cycle from plane.models.cycle_create_request import CycleCreateRequest @@ -33,12 +27,9 @@ from plane.models.transfer_cycle_issue_request_request import TransferCycleIssueRequestRequest from plane.models.transfer_cycle_work_items200_response import TransferCycleWorkItems200Response -from plane.api_client import ApiClient +from plane.api_client import ApiClient, RequestSerialized from plane.api_response import ApiResponse -from plane.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from plane.rest import RESTResponseType class CyclesApi: @@ -53,16 +44,30 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def add_cycle_work_items(self, cycle_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cycle_issue_request_request : CycleIssueRequestRequest, **kwargs) -> CycleIssue: # noqa: E501 - """Add Work Items to Cycle # noqa: E501 - Assign multiple work items to a cycle. Automatically handles bulk creation and updates with activity tracking. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def add_cycle_work_items( + self, + cycle_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cycle_issue_request_request: CycleIssueRequestRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CycleIssue: + """Add Work Items to Cycle - >>> thread = api.add_cycle_work_items(cycle_id, project_id, slug, cycle_issue_request_request, async_req=True) - >>> result = thread.get() + Assign multiple work items to a cycle. Automatically handles bulk creation and updates with activity tracking. :param cycle_id: (required) :type cycle_id: str @@ -72,33 +77,80 @@ def add_cycle_work_items(self, cycle_id : StrictStr, project_id : Annotated[Stri :type slug: str :param cycle_issue_request_request: (required) :type cycle_issue_request_request: CycleIssueRequestRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: CycleIssue - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the add_cycle_work_items_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.add_cycle_work_items_with_http_info(cycle_id, project_id, slug, cycle_issue_request_request, **kwargs) # noqa: E501 - - @validate_arguments - def add_cycle_work_items_with_http_info(self, cycle_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cycle_issue_request_request : CycleIssueRequestRequest, **kwargs) -> ApiResponse: # noqa: E501 - """Add Work Items to Cycle # noqa: E501 - - Assign multiple work items to a cycle. Automatically handles bulk creation and updates with activity tracking. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_cycle_work_items_with_http_info(cycle_id, project_id, slug, cycle_issue_request_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._add_cycle_work_items_serialize( + cycle_id=cycle_id, + project_id=project_id, + slug=slug, + cycle_issue_request_request=cycle_issue_request_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "CycleIssue", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def add_cycle_work_items_with_http_info( + self, + cycle_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cycle_issue_request_request: CycleIssueRequestRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CycleIssue]: + """Add Work Items to Cycle + + Assign multiple work items to a cycle. Automatically handles bulk creation and updates with activity tracking. :param cycle_id: (required) :type cycle_id: str @@ -108,136 +160,248 @@ def add_cycle_work_items_with_http_info(self, cycle_id : StrictStr, project_id : :type slug: str :param cycle_issue_request_request: (required) :type cycle_issue_request_request: CycleIssueRequestRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(CycleIssue, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'cycle_id', - 'project_id', - 'slug', - 'cycle_issue_request_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._add_cycle_work_items_serialize( + cycle_id=cycle_id, + project_id=project_id, + slug=slug, + cycle_issue_request_request=cycle_issue_request_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "CycleIssue", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def add_cycle_work_items_without_preload_content( + self, + cycle_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cycle_issue_request_request: CycleIssueRequestRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add Work Items to Cycle + + Assign multiple work items to a cycle. Automatically handles bulk creation and updates with activity tracking. + + :param cycle_id: (required) + :type cycle_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param cycle_issue_request_request: (required) + :type cycle_issue_request_request: CycleIssueRequestRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_cycle_work_items_serialize( + cycle_id=cycle_id, + project_id=project_id, + slug=slug, + cycle_issue_request_request=cycle_issue_request_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method add_cycle_work_items" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "CycleIssue", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['cycle_id'] is not None: - _path_params['cycle_id'] = _params['cycle_id'] + def _add_cycle_work_items_serialize( + self, + cycle_id, + project_id, + slug, + cycle_issue_request_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if cycle_id is not None: + _path_params['cycle_id'] = cycle_id + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['cycle_issue_request_request'] is not None: - _body_params = _params['cycle_issue_request_request'] + if cycle_issue_request_request is not None: + _body_params = cycle_issue_request_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "CycleIssue", - '400': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/cycles/{cycle_id}/cycle-issues/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/cycles/{cycle_id}/cycle-issues/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def archive_cycle(self, cycle_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> None: # noqa: E501 - """Archive cycle # noqa: E501 - Move a completed cycle to archived status for historical tracking. Only cycles that have ended can be archived. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.archive_cycle(cycle_id, project_id, slug, async_req=True) - >>> result = thread.get() + @validate_call + def archive_cycle( + self, + cycle_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Archive cycle + + Move a completed cycle to archived status for historical tracking. Only cycles that have ended can be archived. :param cycle_id: (required) :type cycle_id: str @@ -245,33 +409,78 @@ def archive_cycle(self, cycle_id : StrictStr, project_id : Annotated[StrictStr, :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the archive_cycle_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.archive_cycle_with_http_info(cycle_id, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def archive_cycle_with_http_info(self, cycle_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Archive cycle # noqa: E501 - - Move a completed cycle to archived status for historical tracking. Only cycles that have ended can be archived. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.archive_cycle_with_http_info(cycle_id, project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._archive_cycle_serialize( + cycle_id=cycle_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def archive_cycle_with_http_info( + self, + cycle_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Archive cycle + + Move a completed cycle to archived status for historical tracking. Only cycles that have ended can be archived. :param cycle_id: (required) :type cycle_id: str @@ -279,115 +488,218 @@ def archive_cycle_with_http_info(self, cycle_id : StrictStr, project_id : Annota :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._archive_cycle_serialize( + cycle_id=cycle_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'cycle_id', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def archive_cycle_without_preload_content( + self, + cycle_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Archive cycle + + Move a completed cycle to archived status for historical tracking. Only cycles that have ended can be archived. + + :param cycle_id: (required) + :type cycle_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._archive_cycle_serialize( + cycle_id=cycle_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method archive_cycle" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['cycle_id'] is not None: - _path_params['cycle_id'] = _params['cycle_id'] + def _archive_cycle_serialize( + self, + cycle_id, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if cycle_id is not None: + _path_params['cycle_id'] = cycle_id + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/cycles/{cycle_id}/archive/', 'POST', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/cycles/{cycle_id}/archive/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def create_cycle(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cycle_create_request : CycleCreateRequest, **kwargs) -> Cycle: # noqa: E501 - """Create cycle # noqa: E501 - Create a new development cycle with specified name, description, and date range. Supports external ID tracking for integration purposes. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_cycle(project_id, slug, cycle_create_request, async_req=True) - >>> result = thread.get() + @validate_call + def create_cycle( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cycle_create_request: CycleCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Cycle: + """Create cycle + + Create a new development cycle with specified name, description, and date range. Supports external ID tracking for integration purposes. :param project_id: Project ID (required) :type project_id: str @@ -395,33 +707,77 @@ def create_cycle(self, project_id : Annotated[StrictStr, Field(..., description= :type slug: str :param cycle_create_request: (required) :type cycle_create_request: CycleCreateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Cycle - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the create_cycle_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.create_cycle_with_http_info(project_id, slug, cycle_create_request, **kwargs) # noqa: E501 - - @validate_arguments - def create_cycle_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cycle_create_request : CycleCreateRequest, **kwargs) -> ApiResponse: # noqa: E501 - """Create cycle # noqa: E501 - - Create a new development cycle with specified name, description, and date range. Supports external ID tracking for integration purposes. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_cycle_with_http_info(project_id, slug, cycle_create_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._create_cycle_serialize( + project_id=project_id, + slug=slug, + cycle_create_request=cycle_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "Cycle", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_cycle_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cycle_create_request: CycleCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Cycle]: + """Create cycle + + Create a new development cycle with specified name, description, and date range. Supports external ID tracking for integration purposes. :param project_id: Project ID (required) :type project_id: str @@ -429,781 +785,844 @@ def create_cycle_with_http_info(self, project_id : Annotated[StrictStr, Field(.. :type slug: str :param cycle_create_request: (required) :type cycle_create_request: CycleCreateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Cycle, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'project_id', - 'slug', - 'cycle_create_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._create_cycle_serialize( + project_id=project_id, + slug=slug, + cycle_create_request=cycle_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_cycle" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] - - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] - - - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - if _params['cycle_create_request'] is not None: - _body_params = _params['cycle_create_request'] - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list - - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { + _response_types_map: Dict[str, Optional[str]] = { '401': None, '403': None, '404': None, '201': "Cycle", } - - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/cycles/', 'POST', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def delete_cycle(self, pk : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> None: # noqa: E501 - """Delete cycle # noqa: E501 + ) - Permanently remove a cycle and all its associated issue relationships # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_cycle(pk, project_id, slug, async_req=True) - >>> result = thread.get() + @validate_call + def create_cycle_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cycle_create_request: CycleCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create cycle - :param pk: (required) - :type pk: str - :param project_id: Project ID (required) - :type project_id: str - :param slug: Workspace slug (required) - :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the delete_cycle_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.delete_cycle_with_http_info(pk, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def delete_cycle_with_http_info(self, pk : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Delete cycle # noqa: E501 - - Permanently remove a cycle and all its associated issue relationships # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_cycle_with_http_info(pk, project_id, slug, async_req=True) - >>> result = thread.get() + Create a new development cycle with specified name, description, and date range. Supports external ID tracking for integration purposes. - :param pk: (required) - :type pk: str :param project_id: Project ID (required) :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + :param cycle_create_request: (required) + :type cycle_create_request: CycleCreateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = [ - 'pk', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._create_cycle_serialize( + project_id=project_id, + slug=slug, + cycle_create_request=cycle_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_cycle" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "Cycle", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + def _create_cycle_serialize( + self, + project_id, + slug, + cycle_create_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 + if cycle_create_request is not None: + _body_params = cycle_create_request + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/cycles/{pk}/', 'DELETE', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/cycles/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def delete_cycle_work_item(self, cycle_id : StrictStr, issue_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> None: # noqa: E501 - """Delete cycle work item # noqa: E501 - Remove a work item from a cycle while keeping the work item in the project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_cycle_work_item(cycle_id, issue_id, project_id, slug, async_req=True) - >>> result = thread.get() - :param cycle_id: (required) - :type cycle_id: str - :param issue_id: (required) - :type issue_id: str - :param project_id: Project ID (required) - :type project_id: str - :param slug: Workspace slug (required) - :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the delete_cycle_work_item_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.delete_cycle_work_item_with_http_info(cycle_id, issue_id, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def delete_cycle_work_item_with_http_info(self, cycle_id : StrictStr, issue_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Delete cycle work item # noqa: E501 - - Remove a work item from a cycle while keeping the work item in the project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_cycle_work_item_with_http_info(cycle_id, issue_id, project_id, slug, async_req=True) - >>> result = thread.get() + @validate_call + def delete_cycle( + self, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete cycle - :param cycle_id: (required) - :type cycle_id: str - :param issue_id: (required) - :type issue_id: str + Permanently remove a cycle and all its associated issue relationships + + :param pk: (required) + :type pk: str :param project_id: Project ID (required) :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = [ - 'cycle_id', - 'issue_id', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._delete_cycle_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_cycle_work_item" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_cycle_with_http_info( + self, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete cycle - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['cycle_id'] is not None: - _path_params['cycle_id'] = _params['cycle_id'] - - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] - - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] - - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] - - - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = {} - - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/cycles/{cycle_id}/cycle-issues/{issue_id}/', 'DELETE', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, - response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def list_archived_cycles(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> PaginatedArchivedCycleResponse: # noqa: E501 - """List archived cycles # noqa: E501 - - Retrieve all cycles that have been archived in the project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_archived_cycles(project_id, slug, cursor, per_page, async_req=True) - >>> result = thread.get() + Permanently remove a cycle and all its associated issue relationships + :param pk: (required) + :type pk: str :param project_id: Project ID (required) :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param cursor: Pagination cursor for getting next set of results - :type cursor: str - :param per_page: Number of results per page (default: 20, max: 100) - :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PaginatedArchivedCycleResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_archived_cycles_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_archived_cycles_with_http_info(project_id, slug, cursor, per_page, **kwargs) # noqa: E501 - - @validate_arguments - def list_archived_cycles_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """List archived cycles # noqa: E501 - - Retrieve all cycles that have been archived in the project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_archived_cycles_with_http_info(project_id, slug, cursor, per_page, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._delete_cycle_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_cycle_without_preload_content( + self, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete cycle + + Permanently remove a cycle and all its associated issue relationships + :param pk: (required) + :type pk: str :param project_id: Project ID (required) :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param cursor: Pagination cursor for getting next set of results - :type cursor: str - :param per_page: Number of results per page (default: 20, max: 100) - :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PaginatedArchivedCycleResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'project_id', - 'slug', - 'cursor', - 'per_page' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._delete_cycle_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_archived_cycles" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + def _delete_cycle_serialize( + self, + pk, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None - # process the query parameters - _query_params = [] - if _params.get('cursor') is not None: # noqa: E501 - _query_params.append(('cursor', _params['cursor'])) + _collection_formats: Dict[str, str] = { + } - if _params.get('per_page') is not None: # noqa: E501 - _query_params.append(('per_page', _params['per_page'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + # process the query parameters # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "PaginatedArchivedCycleResponse", - } - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/archived-cycles/', 'GET', - _path_params, - _query_params, - _header_params, + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/cycles/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def list_cycle_work_items(self, cycle_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> PaginatedCycleIssueResponse: # noqa: E501 - """List cycle work items # noqa: E501 - Retrieve all work items assigned to a cycle. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_cycle_work_items(cycle_id, project_id, slug, cursor, per_page, async_req=True) - >>> result = thread.get() + @validate_call + def delete_cycle_work_item( + self, + cycle_id: StrictStr, + issue_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete cycle work item + + Remove a work item from a cycle while keeping the work item in the project. :param cycle_id: (required) :type cycle_id: str + :param issue_id: (required) + :type issue_id: str :param project_id: Project ID (required) :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param cursor: Pagination cursor for getting next set of results - :type cursor: str - :param per_page: Number of results per page (default: 20, max: 100) - :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PaginatedCycleIssueResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_cycle_work_items_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_cycle_work_items_with_http_info(cycle_id, project_id, slug, cursor, per_page, **kwargs) # noqa: E501 - - @validate_arguments - def list_cycle_work_items_with_http_info(self, cycle_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """List cycle work items # noqa: E501 - - Retrieve all work items assigned to a cycle. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_cycle_work_items_with_http_info(cycle_id, project_id, slug, cursor, per_page, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._delete_cycle_work_item_serialize( + cycle_id=cycle_id, + issue_id=issue_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_cycle_work_item_with_http_info( + self, + cycle_id: StrictStr, + issue_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete cycle work item + + Remove a work item from a cycle while keeping the work item in the project. :param cycle_id: (required) :type cycle_id: str + :param issue_id: (required) + :type issue_id: str :param project_id: Project ID (required) :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param cursor: Pagination cursor for getting next set of results - :type cursor: str - :param per_page: Number of results per page (default: 20, max: 100) - :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PaginatedCycleIssueResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'cycle_id', - 'project_id', - 'slug', - 'cursor', - 'per_page' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._delete_cycle_work_item_serialize( + cycle_id=cycle_id, + issue_id=issue_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_cycle_work_items" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['cycle_id'] is not None: - _path_params['cycle_id'] = _params['cycle_id'] + @validate_call + def delete_cycle_work_item_without_preload_content( + self, + cycle_id: StrictStr, + issue_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete cycle work item + + Remove a work item from a cycle while keeping the work item in the project. + + :param cycle_id: (required) + :type cycle_id: str + :param issue_id: (required) + :type issue_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_cycle_work_item_serialize( + cycle_id=cycle_id, + issue_id=issue_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + def _delete_cycle_work_item_serialize( + self, + cycle_id, + issue_id, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None - # process the query parameters - _query_params = [] - if _params.get('cursor') is not None: # noqa: E501 - _query_params.append(('cursor', _params['cursor'])) + _collection_formats: Dict[str, str] = { + } - if _params.get('per_page') is not None: # noqa: E501 - _query_params.append(('per_page', _params['per_page'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if cycle_id is not None: + _path_params['cycle_id'] = cycle_id + if issue_id is not None: + _path_params['issue_id'] = issue_id + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + # process the query parameters # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "PaginatedCycleIssueResponse", - } - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/cycles/{cycle_id}/cycle-issues/', 'GET', - _path_params, - _query_params, - _header_params, + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/cycles/{cycle_id}/cycle-issues/{issue_id}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def list_cycles(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, cycle_view : Annotated[Optional[StrictStr], Field(description="Filter cycles by status")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> PaginatedCycleResponse: # noqa: E501 - """List cycles # noqa: E501 - Retrieve all cycles in a project. Supports filtering by cycle status like current, upcoming, completed, or draft. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_cycles(project_id, slug, cursor, cycle_view, expand, fields, order_by, per_page, async_req=True) - >>> result = thread.get() + @validate_call + def list_archived_cycles( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PaginatedArchivedCycleResponse: + """List archived cycles + + Retrieve all cycles that have been archived in the project. :param project_id: Project ID (required) :type project_id: str @@ -1211,43 +1630,81 @@ def list_cycles(self, project_id : Annotated[StrictStr, Field(..., description=" :type slug: str :param cursor: Pagination cursor for getting next set of results :type cursor: str - :param cycle_view: Filter cycles by status - :type cycle_view: str - :param expand: Comma-separated list of related fields to expand in response - :type expand: str - :param fields: Comma-separated list of fields to include in response - :type fields: str - :param order_by: Field to order results by. Prefix with '-' for descending order - :type order_by: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PaginatedCycleResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_cycles_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_cycles_with_http_info(project_id, slug, cursor, cycle_view, expand, fields, order_by, per_page, **kwargs) # noqa: E501 - - @validate_arguments - def list_cycles_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, cycle_view : Annotated[Optional[StrictStr], Field(description="Filter cycles by status")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """List cycles # noqa: E501 - - Retrieve all cycles in a project. Supports filtering by cycle status like current, upcoming, completed, or draft. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_cycles_with_http_info(project_id, slug, cursor, cycle_view, expand, fields, order_by, per_page, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_archived_cycles_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedArchivedCycleResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_archived_cycles_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PaginatedArchivedCycleResponse]: + """List archived cycles + + Retrieve all cycles that have been archived in the project. :param project_id: Project ID (required) :type project_id: str @@ -1255,188 +1712,1118 @@ def list_cycles_with_http_info(self, project_id : Annotated[StrictStr, Field(... :type slug: str :param cursor: Pagination cursor for getting next set of results :type cursor: str - :param cycle_view: Filter cycles by status - :type cycle_view: str - :param expand: Comma-separated list of related fields to expand in response - :type expand: str - :param fields: Comma-separated list of fields to include in response - :type fields: str - :param order_by: Field to order results by. Prefix with '-' for descending order - :type order_by: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PaginatedCycleResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'project_id', - 'slug', - 'cursor', - 'cycle_view', - 'expand', - 'fields', - 'order_by', - 'per_page' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_archived_cycles_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_cycles" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedArchivedCycleResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + @validate_call + def list_archived_cycles_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List archived cycles - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + Retrieve all cycles that have been archived in the project. + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param cursor: Pagination cursor for getting next set of results + :type cursor: str + :param per_page: Number of results per page (default: 20, max: 100) + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_archived_cycles_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - # process the query parameters - _query_params = [] - if _params.get('cursor') is not None: # noqa: E501 - _query_params.append(('cursor', _params['cursor'])) + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedArchivedCycleResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - if _params.get('cycle_view') is not None: # noqa: E501 - _query_params.append(('cycle_view', _params['cycle_view'])) - if _params.get('expand') is not None: # noqa: E501 - _query_params.append(('expand', _params['expand'])) + def _list_archived_cycles_serialize( + self, + project_id, + slug, + cursor, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params.get('fields') is not None: # noqa: E501 - _query_params.append(('fields', _params['fields'])) + _host = None - if _params.get('order_by') is not None: # noqa: E501 - _query_params.append(('order_by', _params['order_by'])) + _collection_formats: Dict[str, str] = { + } - if _params.get('per_page') is not None: # noqa: E501 - _query_params.append(('per_page', _params['per_page'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + # process the query parameters + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "PaginatedCycleResponse", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/cycles/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/archived-cycles/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def retrieve_cycle(self, pk : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> Cycle: # noqa: E501 - """Retrieve cycle # noqa: E501 - Retrieve details of a specific cycle by its ID. Supports cycle status filtering. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.retrieve_cycle(pk, project_id, slug, async_req=True) - >>> result = thread.get() - :param pk: (required) - :type pk: str - :param project_id: Project ID (required) - :type project_id: str + @validate_call + def list_cycle_work_items( + self, + cycle_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PaginatedCycleIssueResponse: + """List cycle work items + + Retrieve all work items assigned to a cycle. + + :param cycle_id: (required) + :type cycle_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param cursor: Pagination cursor for getting next set of results + :type cursor: str + :param per_page: Number of results per page (default: 20, max: 100) + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_cycle_work_items_serialize( + cycle_id=cycle_id, + project_id=project_id, + slug=slug, + cursor=cursor, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedCycleIssueResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_cycle_work_items_with_http_info( + self, + cycle_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PaginatedCycleIssueResponse]: + """List cycle work items + + Retrieve all work items assigned to a cycle. + + :param cycle_id: (required) + :type cycle_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param cursor: Pagination cursor for getting next set of results + :type cursor: str + :param per_page: Number of results per page (default: 20, max: 100) + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_cycle_work_items_serialize( + cycle_id=cycle_id, + project_id=project_id, + slug=slug, + cursor=cursor, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedCycleIssueResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_cycle_work_items_without_preload_content( + self, + cycle_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List cycle work items + + Retrieve all work items assigned to a cycle. + + :param cycle_id: (required) + :type cycle_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param cursor: Pagination cursor for getting next set of results + :type cursor: str + :param per_page: Number of results per page (default: 20, max: 100) + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_cycle_work_items_serialize( + cycle_id=cycle_id, + project_id=project_id, + slug=slug, + cursor=cursor, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedCycleIssueResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_cycle_work_items_serialize( + self, + cycle_id, + project_id, + slug, + cursor, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if cycle_id is not None: + _path_params['cycle_id'] = cycle_id + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + # process the query parameters + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/cycles/{cycle_id}/cycle-issues/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def list_cycles( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + cycle_view: Annotated[Optional[StrictStr], Field(description="Filter cycles by status")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PaginatedCycleResponse: + """List cycles + + Retrieve all cycles in a project. Supports filtering by cycle status like current, upcoming, completed, or draft. + + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param cursor: Pagination cursor for getting next set of results + :type cursor: str + :param cycle_view: Filter cycles by status + :type cycle_view: str + :param expand: Comma-separated list of related fields to expand in response + :type expand: str + :param fields: Comma-separated list of fields to include in response + :type fields: str + :param order_by: Field to order results by. Prefix with '-' for descending order + :type order_by: str + :param per_page: Number of results per page (default: 20, max: 100) + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_cycles_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + cycle_view=cycle_view, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedCycleResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_cycles_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + cycle_view: Annotated[Optional[StrictStr], Field(description="Filter cycles by status")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PaginatedCycleResponse]: + """List cycles + + Retrieve all cycles in a project. Supports filtering by cycle status like current, upcoming, completed, or draft. + + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param cursor: Pagination cursor for getting next set of results + :type cursor: str + :param cycle_view: Filter cycles by status + :type cycle_view: str + :param expand: Comma-separated list of related fields to expand in response + :type expand: str + :param fields: Comma-separated list of fields to include in response + :type fields: str + :param order_by: Field to order results by. Prefix with '-' for descending order + :type order_by: str + :param per_page: Number of results per page (default: 20, max: 100) + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_cycles_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + cycle_view=cycle_view, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedCycleResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_cycles_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + cycle_view: Annotated[Optional[StrictStr], Field(description="Filter cycles by status")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List cycles + + Retrieve all cycles in a project. Supports filtering by cycle status like current, upcoming, completed, or draft. + + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param cursor: Pagination cursor for getting next set of results + :type cursor: str + :param cycle_view: Filter cycles by status + :type cycle_view: str + :param expand: Comma-separated list of related fields to expand in response + :type expand: str + :param fields: Comma-separated list of fields to include in response + :type fields: str + :param order_by: Field to order results by. Prefix with '-' for descending order + :type order_by: str + :param per_page: Number of results per page (default: 20, max: 100) + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_cycles_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + cycle_view=cycle_view, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedCycleResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_cycles_serialize( + self, + project_id, + slug, + cursor, + cycle_view, + expand, + fields, + order_by, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + # process the query parameters + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if cycle_view is not None: + + _query_params.append(('cycle_view', cycle_view)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + if fields is not None: + + _query_params.append(('fields', fields)) + + if order_by is not None: + + _query_params.append(('order_by', order_by)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/cycles/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def retrieve_cycle( + self, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Cycle: + """Retrieve cycle + + Retrieve details of a specific cycle by its ID. Supports cycle status filtering. + + :param pk: (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_cycle_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Cycle", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_cycle_with_http_info( + self, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Cycle]: + """Retrieve cycle + + Retrieve details of a specific cycle by its ID. Supports cycle status filtering. + + :param pk: (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Cycle - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the retrieve_cycle_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.retrieve_cycle_with_http_info(pk, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def retrieve_cycle_with_http_info(self, pk : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Retrieve cycle # noqa: E501 - - Retrieve details of a specific cycle by its ID. Supports cycle status filtering. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_cycle_with_http_info(pk, project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._retrieve_cycle_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Cycle", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def retrieve_cycle_without_preload_content( + self, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve cycle + + Retrieve details of a specific cycle by its ID. Supports cycle status filtering. :param pk: (required) :type pk: str @@ -1444,291 +2831,546 @@ def retrieve_cycle_with_http_info(self, pk : StrictStr, project_id : Annotated[S :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_cycle_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Cycle", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_cycle_serialize( + self, + pk, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/cycles/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def retrieve_cycle_work_item( + self, + cycle_id: StrictStr, + issue_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> CycleIssue: + """Retrieve cycle work item + + Retrieve details of a specific cycle work item. + + :param cycle_id: (required) + :type cycle_id: str + :param issue_id: (required) + :type issue_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_cycle_work_item_serialize( + cycle_id=cycle_id, + issue_id=issue_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "CycleIssue", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_cycle_work_item_with_http_info( + self, + cycle_id: StrictStr, + issue_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[CycleIssue]: + """Retrieve cycle work item + + Retrieve details of a specific cycle work item. + + :param cycle_id: (required) + :type cycle_id: str + :param issue_id: (required) + :type issue_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_cycle_work_item_serialize( + cycle_id=cycle_id, + issue_id=issue_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "CycleIssue", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def retrieve_cycle_work_item_without_preload_content( + self, + cycle_id: StrictStr, + issue_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve cycle work item + + Retrieve details of a specific cycle work item. + + :param cycle_id: (required) + :type cycle_id: str + :param issue_id: (required) + :type issue_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Cycle, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'pk', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._retrieve_cycle_work_item_serialize( + cycle_id=cycle_id, + issue_id=issue_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method retrieve_cycle" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "CycleIssue", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + def _retrieve_cycle_work_item_serialize( + self, + cycle_id, + issue_id, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if cycle_id is not None: + _path_params['cycle_id'] = cycle_id + if issue_id is not None: + _path_params['issue_id'] = issue_id + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "Cycle", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/cycles/{pk}/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/cycles/{cycle_id}/cycle-issues/{issue_id}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def retrieve_cycle_work_item(self, cycle_id : StrictStr, issue_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> CycleIssue: # noqa: E501 - """Retrieve cycle work item # noqa: E501 - Retrieve details of a specific cycle work item. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.retrieve_cycle_work_item(cycle_id, issue_id, project_id, slug, async_req=True) - >>> result = thread.get() - :param cycle_id: (required) - :type cycle_id: str - :param issue_id: (required) - :type issue_id: str - :param project_id: Project ID (required) - :type project_id: str - :param slug: Workspace slug (required) - :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: CycleIssue - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the retrieve_cycle_work_item_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.retrieve_cycle_work_item_with_http_info(cycle_id, issue_id, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def retrieve_cycle_work_item_with_http_info(self, cycle_id : StrictStr, issue_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Retrieve cycle work item # noqa: E501 - - Retrieve details of a specific cycle work item. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_cycle_work_item_with_http_info(cycle_id, issue_id, project_id, slug, async_req=True) - >>> result = thread.get() + @validate_call + def transfer_cycle_work_items( + self, + cycle_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + transfer_cycle_issue_request_request: TransferCycleIssueRequestRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> TransferCycleWorkItems200Response: + """Transfer cycle work items + + Move incomplete work items from the current cycle to a new target cycle. Captures progress snapshot and transfers only unfinished work items. :param cycle_id: (required) :type cycle_id: str - :param issue_id: (required) - :type issue_id: str :param project_id: Project ID (required) :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + :param transfer_cycle_issue_request_request: (required) + :type transfer_cycle_issue_request_request: TransferCycleIssueRequestRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(CycleIssue, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'cycle_id', - 'issue_id', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._transfer_cycle_work_items_serialize( + cycle_id=cycle_id, + project_id=project_id, + slug=slug, + transfer_cycle_issue_request_request=transfer_cycle_issue_request_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method retrieve_cycle_work_item" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['cycle_id'] is not None: - _path_params['cycle_id'] = _params['cycle_id'] - - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] - - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] - - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] - - - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { + _response_types_map: Dict[str, Optional[str]] = { '401': None, '403': None, '404': None, - '200': "CycleIssue", + '200': "TransferCycleWorkItems200Response", + '400': "TransferCycleWorkItems400Response", } - - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/cycles/{cycle_id}/cycle-issues/{issue_id}/', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def transfer_cycle_work_items(self, cycle_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], transfer_cycle_issue_request_request : TransferCycleIssueRequestRequest, **kwargs) -> TransferCycleWorkItems200Response: # noqa: E501 - """Transfer cycle work items # noqa: E501 - - Move incomplete work items from the current cycle to a new target cycle. Captures progress snapshot and transfers only unfinished work items. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + ).data + + + @validate_call + def transfer_cycle_work_items_with_http_info( + self, + cycle_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + transfer_cycle_issue_request_request: TransferCycleIssueRequestRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[TransferCycleWorkItems200Response]: + """Transfer cycle work items - >>> thread = api.transfer_cycle_work_items(cycle_id, project_id, slug, transfer_cycle_issue_request_request, async_req=True) - >>> result = thread.get() + Move incomplete work items from the current cycle to a new target cycle. Captures progress snapshot and transfers only unfinished work items. :param cycle_id: (required) :type cycle_id: str @@ -1738,33 +3380,80 @@ def transfer_cycle_work_items(self, cycle_id : StrictStr, project_id : Annotated :type slug: str :param transfer_cycle_issue_request_request: (required) :type transfer_cycle_issue_request_request: TransferCycleIssueRequestRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: TransferCycleWorkItems200Response - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the transfer_cycle_work_items_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.transfer_cycle_work_items_with_http_info(cycle_id, project_id, slug, transfer_cycle_issue_request_request, **kwargs) # noqa: E501 - - @validate_arguments - def transfer_cycle_work_items_with_http_info(self, cycle_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], transfer_cycle_issue_request_request : TransferCycleIssueRequestRequest, **kwargs) -> ApiResponse: # noqa: E501 - """Transfer cycle work items # noqa: E501 - - Move incomplete work items from the current cycle to a new target cycle. Captures progress snapshot and transfers only unfinished work items. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.transfer_cycle_work_items_with_http_info(cycle_id, project_id, slug, transfer_cycle_issue_request_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._transfer_cycle_work_items_serialize( + cycle_id=cycle_id, + project_id=project_id, + slug=slug, + transfer_cycle_issue_request_request=transfer_cycle_issue_request_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "TransferCycleWorkItems200Response", + '400': "TransferCycleWorkItems400Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def transfer_cycle_work_items_without_preload_content( + self, + cycle_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + transfer_cycle_issue_request_request: TransferCycleIssueRequestRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Transfer cycle work items + + Move incomplete work items from the current cycle to a new target cycle. Captures progress snapshot and transfers only unfinished work items. :param cycle_id: (required) :type cycle_id: str @@ -1774,136 +3463,165 @@ def transfer_cycle_work_items_with_http_info(self, cycle_id : StrictStr, project :type slug: str :param transfer_cycle_issue_request_request: (required) :type transfer_cycle_issue_request_request: TransferCycleIssueRequestRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(TransferCycleWorkItems200Response, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'cycle_id', - 'project_id', - 'slug', - 'transfer_cycle_issue_request_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._transfer_cycle_work_items_serialize( + cycle_id=cycle_id, + project_id=project_id, + slug=slug, + transfer_cycle_issue_request_request=transfer_cycle_issue_request_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method transfer_cycle_work_items" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "TransferCycleWorkItems200Response", + '400': "TransferCycleWorkItems400Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['cycle_id'] is not None: - _path_params['cycle_id'] = _params['cycle_id'] + def _transfer_cycle_work_items_serialize( + self, + cycle_id, + project_id, + slug, + transfer_cycle_issue_request_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if cycle_id is not None: + _path_params['cycle_id'] = cycle_id + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['transfer_cycle_issue_request_request'] is not None: - _body_params = _params['transfer_cycle_issue_request_request'] + if transfer_cycle_issue_request_request is not None: + _body_params = transfer_cycle_issue_request_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "TransferCycleWorkItems200Response", - '400': "TransferCycleWorkItems400Response", - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/cycles/{cycle_id}/transfer-issues/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/cycles/{cycle_id}/transfer-issues/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def unarchive_cycle(self, pk : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> None: # noqa: E501 - """Unarchive cycle # noqa: E501 - Restore an archived cycle to active status, making it available for regular use. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def unarchive_cycle( + self, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Unarchive cycle - >>> thread = api.unarchive_cycle(pk, project_id, slug, async_req=True) - >>> result = thread.get() + Restore an archived cycle to active status, making it available for regular use. :param pk: (required) :type pk: str @@ -1911,33 +3629,77 @@ def unarchive_cycle(self, pk : StrictStr, project_id : Annotated[StrictStr, Fiel :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the unarchive_cycle_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.unarchive_cycle_with_http_info(pk, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def unarchive_cycle_with_http_info(self, pk : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Unarchive cycle # noqa: E501 - - Restore an archived cycle to active status, making it available for regular use. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.unarchive_cycle_with_http_info(pk, project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._unarchive_cycle_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def unarchive_cycle_with_http_info( + self, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Unarchive cycle + + Restore an archived cycle to active status, making it available for regular use. :param pk: (required) :type pk: str @@ -1945,115 +3707,217 @@ def unarchive_cycle_with_http_info(self, pk : StrictStr, project_id : Annotated[ :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._unarchive_cycle_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'pk', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def unarchive_cycle_without_preload_content( + self, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Unarchive cycle + + Restore an archived cycle to active status, making it available for regular use. + + :param pk: (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unarchive_cycle_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method unarchive_cycle" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + def _unarchive_cycle_serialize( + self, + pk, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/archived-cycles/{pk}/unarchive/', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/archived-cycles/{pk}/unarchive/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def update_cycle(self, pk : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], patched_cycle_update_request : Optional[PatchedCycleUpdateRequest] = None, **kwargs) -> Cycle: # noqa: E501 - """Update cycle # noqa: E501 - Modify an existing cycle's properties like name, description, or date range. Completed cycles can only have their sort order changed. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_cycle(pk, project_id, slug, patched_cycle_update_request, async_req=True) - >>> result = thread.get() + @validate_call + def update_cycle( + self, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_cycle_update_request: Optional[PatchedCycleUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Cycle: + """Update cycle + + Modify an existing cycle's properties like name, description, or date range. Completed cycles can only have their sort order changed. :param pk: (required) :type pk: str @@ -2063,33 +3927,79 @@ def update_cycle(self, pk : StrictStr, project_id : Annotated[StrictStr, Field(. :type slug: str :param patched_cycle_update_request: :type patched_cycle_update_request: PatchedCycleUpdateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Cycle - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the update_cycle_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.update_cycle_with_http_info(pk, project_id, slug, patched_cycle_update_request, **kwargs) # noqa: E501 - - @validate_arguments - def update_cycle_with_http_info(self, pk : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], patched_cycle_update_request : Optional[PatchedCycleUpdateRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update cycle # noqa: E501 - - Modify an existing cycle's properties like name, description, or date range. Completed cycles can only have their sort order changed. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_cycle_with_http_info(pk, project_id, slug, patched_cycle_update_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._update_cycle_serialize( + pk=pk, + project_id=project_id, + slug=slug, + patched_cycle_update_request=patched_cycle_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Cycle", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_cycle_with_http_info( + self, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_cycle_update_request: Optional[PatchedCycleUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Cycle]: + """Update cycle + + Modify an existing cycle's properties like name, description, or date range. Completed cycles can only have their sort order changed. :param pk: (required) :type pk: str @@ -2099,121 +4009,219 @@ def update_cycle_with_http_info(self, pk : StrictStr, project_id : Annotated[Str :type slug: str :param patched_cycle_update_request: :type patched_cycle_update_request: PatchedCycleUpdateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Cycle, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'pk', - 'project_id', - 'slug', - 'patched_cycle_update_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._update_cycle_serialize( + pk=pk, + project_id=project_id, + slug=slug, + patched_cycle_update_request=patched_cycle_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Cycle", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_cycle_without_preload_content( + self, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_cycle_update_request: Optional[PatchedCycleUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update cycle + + Modify an existing cycle's properties like name, description, or date range. Completed cycles can only have their sort order changed. + + :param pk: (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param patched_cycle_update_request: + :type patched_cycle_update_request: PatchedCycleUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_cycle_serialize( + pk=pk, + project_id=project_id, + slug=slug, + patched_cycle_update_request=patched_cycle_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_cycle" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Cycle", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + def _update_cycle_serialize( + self, + pk, + project_id, + slug, + patched_cycle_update_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_cycle_update_request'] is not None: - _body_params = _params['patched_cycle_update_request'] + if patched_cycle_update_request is not None: + _body_params = patched_cycle_update_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "Cycle", - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/cycles/{pk}/', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/cycles/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/plane/api/intake_api.py b/plane/api/intake_api.py index 01c652b..88aac51 100644 --- a/plane/api/intake_api.py +++ b/plane/api/intake_api.py @@ -12,27 +12,18 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 - -from pydantic import validate_arguments - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr - -from typing import Optional from plane.models.intake_issue import IntakeIssue from plane.models.intake_issue_create_request import IntakeIssueCreateRequest from plane.models.paginated_intake_issue_response import PaginatedIntakeIssueResponse from plane.models.patched_intake_issue_update_request import PatchedIntakeIssueUpdateRequest -from plane.api_client import ApiClient +from plane.api_client import ApiClient, RequestSerialized from plane.api_response import ApiResponse -from plane.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from plane.rest import RESTResponseType class IntakeApi: @@ -47,16 +38,29 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def create_intake_work_item(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], intake_issue_create_request : IntakeIssueCreateRequest, **kwargs) -> IntakeIssue: # noqa: E501 - """Create intake work item # noqa: E501 - Submit a new work item to the project's intake queue for review and triage. Automatically creates the work item with default triage state and tracks activity. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_intake_work_item( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + intake_issue_create_request: IntakeIssueCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IntakeIssue: + """Create intake work item - >>> thread = api.create_intake_work_item(project_id, slug, intake_issue_create_request, async_req=True) - >>> result = thread.get() + Submit a new work item to the project's intake queue for review and triage. Automatically creates the work item with default triage state and tracks activity. :param project_id: Project ID (required) :type project_id: str @@ -64,33 +68,78 @@ def create_intake_work_item(self, project_id : Annotated[StrictStr, Field(..., d :type slug: str :param intake_issue_create_request: (required) :type intake_issue_create_request: IntakeIssueCreateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: IntakeIssue - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the create_intake_work_item_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.create_intake_work_item_with_http_info(project_id, slug, intake_issue_create_request, **kwargs) # noqa: E501 - - @validate_arguments - def create_intake_work_item_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], intake_issue_create_request : IntakeIssueCreateRequest, **kwargs) -> ApiResponse: # noqa: E501 - """Create intake work item # noqa: E501 - - Submit a new work item to the project's intake queue for review and triage. Automatically creates the work item with default triage state and tracks activity. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_intake_work_item_with_http_info(project_id, slug, intake_issue_create_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._create_intake_work_item_serialize( + project_id=project_id, + slug=slug, + intake_issue_create_request=intake_issue_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IntakeIssue", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_intake_work_item_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + intake_issue_create_request: IntakeIssueCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IntakeIssue]: + """Create intake work item + + Submit a new work item to the project's intake queue for review and triage. Automatically creates the work item with default triage state and tracks activity. :param project_id: Project ID (required) :type project_id: str @@ -98,132 +147,240 @@ def create_intake_work_item_with_http_info(self, project_id : Annotated[StrictSt :type slug: str :param intake_issue_create_request: (required) :type intake_issue_create_request: IntakeIssueCreateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(IntakeIssue, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._create_intake_work_item_serialize( + project_id=project_id, + slug=slug, + intake_issue_create_request=intake_issue_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IntakeIssue", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'project_id', - 'slug', - 'intake_issue_create_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def create_intake_work_item_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + intake_issue_create_request: IntakeIssueCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create intake work item + + Submit a new work item to the project's intake queue for review and triage. Automatically creates the work item with default triage state and tracks activity. + + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param intake_issue_create_request: (required) + :type intake_issue_create_request: IntakeIssueCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_intake_work_item_serialize( + project_id=project_id, + slug=slug, + intake_issue_create_request=intake_issue_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_intake_work_item" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IntakeIssue", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + def _create_intake_work_item_serialize( + self, + project_id, + slug, + intake_issue_create_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['intake_issue_create_request'] is not None: - _body_params = _params['intake_issue_create_request'] + if intake_issue_create_request is not None: + _body_params = intake_issue_create_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '201': "IntakeIssue", - '400': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/intake-issues/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/intake-issues/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def delete_intake_work_item(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> None: # noqa: E501 - """Delete intake work item # noqa: E501 - Permanently remove an intake work item from the triage queue. Also deletes the underlying work item if it hasn't been accepted yet. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_intake_work_item(issue_id, project_id, slug, async_req=True) - >>> result = thread.get() + + @validate_call + def delete_intake_work_item( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete intake work item + + Permanently remove an intake work item from the triage queue. Also deletes the underlying work item if it hasn't been accepted yet. :param issue_id: Issue ID (required) :type issue_id: str @@ -231,33 +388,77 @@ def delete_intake_work_item(self, issue_id : Annotated[StrictStr, Field(..., des :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the delete_intake_work_item_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.delete_intake_work_item_with_http_info(issue_id, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def delete_intake_work_item_with_http_info(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Delete intake work item # noqa: E501 - - Permanently remove an intake work item from the triage queue. Also deletes the underlying work item if it hasn't been accepted yet. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_intake_work_item_with_http_info(issue_id, project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._delete_intake_work_item_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_intake_work_item_with_http_info( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete intake work item + + Permanently remove an intake work item from the triage queue. Also deletes the underlying work item if it hasn't been accepted yet. :param issue_id: Issue ID (required) :type issue_id: str @@ -265,115 +466,219 @@ def delete_intake_work_item_with_http_info(self, issue_id : Annotated[StrictStr, :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._delete_intake_work_item_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'issue_id', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def delete_intake_work_item_without_preload_content( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete intake work item + + Permanently remove an intake work item from the triage queue. Also deletes the underlying work item if it hasn't been accepted yet. + + :param issue_id: Issue ID (required) + :type issue_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_intake_work_item_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_intake_work_item" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] + def _delete_intake_work_item_serialize( + self, + issue_id, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/intake-issues/{issue_id}/', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/intake-issues/{issue_id}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def get_intake_work_items_list(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> PaginatedIntakeIssueResponse: # noqa: E501 - """List intake work items # noqa: E501 - Retrieve all work items in the project's intake queue. Returns paginated results when listing all intake work items. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_intake_work_items_list(project_id, slug, cursor, expand, fields, per_page, async_req=True) - >>> result = thread.get() + + @validate_call + def get_intake_work_items_list( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PaginatedIntakeIssueResponse: + """List intake work items + + Retrieve all work items in the project's intake queue. Returns paginated results when listing all intake work items. :param project_id: Project ID (required) :type project_id: str @@ -387,33 +692,83 @@ def get_intake_work_items_list(self, project_id : Annotated[StrictStr, Field(... :type fields: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PaginatedIntakeIssueResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the get_intake_work_items_list_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.get_intake_work_items_list_with_http_info(project_id, slug, cursor, expand, fields, per_page, **kwargs) # noqa: E501 - - @validate_arguments - def get_intake_work_items_list_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """List intake work items # noqa: E501 - - Retrieve all work items in the project's intake queue. Returns paginated results when listing all intake work items. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_intake_work_items_list_with_http_info(project_id, slug, cursor, expand, fields, per_page, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._get_intake_work_items_list_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedIntakeIssueResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_intake_work_items_list_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PaginatedIntakeIssueResponse]: + """List intake work items + + Retrieve all work items in the project's intake queue. Returns paginated results when listing all intake work items. :param project_id: Project ID (required) :type project_id: str @@ -427,136 +782,255 @@ def get_intake_work_items_list_with_http_info(self, project_id : Annotated[Stric :type fields: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PaginatedIntakeIssueResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'project_id', - 'slug', - 'cursor', - 'expand', - 'fields', - 'per_page' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._get_intake_work_items_list_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_intake_work_items_list" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedIntakeIssueResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + @validate_call + def get_intake_work_items_list_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List intake work items - # process the query parameters - _query_params = [] - if _params.get('cursor') is not None: # noqa: E501 - _query_params.append(('cursor', _params['cursor'])) + Retrieve all work items in the project's intake queue. Returns paginated results when listing all intake work items. - if _params.get('expand') is not None: # noqa: E501 - _query_params.append(('expand', _params['expand'])) + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param cursor: Pagination cursor for getting next set of results + :type cursor: str + :param expand: Comma-separated list of related fields to expand in response + :type expand: str + :param fields: Comma-separated list of fields to include in response + :type fields: str + :param per_page: Number of results per page (default: 20, max: 100) + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_intake_work_items_list_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('fields') is not None: # noqa: E501 - _query_params.append(('fields', _params['fields'])) + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedIntakeIssueResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _get_intake_work_items_list_serialize( + self, + project_id, + slug, + cursor, + expand, + fields, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('per_page') is not None: # noqa: E501 - _query_params.append(('per_page', _params['per_page'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + # process the query parameters + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + if fields is not None: + + _query_params.append(('fields', fields)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "PaginatedIntakeIssueResponse", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/intake-issues/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/intake-issues/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def retrieve_intake_work_item(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> IntakeIssue: # noqa: E501 - """Retrieve intake work item # noqa: E501 - Retrieve details of a specific intake work item. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.retrieve_intake_work_item(issue_id, project_id, slug, async_req=True) - >>> result = thread.get() + @validate_call + def retrieve_intake_work_item( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IntakeIssue: + """Retrieve intake work item + + Retrieve details of a specific intake work item. :param issue_id: Issue ID (required) :type issue_id: str @@ -564,33 +1038,77 @@ def retrieve_intake_work_item(self, issue_id : Annotated[StrictStr, Field(..., d :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: IntakeIssue - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the retrieve_intake_work_item_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.retrieve_intake_work_item_with_http_info(issue_id, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def retrieve_intake_work_item_with_http_info(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Retrieve intake work item # noqa: E501 - - Retrieve details of a specific intake work item. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_intake_work_item_with_http_info(issue_id, project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._retrieve_intake_work_item_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IntakeIssue", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_intake_work_item_with_http_info( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IntakeIssue]: + """Retrieve intake work item + + Retrieve details of a specific intake work item. :param issue_id: Issue ID (required) :type issue_id: str @@ -598,124 +1116,224 @@ def retrieve_intake_work_item_with_http_info(self, issue_id : Annotated[StrictSt :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(IntakeIssue, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._retrieve_intake_work_item_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IntakeIssue", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'issue_id', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def retrieve_intake_work_item_without_preload_content( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve intake work item + + Retrieve details of a specific intake work item. + + :param issue_id: Issue ID (required) + :type issue_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_intake_work_item_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method retrieve_intake_work_item" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IntakeIssue", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] + def _retrieve_intake_work_item_serialize( + self, + issue_id, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "IntakeIssue", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/intake-issues/{issue_id}/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/intake-issues/{issue_id}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def update_intake_work_item(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], patched_intake_issue_update_request : Optional[PatchedIntakeIssueUpdateRequest] = None, **kwargs) -> IntakeIssue: # noqa: E501 - """Update intake work item # noqa: E501 - Modify an existing intake work item's properties or status for triage processing. Supports status changes like accept, reject, or mark as duplicate. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_intake_work_item(issue_id, project_id, slug, patched_intake_issue_update_request, async_req=True) - >>> result = thread.get() + + @validate_call + def update_intake_work_item( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_intake_issue_update_request: Optional[PatchedIntakeIssueUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IntakeIssue: + """Update intake work item + + Modify an existing intake work item's properties or status for triage processing. Supports status changes like accept, reject, or mark as duplicate. :param issue_id: Issue ID (required) :type issue_id: str @@ -725,33 +1343,80 @@ def update_intake_work_item(self, issue_id : Annotated[StrictStr, Field(..., des :type slug: str :param patched_intake_issue_update_request: :type patched_intake_issue_update_request: PatchedIntakeIssueUpdateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: IntakeIssue - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the update_intake_work_item_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.update_intake_work_item_with_http_info(issue_id, project_id, slug, patched_intake_issue_update_request, **kwargs) # noqa: E501 - - @validate_arguments - def update_intake_work_item_with_http_info(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], patched_intake_issue_update_request : Optional[PatchedIntakeIssueUpdateRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update intake work item # noqa: E501 - - Modify an existing intake work item's properties or status for triage processing. Supports status changes like accept, reject, or mark as duplicate. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_intake_work_item_with_http_info(issue_id, project_id, slug, patched_intake_issue_update_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._update_intake_work_item_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + patched_intake_issue_update_request=patched_intake_issue_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IntakeIssue", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_intake_work_item_with_http_info( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_intake_issue_update_request: Optional[PatchedIntakeIssueUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IntakeIssue]: + """Update intake work item + + Modify an existing intake work item's properties or status for triage processing. Supports status changes like accept, reject, or mark as duplicate. :param issue_id: Issue ID (required) :type issue_id: str @@ -761,122 +1426,221 @@ def update_intake_work_item_with_http_info(self, issue_id : Annotated[StrictStr, :type slug: str :param patched_intake_issue_update_request: :type patched_intake_issue_update_request: PatchedIntakeIssueUpdateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(IntakeIssue, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'issue_id', - 'project_id', - 'slug', - 'patched_intake_issue_update_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._update_intake_work_item_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + patched_intake_issue_update_request=patched_intake_issue_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IntakeIssue", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_intake_work_item_without_preload_content( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_intake_issue_update_request: Optional[PatchedIntakeIssueUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update intake work item + + Modify an existing intake work item's properties or status for triage processing. Supports status changes like accept, reject, or mark as duplicate. + + :param issue_id: Issue ID (required) + :type issue_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param patched_intake_issue_update_request: + :type patched_intake_issue_update_request: PatchedIntakeIssueUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_intake_work_item_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + patched_intake_issue_update_request=patched_intake_issue_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_intake_work_item" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IntakeIssue", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] + def _update_intake_work_item_serialize( + self, + issue_id, + project_id, + slug, + patched_intake_issue_update_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_intake_issue_update_request'] is not None: - _body_params = _params['patched_intake_issue_update_request'] + if patched_intake_issue_update_request is not None: + _body_params = patched_intake_issue_update_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "IntakeIssue", - '400': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/intake-issues/{issue_id}/', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/intake-issues/{issue_id}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/plane/api/labels_api.py b/plane/api/labels_api.py index d60c44b..af08384 100644 --- a/plane/api/labels_api.py +++ b/plane/api/labels_api.py @@ -12,27 +12,18 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 - -from pydantic import validate_arguments - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr - -from typing import Optional from plane.models.label import Label from plane.models.label_create_update_request import LabelCreateUpdateRequest from plane.models.paginated_label_response import PaginatedLabelResponse from plane.models.patched_label_create_update_request import PatchedLabelCreateUpdateRequest -from plane.api_client import ApiClient +from plane.api_client import ApiClient, RequestSerialized from plane.api_response import ApiResponse -from plane.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from plane.rest import RESTResponseType class LabelsApi: @@ -47,16 +38,29 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def create_label(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], label_create_update_request : LabelCreateUpdateRequest, **kwargs) -> Label: # noqa: E501 - """Endpoints for label create/update/delete and fetch label details # noqa: E501 - Create a new label in the specified project with name, color, and description. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_label( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + label_create_update_request: LabelCreateUpdateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Label: + """Endpoints for label create/update/delete and fetch label details - >>> thread = api.create_label(project_id, slug, label_create_update_request, async_req=True) - >>> result = thread.get() + Create a new label in the specified project with name, color, and description. :param project_id: Project ID (required) :type project_id: str @@ -64,33 +68,79 @@ def create_label(self, project_id : Annotated[StrictStr, Field(..., description= :type slug: str :param label_create_update_request: (required) :type label_create_update_request: LabelCreateUpdateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Label - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the create_label_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.create_label_with_http_info(project_id, slug, label_create_update_request, **kwargs) # noqa: E501 - - @validate_arguments - def create_label_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], label_create_update_request : LabelCreateUpdateRequest, **kwargs) -> ApiResponse: # noqa: E501 - """Endpoints for label create/update/delete and fetch label details # noqa: E501 - - Create a new label in the specified project with name, color, and description. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_label_with_http_info(project_id, slug, label_create_update_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._create_label_serialize( + project_id=project_id, + slug=slug, + label_create_update_request=label_create_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "Label", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_label_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + label_create_update_request: LabelCreateUpdateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Label]: + """Endpoints for label create/update/delete and fetch label details + + Create a new label in the specified project with name, color, and description. :param project_id: Project ID (required) :type project_id: str @@ -98,133 +148,242 @@ def create_label_with_http_info(self, project_id : Annotated[StrictStr, Field(.. :type slug: str :param label_create_update_request: (required) :type label_create_update_request: LabelCreateUpdateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Label, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._create_label_serialize( + project_id=project_id, + slug=slug, + label_create_update_request=label_create_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "Label", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'project_id', - 'slug', - 'label_create_update_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def create_label_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + label_create_update_request: LabelCreateUpdateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Endpoints for label create/update/delete and fetch label details + + Create a new label in the specified project with name, color, and description. + + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param label_create_update_request: (required) + :type label_create_update_request: LabelCreateUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_label_serialize( + project_id=project_id, + slug=slug, + label_create_update_request=label_create_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_label" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "Label", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + def _create_label_serialize( + self, + project_id, + slug, + label_create_update_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['label_create_update_request'] is not None: - _body_params = _params['label_create_update_request'] + if label_create_update_request is not None: + _body_params = label_create_update_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '201': "Label", - '400': None, - '409': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/labels/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/labels/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def delete_label(self, pk : Annotated[StrictStr, Field(..., description="Label ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> None: # noqa: E501 - """Delete a label # noqa: E501 - Permanently remove a label from the project. This action cannot be undone. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_label(pk, project_id, slug, async_req=True) - >>> result = thread.get() + @validate_call + def delete_label( + self, + pk: Annotated[StrictStr, Field(description="Label ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete a label + + Permanently remove a label from the project. This action cannot be undone. :param pk: Label ID (required) :type pk: str @@ -232,33 +391,77 @@ def delete_label(self, pk : Annotated[StrictStr, Field(..., description="Label I :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the delete_label_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.delete_label_with_http_info(pk, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def delete_label_with_http_info(self, pk : Annotated[StrictStr, Field(..., description="Label ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Delete a label # noqa: E501 - - Permanently remove a label from the project. This action cannot be undone. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_label_with_http_info(pk, project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._delete_label_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_label_with_http_info( + self, + pk: Annotated[StrictStr, Field(description="Label ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete a label + + Permanently remove a label from the project. This action cannot be undone. :param pk: Label ID (required) :type pk: str @@ -266,115 +469,216 @@ def delete_label_with_http_info(self, pk : Annotated[StrictStr, Field(..., descr :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._delete_label_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'pk', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def delete_label_without_preload_content( + self, + pk: Annotated[StrictStr, Field(description="Label ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete a label + + Permanently remove a label from the project. This action cannot be undone. + + :param pk: Label ID (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_label_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_label" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + def _delete_label_serialize( + self, + pk, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/labels/{pk}/', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/labels/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def get_labels(self, pk : Annotated[StrictStr, Field(..., description="Label ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> Label: # noqa: E501 - """Endpoints for label create/update/delete and fetch label details # noqa: E501 - Retrieve details of a specific label. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_labels(pk, project_id, slug, async_req=True) - >>> result = thread.get() + + @validate_call + def get_labels( + self, + pk: Annotated[StrictStr, Field(description="Label ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Label: + """Endpoints for label create/update/delete and fetch label details + + Retrieve details of a specific label. :param pk: Label ID (required) :type pk: str @@ -382,33 +686,77 @@ def get_labels(self, pk : Annotated[StrictStr, Field(..., description="Label ID" :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Label - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the get_labels_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.get_labels_with_http_info(pk, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def get_labels_with_http_info(self, pk : Annotated[StrictStr, Field(..., description="Label ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Endpoints for label create/update/delete and fetch label details # noqa: E501 - - Retrieve details of a specific label. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_labels_with_http_info(pk, project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._get_labels_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Label", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_labels_with_http_info( + self, + pk: Annotated[StrictStr, Field(description="Label ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Label]: + """Endpoints for label create/update/delete and fetch label details + + Retrieve details of a specific label. :param pk: Label ID (required) :type pk: str @@ -416,124 +764,227 @@ def get_labels_with_http_info(self, pk : Annotated[StrictStr, Field(..., descrip :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Label, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_labels_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Label", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'pk', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def get_labels_without_preload_content( + self, + pk: Annotated[StrictStr, Field(description="Label ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Endpoints for label create/update/delete and fetch label details + + Retrieve details of a specific label. + + :param pk: Label ID (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_labels_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_labels" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Label", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + def _get_labels_serialize( + self, + pk, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "Label", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/labels/{pk}/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/labels/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def list_labels(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> PaginatedLabelResponse: # noqa: E501 - """Endpoints for label create/update/delete and fetch label details # noqa: E501 - Retrieve all labels in a project. Supports filtering by name and color. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_labels(project_id, slug, cursor, expand, fields, order_by, per_page, async_req=True) - >>> result = thread.get() + + @validate_call + def list_labels( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PaginatedLabelResponse: + """Endpoints for label create/update/delete and fetch label details + + Retrieve all labels in a project. Supports filtering by name and color. :param project_id: Project ID (required) :type project_id: str @@ -549,33 +1000,86 @@ def list_labels(self, project_id : Annotated[StrictStr, Field(..., description=" :type order_by: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PaginatedLabelResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_labels_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_labels_with_http_info(project_id, slug, cursor, expand, fields, order_by, per_page, **kwargs) # noqa: E501 - - @validate_arguments - def list_labels_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Endpoints for label create/update/delete and fetch label details # noqa: E501 - - Retrieve all labels in a project. Supports filtering by name and color. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_labels_with_http_info(project_id, slug, cursor, expand, fields, order_by, per_page, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_labels_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedLabelResponse", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_labels_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PaginatedLabelResponse]: + """Endpoints for label create/update/delete and fetch label details + + Retrieve all labels in a project. Supports filtering by name and color. :param project_id: Project ID (required) :type project_id: str @@ -591,141 +1095,268 @@ def list_labels_with_http_info(self, project_id : Annotated[StrictStr, Field(... :type order_by: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PaginatedLabelResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'project_id', - 'slug', - 'cursor', - 'expand', - 'fields', - 'order_by', - 'per_page' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_labels_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_labels" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] - - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedLabelResponse", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - # process the query parameters - _query_params = [] - if _params.get('cursor') is not None: # noqa: E501 - _query_params.append(('cursor', _params['cursor'])) + @validate_call + def list_labels_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Endpoints for label create/update/delete and fetch label details - if _params.get('expand') is not None: # noqa: E501 - _query_params.append(('expand', _params['expand'])) + Retrieve all labels in a project. Supports filtering by name and color. - if _params.get('fields') is not None: # noqa: E501 - _query_params.append(('fields', _params['fields'])) + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param cursor: Pagination cursor for getting next set of results + :type cursor: str + :param expand: Comma-separated list of related fields to expand in response + :type expand: str + :param fields: Comma-separated list of fields to include in response + :type fields: str + :param order_by: Field to order results by. Prefix with '-' for descending order + :type order_by: str + :param per_page: Number of results per page (default: 20, max: 100) + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_labels_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('order_by') is not None: # noqa: E501 - _query_params.append(('order_by', _params['order_by'])) + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedLabelResponse", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_labels_serialize( + self, + project_id, + slug, + cursor, + expand, + fields, + order_by, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('per_page') is not None: # noqa: E501 - _query_params.append(('per_page', _params['per_page'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + # process the query parameters + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + if fields is not None: + + _query_params.append(('fields', fields)) + + if order_by is not None: + + _query_params.append(('order_by', order_by)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "PaginatedLabelResponse", - '400': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/labels/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/labels/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def update_label(self, pk : Annotated[StrictStr, Field(..., description="Label ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], patched_label_create_update_request : Optional[PatchedLabelCreateUpdateRequest] = None, **kwargs) -> Label: # noqa: E501 - """Update a label # noqa: E501 - Partially update an existing label's properties like name, color, or description. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_label(pk, project_id, slug, patched_label_create_update_request, async_req=True) - >>> result = thread.get() + + @validate_call + def update_label( + self, + pk: Annotated[StrictStr, Field(description="Label ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_label_create_update_request: Optional[PatchedLabelCreateUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Label: + """Update a label + + Partially update an existing label's properties like name, color, or description. :param pk: Label ID (required) :type pk: str @@ -735,33 +1366,81 @@ def update_label(self, pk : Annotated[StrictStr, Field(..., description="Label I :type slug: str :param patched_label_create_update_request: :type patched_label_create_update_request: PatchedLabelCreateUpdateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Label - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the update_label_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.update_label_with_http_info(pk, project_id, slug, patched_label_create_update_request, **kwargs) # noqa: E501 - - @validate_arguments - def update_label_with_http_info(self, pk : Annotated[StrictStr, Field(..., description="Label ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], patched_label_create_update_request : Optional[PatchedLabelCreateUpdateRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update a label # noqa: E501 - - Partially update an existing label's properties like name, color, or description. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_label_with_http_info(pk, project_id, slug, patched_label_create_update_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._update_label_serialize( + pk=pk, + project_id=project_id, + slug=slug, + patched_label_create_update_request=patched_label_create_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Label", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_label_with_http_info( + self, + pk: Annotated[StrictStr, Field(description="Label ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_label_create_update_request: Optional[PatchedLabelCreateUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Label]: + """Update a label + + Partially update an existing label's properties like name, color, or description. :param pk: Label ID (required) :type pk: str @@ -771,123 +1450,223 @@ def update_label_with_http_info(self, pk : Annotated[StrictStr, Field(..., descr :type slug: str :param patched_label_create_update_request: :type patched_label_create_update_request: PatchedLabelCreateUpdateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Label, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'pk', - 'project_id', - 'slug', - 'patched_label_create_update_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._update_label_serialize( + pk=pk, + project_id=project_id, + slug=slug, + patched_label_create_update_request=patched_label_create_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Label", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_label_without_preload_content( + self, + pk: Annotated[StrictStr, Field(description="Label ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_label_create_update_request: Optional[PatchedLabelCreateUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a label + + Partially update an existing label's properties like name, color, or description. + + :param pk: Label ID (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param patched_label_create_update_request: + :type patched_label_create_update_request: PatchedLabelCreateUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_label_serialize( + pk=pk, + project_id=project_id, + slug=slug, + patched_label_create_update_request=patched_label_create_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_label" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Label", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + def _update_label_serialize( + self, + pk, + project_id, + slug, + patched_label_create_update_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_label_create_update_request'] is not None: - _body_params = _params['patched_label_create_update_request'] + if patched_label_create_update_request is not None: + _body_params = patched_label_create_update_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "Label", - '400': None, - '409': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/labels/{pk}/', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/labels/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/plane/api/members_api.py b/plane/api/members_api.py index c7fbe8e..f9253e9 100644 --- a/plane/api/members_api.py +++ b/plane/api/members_api.py @@ -12,25 +12,16 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 - -from pydantic import validate_arguments - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr - -from typing import List from plane.models.get_workspace_members200_response_inner import GetWorkspaceMembers200ResponseInner from plane.models.user_lite import UserLite -from plane.api_client import ApiClient +from plane.api_client import ApiClient, RequestSerialized from plane.api_response import ApiResponse -from plane.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from plane.rest import RESTResponseType class MembersApi: @@ -45,296 +36,561 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def get_project_members(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> List[UserLite]: # noqa: E501 - """List project members # noqa: E501 - Retrieve all users who are members of the specified project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def get_project_members( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[UserLite]: + """List project members - >>> thread = api.get_project_members(project_id, slug, async_req=True) - >>> result = thread.get() + Retrieve all users who are members of the specified project. :param project_id: Project ID (required) :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[UserLite] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the get_project_members_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.get_project_members_with_http_info(project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def get_project_members_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """List project members # noqa: E501 - - Retrieve all users who are members of the specified project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_project_members_with_http_info(project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._get_project_members_serialize( + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[UserLite]", + '401': None, + '403': None, + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_project_members_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[UserLite]]: + """List project members + + Retrieve all users who are members of the specified project. :param project_id: Project ID (required) :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[UserLite], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_project_members_serialize( + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[UserLite]", + '401': None, + '403': None, + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def get_project_members_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List project members + + Retrieve all users who are members of the specified project. + + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_project_members_serialize( + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[UserLite]", + '401': None, + '403': None, + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_project_members" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _get_project_members_serialize( + self, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '200': "List[UserLite]", - '401': None, - '403': None, - '404': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/members/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/members/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def get_workspace_members(self, slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> List[GetWorkspaceMembers200ResponseInner]: # noqa: E501 - """List workspace members # noqa: E501 - Retrieve all users who are members of the specified workspace. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workspace_members(slug, async_req=True) - >>> result = thread.get() + + @validate_call + def get_workspace_members( + self, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[GetWorkspaceMembers200ResponseInner]: + """List workspace members + + Retrieve all users who are members of the specified workspace. :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[GetWorkspaceMembers200ResponseInner] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the get_workspace_members_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.get_workspace_members_with_http_info(slug, **kwargs) # noqa: E501 - - @validate_arguments - def get_workspace_members_with_http_info(self, slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """List workspace members # noqa: E501 - - Retrieve all users who are members of the specified workspace. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_workspace_members_with_http_info(slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._get_workspace_members_serialize( + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[GetWorkspaceMembers200ResponseInner]", + '401': None, + '403': None, + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_workspace_members_with_http_info( + self, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[GetWorkspaceMembers200ResponseInner]]: + """List workspace members + + Retrieve all users who are members of the specified workspace. :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[GetWorkspaceMembers200ResponseInner], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_workspace_members_serialize( + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[GetWorkspaceMembers200ResponseInner]", + '401': None, + '403': None, + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def get_workspace_members_without_preload_content( + self, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List workspace members + + Retrieve all users who are members of the specified workspace. + + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_workspace_members_serialize( + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_workspace_members" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "List[GetWorkspaceMembers200ResponseInner]", + '401': None, + '403': None, + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + def _get_workspace_members_serialize( + self, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '200': "List[GetWorkspaceMembers200ResponseInner]", - '401': None, - '403': None, - '404': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/members/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/members/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/plane/api/modules_api.py b/plane/api/modules_api.py index 56fc7e9..fdf56e1 100644 --- a/plane/api/modules_api.py +++ b/plane/api/modules_api.py @@ -12,15 +12,9 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 - -from pydantic import validate_arguments - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr - -from typing import Optional from plane.models.module import Module from plane.models.module_create_request import ModuleCreateRequest @@ -31,12 +25,9 @@ from plane.models.paginated_module_response import PaginatedModuleResponse from plane.models.patched_module_update_request import PatchedModuleUpdateRequest -from plane.api_client import ApiClient +from plane.api_client import ApiClient, RequestSerialized from plane.api_response import ApiResponse -from plane.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from plane.rest import RESTResponseType class ModulesApi: @@ -51,16 +42,30 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def add_module_work_items(self, module_id : Annotated[StrictStr, Field(..., description="Module ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], module_issue_request_request : ModuleIssueRequestRequest, **kwargs) -> ModuleIssue: # noqa: E501 - """Add Work Items to Module # noqa: E501 - Assign multiple work items to a module or move them from another module. Automatically handles bulk creation and updates with activity tracking. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def add_module_work_items( + self, + module_id: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + module_issue_request_request: ModuleIssueRequestRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ModuleIssue: + """Add Work Items to Module - >>> thread = api.add_module_work_items(module_id, project_id, slug, module_issue_request_request, async_req=True) - >>> result = thread.get() + Assign multiple work items to a module or move them from another module. Automatically handles bulk creation and updates with activity tracking. :param module_id: Module ID (required) :type module_id: str @@ -70,33 +75,80 @@ def add_module_work_items(self, module_id : Annotated[StrictStr, Field(..., desc :type slug: str :param module_issue_request_request: (required) :type module_issue_request_request: ModuleIssueRequestRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: ModuleIssue - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the add_module_work_items_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.add_module_work_items_with_http_info(module_id, project_id, slug, module_issue_request_request, **kwargs) # noqa: E501 - - @validate_arguments - def add_module_work_items_with_http_info(self, module_id : Annotated[StrictStr, Field(..., description="Module ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], module_issue_request_request : ModuleIssueRequestRequest, **kwargs) -> ApiResponse: # noqa: E501 - """Add Work Items to Module # noqa: E501 - - Assign multiple work items to a module or move them from another module. Automatically handles bulk creation and updates with activity tracking. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.add_module_work_items_with_http_info(module_id, project_id, slug, module_issue_request_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._add_module_work_items_serialize( + module_id=module_id, + project_id=project_id, + slug=slug, + module_issue_request_request=module_issue_request_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "ModuleIssue", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def add_module_work_items_with_http_info( + self, + module_id: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + module_issue_request_request: ModuleIssueRequestRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[ModuleIssue]: + """Add Work Items to Module + + Assign multiple work items to a module or move them from another module. Automatically handles bulk creation and updates with activity tracking. :param module_id: Module ID (required) :type module_id: str @@ -106,136 +158,248 @@ def add_module_work_items_with_http_info(self, module_id : Annotated[StrictStr, :type slug: str :param module_issue_request_request: (required) :type module_issue_request_request: ModuleIssueRequestRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(ModuleIssue, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'module_id', - 'project_id', - 'slug', - 'module_issue_request_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._add_module_work_items_serialize( + module_id=module_id, + project_id=project_id, + slug=slug, + module_issue_request_request=module_issue_request_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "ModuleIssue", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def add_module_work_items_without_preload_content( + self, + module_id: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + module_issue_request_request: ModuleIssueRequestRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Add Work Items to Module + + Assign multiple work items to a module or move them from another module. Automatically handles bulk creation and updates with activity tracking. + + :param module_id: Module ID (required) + :type module_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param module_issue_request_request: (required) + :type module_issue_request_request: ModuleIssueRequestRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._add_module_work_items_serialize( + module_id=module_id, + project_id=project_id, + slug=slug, + module_issue_request_request=module_issue_request_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method add_module_work_items" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "ModuleIssue", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['module_id'] is not None: - _path_params['module_id'] = _params['module_id'] + def _add_module_work_items_serialize( + self, + module_id, + project_id, + slug, + module_issue_request_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if module_id is not None: + _path_params['module_id'] = module_id + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['module_issue_request_request'] is not None: - _body_params = _params['module_issue_request_request'] + if module_issue_request_request is not None: + _body_params = module_issue_request_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "ModuleIssue", - '400': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/modules/{module_id}/module-issues/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/modules/{module_id}/module-issues/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def archive_module(self, pk : Annotated[StrictStr, Field(..., description="Module ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> None: # noqa: E501 - """Archive module # noqa: E501 - Move a module to archived status for historical tracking. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.archive_module(pk, project_id, slug, async_req=True) - >>> result = thread.get() + @validate_call + def archive_module( + self, + pk: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Archive module + + Move a module to archived status for historical tracking. :param pk: Module ID (required) :type pk: str @@ -243,33 +407,78 @@ def archive_module(self, pk : Annotated[StrictStr, Field(..., description="Modul :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the archive_module_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.archive_module_with_http_info(pk, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def archive_module_with_http_info(self, pk : Annotated[StrictStr, Field(..., description="Module ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Archive module # noqa: E501 - - Move a module to archived status for historical tracking. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.archive_module_with_http_info(pk, project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._archive_module_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def archive_module_with_http_info( + self, + pk: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Archive module + + Move a module to archived status for historical tracking. :param pk: Module ID (required) :type pk: str @@ -277,115 +486,218 @@ def archive_module_with_http_info(self, pk : Annotated[StrictStr, Field(..., des :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._archive_module_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'pk', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def archive_module_without_preload_content( + self, + pk: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Archive module + + Move a module to archived status for historical tracking. + + :param pk: Module ID (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._archive_module_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method archive_module" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + def _archive_module_serialize( + self, + pk, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/modules/{pk}/archive/', 'POST', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/modules/{pk}/archive/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def create_module(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], module_create_request : ModuleCreateRequest, **kwargs) -> Module: # noqa: E501 - """Create module # noqa: E501 - Create a new project module with specified name, description, and timeline. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_module(project_id, slug, module_create_request, async_req=True) - >>> result = thread.get() + @validate_call + def create_module( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + module_create_request: ModuleCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Module: + """Create module + + Create a new project module with specified name, description, and timeline. :param project_id: Project ID (required) :type project_id: str @@ -393,33 +705,79 @@ def create_module(self, project_id : Annotated[StrictStr, Field(..., description :type slug: str :param module_create_request: (required) :type module_create_request: ModuleCreateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Module - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the create_module_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.create_module_with_http_info(project_id, slug, module_create_request, **kwargs) # noqa: E501 - - @validate_arguments - def create_module_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], module_create_request : ModuleCreateRequest, **kwargs) -> ApiResponse: # noqa: E501 - """Create module # noqa: E501 - - Create a new project module with specified name, description, and timeline. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_module_with_http_info(project_id, slug, module_create_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._create_module_serialize( + project_id=project_id, + slug=slug, + module_create_request=module_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "Module", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_module_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + module_create_request: ModuleCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Module]: + """Create module + + Create a new project module with specified name, description, and timeline. :param project_id: Project ID (required) :type project_id: str @@ -427,98 +785,39 @@ def create_module_with_http_info(self, project_id : Annotated[StrictStr, Field(. :type slug: str :param module_create_request: (required) :type module_create_request: ModuleCreateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Module, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'project_id', - 'slug', - 'module_create_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._create_module_serialize( + project_id=project_id, + slug=slug, + module_create_request=module_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_module" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] - - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] - - - # process the query parameters - _query_params = [] - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - if _params['module_create_request'] is not None: - _body_params = _params['module_create_request'] - - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list - - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { + _response_types_map: Dict[str, Optional[str]] = { '401': None, '403': None, '404': None, @@ -526,342 +825,811 @@ def create_module_with_http_info(self, project_id : Annotated[StrictStr, Field(. '400': None, '409': None, } - - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/modules/', 'POST', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) - - @validate_arguments - def delete_module(self, pk : Annotated[StrictStr, Field(..., description="Module ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> None: # noqa: E501 - """Delete module # noqa: E501 + ) - Permanently remove a module and all its associated issue relationships. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_module(pk, project_id, slug, async_req=True) - >>> result = thread.get() + @validate_call + def create_module_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + module_create_request: ModuleCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create module - :param pk: Module ID (required) - :type pk: str - :param project_id: Project ID (required) - :type project_id: str - :param slug: Workspace slug (required) - :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the delete_module_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.delete_module_with_http_info(pk, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def delete_module_with_http_info(self, pk : Annotated[StrictStr, Field(..., description="Module ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Delete module # noqa: E501 - - Permanently remove a module and all its associated issue relationships. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_module_with_http_info(pk, project_id, slug, async_req=True) - >>> result = thread.get() + Create a new project module with specified name, description, and timeline. - :param pk: Module ID (required) - :type pk: str :param project_id: Project ID (required) :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + :param module_create_request: (required) + :type module_create_request: ModuleCreateRequest :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = [ - 'pk', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._create_module_serialize( + project_id=project_id, + slug=slug, + module_create_request=module_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_module" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "Module", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + def _create_module_serialize( + self, + project_id, + slug, + module_create_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 + if module_create_request is not None: + _body_params = module_create_request + - _response_types_map = {} + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + # set the HTTP header `Content-Type` + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/modules/{pk}/', 'DELETE', - _path_params, - _query_params, - _header_params, + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/modules/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def delete_module_work_item(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], module_id : Annotated[StrictStr, Field(..., description="Module ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> None: # noqa: E501 - """Delete module work item # noqa: E501 - Remove a work item from a module while keeping the work item in the project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_module_work_item(issue_id, module_id, project_id, slug, async_req=True) - >>> result = thread.get() - :param issue_id: Issue ID (required) - :type issue_id: str - :param module_id: Module ID (required) - :type module_id: str - :param project_id: Project ID (required) - :type project_id: str - :param slug: Workspace slug (required) - :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the delete_module_work_item_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.delete_module_work_item_with_http_info(issue_id, module_id, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def delete_module_work_item_with_http_info(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], module_id : Annotated[StrictStr, Field(..., description="Module ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Delete module work item # noqa: E501 - - Remove a work item from a module while keeping the work item in the project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_module_work_item_with_http_info(issue_id, module_id, project_id, slug, async_req=True) - >>> result = thread.get() + @validate_call + def delete_module( + self, + pk: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete module - :param issue_id: Issue ID (required) - :type issue_id: str - :param module_id: Module ID (required) - :type module_id: str + Permanently remove a module and all its associated issue relationships. + + :param pk: Module ID (required) + :type pk: str :param project_id: Project ID (required) :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = [ - 'issue_id', - 'module_id', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._delete_module_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_module_work_item" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_module_with_http_info( + self, + pk: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete module + + Permanently remove a module and all its associated issue relationships. + + :param pk: Module ID (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_module_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_module_without_preload_content( + self, + pk: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete module + + Permanently remove a module and all its associated issue relationships. + + :param pk: Module ID (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_module_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + - if _params['module_id'] is not None: - _path_params['module_id'] = _params['module_id'] + def _delete_module_serialize( + self, + pk, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/modules/{module_id}/module-issues/{issue_id}/', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/modules/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def delete_module_work_item( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + module_id: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete module work item + + Remove a work item from a module while keeping the work item in the project. + + :param issue_id: Issue ID (required) + :type issue_id: str + :param module_id: Module ID (required) + :type module_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_module_work_item_serialize( + issue_id=issue_id, + module_id=module_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_module_work_item_with_http_info( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + module_id: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete module work item + + Remove a work item from a module while keeping the work item in the project. + + :param issue_id: Issue ID (required) + :type issue_id: str + :param module_id: Module ID (required) + :type module_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_module_work_item_serialize( + issue_id=issue_id, + module_id=module_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def delete_module_work_item_without_preload_content( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + module_id: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete module work item + + Remove a work item from a module while keeping the work item in the project. + + :param issue_id: Issue ID (required) + :type issue_id: str + :param module_id: Module ID (required) + :type module_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_module_work_item_serialize( + issue_id=issue_id, + module_id=module_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_module_work_item_serialize( + self, + issue_id, + module_id, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if module_id is not None: + _path_params['module_id'] = module_id + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + # process the query parameters + # process the header parameters + # process the form parameters + # process the body parameter + + + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/modules/{module_id}/module-issues/{issue_id}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def list_archived_modules(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> PaginatedArchivedModuleResponse: # noqa: E501 - """List archived modules # noqa: E501 - Retrieve all modules that have been archived in the project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_archived_modules(project_id, slug, cursor, expand, fields, order_by, per_page, async_req=True) - >>> result = thread.get() + @validate_call + def list_archived_modules( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PaginatedArchivedModuleResponse: + """List archived modules + + Retrieve all modules that have been archived in the project. :param project_id: Project ID (required) :type project_id: str @@ -877,33 +1645,85 @@ def list_archived_modules(self, project_id : Annotated[StrictStr, Field(..., des :type order_by: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PaginatedArchivedModuleResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_archived_modules_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_archived_modules_with_http_info(project_id, slug, cursor, expand, fields, order_by, per_page, **kwargs) # noqa: E501 - - @validate_arguments - def list_archived_modules_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """List archived modules # noqa: E501 - - Retrieve all modules that have been archived in the project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_archived_modules_with_http_info(project_id, slug, cursor, expand, fields, order_by, per_page, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_archived_modules_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedArchivedModuleResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_archived_modules_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PaginatedArchivedModuleResponse]: + """List archived modules + + Retrieve all modules that have been archived in the project. :param project_id: Project ID (required) :type project_id: str @@ -919,140 +1739,270 @@ def list_archived_modules_with_http_info(self, project_id : Annotated[StrictStr, :type order_by: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PaginatedArchivedModuleResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'project_id', - 'slug', - 'cursor', - 'expand', - 'fields', - 'order_by', - 'per_page' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_archived_modules_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_archived_modules" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] - - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedArchivedModuleResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - # process the query parameters - _query_params = [] - if _params.get('cursor') is not None: # noqa: E501 - _query_params.append(('cursor', _params['cursor'])) + @validate_call + def list_archived_modules_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List archived modules - if _params.get('expand') is not None: # noqa: E501 - _query_params.append(('expand', _params['expand'])) + Retrieve all modules that have been archived in the project. - if _params.get('fields') is not None: # noqa: E501 - _query_params.append(('fields', _params['fields'])) + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param cursor: Pagination cursor for getting next set of results + :type cursor: str + :param expand: Comma-separated list of related fields to expand in response + :type expand: str + :param fields: Comma-separated list of fields to include in response + :type fields: str + :param order_by: Field to order results by. Prefix with '-' for descending order + :type order_by: str + :param per_page: Number of results per page (default: 20, max: 100) + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_archived_modules_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('order_by') is not None: # noqa: E501 - _query_params.append(('order_by', _params['order_by'])) + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedArchivedModuleResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_archived_modules_serialize( + self, + project_id, + slug, + cursor, + expand, + fields, + order_by, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('per_page') is not None: # noqa: E501 - _query_params.append(('per_page', _params['per_page'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + # process the query parameters + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + if fields is not None: + + _query_params.append(('fields', fields)) + + if order_by is not None: + + _query_params.append(('order_by', order_by)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "PaginatedArchivedModuleResponse", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/archived-modules/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/archived-modules/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def list_module_work_items(self, module_id : Annotated[StrictStr, Field(..., description="Module ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> PaginatedModuleIssueResponse: # noqa: E501 - """List module work items # noqa: E501 - Retrieve all work items assigned to a module with detailed information. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_module_work_items(module_id, project_id, slug, cursor, expand, fields, order_by, per_page, async_req=True) - >>> result = thread.get() + + @validate_call + def list_module_work_items( + self, + module_id: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PaginatedModuleIssueResponse: + """List module work items + + Retrieve all work items assigned to a module with detailed information. :param module_id: Module ID (required) :type module_id: str @@ -1070,33 +2020,87 @@ def list_module_work_items(self, module_id : Annotated[StrictStr, Field(..., des :type order_by: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PaginatedModuleIssueResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_module_work_items_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_module_work_items_with_http_info(module_id, project_id, slug, cursor, expand, fields, order_by, per_page, **kwargs) # noqa: E501 - - @validate_arguments - def list_module_work_items_with_http_info(self, module_id : Annotated[StrictStr, Field(..., description="Module ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """List module work items # noqa: E501 - - Retrieve all work items assigned to a module with detailed information. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_module_work_items_with_http_info(module_id, project_id, slug, cursor, expand, fields, order_by, per_page, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_module_work_items_serialize( + module_id=module_id, + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedModuleIssueResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_module_work_items_with_http_info( + self, + module_id: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PaginatedModuleIssueResponse]: + """List module work items + + Retrieve all work items assigned to a module with detailed information. :param module_id: Module ID (required) :type module_id: str @@ -1114,186 +2118,465 @@ def list_module_work_items_with_http_info(self, module_id : Annotated[StrictStr, :type order_by: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PaginatedModuleIssueResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'module_id', - 'project_id', - 'slug', - 'cursor', - 'expand', - 'fields', - 'order_by', - 'per_page' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._list_module_work_items_serialize( + module_id=module_id, + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedModuleIssueResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def list_module_work_items_without_preload_content( + self, + module_id: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List module work items + + Retrieve all work items assigned to a module with detailed information. + + :param module_id: Module ID (required) + :type module_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param cursor: Pagination cursor for getting next set of results + :type cursor: str + :param expand: Comma-separated list of related fields to expand in response + :type expand: str + :param fields: Comma-separated list of fields to include in response + :type fields: str + :param order_by: Field to order results by. Prefix with '-' for descending order + :type order_by: str + :param per_page: Number of results per page (default: 20, max: 100) + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_module_work_items_serialize( + module_id=module_id, + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_module_work_items" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedModuleIssueResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_module_work_items_serialize( + self, + module_id, + project_id, + slug, + cursor, + expand, + fields, + order_by, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - _collection_formats = {} + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None # process the path parameters - _path_params = {} - if _params['module_id'] is not None: - _path_params['module_id'] = _params['module_id'] + if module_id is not None: + _path_params['module_id'] = module_id + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + # process the query parameters + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + if fields is not None: + + _query_params.append(('fields', fields)) + + if order_by is not None: + + _query_params.append(('order_by', order_by)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # process the query parameters - _query_params = [] - if _params.get('cursor') is not None: # noqa: E501 - _query_params.append(('cursor', _params['cursor'])) + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - if _params.get('expand') is not None: # noqa: E501 - _query_params.append(('expand', _params['expand'])) + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/modules/{module_id}/module-issues/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) - if _params.get('fields') is not None: # noqa: E501 - _query_params.append(('fields', _params['fields'])) - if _params.get('order_by') is not None: # noqa: E501 - _query_params.append(('order_by', _params['order_by'])) - if _params.get('per_page') is not None: # noqa: E501 - _query_params.append(('per_page', _params['per_page'])) - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + @validate_call + def list_modules( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PaginatedModuleResponse: + """List modules - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 + Retrieve all modules in a project. - _response_types_map = { + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param cursor: Pagination cursor for getting next set of results + :type cursor: str + :param expand: Comma-separated list of related fields to expand in response + :type expand: str + :param fields: Comma-separated list of fields to include in response + :type fields: str + :param order_by: Field to order results by. Prefix with '-' for descending order + :type order_by: str + :param per_page: Number of results per page (default: 20, max: 100) + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_modules_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { '401': None, '403': None, '404': None, - '200': "PaginatedModuleIssueResponse", + '200': "PaginatedModuleResponse", } - - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/modules/{module_id}/module-issues/', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + ).data + + + @validate_call + def list_modules_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PaginatedModuleResponse]: + """List modules + + Retrieve all modules in a project. + + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param cursor: Pagination cursor for getting next set of results + :type cursor: str + :param expand: Comma-separated list of related fields to expand in response + :type expand: str + :param fields: Comma-separated list of fields to include in response + :type fields: str + :param order_by: Field to order results by. Prefix with '-' for descending order + :type order_by: str + :param per_page: Number of results per page (default: 20, max: 100) + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_modules_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - @validate_arguments - def list_modules(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> PaginatedModuleResponse: # noqa: E501 - """List modules # noqa: E501 + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedModuleResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - Retrieve all modules in a project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_modules(project_id, slug, cursor, expand, fields, order_by, per_page, async_req=True) - >>> result = thread.get() + @validate_call + def list_modules_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List modules - :param project_id: Project ID (required) - :type project_id: str - :param slug: Workspace slug (required) - :type slug: str - :param cursor: Pagination cursor for getting next set of results - :type cursor: str - :param expand: Comma-separated list of related fields to expand in response - :type expand: str - :param fields: Comma-separated list of fields to include in response - :type fields: str - :param order_by: Field to order results by. Prefix with '-' for descending order - :type order_by: str - :param per_page: Number of results per page (default: 20, max: 100) - :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PaginatedModuleResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_modules_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_modules_with_http_info(project_id, slug, cursor, expand, fields, order_by, per_page, **kwargs) # noqa: E501 - - @validate_arguments - def list_modules_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """List modules # noqa: E501 - - Retrieve all modules in a project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_modules_with_http_info(project_id, slug, cursor, expand, fields, order_by, per_page, async_req=True) - >>> result = thread.get() + Retrieve all modules in a project. :param project_id: Project ID (required) :type project_id: str @@ -1309,140 +2592,171 @@ def list_modules_with_http_info(self, project_id : Annotated[StrictStr, Field(.. :type order_by: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PaginatedModuleResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'project_id', - 'slug', - 'cursor', - 'expand', - 'fields', - 'order_by', - 'per_page' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_modules_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_modules" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedModuleResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_modules_serialize( + self, + project_id, + slug, + cursor, + expand, + fields, + order_by, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - _collection_formats = {} + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] - - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] - - + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] - if _params.get('cursor') is not None: # noqa: E501 - _query_params.append(('cursor', _params['cursor'])) - - if _params.get('expand') is not None: # noqa: E501 - _query_params.append(('expand', _params['expand'])) - - if _params.get('fields') is not None: # noqa: E501 - _query_params.append(('fields', _params['fields'])) - - if _params.get('order_by') is not None: # noqa: E501 - _query_params.append(('order_by', _params['order_by'])) - - if _params.get('per_page') is not None: # noqa: E501 - _query_params.append(('per_page', _params['per_page'])) - + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + if fields is not None: + + _query_params.append(('fields', fields)) + + if order_by is not None: + + _query_params.append(('order_by', order_by)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "PaginatedModuleResponse", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/modules/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/modules/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def retrieve_module(self, pk : Annotated[StrictStr, Field(..., description="Module ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> Module: # noqa: E501 - """Retrieve module # noqa: E501 - Retrieve details of a specific module. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def retrieve_module( + self, + pk: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Module: + """Retrieve module - >>> thread = api.retrieve_module(pk, project_id, slug, async_req=True) - >>> result = thread.get() + Retrieve details of a specific module. :param pk: Module ID (required) :type pk: str @@ -1450,33 +2764,77 @@ def retrieve_module(self, pk : Annotated[StrictStr, Field(..., description="Modu :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Module - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the retrieve_module_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.retrieve_module_with_http_info(pk, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def retrieve_module_with_http_info(self, pk : Annotated[StrictStr, Field(..., description="Module ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Retrieve module # noqa: E501 - - Retrieve details of a specific module. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_module_with_http_info(pk, project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._retrieve_module_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Module", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_module_with_http_info( + self, + pk: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Module]: + """Retrieve module + + Retrieve details of a specific module. :param pk: Module ID (required) :type pk: str @@ -1484,124 +2842,223 @@ def retrieve_module_with_http_info(self, pk : Annotated[StrictStr, Field(..., de :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Module, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._retrieve_module_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Module", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'pk', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def retrieve_module_without_preload_content( + self, + pk: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve module + + Retrieve details of a specific module. + + :param pk: Module ID (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_module_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method retrieve_module" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Module", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + def _retrieve_module_serialize( + self, + pk, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "Module", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/modules/{pk}/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/modules/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def unarchive_module(self, pk : Annotated[StrictStr, Field(..., description="Module ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> None: # noqa: E501 - """Unarchive module # noqa: E501 - Restore an archived module to active status, making it available for regular use. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def unarchive_module( + self, + pk: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Unarchive module - >>> thread = api.unarchive_module(pk, project_id, slug, async_req=True) - >>> result = thread.get() + Restore an archived module to active status, making it available for regular use. :param pk: Module ID (required) :type pk: str @@ -1609,33 +3066,77 @@ def unarchive_module(self, pk : Annotated[StrictStr, Field(..., description="Mod :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the unarchive_module_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.unarchive_module_with_http_info(pk, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def unarchive_module_with_http_info(self, pk : Annotated[StrictStr, Field(..., description="Module ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Unarchive module # noqa: E501 - - Restore an archived module to active status, making it available for regular use. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.unarchive_module_with_http_info(pk, project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._unarchive_module_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def unarchive_module_with_http_info( + self, + pk: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Unarchive module + + Restore an archived module to active status, making it available for regular use. :param pk: Module ID (required) :type pk: str @@ -1643,115 +3144,217 @@ def unarchive_module_with_http_info(self, pk : Annotated[StrictStr, Field(..., d :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._unarchive_module_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'pk', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def unarchive_module_without_preload_content( + self, + pk: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Unarchive module + + Restore an archived module to active status, making it available for regular use. + + :param pk: Module ID (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unarchive_module_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method unarchive_module" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + def _unarchive_module_serialize( + self, + pk, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/archived-modules/{pk}/unarchive/', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/archived-modules/{pk}/unarchive/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def update_module(self, pk : Annotated[StrictStr, Field(..., description="Module ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], patched_module_update_request : Optional[PatchedModuleUpdateRequest] = None, **kwargs) -> Module: # noqa: E501 - """Update module # noqa: E501 - Modify an existing module's properties like name, description, status, or timeline. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_module(pk, project_id, slug, patched_module_update_request, async_req=True) - >>> result = thread.get() + @validate_call + def update_module( + self, + pk: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_module_update_request: Optional[PatchedModuleUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Module: + """Update module + + Modify an existing module's properties like name, description, status, or timeline. :param pk: Module ID (required) :type pk: str @@ -1761,33 +3364,81 @@ def update_module(self, pk : Annotated[StrictStr, Field(..., description="Module :type slug: str :param patched_module_update_request: :type patched_module_update_request: PatchedModuleUpdateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Module - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the update_module_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.update_module_with_http_info(pk, project_id, slug, patched_module_update_request, **kwargs) # noqa: E501 - - @validate_arguments - def update_module_with_http_info(self, pk : Annotated[StrictStr, Field(..., description="Module ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], patched_module_update_request : Optional[PatchedModuleUpdateRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update module # noqa: E501 - - Modify an existing module's properties like name, description, status, or timeline. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_module_with_http_info(pk, project_id, slug, patched_module_update_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._update_module_serialize( + pk=pk, + project_id=project_id, + slug=slug, + patched_module_update_request=patched_module_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Module", + '400': "Module", + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_module_with_http_info( + self, + pk: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_module_update_request: Optional[PatchedModuleUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Module]: + """Update module + + Modify an existing module's properties like name, description, status, or timeline. :param pk: Module ID (required) :type pk: str @@ -1797,123 +3448,223 @@ def update_module_with_http_info(self, pk : Annotated[StrictStr, Field(..., desc :type slug: str :param patched_module_update_request: :type patched_module_update_request: PatchedModuleUpdateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Module, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'pk', - 'project_id', - 'slug', - 'patched_module_update_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._update_module_serialize( + pk=pk, + project_id=project_id, + slug=slug, + patched_module_update_request=patched_module_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Module", + '400': "Module", + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_module_without_preload_content( + self, + pk: Annotated[StrictStr, Field(description="Module ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_module_update_request: Optional[PatchedModuleUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update module + + Modify an existing module's properties like name, description, status, or timeline. + + :param pk: Module ID (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param patched_module_update_request: + :type patched_module_update_request: PatchedModuleUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_module_serialize( + pk=pk, + project_id=project_id, + slug=slug, + patched_module_update_request=patched_module_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_module" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Module", + '400': "Module", + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + def _update_module_serialize( + self, + pk, + project_id, + slug, + patched_module_update_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_module_update_request'] is not None: - _body_params = _params['patched_module_update_request'] + if patched_module_update_request is not None: + _body_params = patched_module_update_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "Module", - '400': "Module", - '409': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/modules/{pk}/', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/modules/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/plane/api/projects_api.py b/plane/api/projects_api.py index 15dca33..28ac4b3 100644 --- a/plane/api/projects_api.py +++ b/plane/api/projects_api.py @@ -12,27 +12,18 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 - -from pydantic import validate_arguments - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr - -from typing import Optional from plane.models.paginated_project_response import PaginatedProjectResponse from plane.models.patched_project_update_request import PatchedProjectUpdateRequest from plane.models.project import Project from plane.models.project_create_request import ProjectCreateRequest -from plane.api_client import ApiClient +from plane.api_client import ApiClient, RequestSerialized from plane.api_response import ApiResponse -from plane.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from plane.rest import RESTResponseType class ProjectsApi: @@ -47,459 +38,897 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def archive_project(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> None: # noqa: E501 - """Archive project # noqa: E501 - Move a project to archived status, hiding it from active project lists. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def archive_project( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Archive project - >>> thread = api.archive_project(project_id, slug, async_req=True) - >>> result = thread.get() + Move a project to archived status, hiding it from active project lists. :param project_id: Project ID (required) :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the archive_project_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.archive_project_with_http_info(project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def archive_project_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Archive project # noqa: E501 - - Move a project to archived status, hiding it from active project lists. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.archive_project_with_http_info(project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._archive_project_serialize( + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def archive_project_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Archive project + + Move a project to archived status, hiding it from active project lists. :param project_id: Project ID (required) :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._archive_project_serialize( + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def archive_project_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Archive project + + Move a project to archived status, hiding it from active project lists. + + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._archive_project_serialize( + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method archive_project" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + def _archive_project_serialize( + self, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/archive/', 'POST', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/archive/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def create_project(self, slug : Annotated[StrictStr, Field(..., description="Workspace slug")], project_create_request : ProjectCreateRequest, **kwargs) -> Project: # noqa: E501 - """Create project # noqa: E501 - Create a new project in the workspace with default states and member assignments. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_project(slug, project_create_request, async_req=True) - >>> result = thread.get() + @validate_call + def create_project( + self, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + project_create_request: ProjectCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Project: + """Create project + + Create a new project in the workspace with default states and member assignments. :param slug: Workspace slug (required) :type slug: str :param project_create_request: (required) :type project_create_request: ProjectCreateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Project - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the create_project_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.create_project_with_http_info(slug, project_create_request, **kwargs) # noqa: E501 - - @validate_arguments - def create_project_with_http_info(self, slug : Annotated[StrictStr, Field(..., description="Workspace slug")], project_create_request : ProjectCreateRequest, **kwargs) -> ApiResponse: # noqa: E501 - """Create project # noqa: E501 - - Create a new project in the workspace with default states and member assignments. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_project_with_http_info(slug, project_create_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._create_project_serialize( + slug=slug, + project_create_request=project_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "Project", + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_project_with_http_info( + self, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + project_create_request: ProjectCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Project]: + """Create project + + Create a new project in the workspace with default states and member assignments. :param slug: Workspace slug (required) :type slug: str :param project_create_request: (required) :type project_create_request: ProjectCreateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Project, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._create_project_serialize( + slug=slug, + project_create_request=project_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "Project", + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'slug', - 'project_create_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def create_project_without_preload_content( + self, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + project_create_request: ProjectCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create project + + Create a new project in the workspace with default states and member assignments. + + :param slug: Workspace slug (required) + :type slug: str + :param project_create_request: (required) + :type project_create_request: ProjectCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_project_serialize( + slug=slug, + project_create_request=project_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_project" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "Project", + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + def _create_project_serialize( + self, + slug, + project_create_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['project_create_request'] is not None: - _body_params = _params['project_create_request'] + if project_create_request is not None: + _body_params = project_create_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '201': "Project", - '409': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{slug}/projects/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def delete_project(self, pk : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> None: # noqa: E501 - """Delete project # noqa: E501 - Permanently remove a project and all its associated data from the workspace. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_project(pk, slug, async_req=True) - >>> result = thread.get() + + @validate_call + def delete_project( + self, + pk: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete project + + Permanently remove a project and all its associated data from the workspace. :param pk: Project ID (required) :type pk: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the delete_project_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.delete_project_with_http_info(pk, slug, **kwargs) # noqa: E501 - - @validate_arguments - def delete_project_with_http_info(self, pk : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Delete project # noqa: E501 - - Permanently remove a project and all its associated data from the workspace. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_project_with_http_info(pk, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._delete_project_serialize( + pk=pk, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_project_with_http_info( + self, + pk: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete project + + Permanently remove a project and all its associated data from the workspace. :param pk: Project ID (required) :type pk: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._delete_project_serialize( + pk=pk, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'pk', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def delete_project_without_preload_content( + self, + pk: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete project + + Permanently remove a project and all its associated data from the workspace. + + :param pk: Project ID (required) + :type pk: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_project_serialize( + pk=pk, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_project" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + def _delete_project_serialize( + self, + pk, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if pk is not None: + _path_params['pk'] = pk + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{pk}/', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v1/workspaces/{slug}/projects/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def list_projects(self, slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> PaginatedProjectResponse: # noqa: E501 - """List or retrieve projects # noqa: E501 - Retrieve all projects in a workspace or get details of a specific project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_projects(slug, cursor, expand, fields, order_by, per_page, async_req=True) - >>> result = thread.get() + @validate_call + def list_projects( + self, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PaginatedProjectResponse: + """List or retrieve projects + + Retrieve all projects in a workspace or get details of a specific project. :param slug: Workspace slug (required) :type slug: str @@ -513,33 +942,83 @@ def list_projects(self, slug : Annotated[StrictStr, Field(..., description="Work :type order_by: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PaginatedProjectResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_projects_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_projects_with_http_info(slug, cursor, expand, fields, order_by, per_page, **kwargs) # noqa: E501 - - @validate_arguments - def list_projects_with_http_info(self, slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """List or retrieve projects # noqa: E501 - - Retrieve all projects in a workspace or get details of a specific project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_projects_with_http_info(slug, cursor, expand, fields, order_by, per_page, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_projects_serialize( + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedProjectResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_projects_with_http_info( + self, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PaginatedProjectResponse]: + """List or retrieve projects + + Retrieve all projects in a workspace or get details of a specific project. :param slug: Workspace slug (required) :type slug: str @@ -553,429 +1032,824 @@ def list_projects_with_http_info(self, slug : Annotated[StrictStr, Field(..., de :type order_by: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PaginatedProjectResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'slug', - 'cursor', - 'expand', - 'fields', - 'order_by', - 'per_page' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_projects_serialize( + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_projects" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedProjectResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - # process the query parameters - _query_params = [] - if _params.get('cursor') is not None: # noqa: E501 - _query_params.append(('cursor', _params['cursor'])) + @validate_call + def list_projects_without_preload_content( + self, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List or retrieve projects - if _params.get('expand') is not None: # noqa: E501 - _query_params.append(('expand', _params['expand'])) + Retrieve all projects in a workspace or get details of a specific project. - if _params.get('fields') is not None: # noqa: E501 - _query_params.append(('fields', _params['fields'])) + :param slug: Workspace slug (required) + :type slug: str + :param cursor: Pagination cursor for getting next set of results + :type cursor: str + :param expand: Comma-separated list of related fields to expand in response + :type expand: str + :param fields: Comma-separated list of fields to include in response + :type fields: str + :param order_by: Field to order results by. Prefix with '-' for descending order + :type order_by: str + :param per_page: Number of results per page (default: 20, max: 100) + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_projects_serialize( + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('order_by') is not None: # noqa: E501 - _query_params.append(('order_by', _params['order_by'])) + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedProjectResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_projects_serialize( + self, + slug, + cursor, + expand, + fields, + order_by, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('per_page') is not None: # noqa: E501 - _query_params.append(('per_page', _params['per_page'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if slug is not None: + _path_params['slug'] = slug + # process the query parameters + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + if fields is not None: + + _query_params.append(('fields', fields)) + + if order_by is not None: + + _query_params.append(('order_by', order_by)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "PaginatedProjectResponse", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def retrieve_project(self, pk : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> Project: # noqa: E501 - """Retrieve project # noqa: E501 - Retrieve details of a specific project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.retrieve_project(pk, slug, async_req=True) - >>> result = thread.get() + + @validate_call + def retrieve_project( + self, + pk: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Project: + """Retrieve project + + Retrieve details of a specific project. :param pk: Project ID (required) :type pk: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Project - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the retrieve_project_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.retrieve_project_with_http_info(pk, slug, **kwargs) # noqa: E501 - - @validate_arguments - def retrieve_project_with_http_info(self, pk : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Retrieve project # noqa: E501 - - Retrieve details of a specific project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_project_with_http_info(pk, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._retrieve_project_serialize( + pk=pk, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Project", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_project_with_http_info( + self, + pk: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Project]: + """Retrieve project + + Retrieve details of a specific project. :param pk: Project ID (required) :type pk: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Project, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._retrieve_project_serialize( + pk=pk, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Project", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'pk', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def retrieve_project_without_preload_content( + self, + pk: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve project + + Retrieve details of a specific project. + + :param pk: Project ID (required) + :type pk: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_project_serialize( + pk=pk, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method retrieve_project" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Project", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + def _retrieve_project_serialize( + self, + pk, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if pk is not None: + _path_params['pk'] = pk + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "Project", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{pk}/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def unarchive_project(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> None: # noqa: E501 - """Unarchive project # noqa: E501 - Restore an archived project to active status, making it available in regular workflows. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.unarchive_project(project_id, slug, async_req=True) - >>> result = thread.get() + + @validate_call + def unarchive_project( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Unarchive project + + Restore an archived project to active status, making it available in regular workflows. :param project_id: Project ID (required) :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the unarchive_project_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.unarchive_project_with_http_info(project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def unarchive_project_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Unarchive project # noqa: E501 - - Restore an archived project to active status, making it available in regular workflows. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.unarchive_project_with_http_info(project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._unarchive_project_serialize( + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def unarchive_project_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Unarchive project + + Restore an archived project to active status, making it available in regular workflows. :param project_id: Project ID (required) :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._unarchive_project_serialize( + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def unarchive_project_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Unarchive project + + Restore an archived project to active status, making it available in regular workflows. + + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._unarchive_project_serialize( + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method unarchive_project" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + def _unarchive_project_serialize( + self, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/archive/', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/archive/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def update_project(self, pk : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], patched_project_update_request : Optional[PatchedProjectUpdateRequest] = None, **kwargs) -> Project: # noqa: E501 - """Update project # noqa: E501 - Partially update an existing project's properties like name, description, or settings. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_project(pk, slug, patched_project_update_request, async_req=True) - >>> result = thread.get() + @validate_call + def update_project( + self, + pk: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_project_update_request: Optional[PatchedProjectUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Project: + """Update project + + Partially update an existing project's properties like name, description, or settings. :param pk: Project ID (required) :type pk: str @@ -983,33 +1857,78 @@ def update_project(self, pk : Annotated[StrictStr, Field(..., description="Proje :type slug: str :param patched_project_update_request: :type patched_project_update_request: PatchedProjectUpdateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Project - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the update_project_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.update_project_with_http_info(pk, slug, patched_project_update_request, **kwargs) # noqa: E501 - - @validate_arguments - def update_project_with_http_info(self, pk : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], patched_project_update_request : Optional[PatchedProjectUpdateRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update project # noqa: E501 - - Partially update an existing project's properties like name, description, or settings. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_project_with_http_info(pk, slug, patched_project_update_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._update_project_serialize( + pk=pk, + slug=slug, + patched_project_update_request=patched_project_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Project", + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_project_with_http_info( + self, + pk: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_project_update_request: Optional[PatchedProjectUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Project]: + """Update project + + Partially update an existing project's properties like name, description, or settings. :param pk: Project ID (required) :type pk: str @@ -1017,118 +1936,213 @@ def update_project_with_http_info(self, pk : Annotated[StrictStr, Field(..., des :type slug: str :param patched_project_update_request: :type patched_project_update_request: PatchedProjectUpdateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Project, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._update_project_serialize( + pk=pk, + slug=slug, + patched_project_update_request=patched_project_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Project", + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'pk', - 'slug', - 'patched_project_update_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def update_project_without_preload_content( + self, + pk: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_project_update_request: Optional[PatchedProjectUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update project + + Partially update an existing project's properties like name, description, or settings. + + :param pk: Project ID (required) + :type pk: str + :param slug: Workspace slug (required) + :type slug: str + :param patched_project_update_request: + :type patched_project_update_request: PatchedProjectUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_project_serialize( + pk=pk, + slug=slug, + patched_project_update_request=patched_project_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_project" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Project", + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + def _update_project_serialize( + self, + pk, + slug, + patched_project_update_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if pk is not None: + _path_params['pk'] = pk + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_project_update_request'] is not None: - _body_params = _params['patched_project_update_request'] + if patched_project_update_request is not None: + _body_params = patched_project_update_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "Project", - '409': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{pk}/', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v1/workspaces/{slug}/projects/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/plane/api/states_api.py b/plane/api/states_api.py index 8605c8d..b14665c 100644 --- a/plane/api/states_api.py +++ b/plane/api/states_api.py @@ -12,27 +12,18 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 - -from pydantic import validate_arguments - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr - -from typing import Optional from plane.models.paginated_state_response import PaginatedStateResponse from plane.models.patched_state_request import PatchedStateRequest from plane.models.state import State from plane.models.state_request import StateRequest -from plane.api_client import ApiClient +from plane.api_client import ApiClient, RequestSerialized from plane.api_response import ApiResponse -from plane.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from plane.rest import RESTResponseType class StatesApi: @@ -47,16 +38,29 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def create_state(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], state_request : StateRequest, **kwargs) -> State: # noqa: E501 - """Create state # noqa: E501 - Create a new workflow state for a project with specified name, color, and group. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_state( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + state_request: StateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> State: + """Create state - >>> thread = api.create_state(project_id, slug, state_request, async_req=True) - >>> result = thread.get() + Create a new workflow state for a project with specified name, color, and group. :param project_id: Project ID (required) :type project_id: str @@ -64,33 +68,79 @@ def create_state(self, project_id : Annotated[StrictStr, Field(..., description= :type slug: str :param state_request: (required) :type state_request: StateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: State - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the create_state_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.create_state_with_http_info(project_id, slug, state_request, **kwargs) # noqa: E501 - - @validate_arguments - def create_state_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], state_request : StateRequest, **kwargs) -> ApiResponse: # noqa: E501 - """Create state # noqa: E501 - - Create a new workflow state for a project with specified name, color, and group. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_state_with_http_info(project_id, slug, state_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._create_state_serialize( + project_id=project_id, + slug=slug, + state_request=state_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "State", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_state_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + state_request: StateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[State]: + """Create state + + Create a new workflow state for a project with specified name, color, and group. :param project_id: Project ID (required) :type project_id: str @@ -98,133 +148,242 @@ def create_state_with_http_info(self, project_id : Annotated[StrictStr, Field(.. :type slug: str :param state_request: (required) :type state_request: StateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(State, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._create_state_serialize( + project_id=project_id, + slug=slug, + state_request=state_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "State", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'project_id', - 'slug', - 'state_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def create_state_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + state_request: StateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create state + + Create a new workflow state for a project with specified name, color, and group. + + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param state_request: (required) + :type state_request: StateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_state_serialize( + project_id=project_id, + slug=slug, + state_request=state_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_state" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "State", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + def _create_state_serialize( + self, + project_id, + slug, + state_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['state_request'] is not None: - _body_params = _params['state_request'] + if state_request is not None: + _body_params = state_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "State", - '400': None, - '409': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/states/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/states/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def delete_state(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], state_id : Annotated[StrictStr, Field(..., description="State ID")], **kwargs) -> None: # noqa: E501 - """Delete state # noqa: E501 - Permanently remove a workflow state from a project. Default states and states with existing work items cannot be deleted. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_state(project_id, slug, state_id, async_req=True) - >>> result = thread.get() + + @validate_call + def delete_state( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + state_id: Annotated[StrictStr, Field(description="State ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete state + + Permanently remove a workflow state from a project. Default states and states with existing work items cannot be deleted. :param project_id: Project ID (required) :type project_id: str @@ -232,33 +391,78 @@ def delete_state(self, project_id : Annotated[StrictStr, Field(..., description= :type slug: str :param state_id: State ID (required) :type state_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the delete_state_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.delete_state_with_http_info(project_id, slug, state_id, **kwargs) # noqa: E501 - - @validate_arguments - def delete_state_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], state_id : Annotated[StrictStr, Field(..., description="State ID")], **kwargs) -> ApiResponse: # noqa: E501 - """Delete state # noqa: E501 - - Permanently remove a workflow state from a project. Default states and states with existing work items cannot be deleted. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_state_with_http_info(project_id, slug, state_id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._delete_state_serialize( + project_id=project_id, + slug=slug, + state_id=state_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_state_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + state_id: Annotated[StrictStr, Field(description="State ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete state + + Permanently remove a workflow state from a project. Default states and states with existing work items cannot be deleted. :param project_id: Project ID (required) :type project_id: str @@ -266,115 +470,221 @@ def delete_state_with_http_info(self, project_id : Annotated[StrictStr, Field(.. :type slug: str :param state_id: State ID (required) :type state_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._delete_state_serialize( + project_id=project_id, + slug=slug, + state_id=state_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'project_id', - 'slug', - 'state_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def delete_state_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + state_id: Annotated[StrictStr, Field(description="State ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete state + + Permanently remove a workflow state from a project. Default states and states with existing work items cannot be deleted. + + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param state_id: State ID (required) + :type state_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_state_serialize( + project_id=project_id, + slug=slug, + state_id=state_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_state" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + def _delete_state_serialize( + self, + project_id, + slug, + state_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _host = None - if _params['state_id'] is not None: - _path_params['state_id'] = _params['state_id'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + if state_id is not None: + _path_params['state_id'] = state_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/states/{state_id}/', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/states/{state_id}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def list_states(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> PaginatedStateResponse: # noqa: E501 - """List states # noqa: E501 - Retrieve all workflow states for a project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def list_states( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PaginatedStateResponse: + """List states - >>> thread = api.list_states(project_id, slug, cursor, expand, fields, per_page, async_req=True) - >>> result = thread.get() + Retrieve all workflow states for a project. :param project_id: Project ID (required) :type project_id: str @@ -388,33 +698,83 @@ def list_states(self, project_id : Annotated[StrictStr, Field(..., description=" :type fields: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PaginatedStateResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_states_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_states_with_http_info(project_id, slug, cursor, expand, fields, per_page, **kwargs) # noqa: E501 - - @validate_arguments - def list_states_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """List states # noqa: E501 - - Retrieve all workflow states for a project. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_states_with_http_info(project_id, slug, cursor, expand, fields, per_page, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_states_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedStateResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_states_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PaginatedStateResponse]: + """List states + + Retrieve all workflow states for a project. :param project_id: Project ID (required) :type project_id: str @@ -428,136 +788,255 @@ def list_states_with_http_info(self, project_id : Annotated[StrictStr, Field(... :type fields: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PaginatedStateResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'project_id', - 'slug', - 'cursor', - 'expand', - 'fields', - 'per_page' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_states_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_states" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedStateResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + @validate_call + def list_states_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List states - # process the query parameters - _query_params = [] - if _params.get('cursor') is not None: # noqa: E501 - _query_params.append(('cursor', _params['cursor'])) + Retrieve all workflow states for a project. - if _params.get('expand') is not None: # noqa: E501 - _query_params.append(('expand', _params['expand'])) + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param cursor: Pagination cursor for getting next set of results + :type cursor: str + :param expand: Comma-separated list of related fields to expand in response + :type expand: str + :param fields: Comma-separated list of fields to include in response + :type fields: str + :param per_page: Number of results per page (default: 20, max: 100) + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_states_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('fields') is not None: # noqa: E501 - _query_params.append(('fields', _params['fields'])) + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedStateResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_states_serialize( + self, + project_id, + slug, + cursor, + expand, + fields, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('per_page') is not None: # noqa: E501 - _query_params.append(('per_page', _params['per_page'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + # process the query parameters + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + if fields is not None: + + _query_params.append(('fields', fields)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "PaginatedStateResponse", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/states/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/states/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def retrieve_state(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], state_id : Annotated[StrictStr, Field(..., description="State ID")], **kwargs) -> State: # noqa: E501 - """Retrieve state # noqa: E501 - Retrieve details of a specific state. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.retrieve_state(project_id, slug, state_id, async_req=True) - >>> result = thread.get() + + @validate_call + def retrieve_state( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + state_id: Annotated[StrictStr, Field(description="State ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> State: + """Retrieve state + + Retrieve details of a specific state. :param project_id: Project ID (required) :type project_id: str @@ -565,33 +1044,77 @@ def retrieve_state(self, project_id : Annotated[StrictStr, Field(..., descriptio :type slug: str :param state_id: State ID (required) :type state_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: State - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the retrieve_state_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.retrieve_state_with_http_info(project_id, slug, state_id, **kwargs) # noqa: E501 - - @validate_arguments - def retrieve_state_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], state_id : Annotated[StrictStr, Field(..., description="State ID")], **kwargs) -> ApiResponse: # noqa: E501 - """Retrieve state # noqa: E501 - - Retrieve details of a specific state. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_state_with_http_info(project_id, slug, state_id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._retrieve_state_serialize( + project_id=project_id, + slug=slug, + state_id=state_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "State", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_state_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + state_id: Annotated[StrictStr, Field(description="State ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[State]: + """Retrieve state + + Retrieve details of a specific state. :param project_id: Project ID (required) :type project_id: str @@ -599,124 +1122,224 @@ def retrieve_state_with_http_info(self, project_id : Annotated[StrictStr, Field( :type slug: str :param state_id: State ID (required) :type state_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(State, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._retrieve_state_serialize( + project_id=project_id, + slug=slug, + state_id=state_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "State", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'project_id', - 'slug', - 'state_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def retrieve_state_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + state_id: Annotated[StrictStr, Field(description="State ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve state + + Retrieve details of a specific state. + + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param state_id: State ID (required) + :type state_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_state_serialize( + project_id=project_id, + slug=slug, + state_id=state_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method retrieve_state" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "State", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + def _retrieve_state_serialize( + self, + project_id, + slug, + state_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _host = None - if _params['state_id'] is not None: - _path_params['state_id'] = _params['state_id'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + if state_id is not None: + _path_params['state_id'] = state_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "State", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/states/{state_id}/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/states/{state_id}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def update_state(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], state_id : Annotated[StrictStr, Field(..., description="State ID")], patched_state_request : Optional[PatchedStateRequest] = None, **kwargs) -> State: # noqa: E501 - """Update state # noqa: E501 - Partially update an existing workflow state's properties like name, color, or group. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_state(project_id, slug, state_id, patched_state_request, async_req=True) - >>> result = thread.get() + + @validate_call + def update_state( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + state_id: Annotated[StrictStr, Field(description="State ID")], + patched_state_request: Optional[PatchedStateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> State: + """Update state + + Partially update an existing workflow state's properties like name, color, or group. :param project_id: Project ID (required) :type project_id: str @@ -726,33 +1349,81 @@ def update_state(self, project_id : Annotated[StrictStr, Field(..., description= :type state_id: str :param patched_state_request: :type patched_state_request: PatchedStateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: State - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the update_state_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.update_state_with_http_info(project_id, slug, state_id, patched_state_request, **kwargs) # noqa: E501 - - @validate_arguments - def update_state_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], state_id : Annotated[StrictStr, Field(..., description="State ID")], patched_state_request : Optional[PatchedStateRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update state # noqa: E501 - - Partially update an existing workflow state's properties like name, color, or group. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_state_with_http_info(project_id, slug, state_id, patched_state_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._update_state_serialize( + project_id=project_id, + slug=slug, + state_id=state_id, + patched_state_request=patched_state_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "State", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_state_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + state_id: Annotated[StrictStr, Field(description="State ID")], + patched_state_request: Optional[PatchedStateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[State]: + """Update state + + Partially update an existing workflow state's properties like name, color, or group. :param project_id: Project ID (required) :type project_id: str @@ -762,123 +1433,223 @@ def update_state_with_http_info(self, project_id : Annotated[StrictStr, Field(.. :type state_id: str :param patched_state_request: :type patched_state_request: PatchedStateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(State, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'project_id', - 'slug', - 'state_id', - 'patched_state_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._update_state_serialize( + project_id=project_id, + slug=slug, + state_id=state_id, + patched_state_request=patched_state_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "State", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_state_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + state_id: Annotated[StrictStr, Field(description="State ID")], + patched_state_request: Optional[PatchedStateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update state + + Partially update an existing workflow state's properties like name, color, or group. + + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param state_id: State ID (required) + :type state_id: str + :param patched_state_request: + :type patched_state_request: PatchedStateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_state_serialize( + project_id=project_id, + slug=slug, + state_id=state_id, + patched_state_request=patched_state_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_state" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "State", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + def _update_state_serialize( + self, + project_id, + slug, + state_id, + patched_state_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _host = None - if _params['state_id'] is not None: - _path_params['state_id'] = _params['state_id'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + if state_id is not None: + _path_params['state_id'] = state_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_state_request'] is not None: - _body_params = _params['patched_state_request'] + if patched_state_request is not None: + _body_params = patched_state_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "State", - '400': None, - '409': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/states/{state_id}/', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/states/{state_id}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/plane/api/users_api.py b/plane/api/users_api.py index 4f09ff7..5cbf096 100644 --- a/plane/api/users_api.py +++ b/plane/api/users_api.py @@ -12,19 +12,15 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 - -from pydantic import validate_arguments +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union +from typing_extensions import Annotated from plane.models.user_lite import UserLite -from plane.api_client import ApiClient +from plane.api_client import ApiClient, RequestSerialized from plane.api_response import ApiResponse -from plane.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from plane.rest import RESTResponseType class UsersApi: @@ -39,135 +35,253 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def get_current_user(self, **kwargs) -> UserLite: # noqa: E501 - """Get current user # noqa: E501 - Retrieve the authenticated user's profile information including basic details. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def get_current_user( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> UserLite: + """Get current user - >>> thread = api.get_current_user(async_req=True) - >>> result = thread.get() + Retrieve the authenticated user's profile information including basic details. - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: UserLite - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the get_current_user_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.get_current_user_with_http_info(**kwargs) # noqa: E501 - - @validate_arguments - def get_current_user_with_http_info(self, **kwargs) -> ApiResponse: # noqa: E501 - """Get current user # noqa: E501 - - Retrieve the authenticated user's profile information including basic details. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_current_user_with_http_info(async_req=True) - >>> result = thread.get() - - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional + """ # noqa: E501 + + _param = self._get_current_user_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '200': "UserLite", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_current_user_with_http_info( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[UserLite]: + """Get current user + + Retrieve the authenticated user's profile information including basic details. + :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(UserLite, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 - _params = locals() + _param = self._get_current_user_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _all_params = [ - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '200': "UserLite", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def get_current_user_without_preload_content( + self, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get current user + + Retrieve the authenticated user's profile information including basic details. + + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_current_user_serialize( + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '200': "UserLite", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout ) + return response_data.response - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_current_user" % _key - ) - _params[_key] = _val - del _params['kwargs'] - _collection_formats = {} + def _get_current_user_serialize( + self, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - # process the path parameters - _path_params = {} + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '200': "UserLite", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/users/me/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/users/me/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/plane/api/work_item_activity_api.py b/plane/api/work_item_activity_api.py index 4de7347..2ac7557 100644 --- a/plane/api/work_item_activity_api.py +++ b/plane/api/work_item_activity_api.py @@ -12,25 +12,16 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 - -from pydantic import validate_arguments - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr - -from typing import Optional from plane.models.paginated_issue_activity_detail_response import PaginatedIssueActivityDetailResponse from plane.models.paginated_issue_activity_response import PaginatedIssueActivityResponse -from plane.api_client import ApiClient +from plane.api_client import ApiClient, RequestSerialized from plane.api_response import ApiResponse -from plane.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from plane.rest import RESTResponseType class WorkItemActivityApi: @@ -45,16 +36,34 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def list_work_item_activities(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> PaginatedIssueActivityResponse: # noqa: E501 - """Endpoints for issue activity/search and fetch issue activity details # noqa: E501 - Retrieve all activities for a work item. Supports filtering by activity type and date range. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def list_work_item_activities( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PaginatedIssueActivityResponse: + """Endpoints for issue activity/search and fetch issue activity details - >>> thread = api.list_work_item_activities(issue_id, project_id, slug, cursor, expand, fields, order_by, per_page, async_req=True) - >>> result = thread.get() + Retrieve all activities for a work item. Supports filtering by activity type and date range. :param issue_id: Issue ID (required) :type issue_id: str @@ -72,33 +81,88 @@ def list_work_item_activities(self, issue_id : Annotated[StrictStr, Field(..., d :type order_by: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PaginatedIssueActivityResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_work_item_activities_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_work_item_activities_with_http_info(issue_id, project_id, slug, cursor, expand, fields, order_by, per_page, **kwargs) # noqa: E501 - - @validate_arguments - def list_work_item_activities_with_http_info(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Endpoints for issue activity/search and fetch issue activity details # noqa: E501 - - Retrieve all activities for a work item. Supports filtering by activity type and date range. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_work_item_activities_with_http_info(issue_id, project_id, slug, cursor, expand, fields, order_by, per_page, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_work_item_activities_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedIssueActivityResponse", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_work_item_activities_with_http_info( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PaginatedIssueActivityResponse]: + """Endpoints for issue activity/search and fetch issue activity details + + Retrieve all activities for a work item. Supports filtering by activity type and date range. :param issue_id: Issue ID (required) :type issue_id: str @@ -116,145 +180,281 @@ def list_work_item_activities_with_http_info(self, issue_id : Annotated[StrictSt :type order_by: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PaginatedIssueActivityResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'issue_id', - 'project_id', - 'slug', - 'cursor', - 'expand', - 'fields', - 'order_by', - 'per_page' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_work_item_activities_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_work_item_activities" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] - - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] - - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedIssueActivityResponse", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - # process the query parameters - _query_params = [] - if _params.get('cursor') is not None: # noqa: E501 - _query_params.append(('cursor', _params['cursor'])) + @validate_call + def list_work_item_activities_without_preload_content( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Endpoints for issue activity/search and fetch issue activity details - if _params.get('expand') is not None: # noqa: E501 - _query_params.append(('expand', _params['expand'])) + Retrieve all activities for a work item. Supports filtering by activity type and date range. - if _params.get('fields') is not None: # noqa: E501 - _query_params.append(('fields', _params['fields'])) + :param issue_id: Issue ID (required) + :type issue_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param cursor: Pagination cursor for getting next set of results + :type cursor: str + :param expand: Comma-separated list of related fields to expand in response + :type expand: str + :param fields: Comma-separated list of fields to include in response + :type fields: str + :param order_by: Field to order results by. Prefix with '-' for descending order + :type order_by: str + :param per_page: Number of results per page (default: 20, max: 100) + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_work_item_activities_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('order_by') is not None: # noqa: E501 - _query_params.append(('order_by', _params['order_by'])) + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedIssueActivityResponse", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_work_item_activities_serialize( + self, + issue_id, + project_id, + slug, + cursor, + expand, + fields, + order_by, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('per_page') is not None: # noqa: E501 - _query_params.append(('per_page', _params['per_page'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + # process the query parameters + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + if fields is not None: + + _query_params.append(('fields', fields)) + + if order_by is not None: + + _query_params.append(('order_by', order_by)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "PaginatedIssueActivityResponse", - '400': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/activities/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/activities/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def retrieve_work_item_activity(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], pk : Annotated[StrictStr, Field(..., description="Activity ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> PaginatedIssueActivityDetailResponse: # noqa: E501 - """Endpoints for issue activity/search and fetch issue activity details # noqa: E501 - Retrieve details of a specific activity. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.retrieve_work_item_activity(issue_id, pk, project_id, slug, cursor, expand, fields, order_by, per_page, async_req=True) - >>> result = thread.get() + + @validate_call + def retrieve_work_item_activity( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + pk: Annotated[StrictStr, Field(description="Activity ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PaginatedIssueActivityDetailResponse: + """Endpoints for issue activity/search and fetch issue activity details + + Retrieve details of a specific activity. :param issue_id: Issue ID (required) :type issue_id: str @@ -274,33 +474,90 @@ def retrieve_work_item_activity(self, issue_id : Annotated[StrictStr, Field(..., :type order_by: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PaginatedIssueActivityDetailResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the retrieve_work_item_activity_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.retrieve_work_item_activity_with_http_info(issue_id, pk, project_id, slug, cursor, expand, fields, order_by, per_page, **kwargs) # noqa: E501 - - @validate_arguments - def retrieve_work_item_activity_with_http_info(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], pk : Annotated[StrictStr, Field(..., description="Activity ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Endpoints for issue activity/search and fetch issue activity details # noqa: E501 - - Retrieve details of a specific activity. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_work_item_activity_with_http_info(issue_id, pk, project_id, slug, cursor, expand, fields, order_by, per_page, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._retrieve_work_item_activity_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedIssueActivityDetailResponse", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_work_item_activity_with_http_info( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + pk: Annotated[StrictStr, Field(description="Activity ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PaginatedIssueActivityDetailResponse]: + """Endpoints for issue activity/search and fetch issue activity details + + Retrieve details of a specific activity. :param issue_id: Issue ID (required) :type issue_id: str @@ -320,135 +577,256 @@ def retrieve_work_item_activity_with_http_info(self, issue_id : Annotated[Strict :type order_by: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PaginatedIssueActivityDetailResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'issue_id', - 'pk', - 'project_id', - 'slug', - 'cursor', - 'expand', - 'fields', - 'order_by', - 'per_page' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._retrieve_work_item_activity_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method retrieve_work_item_activity" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedIssueActivityDetailResponse", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] + @validate_call + def retrieve_work_item_activity_without_preload_content( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + pk: Annotated[StrictStr, Field(description="Activity ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Endpoints for issue activity/search and fetch issue activity details - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + Retrieve details of a specific activity. - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + :param issue_id: Issue ID (required) + :type issue_id: str + :param pk: Activity ID (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param cursor: Pagination cursor for getting next set of results + :type cursor: str + :param expand: Comma-separated list of related fields to expand in response + :type expand: str + :param fields: Comma-separated list of fields to include in response + :type fields: str + :param order_by: Field to order results by. Prefix with '-' for descending order + :type order_by: str + :param per_page: Number of results per page (default: 20, max: 100) + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_work_item_activity_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedIssueActivityDetailResponse", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_work_item_activity_serialize( + self, + issue_id, + pk, + project_id, + slug, + cursor, + expand, + fields, + order_by, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] - if _params.get('cursor') is not None: # noqa: E501 - _query_params.append(('cursor', _params['cursor'])) - - if _params.get('expand') is not None: # noqa: E501 - _query_params.append(('expand', _params['expand'])) - - if _params.get('fields') is not None: # noqa: E501 - _query_params.append(('fields', _params['fields'])) - - if _params.get('order_by') is not None: # noqa: E501 - _query_params.append(('order_by', _params['order_by'])) - - if _params.get('per_page') is not None: # noqa: E501 - _query_params.append(('per_page', _params['per_page'])) - + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + if fields is not None: + + _query_params.append(('fields', fields)) + + if order_by is not None: + + _query_params.append(('order_by', order_by)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "PaginatedIssueActivityDetailResponse", - '400': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/activities/{pk}/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/activities/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/plane/api/work_item_attachments_api.py b/plane/api/work_item_attachments_api.py index 60a2f0a..2c2b209 100644 --- a/plane/api/work_item_attachments_api.py +++ b/plane/api/work_item_attachments_api.py @@ -12,23 +12,16 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 - -from pydantic import validate_arguments - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr from plane.models.issue_attachment import IssueAttachment from plane.models.issue_attachment_upload_request import IssueAttachmentUploadRequest -from plane.api_client import ApiClient +from plane.api_client import ApiClient, RequestSerialized from plane.api_response import ApiResponse -from plane.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from plane.rest import RESTResponseType class WorkItemAttachmentsApi: @@ -43,16 +36,30 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def create_work_item_attachment(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], issue_attachment_upload_request : IssueAttachmentUploadRequest, **kwargs) -> None: # noqa: E501 - """Endpoints for issue attachment create/update/delete and fetch issue attachment details # noqa: E501 - Generate presigned URL for uploading file attachments to a work item. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_work_item_attachment( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_attachment_upload_request: IssueAttachmentUploadRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Endpoints for issue attachment create/update/delete and fetch issue attachment details - >>> thread = api.create_work_item_attachment(issue_id, project_id, slug, issue_attachment_upload_request, async_req=True) - >>> result = thread.get() + Generate presigned URL for uploading file attachments to a work item. :param issue_id: Issue ID (required) :type issue_id: str @@ -62,33 +69,80 @@ def create_work_item_attachment(self, issue_id : Annotated[StrictStr, Field(..., :type slug: str :param issue_attachment_upload_request: (required) :type issue_attachment_upload_request: IssueAttachmentUploadRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the create_work_item_attachment_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.create_work_item_attachment_with_http_info(issue_id, project_id, slug, issue_attachment_upload_request, **kwargs) # noqa: E501 - - @validate_arguments - def create_work_item_attachment_with_http_info(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], issue_attachment_upload_request : IssueAttachmentUploadRequest, **kwargs) -> ApiResponse: # noqa: E501 - """Endpoints for issue attachment create/update/delete and fetch issue attachment details # noqa: E501 - - Generate presigned URL for uploading file attachments to a work item. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_work_item_attachment_with_http_info(issue_id, project_id, slug, issue_attachment_upload_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._create_work_item_attachment_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + issue_attachment_upload_request=issue_attachment_upload_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': None, + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_work_item_attachment_with_http_info( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_attachment_upload_request: IssueAttachmentUploadRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Endpoints for issue attachment create/update/delete and fetch issue attachment details + + Generate presigned URL for uploading file attachments to a work item. :param issue_id: Issue ID (required) :type issue_id: str @@ -98,126 +152,242 @@ def create_work_item_attachment_with_http_info(self, issue_id : Annotated[Strict :type slug: str :param issue_attachment_upload_request: (required) :type issue_attachment_upload_request: IssueAttachmentUploadRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = [ - 'issue_id', - 'project_id', - 'slug', - 'issue_attachment_upload_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._create_work_item_attachment_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + issue_attachment_upload_request=issue_attachment_upload_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': None, + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_work_item_attachment_without_preload_content( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_attachment_upload_request: IssueAttachmentUploadRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Endpoints for issue attachment create/update/delete and fetch issue attachment details + + Generate presigned URL for uploading file attachments to a work item. + + :param issue_id: Issue ID (required) + :type issue_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param issue_attachment_upload_request: (required) + :type issue_attachment_upload_request: IssueAttachmentUploadRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_work_item_attachment_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + issue_attachment_upload_request=issue_attachment_upload_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_work_item_attachment" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': None, + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] + def _create_work_item_attachment_serialize( + self, + issue_id, + project_id, + slug, + issue_attachment_upload_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['issue_attachment_upload_request'] is not None: - _body_params = _params['issue_attachment_upload_request'] + if issue_attachment_upload_request is not None: + _body_params = issue_attachment_upload_request + + # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = {} + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/issue-attachments/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/issue-attachments/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def delete_work_item_attachment(self, issue_id : StrictStr, pk : Annotated[StrictStr, Field(..., description="Attachment ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> None: # noqa: E501 - """Endpoints for issue attachment create/update/delete and fetch issue attachment details # noqa: E501 - Permanently remove an attachment from a work item. Records deletion activity for audit purposes. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_work_item_attachment(issue_id, pk, project_id, slug, async_req=True) - >>> result = thread.get() + + @validate_call + def delete_work_item_attachment( + self, + issue_id: StrictStr, + pk: Annotated[StrictStr, Field(description="Attachment ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Endpoints for issue attachment create/update/delete and fetch issue attachment details + + Permanently remove an attachment from a work item. Records deletion activity for audit purposes. :param issue_id: (required) :type issue_id: str @@ -227,33 +397,79 @@ def delete_work_item_attachment(self, issue_id : StrictStr, pk : Annotated[Stric :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the delete_work_item_attachment_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.delete_work_item_attachment_with_http_info(issue_id, pk, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def delete_work_item_attachment_with_http_info(self, issue_id : StrictStr, pk : Annotated[StrictStr, Field(..., description="Attachment ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Endpoints for issue attachment create/update/delete and fetch issue attachment details # noqa: E501 - - Permanently remove an attachment from a work item. Records deletion activity for audit purposes. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_work_item_attachment_with_http_info(issue_id, pk, project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._delete_work_item_attachment_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_work_item_attachment_with_http_info( + self, + issue_id: StrictStr, + pk: Annotated[StrictStr, Field(description="Attachment ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Endpoints for issue attachment create/update/delete and fetch issue attachment details + + Permanently remove an attachment from a work item. Records deletion activity for audit purposes. :param issue_id: (required) :type issue_id: str @@ -263,119 +479,224 @@ def delete_work_item_attachment_with_http_info(self, issue_id : StrictStr, pk : :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = [ - 'issue_id', - 'pk', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._delete_work_item_attachment_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_work_item_attachment" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] + @validate_call + def delete_work_item_attachment_without_preload_content( + self, + issue_id: StrictStr, + pk: Annotated[StrictStr, Field(description="Attachment ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Endpoints for issue attachment create/update/delete and fetch issue attachment details + + Permanently remove an attachment from a work item. Records deletion activity for audit purposes. + + :param issue_id: (required) + :type issue_id: str + :param pk: Attachment ID (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_work_item_attachment_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + def _delete_work_item_attachment_serialize( + self, + issue_id, + pk, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/issue-attachments/{pk}/', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/issue-attachments/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def list_work_item_attachments(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> IssueAttachment: # noqa: E501 - """Endpoints for issue attachment create/update/delete and fetch issue attachment details # noqa: E501 - Retrieve all attachments for a work item. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_work_item_attachments(issue_id, project_id, slug, async_req=True) - >>> result = thread.get() + @validate_call + def list_work_item_attachments( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IssueAttachment: + """Endpoints for issue attachment create/update/delete and fetch issue attachment details + + Retrieve all attachments for a work item. :param issue_id: Issue ID (required) :type issue_id: str @@ -383,33 +704,78 @@ def list_work_item_attachments(self, issue_id : Annotated[StrictStr, Field(..., :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: IssueAttachment - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_work_item_attachments_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_work_item_attachments_with_http_info(issue_id, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def list_work_item_attachments_with_http_info(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Endpoints for issue attachment create/update/delete and fetch issue attachment details # noqa: E501 - - Retrieve all attachments for a work item. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_work_item_attachments_with_http_info(issue_id, project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_work_item_attachments_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueAttachment", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_work_item_attachments_with_http_info( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IssueAttachment]: + """Endpoints for issue attachment create/update/delete and fetch issue attachment details + + Retrieve all attachments for a work item. :param issue_id: Issue ID (required) :type issue_id: str @@ -417,125 +783,226 @@ def list_work_item_attachments_with_http_info(self, issue_id : Annotated[StrictS :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(IssueAttachment, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._list_work_item_attachments_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueAttachment", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'issue_id', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def list_work_item_attachments_without_preload_content( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Endpoints for issue attachment create/update/delete and fetch issue attachment details + + Retrieve all attachments for a work item. + + :param issue_id: Issue ID (required) + :type issue_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_work_item_attachments_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_work_item_attachments" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueAttachment", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] + def _list_work_item_attachments_serialize( + self, + issue_id, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "IssueAttachment", - '400': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/issue-attachments/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/issue-attachments/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def retrieve_work_item_attachment(self, issue_id : StrictStr, pk : Annotated[StrictStr, Field(..., description="Attachment ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> None: # noqa: E501 - """Endpoints for issue attachment create/update/delete and fetch issue attachment details # noqa: E501 - Download attachment file. Returns a redirect to the presigned download URL. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.retrieve_work_item_attachment(issue_id, pk, project_id, slug, async_req=True) - >>> result = thread.get() + @validate_call + def retrieve_work_item_attachment( + self, + issue_id: StrictStr, + pk: Annotated[StrictStr, Field(description="Attachment ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Endpoints for issue attachment create/update/delete and fetch issue attachment details + + Download attachment file. Returns a redirect to the presigned download URL. :param issue_id: (required) :type issue_id: str @@ -545,33 +1012,80 @@ def retrieve_work_item_attachment(self, issue_id : StrictStr, pk : Annotated[Str :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the retrieve_work_item_attachment_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.retrieve_work_item_attachment_with_http_info(issue_id, pk, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def retrieve_work_item_attachment_with_http_info(self, issue_id : StrictStr, pk : Annotated[StrictStr, Field(..., description="Attachment ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Endpoints for issue attachment create/update/delete and fetch issue attachment details # noqa: E501 - - Download attachment file. Returns a redirect to the presigned download URL. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_work_item_attachment_with_http_info(issue_id, pk, project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._retrieve_work_item_attachment_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '302': None, + '400': "RetrieveWorkItemAttachment400Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_work_item_attachment_with_http_info( + self, + issue_id: StrictStr, + pk: Annotated[StrictStr, Field(description="Attachment ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Endpoints for issue attachment create/update/delete and fetch issue attachment details + + Download attachment file. Returns a redirect to the presigned download URL. :param issue_id: (required) :type issue_id: str @@ -581,109 +1095,206 @@ def retrieve_work_item_attachment_with_http_info(self, issue_id : StrictStr, pk :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = [ - 'issue_id', - 'pk', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._retrieve_work_item_attachment_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method retrieve_work_item_attachment" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '302': None, + '400': "RetrieveWorkItemAttachment400Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] + @validate_call + def retrieve_work_item_attachment_without_preload_content( + self, + issue_id: StrictStr, + pk: Annotated[StrictStr, Field(description="Attachment ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Endpoints for issue attachment create/update/delete and fetch issue attachment details + + Download attachment file. Returns a redirect to the presigned download URL. + + :param issue_id: (required) + :type issue_id: str + :param pk: Attachment ID (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_work_item_attachment_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '302': None, + '400': "RetrieveWorkItemAttachment400Response", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + def _retrieve_work_item_attachment_serialize( + self, + issue_id, + pk, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = {} + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/issue-attachments/{pk}/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/issue-attachments/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/plane/api/work_item_comments_api.py b/plane/api/work_item_comments_api.py index d56caa0..409f55d 100644 --- a/plane/api/work_item_comments_api.py +++ b/plane/api/work_item_comments_api.py @@ -12,27 +12,18 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 - -from pydantic import validate_arguments - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr - -from typing import Optional from plane.models.issue_comment import IssueComment from plane.models.issue_comment_create_request import IssueCommentCreateRequest from plane.models.paginated_issue_comment_response import PaginatedIssueCommentResponse from plane.models.patched_issue_comment_create_request import PatchedIssueCommentCreateRequest -from plane.api_client import ApiClient +from plane.api_client import ApiClient, RequestSerialized from plane.api_response import ApiResponse -from plane.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from plane.rest import RESTResponseType class WorkItemCommentsApi: @@ -47,16 +38,30 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def create_work_item_comment(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], issue_comment_create_request : Optional[IssueCommentCreateRequest] = None, **kwargs) -> IssueComment: # noqa: E501 - """Endpoints for issue comment create/update/delete and fetch issue comment details # noqa: E501 - Add a new comment to a work item with HTML content. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_work_item_comment( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_comment_create_request: Optional[IssueCommentCreateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IssueComment: + """Endpoints for issue comment create/update/delete and fetch issue comment details - >>> thread = api.create_work_item_comment(issue_id, project_id, slug, issue_comment_create_request, async_req=True) - >>> result = thread.get() + Add a new comment to a work item with HTML content. :param issue_id: Issue ID (required) :type issue_id: str @@ -66,33 +71,81 @@ def create_work_item_comment(self, issue_id : Annotated[StrictStr, Field(..., de :type slug: str :param issue_comment_create_request: :type issue_comment_create_request: IssueCommentCreateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: IssueComment - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the create_work_item_comment_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.create_work_item_comment_with_http_info(issue_id, project_id, slug, issue_comment_create_request, **kwargs) # noqa: E501 - - @validate_arguments - def create_work_item_comment_with_http_info(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], issue_comment_create_request : Optional[IssueCommentCreateRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Endpoints for issue comment create/update/delete and fetch issue comment details # noqa: E501 - - Add a new comment to a work item with HTML content. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_work_item_comment_with_http_info(issue_id, project_id, slug, issue_comment_create_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._create_work_item_comment_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + issue_comment_create_request=issue_comment_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IssueComment", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_work_item_comment_with_http_info( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_comment_create_request: Optional[IssueCommentCreateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IssueComment]: + """Endpoints for issue comment create/update/delete and fetch issue comment details + + Add a new comment to a work item with HTML content. :param issue_id: Issue ID (required) :type issue_id: str @@ -102,137 +155,251 @@ def create_work_item_comment_with_http_info(self, issue_id : Annotated[StrictStr :type slug: str :param issue_comment_create_request: :type issue_comment_create_request: IssueCommentCreateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(IssueComment, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'issue_id', - 'project_id', - 'slug', - 'issue_comment_create_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._create_work_item_comment_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + issue_comment_create_request=issue_comment_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IssueComment", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_work_item_comment_without_preload_content( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_comment_create_request: Optional[IssueCommentCreateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Endpoints for issue comment create/update/delete and fetch issue comment details + + Add a new comment to a work item with HTML content. + + :param issue_id: Issue ID (required) + :type issue_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param issue_comment_create_request: + :type issue_comment_create_request: IssueCommentCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_work_item_comment_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + issue_comment_create_request=issue_comment_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_work_item_comment" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IssueComment", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] + def _create_work_item_comment_serialize( + self, + issue_id, + project_id, + slug, + issue_comment_create_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['issue_comment_create_request'] is not None: - _body_params = _params['issue_comment_create_request'] + if issue_comment_create_request is not None: + _body_params = issue_comment_create_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '201': "IssueComment", - '400': None, - '409': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/comments/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/comments/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def delete_work_item_comment(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], pk : Annotated[StrictStr, Field(..., description="Comment ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> None: # noqa: E501 - """Endpoints for issue comment create/update/delete and fetch issue comment details # noqa: E501 - Permanently remove a comment from a work item. Records deletion activity for audit purposes. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def delete_work_item_comment( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + pk: Annotated[StrictStr, Field(description="Comment ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Endpoints for issue comment create/update/delete and fetch issue comment details - >>> thread = api.delete_work_item_comment(issue_id, pk, project_id, slug, async_req=True) - >>> result = thread.get() + Permanently remove a comment from a work item. Records deletion activity for audit purposes. :param issue_id: Issue ID (required) :type issue_id: str @@ -242,33 +409,79 @@ def delete_work_item_comment(self, issue_id : Annotated[StrictStr, Field(..., de :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the delete_work_item_comment_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.delete_work_item_comment_with_http_info(issue_id, pk, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def delete_work_item_comment_with_http_info(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], pk : Annotated[StrictStr, Field(..., description="Comment ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Endpoints for issue comment create/update/delete and fetch issue comment details # noqa: E501 - - Permanently remove a comment from a work item. Records deletion activity for audit purposes. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_work_item_comment_with_http_info(issue_id, pk, project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._delete_work_item_comment_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_work_item_comment_with_http_info( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + pk: Annotated[StrictStr, Field(description="Comment ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Endpoints for issue comment create/update/delete and fetch issue comment details + + Permanently remove a comment from a work item. Records deletion activity for audit purposes. :param issue_id: Issue ID (required) :type issue_id: str @@ -278,119 +491,229 @@ def delete_work_item_comment_with_http_info(self, issue_id : Annotated[StrictStr :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = [ - 'issue_id', - 'pk', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._delete_work_item_comment_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_work_item_comment" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] + @validate_call + def delete_work_item_comment_without_preload_content( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + pk: Annotated[StrictStr, Field(description="Comment ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Endpoints for issue comment create/update/delete and fetch issue comment details - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + Permanently remove a comment from a work item. Records deletion activity for audit purposes. + + :param issue_id: Issue ID (required) + :type issue_id: str + :param pk: Comment ID (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_work_item_comment_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + def _delete_work_item_comment_serialize( + self, + issue_id, + pk, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/comments/{pk}/', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/comments/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def list_work_item_comments(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> PaginatedIssueCommentResponse: # noqa: E501 - """Endpoints for issue comment create/update/delete and fetch issue comment details # noqa: E501 - Retrieve all comments for a work item. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_work_item_comments(issue_id, project_id, slug, cursor, expand, fields, order_by, per_page, async_req=True) - >>> result = thread.get() + + @validate_call + def list_work_item_comments( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PaginatedIssueCommentResponse: + """Endpoints for issue comment create/update/delete and fetch issue comment details + + Retrieve all comments for a work item. :param issue_id: Issue ID (required) :type issue_id: str @@ -408,33 +731,87 @@ def list_work_item_comments(self, issue_id : Annotated[StrictStr, Field(..., des :type order_by: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PaginatedIssueCommentResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_work_item_comments_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_work_item_comments_with_http_info(issue_id, project_id, slug, cursor, expand, fields, order_by, per_page, **kwargs) # noqa: E501 - - @validate_arguments - def list_work_item_comments_with_http_info(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Endpoints for issue comment create/update/delete and fetch issue comment details # noqa: E501 - - Retrieve all comments for a work item. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_work_item_comments_with_http_info(issue_id, project_id, slug, cursor, expand, fields, order_by, per_page, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_work_item_comments_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedIssueCommentResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_work_item_comments_with_http_info( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PaginatedIssueCommentResponse]: + """Endpoints for issue comment create/update/delete and fetch issue comment details + + Retrieve all comments for a work item. :param issue_id: Issue ID (required) :type issue_id: str @@ -452,144 +829,274 @@ def list_work_item_comments_with_http_info(self, issue_id : Annotated[StrictStr, :type order_by: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PaginatedIssueCommentResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'issue_id', - 'project_id', - 'slug', - 'cursor', - 'expand', - 'fields', - 'order_by', - 'per_page' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_work_item_comments_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_work_item_comments" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] - - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] - - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedIssueCommentResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - # process the query parameters - _query_params = [] - if _params.get('cursor') is not None: # noqa: E501 - _query_params.append(('cursor', _params['cursor'])) + @validate_call + def list_work_item_comments_without_preload_content( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Endpoints for issue comment create/update/delete and fetch issue comment details - if _params.get('expand') is not None: # noqa: E501 - _query_params.append(('expand', _params['expand'])) + Retrieve all comments for a work item. - if _params.get('fields') is not None: # noqa: E501 - _query_params.append(('fields', _params['fields'])) + :param issue_id: Issue ID (required) + :type issue_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param cursor: Pagination cursor for getting next set of results + :type cursor: str + :param expand: Comma-separated list of related fields to expand in response + :type expand: str + :param fields: Comma-separated list of fields to include in response + :type fields: str + :param order_by: Field to order results by. Prefix with '-' for descending order + :type order_by: str + :param per_page: Number of results per page (default: 20, max: 100) + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_work_item_comments_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('order_by') is not None: # noqa: E501 - _query_params.append(('order_by', _params['order_by'])) + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedIssueCommentResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_work_item_comments_serialize( + self, + issue_id, + project_id, + slug, + cursor, + expand, + fields, + order_by, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('per_page') is not None: # noqa: E501 - _query_params.append(('per_page', _params['per_page'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + # process the query parameters + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + if fields is not None: + + _query_params.append(('fields', fields)) + + if order_by is not None: + + _query_params.append(('order_by', order_by)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "PaginatedIssueCommentResponse", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/comments/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/comments/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def retrieve_work_item_comment(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], pk : Annotated[StrictStr, Field(..., description="Comment ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> IssueComment: # noqa: E501 - """Endpoints for issue comment create/update/delete and fetch issue comment details # noqa: E501 - Retrieve details of a specific comment. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.retrieve_work_item_comment(issue_id, pk, project_id, slug, async_req=True) - >>> result = thread.get() + + @validate_call + def retrieve_work_item_comment( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + pk: Annotated[StrictStr, Field(description="Comment ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IssueComment: + """Endpoints for issue comment create/update/delete and fetch issue comment details + + Retrieve details of a specific comment. :param issue_id: Issue ID (required) :type issue_id: str @@ -599,33 +1106,80 @@ def retrieve_work_item_comment(self, issue_id : Annotated[StrictStr, Field(..., :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: IssueComment - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the retrieve_work_item_comment_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.retrieve_work_item_comment_with_http_info(issue_id, pk, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def retrieve_work_item_comment_with_http_info(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], pk : Annotated[StrictStr, Field(..., description="Comment ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Endpoints for issue comment create/update/delete and fetch issue comment details # noqa: E501 - - Retrieve details of a specific comment. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_work_item_comment_with_http_info(issue_id, pk, project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._retrieve_work_item_comment_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueComment", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_work_item_comment_with_http_info( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + pk: Annotated[StrictStr, Field(description="Comment ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IssueComment]: + """Endpoints for issue comment create/update/delete and fetch issue comment details + + Retrieve details of a specific comment. :param issue_id: Issue ID (required) :type issue_id: str @@ -635,129 +1189,235 @@ def retrieve_work_item_comment_with_http_info(self, issue_id : Annotated[StrictS :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(IssueComment, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'issue_id', - 'pk', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._retrieve_work_item_comment_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method retrieve_work_item_comment" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueComment", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] + @validate_call + def retrieve_work_item_comment_without_preload_content( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + pk: Annotated[StrictStr, Field(description="Comment ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Endpoints for issue comment create/update/delete and fetch issue comment details - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + Retrieve details of a specific comment. - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + :param issue_id: Issue ID (required) + :type issue_id: str + :param pk: Comment ID (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_work_item_comment_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueComment", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_work_item_comment_serialize( + self, + issue_id, + pk, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "IssueComment", - '400': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/comments/{pk}/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/comments/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def update_work_item_comment(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], pk : Annotated[StrictStr, Field(..., description="Comment ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], patched_issue_comment_create_request : Optional[PatchedIssueCommentCreateRequest] = None, **kwargs) -> IssueComment: # noqa: E501 - """Endpoints for issue comment create/update/delete and fetch issue comment details # noqa: E501 - Modify the content of an existing comment on a work item. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_work_item_comment(issue_id, pk, project_id, slug, patched_issue_comment_create_request, async_req=True) - >>> result = thread.get() + + @validate_call + def update_work_item_comment( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + pk: Annotated[StrictStr, Field(description="Comment ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_issue_comment_create_request: Optional[PatchedIssueCommentCreateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IssueComment: + """Endpoints for issue comment create/update/delete and fetch issue comment details + + Modify the content of an existing comment on a work item. :param issue_id: Issue ID (required) :type issue_id: str @@ -769,33 +1429,83 @@ def update_work_item_comment(self, issue_id : Annotated[StrictStr, Field(..., de :type slug: str :param patched_issue_comment_create_request: :type patched_issue_comment_create_request: PatchedIssueCommentCreateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: IssueComment - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the update_work_item_comment_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.update_work_item_comment_with_http_info(issue_id, pk, project_id, slug, patched_issue_comment_create_request, **kwargs) # noqa: E501 - - @validate_arguments - def update_work_item_comment_with_http_info(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], pk : Annotated[StrictStr, Field(..., description="Comment ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], patched_issue_comment_create_request : Optional[PatchedIssueCommentCreateRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Endpoints for issue comment create/update/delete and fetch issue comment details # noqa: E501 - - Modify the content of an existing comment on a work item. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_work_item_comment_with_http_info(issue_id, pk, project_id, slug, patched_issue_comment_create_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._update_work_item_comment_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + patched_issue_comment_create_request=patched_issue_comment_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueComment", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_work_item_comment_with_http_info( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + pk: Annotated[StrictStr, Field(description="Comment ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_issue_comment_create_request: Optional[PatchedIssueCommentCreateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IssueComment]: + """Endpoints for issue comment create/update/delete and fetch issue comment details + + Modify the content of an existing comment on a work item. :param issue_id: Issue ID (required) :type issue_id: str @@ -807,127 +1517,231 @@ def update_work_item_comment_with_http_info(self, issue_id : Annotated[StrictStr :type slug: str :param patched_issue_comment_create_request: :type patched_issue_comment_create_request: PatchedIssueCommentCreateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(IssueComment, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'issue_id', - 'pk', - 'project_id', - 'slug', - 'patched_issue_comment_create_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._update_work_item_comment_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + patched_issue_comment_create_request=patched_issue_comment_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_work_item_comment" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueComment", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] + @validate_call + def update_work_item_comment_without_preload_content( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + pk: Annotated[StrictStr, Field(description="Comment ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_issue_comment_create_request: Optional[PatchedIssueCommentCreateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Endpoints for issue comment create/update/delete and fetch issue comment details + + Modify the content of an existing comment on a work item. + + :param issue_id: Issue ID (required) + :type issue_id: str + :param pk: Comment ID (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param patched_issue_comment_create_request: + :type patched_issue_comment_create_request: PatchedIssueCommentCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_work_item_comment_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + patched_issue_comment_create_request=patched_issue_comment_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueComment", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + def _update_work_item_comment_serialize( + self, + issue_id, + pk, + project_id, + slug, + patched_issue_comment_create_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_issue_comment_create_request'] is not None: - _body_params = _params['patched_issue_comment_create_request'] + if patched_issue_comment_create_request is not None: + _body_params = patched_issue_comment_create_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "IssueComment", - '400': None, - '409': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/comments/{pk}/', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/comments/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/plane/api/work_item_links_api.py b/plane/api/work_item_links_api.py index 86c3b22..fef8ef3 100644 --- a/plane/api/work_item_links_api.py +++ b/plane/api/work_item_links_api.py @@ -12,15 +12,9 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 - -from pydantic import validate_arguments - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr - -from typing import Optional from plane.models.issue_link import IssueLink from plane.models.issue_link_create_request import IssueLinkCreateRequest @@ -28,12 +22,9 @@ from plane.models.paginated_issue_link_response import PaginatedIssueLinkResponse from plane.models.patched_issue_link_update_request import PatchedIssueLinkUpdateRequest -from plane.api_client import ApiClient +from plane.api_client import ApiClient, RequestSerialized from plane.api_response import ApiResponse -from plane.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from plane.rest import RESTResponseType class WorkItemLinksApi: @@ -48,16 +39,30 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def create_work_item_link(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], issue_link_create_request : IssueLinkCreateRequest, **kwargs) -> IssueLink: # noqa: E501 - """Endpoints for issue link create/update/delete and fetch issue link details # noqa: E501 - Add a new external link to a work item with URL, title, and metadata. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_work_item_link( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_link_create_request: IssueLinkCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IssueLink: + """Endpoints for issue link create/update/delete and fetch issue link details - >>> thread = api.create_work_item_link(issue_id, project_id, slug, issue_link_create_request, async_req=True) - >>> result = thread.get() + Add a new external link to a work item with URL, title, and metadata. :param issue_id: Issue ID (required) :type issue_id: str @@ -67,33 +72,80 @@ def create_work_item_link(self, issue_id : Annotated[StrictStr, Field(..., descr :type slug: str :param issue_link_create_request: (required) :type issue_link_create_request: IssueLinkCreateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: IssueLink - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the create_work_item_link_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.create_work_item_link_with_http_info(issue_id, project_id, slug, issue_link_create_request, **kwargs) # noqa: E501 - - @validate_arguments - def create_work_item_link_with_http_info(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], issue_link_create_request : IssueLinkCreateRequest, **kwargs) -> ApiResponse: # noqa: E501 - """Endpoints for issue link create/update/delete and fetch issue link details # noqa: E501 - - Add a new external link to a work item with URL, title, and metadata. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_work_item_link_with_http_info(issue_id, project_id, slug, issue_link_create_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._create_work_item_link_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + issue_link_create_request=issue_link_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IssueLink", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_work_item_link_with_http_info( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_link_create_request: IssueLinkCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IssueLink]: + """Endpoints for issue link create/update/delete and fetch issue link details + + Add a new external link to a work item with URL, title, and metadata. :param issue_id: Issue ID (required) :type issue_id: str @@ -103,136 +155,249 @@ def create_work_item_link_with_http_info(self, issue_id : Annotated[StrictStr, F :type slug: str :param issue_link_create_request: (required) :type issue_link_create_request: IssueLinkCreateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(IssueLink, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'issue_id', - 'project_id', - 'slug', - 'issue_link_create_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._create_work_item_link_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + issue_link_create_request=issue_link_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IssueLink", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_work_item_link_without_preload_content( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_link_create_request: IssueLinkCreateRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Endpoints for issue link create/update/delete and fetch issue link details + + Add a new external link to a work item with URL, title, and metadata. + + :param issue_id: Issue ID (required) + :type issue_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param issue_link_create_request: (required) + :type issue_link_create_request: IssueLinkCreateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_work_item_link_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + issue_link_create_request=issue_link_create_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_work_item_link" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IssueLink", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] + def _create_work_item_link_serialize( + self, + issue_id, + project_id, + slug, + issue_link_create_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['issue_link_create_request'] is not None: - _body_params = _params['issue_link_create_request'] + if issue_link_create_request is not None: + _body_params = issue_link_create_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '201': "IssueLink", - '400': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/links/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/links/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def delete_work_item_link(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], pk : Annotated[StrictStr, Field(..., description="Link ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> None: # noqa: E501 - """Endpoints for issue link create/update/delete and fetch issue link details # noqa: E501 - Permanently remove an external link from a work item. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_work_item_link(issue_id, pk, project_id, slug, async_req=True) - >>> result = thread.get() + + @validate_call + def delete_work_item_link( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + pk: Annotated[StrictStr, Field(description="Link ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Endpoints for issue link create/update/delete and fetch issue link details + + Permanently remove an external link from a work item. :param issue_id: Issue ID (required) :type issue_id: str @@ -242,33 +407,79 @@ def delete_work_item_link(self, issue_id : Annotated[StrictStr, Field(..., descr :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the delete_work_item_link_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.delete_work_item_link_with_http_info(issue_id, pk, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def delete_work_item_link_with_http_info(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], pk : Annotated[StrictStr, Field(..., description="Link ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Endpoints for issue link create/update/delete and fetch issue link details # noqa: E501 - - Permanently remove an external link from a work item. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_work_item_link_with_http_info(issue_id, pk, project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._delete_work_item_link_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_work_item_link_with_http_info( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + pk: Annotated[StrictStr, Field(description="Link ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Endpoints for issue link create/update/delete and fetch issue link details + + Permanently remove an external link from a work item. :param issue_id: Issue ID (required) :type issue_id: str @@ -278,119 +489,229 @@ def delete_work_item_link_with_http_info(self, issue_id : Annotated[StrictStr, F :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = [ - 'issue_id', - 'pk', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._delete_work_item_link_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_work_item_link" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] + @validate_call + def delete_work_item_link_without_preload_content( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + pk: Annotated[StrictStr, Field(description="Link ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Endpoints for issue link create/update/delete and fetch issue link details - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + Permanently remove an external link from a work item. - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + :param issue_id: Issue ID (required) + :type issue_id: str + :param pk: Link ID (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_work_item_link_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_work_item_link_serialize( + self, + issue_id, + pk, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/links/{pk}/', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/links/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def list_work_item_links(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> PaginatedIssueLinkResponse: # noqa: E501 - """Endpoints for issue link create/update/delete and fetch issue link details # noqa: E501 - Retrieve all links associated with a work item. Supports filtering by URL, title, and metadata. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_work_item_links(issue_id, project_id, slug, cursor, expand, fields, order_by, per_page, async_req=True) - >>> result = thread.get() + @validate_call + def list_work_item_links( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PaginatedIssueLinkResponse: + """Endpoints for issue link create/update/delete and fetch issue link details + + Retrieve all links associated with a work item. Supports filtering by URL, title, and metadata. :param issue_id: Issue ID (required) :type issue_id: str @@ -408,33 +729,88 @@ def list_work_item_links(self, issue_id : Annotated[StrictStr, Field(..., descri :type order_by: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PaginatedIssueLinkResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_work_item_links_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_work_item_links_with_http_info(issue_id, project_id, slug, cursor, expand, fields, order_by, per_page, **kwargs) # noqa: E501 - - @validate_arguments - def list_work_item_links_with_http_info(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Endpoints for issue link create/update/delete and fetch issue link details # noqa: E501 - - Retrieve all links associated with a work item. Supports filtering by URL, title, and metadata. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_work_item_links_with_http_info(issue_id, project_id, slug, cursor, expand, fields, order_by, per_page, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_work_item_links_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedIssueLinkResponse", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_work_item_links_with_http_info( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PaginatedIssueLinkResponse]: + """Endpoints for issue link create/update/delete and fetch issue link details + + Retrieve all links associated with a work item. Supports filtering by URL, title, and metadata. :param issue_id: Issue ID (required) :type issue_id: str @@ -452,145 +828,280 @@ def list_work_item_links_with_http_info(self, issue_id : Annotated[StrictStr, Fi :type order_by: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PaginatedIssueLinkResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'issue_id', - 'project_id', - 'slug', - 'cursor', - 'expand', - 'fields', - 'order_by', - 'per_page' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_work_item_links_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_work_item_links" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] - - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] - - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedIssueLinkResponse", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - # process the query parameters - _query_params = [] - if _params.get('cursor') is not None: # noqa: E501 - _query_params.append(('cursor', _params['cursor'])) + @validate_call + def list_work_item_links_without_preload_content( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Endpoints for issue link create/update/delete and fetch issue link details - if _params.get('expand') is not None: # noqa: E501 - _query_params.append(('expand', _params['expand'])) + Retrieve all links associated with a work item. Supports filtering by URL, title, and metadata. - if _params.get('fields') is not None: # noqa: E501 - _query_params.append(('fields', _params['fields'])) + :param issue_id: Issue ID (required) + :type issue_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param cursor: Pagination cursor for getting next set of results + :type cursor: str + :param expand: Comma-separated list of related fields to expand in response + :type expand: str + :param fields: Comma-separated list of fields to include in response + :type fields: str + :param order_by: Field to order results by. Prefix with '-' for descending order + :type order_by: str + :param per_page: Number of results per page (default: 20, max: 100) + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_work_item_links_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('order_by') is not None: # noqa: E501 - _query_params.append(('order_by', _params['order_by'])) + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedIssueLinkResponse", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_work_item_links_serialize( + self, + issue_id, + project_id, + slug, + cursor, + expand, + fields, + order_by, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('per_page') is not None: # noqa: E501 - _query_params.append(('per_page', _params['per_page'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + # process the query parameters + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + if fields is not None: + + _query_params.append(('fields', fields)) + + if order_by is not None: + + _query_params.append(('order_by', order_by)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "PaginatedIssueLinkResponse", - '400': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/links/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/links/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def retrieve_work_item_link(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], pk : Annotated[StrictStr, Field(..., description="Link ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> PaginatedIssueLinkDetailResponse: # noqa: E501 - """Endpoints for issue link create/update/delete and fetch issue link details # noqa: E501 - Retrieve details of a specific work item link. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.retrieve_work_item_link(issue_id, pk, project_id, slug, cursor, expand, fields, per_page, async_req=True) - >>> result = thread.get() + + @validate_call + def retrieve_work_item_link( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + pk: Annotated[StrictStr, Field(description="Link ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PaginatedIssueLinkDetailResponse: + """Endpoints for issue link create/update/delete and fetch issue link details + + Retrieve details of a specific work item link. :param issue_id: Issue ID (required) :type issue_id: str @@ -608,33 +1119,87 @@ def retrieve_work_item_link(self, issue_id : Annotated[StrictStr, Field(..., des :type fields: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PaginatedIssueLinkDetailResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the retrieve_work_item_link_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.retrieve_work_item_link_with_http_info(issue_id, pk, project_id, slug, cursor, expand, fields, per_page, **kwargs) # noqa: E501 - - @validate_arguments - def retrieve_work_item_link_with_http_info(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], pk : Annotated[StrictStr, Field(..., description="Link ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Endpoints for issue link create/update/delete and fetch issue link details # noqa: E501 - - Retrieve details of a specific work item link. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_work_item_link_with_http_info(issue_id, pk, project_id, slug, cursor, expand, fields, per_page, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._retrieve_work_item_link_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedIssueLinkDetailResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_work_item_link_with_http_info( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + pk: Annotated[StrictStr, Field(description="Link ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PaginatedIssueLinkDetailResponse]: + """Endpoints for issue link create/update/delete and fetch issue link details + + Retrieve details of a specific work item link. :param issue_id: Issue ID (required) :type issue_id: str @@ -652,144 +1217,273 @@ def retrieve_work_item_link_with_http_info(self, issue_id : Annotated[StrictStr, :type fields: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PaginatedIssueLinkDetailResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'issue_id', - 'pk', - 'project_id', - 'slug', - 'cursor', - 'expand', - 'fields', - 'per_page' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._retrieve_work_item_link_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method retrieve_work_item_link" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedIssueLinkDetailResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] + @validate_call + def retrieve_work_item_link_without_preload_content( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + pk: Annotated[StrictStr, Field(description="Link ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Endpoints for issue link create/update/delete and fetch issue link details - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + Retrieve details of a specific work item link. - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + :param issue_id: Issue ID (required) + :type issue_id: str + :param pk: Link ID (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param cursor: Pagination cursor for getting next set of results + :type cursor: str + :param expand: Comma-separated list of related fields to expand in response + :type expand: str + :param fields: Comma-separated list of fields to include in response + :type fields: str + :param per_page: Number of results per page (default: 20, max: 100) + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_work_item_link_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + fields=fields, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedIssueLinkDetailResponse", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_work_item_link_serialize( + self, + issue_id, + pk, + project_id, + slug, + cursor, + expand, + fields, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] - if _params.get('cursor') is not None: # noqa: E501 - _query_params.append(('cursor', _params['cursor'])) - - if _params.get('expand') is not None: # noqa: E501 - _query_params.append(('expand', _params['expand'])) - - if _params.get('fields') is not None: # noqa: E501 - _query_params.append(('fields', _params['fields'])) - - if _params.get('per_page') is not None: # noqa: E501 - _query_params.append(('per_page', _params['per_page'])) - + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + if fields is not None: + + _query_params.append(('fields', fields)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "PaginatedIssueLinkDetailResponse", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/links/{pk}/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/links/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def update_issue_link(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], pk : Annotated[StrictStr, Field(..., description="Link ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], patched_issue_link_update_request : Optional[PatchedIssueLinkUpdateRequest] = None, **kwargs) -> IssueLink: # noqa: E501 - """Update an issue link # noqa: E501 - Modify the URL, title, or metadata of an existing issue link. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def update_issue_link( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + pk: Annotated[StrictStr, Field(description="Link ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_issue_link_update_request: Optional[PatchedIssueLinkUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IssueLink: + """Update an issue link - >>> thread = api.update_issue_link(issue_id, pk, project_id, slug, patched_issue_link_update_request, async_req=True) - >>> result = thread.get() + Modify the URL, title, or metadata of an existing issue link. :param issue_id: Issue ID (required) :type issue_id: str @@ -801,33 +1495,82 @@ def update_issue_link(self, issue_id : Annotated[StrictStr, Field(..., descripti :type slug: str :param patched_issue_link_update_request: :type patched_issue_link_update_request: PatchedIssueLinkUpdateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: IssueLink - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the update_issue_link_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.update_issue_link_with_http_info(issue_id, pk, project_id, slug, patched_issue_link_update_request, **kwargs) # noqa: E501 - - @validate_arguments - def update_issue_link_with_http_info(self, issue_id : Annotated[StrictStr, Field(..., description="Issue ID")], pk : Annotated[StrictStr, Field(..., description="Link ID")], project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], patched_issue_link_update_request : Optional[PatchedIssueLinkUpdateRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update an issue link # noqa: E501 - - Modify the URL, title, or metadata of an existing issue link. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_issue_link_with_http_info(issue_id, pk, project_id, slug, patched_issue_link_update_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._update_issue_link_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + patched_issue_link_update_request=patched_issue_link_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueLink", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_issue_link_with_http_info( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + pk: Annotated[StrictStr, Field(description="Link ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_issue_link_update_request: Optional[PatchedIssueLinkUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IssueLink]: + """Update an issue link + + Modify the URL, title, or metadata of an existing issue link. :param issue_id: Issue ID (required) :type issue_id: str @@ -839,126 +1582,229 @@ def update_issue_link_with_http_info(self, issue_id : Annotated[StrictStr, Field :type slug: str :param patched_issue_link_update_request: :type patched_issue_link_update_request: PatchedIssueLinkUpdateRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(IssueLink, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'issue_id', - 'pk', - 'project_id', - 'slug', - 'patched_issue_link_update_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._update_issue_link_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + patched_issue_link_update_request=patched_issue_link_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_issue_link" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueLink", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] + @validate_call + def update_issue_link_without_preload_content( + self, + issue_id: Annotated[StrictStr, Field(description="Issue ID")], + pk: Annotated[StrictStr, Field(description="Link ID")], + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_issue_link_update_request: Optional[PatchedIssueLinkUpdateRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update an issue link + + Modify the URL, title, or metadata of an existing issue link. + + :param issue_id: Issue ID (required) + :type issue_id: str + :param pk: Link ID (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param patched_issue_link_update_request: + :type patched_issue_link_update_request: PatchedIssueLinkUpdateRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_issue_link_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + patched_issue_link_update_request=patched_issue_link_update_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueLink", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + def _update_issue_link_serialize( + self, + issue_id, + pk, + project_id, + slug, + patched_issue_link_update_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_issue_link_update_request'] is not None: - _body_params = _params['patched_issue_link_update_request'] + if patched_issue_link_update_request is not None: + _body_params = patched_issue_link_update_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "IssueLink", - '400': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/links/{pk}/', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/links/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/plane/api/work_item_properties_api.py b/plane/api/work_item_properties_api.py index 4dd2f13..70bff51 100644 --- a/plane/api/work_item_properties_api.py +++ b/plane/api/work_item_properties_api.py @@ -12,15 +12,9 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 - -from pydantic import validate_arguments - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr - -from typing import List, Optional from plane.models.issue_property_api import IssuePropertyAPI from plane.models.issue_property_api_request import IssuePropertyAPIRequest @@ -32,12 +26,9 @@ from plane.models.patched_issue_property_api_request import PatchedIssuePropertyAPIRequest from plane.models.patched_issue_property_option_api_request import PatchedIssuePropertyOptionAPIRequest -from plane.api_client import ApiClient +from plane.api_client import ApiClient, RequestSerialized from plane.api_response import ApiResponse -from plane.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from plane.rest import RESTResponseType class WorkItemPropertiesApi: @@ -52,16 +43,30 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def create_issue_property(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], type_id : Annotated[StrictStr, Field(..., description="Type ID")], issue_property_api_request : IssuePropertyAPIRequest, **kwargs) -> IssuePropertyAPI: # noqa: E501 - """Create a new issue property # noqa: E501 - Create a new issue property # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_issue_property( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: Annotated[StrictStr, Field(description="Type ID")], + issue_property_api_request: IssuePropertyAPIRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IssuePropertyAPI: + """Create a new issue property - >>> thread = api.create_issue_property(project_id, slug, type_id, issue_property_api_request, async_req=True) - >>> result = thread.get() + Create a new issue property :param project_id: Project ID (required) :type project_id: str @@ -71,33 +76,80 @@ def create_issue_property(self, project_id : Annotated[StrictStr, Field(..., des :type type_id: str :param issue_property_api_request: (required) :type issue_property_api_request: IssuePropertyAPIRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: IssuePropertyAPI - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the create_issue_property_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.create_issue_property_with_http_info(project_id, slug, type_id, issue_property_api_request, **kwargs) # noqa: E501 - - @validate_arguments - def create_issue_property_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], type_id : Annotated[StrictStr, Field(..., description="Type ID")], issue_property_api_request : IssuePropertyAPIRequest, **kwargs) -> ApiResponse: # noqa: E501 - """Create a new issue property # noqa: E501 - - Create a new issue property # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_issue_property_with_http_info(project_id, slug, type_id, issue_property_api_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._create_issue_property_serialize( + project_id=project_id, + slug=slug, + type_id=type_id, + issue_property_api_request=issue_property_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IssuePropertyAPI", + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_issue_property_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: Annotated[StrictStr, Field(description="Type ID")], + issue_property_api_request: IssuePropertyAPIRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IssuePropertyAPI]: + """Create a new issue property + + Create a new issue property :param project_id: Project ID (required) :type project_id: str @@ -107,136 +159,249 @@ def create_issue_property_with_http_info(self, project_id : Annotated[StrictStr, :type type_id: str :param issue_property_api_request: (required) :type issue_property_api_request: IssuePropertyAPIRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(IssuePropertyAPI, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'project_id', - 'slug', - 'type_id', - 'issue_property_api_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._create_issue_property_serialize( + project_id=project_id, + slug=slug, + type_id=type_id, + issue_property_api_request=issue_property_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IssuePropertyAPI", + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_issue_property_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: Annotated[StrictStr, Field(description="Type ID")], + issue_property_api_request: IssuePropertyAPIRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new issue property + + Create a new issue property + + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param type_id: Type ID (required) + :type type_id: str + :param issue_property_api_request: (required) + :type issue_property_api_request: IssuePropertyAPIRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_issue_property_serialize( + project_id=project_id, + slug=slug, + type_id=type_id, + issue_property_api_request=issue_property_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_issue_property" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IssuePropertyAPI", + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + def _create_issue_property_serialize( + self, + project_id, + slug, + type_id, + issue_property_api_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _host = None - if _params['type_id'] is not None: - _path_params['type_id'] = _params['type_id'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + if type_id is not None: + _path_params['type_id'] = type_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['issue_property_api_request'] is not None: - _body_params = _params['issue_property_api_request'] + if issue_property_api_request is not None: + _body_params = issue_property_api_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '201': "IssuePropertyAPI", - '409': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issue-types/{type_id}/issue-properties/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issue-types/{type_id}/issue-properties/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def create_issue_property_option(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], property_id : Annotated[StrictStr, Field(..., description="Property ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], issue_property_option_api_request : IssuePropertyOptionAPIRequest, **kwargs) -> IssuePropertyOptionAPI: # noqa: E501 - """Create a new issue property option # noqa: E501 - Create a new issue property option # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_issue_property_option(project_id, property_id, slug, issue_property_option_api_request, async_req=True) - >>> result = thread.get() + @validate_call + def create_issue_property_option( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: Annotated[StrictStr, Field(description="Property ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_property_option_api_request: IssuePropertyOptionAPIRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IssuePropertyOptionAPI: + """Create a new issue property option + + Create a new issue property option :param project_id: Project ID (required) :type project_id: str @@ -246,33 +411,81 @@ def create_issue_property_option(self, project_id : Annotated[StrictStr, Field(. :type slug: str :param issue_property_option_api_request: (required) :type issue_property_option_api_request: IssuePropertyOptionAPIRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: IssuePropertyOptionAPI - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the create_issue_property_option_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.create_issue_property_option_with_http_info(project_id, property_id, slug, issue_property_option_api_request, **kwargs) # noqa: E501 - - @validate_arguments - def create_issue_property_option_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], property_id : Annotated[StrictStr, Field(..., description="Property ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], issue_property_option_api_request : IssuePropertyOptionAPIRequest, **kwargs) -> ApiResponse: # noqa: E501 - """Create a new issue property option # noqa: E501 - - Create a new issue property option # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_issue_property_option_with_http_info(project_id, property_id, slug, issue_property_option_api_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._create_issue_property_option_serialize( + project_id=project_id, + property_id=property_id, + slug=slug, + issue_property_option_api_request=issue_property_option_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IssuePropertyOptionAPI", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_issue_property_option_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: Annotated[StrictStr, Field(description="Property ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_property_option_api_request: IssuePropertyOptionAPIRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IssuePropertyOptionAPI]: + """Create a new issue property option + + Create a new issue property option :param project_id: Project ID (required) :type project_id: str @@ -282,137 +495,252 @@ def create_issue_property_option_with_http_info(self, project_id : Annotated[Str :type slug: str :param issue_property_option_api_request: (required) :type issue_property_option_api_request: IssuePropertyOptionAPIRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(IssuePropertyOptionAPI, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'project_id', - 'property_id', - 'slug', - 'issue_property_option_api_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._create_issue_property_option_serialize( + project_id=project_id, + property_id=property_id, + slug=slug, + issue_property_option_api_request=issue_property_option_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IssuePropertyOptionAPI", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_issue_property_option_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: Annotated[StrictStr, Field(description="Property ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_property_option_api_request: IssuePropertyOptionAPIRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new issue property option + + Create a new issue property option + + :param project_id: Project ID (required) + :type project_id: str + :param property_id: Property ID (required) + :type property_id: str + :param slug: Workspace slug (required) + :type slug: str + :param issue_property_option_api_request: (required) + :type issue_property_option_api_request: IssuePropertyOptionAPIRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_issue_property_option_serialize( + project_id=project_id, + property_id=property_id, + slug=slug, + issue_property_option_api_request=issue_property_option_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_issue_property_option" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IssuePropertyOptionAPI", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + def _create_issue_property_option_serialize( + self, + project_id, + property_id, + slug, + issue_property_option_api_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['property_id'] is not None: - _path_params['property_id'] = _params['property_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if property_id is not None: + _path_params['property_id'] = property_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['issue_property_option_api_request'] is not None: - _body_params = _params['issue_property_option_api_request'] + if issue_property_option_api_request is not None: + _body_params = issue_property_option_api_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '201': "IssuePropertyOptionAPI", - '400': None, - '409': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issue-properties/{property_id}/options/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issue-properties/{property_id}/options/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def create_issue_property_value(self, issue_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], property_id : Annotated[StrictStr, Field(..., description="Property ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], issue_property_value_api_request : IssuePropertyValueAPIRequest, **kwargs) -> IssuePropertyValueAPI: # noqa: E501 - """Create/update an issue property value # noqa: E501 - Create/update an issue property value # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.create_issue_property_value(issue_id, project_id, property_id, slug, issue_property_value_api_request, async_req=True) - >>> result = thread.get() + + @validate_call + def create_issue_property_value( + self, + issue_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: Annotated[StrictStr, Field(description="Property ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_property_value_api_request: IssuePropertyValueAPIRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IssuePropertyValueAPI: + """Create/update an issue property value + + Create/update an issue property value :param issue_id: (required) :type issue_id: str @@ -424,33 +752,82 @@ def create_issue_property_value(self, issue_id : StrictStr, project_id : Annotat :type slug: str :param issue_property_value_api_request: (required) :type issue_property_value_api_request: IssuePropertyValueAPIRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: IssuePropertyValueAPI - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the create_issue_property_value_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.create_issue_property_value_with_http_info(issue_id, project_id, property_id, slug, issue_property_value_api_request, **kwargs) # noqa: E501 - - @validate_arguments - def create_issue_property_value_with_http_info(self, issue_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], property_id : Annotated[StrictStr, Field(..., description="Property ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], issue_property_value_api_request : IssuePropertyValueAPIRequest, **kwargs) -> ApiResponse: # noqa: E501 - """Create/update an issue property value # noqa: E501 - - Create/update an issue property value # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_issue_property_value_with_http_info(issue_id, project_id, property_id, slug, issue_property_value_api_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._create_issue_property_value_serialize( + issue_id=issue_id, + project_id=project_id, + property_id=property_id, + slug=slug, + issue_property_value_api_request=issue_property_value_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IssuePropertyValueAPI", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_issue_property_value_with_http_info( + self, + issue_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: Annotated[StrictStr, Field(description="Property ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_property_value_api_request: IssuePropertyValueAPIRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IssuePropertyValueAPI]: + """Create/update an issue property value + + Create/update an issue property value :param issue_id: (required) :type issue_id: str @@ -462,140 +839,257 @@ def create_issue_property_value_with_http_info(self, issue_id : StrictStr, proje :type slug: str :param issue_property_value_api_request: (required) :type issue_property_value_api_request: IssuePropertyValueAPIRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(IssuePropertyValueAPI, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'issue_id', - 'project_id', - 'property_id', - 'slug', - 'issue_property_value_api_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._create_issue_property_value_serialize( + issue_id=issue_id, + project_id=project_id, + property_id=property_id, + slug=slug, + issue_property_value_api_request=issue_property_value_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_issue_property_value" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IssuePropertyValueAPI", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] + @validate_call + def create_issue_property_value_without_preload_content( + self, + issue_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: Annotated[StrictStr, Field(description="Property ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_property_value_api_request: IssuePropertyValueAPIRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create/update an issue property value + + Create/update an issue property value - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + :param issue_id: (required) + :type issue_id: str + :param project_id: Project ID (required) + :type project_id: str + :param property_id: Property ID (required) + :type property_id: str + :param slug: Workspace slug (required) + :type slug: str + :param issue_property_value_api_request: (required) + :type issue_property_value_api_request: IssuePropertyValueAPIRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_issue_property_value_serialize( + issue_id=issue_id, + project_id=project_id, + property_id=property_id, + slug=slug, + issue_property_value_api_request=issue_property_value_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IssuePropertyValueAPI", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _create_issue_property_value_serialize( + self, + issue_id, + project_id, + property_id, + slug, + issue_property_value_api_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['property_id'] is not None: - _path_params['property_id'] = _params['property_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if project_id is not None: + _path_params['project_id'] = project_id + if property_id is not None: + _path_params['property_id'] = property_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['issue_property_value_api_request'] is not None: - _body_params = _params['issue_property_value_api_request'] + if issue_property_value_api_request is not None: + _body_params = issue_property_value_api_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '201': "IssuePropertyValueAPI", - '400': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/issue-properties/{property_id}/values/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/issue-properties/{property_id}/values/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def delete_issue_property(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], property_id : StrictStr, slug : Annotated[StrictStr, Field(..., description="Workspace slug")], type_id : Annotated[StrictStr, Field(..., description="Type ID")], **kwargs) -> None: # noqa: E501 - """Delete an issue property # noqa: E501 - Delete an issue property # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def delete_issue_property( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: StrictStr, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: Annotated[StrictStr, Field(description="Type ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete an issue property - >>> thread = api.delete_issue_property(project_id, property_id, slug, type_id, async_req=True) - >>> result = thread.get() + Delete an issue property :param project_id: Project ID (required) :type project_id: str @@ -605,33 +1099,79 @@ def delete_issue_property(self, project_id : Annotated[StrictStr, Field(..., des :type slug: str :param type_id: Type ID (required) :type type_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the delete_issue_property_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.delete_issue_property_with_http_info(project_id, property_id, slug, type_id, **kwargs) # noqa: E501 - - @validate_arguments - def delete_issue_property_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], property_id : StrictStr, slug : Annotated[StrictStr, Field(..., description="Workspace slug")], type_id : Annotated[StrictStr, Field(..., description="Type ID")], **kwargs) -> ApiResponse: # noqa: E501 - """Delete an issue property # noqa: E501 - - Delete an issue property # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_issue_property_with_http_info(project_id, property_id, slug, type_id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._delete_issue_property_serialize( + project_id=project_id, + property_id=property_id, + slug=slug, + type_id=type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_issue_property_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: StrictStr, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: Annotated[StrictStr, Field(description="Type ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete an issue property + + Delete an issue property :param project_id: Project ID (required) :type project_id: str @@ -641,119 +1181,225 @@ def delete_issue_property_with_http_info(self, project_id : Annotated[StrictStr, :type slug: str :param type_id: Type ID (required) :type type_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = [ - 'project_id', - 'property_id', - 'slug', - 'type_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._delete_issue_property_serialize( + project_id=project_id, + property_id=property_id, + slug=slug, + type_id=type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_issue_property" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + @validate_call + def delete_issue_property_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: StrictStr, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: Annotated[StrictStr, Field(description="Type ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete an issue property + + Delete an issue property + + :param project_id: Project ID (required) + :type project_id: str + :param property_id: (required) + :type property_id: str + :param slug: Workspace slug (required) + :type slug: str + :param type_id: Type ID (required) + :type type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_issue_property_serialize( + project_id=project_id, + property_id=property_id, + slug=slug, + type_id=type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + - if _params['property_id'] is not None: - _path_params['property_id'] = _params['property_id'] + def _delete_issue_property_serialize( + self, + project_id, + property_id, + slug, + type_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _host = None - if _params['type_id'] is not None: - _path_params['type_id'] = _params['type_id'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if property_id is not None: + _path_params['property_id'] = property_id + if slug is not None: + _path_params['slug'] = slug + if type_id is not None: + _path_params['type_id'] = type_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issue-types/{type_id}/issue-properties/{property_id}/', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issue-types/{type_id}/issue-properties/{property_id}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def delete_issue_property_option(self, option_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], property_id : Annotated[StrictStr, Field(..., description="Property ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> None: # noqa: E501 - """Delete an issue property option # noqa: E501 - Delete an issue property option # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def delete_issue_property_option( + self, + option_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: Annotated[StrictStr, Field(description="Property ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete an issue property option - >>> thread = api.delete_issue_property_option(option_id, project_id, property_id, slug, async_req=True) - >>> result = thread.get() + Delete an issue property option :param option_id: (required) :type option_id: str @@ -763,33 +1409,79 @@ def delete_issue_property_option(self, option_id : StrictStr, project_id : Annot :type property_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the delete_issue_property_option_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.delete_issue_property_option_with_http_info(option_id, project_id, property_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def delete_issue_property_option_with_http_info(self, option_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], property_id : Annotated[StrictStr, Field(..., description="Property ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Delete an issue property option # noqa: E501 - - Delete an issue property option # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_issue_property_option_with_http_info(option_id, project_id, property_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._delete_issue_property_option_serialize( + option_id=option_id, + project_id=project_id, + property_id=property_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_issue_property_option_with_http_info( + self, + option_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: Annotated[StrictStr, Field(description="Property ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete an issue property option + + Delete an issue property option :param option_id: (required) :type option_id: str @@ -799,119 +1491,224 @@ def delete_issue_property_option_with_http_info(self, option_id : StrictStr, pro :type property_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = [ - 'option_id', - 'project_id', - 'property_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._delete_issue_property_option_serialize( + option_id=option_id, + project_id=project_id, + property_id=property_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_issue_property_option" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['option_id'] is not None: - _path_params['option_id'] = _params['option_id'] + @validate_call + def delete_issue_property_option_without_preload_content( + self, + option_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: Annotated[StrictStr, Field(description="Property ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete an issue property option - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + Delete an issue property option - if _params['property_id'] is not None: - _path_params['property_id'] = _params['property_id'] + :param option_id: (required) + :type option_id: str + :param project_id: Project ID (required) + :type project_id: str + :param property_id: Property ID (required) + :type property_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_issue_property_option_serialize( + option_id=option_id, + project_id=project_id, + property_id=property_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _delete_issue_property_option_serialize( + self, + option_id, + project_id, + property_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if option_id is not None: + _path_params['option_id'] = option_id + if project_id is not None: + _path_params['project_id'] = project_id + if property_id is not None: + _path_params['property_id'] = property_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issue-properties/{property_id}/options/{option_id}/', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issue-properties/{property_id}/options/{option_id}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def list_issue_properties(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], type_id : Annotated[StrictStr, Field(..., description="Type ID")], **kwargs) -> List[IssuePropertyAPI]: # noqa: E501 - """List issue properties # noqa: E501 - List issue properties # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_issue_properties(project_id, slug, type_id, async_req=True) - >>> result = thread.get() + + @validate_call + def list_issue_properties( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: Annotated[StrictStr, Field(description="Type ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[IssuePropertyAPI]: + """List issue properties + + List issue properties :param project_id: Project ID (required) :type project_id: str @@ -919,33 +1716,77 @@ def list_issue_properties(self, project_id : Annotated[StrictStr, Field(..., des :type slug: str :param type_id: Type ID (required) :type type_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[IssuePropertyAPI] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_issue_properties_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_issue_properties_with_http_info(project_id, slug, type_id, **kwargs) # noqa: E501 - - @validate_arguments - def list_issue_properties_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], type_id : Annotated[StrictStr, Field(..., description="Type ID")], **kwargs) -> ApiResponse: # noqa: E501 - """List issue properties # noqa: E501 - - List issue properties # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_issue_properties_with_http_info(project_id, slug, type_id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_issue_properties_serialize( + project_id=project_id, + slug=slug, + type_id=type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "List[IssuePropertyAPI]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_issue_properties_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: Annotated[StrictStr, Field(description="Type ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[IssuePropertyAPI]]: + """List issue properties + + List issue properties :param project_id: Project ID (required) :type project_id: str @@ -953,124 +1794,223 @@ def list_issue_properties_with_http_info(self, project_id : Annotated[StrictStr, :type slug: str :param type_id: Type ID (required) :type type_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[IssuePropertyAPI], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._list_issue_properties_serialize( + project_id=project_id, + slug=slug, + type_id=type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "List[IssuePropertyAPI]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'project_id', - 'slug', - 'type_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def list_issue_properties_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: Annotated[StrictStr, Field(description="Type ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List issue properties + + List issue properties + + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param type_id: Type ID (required) + :type type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_issue_properties_serialize( + project_id=project_id, + slug=slug, + type_id=type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_issue_properties" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "List[IssuePropertyAPI]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + def _list_issue_properties_serialize( + self, + project_id, + slug, + type_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _host = None - if _params['type_id'] is not None: - _path_params['type_id'] = _params['type_id'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + if type_id is not None: + _path_params['type_id'] = type_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "List[IssuePropertyAPI]", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issue-types/{type_id}/issue-properties/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issue-types/{type_id}/issue-properties/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def list_issue_property_options(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], property_id : Annotated[StrictStr, Field(..., description="Property ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> List[IssuePropertyOptionAPI]: # noqa: E501 - """List issue property options # noqa: E501 - List issue property options # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_issue_property_options(project_id, property_id, slug, async_req=True) - >>> result = thread.get() + + @validate_call + def list_issue_property_options( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: Annotated[StrictStr, Field(description="Property ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[IssuePropertyOptionAPI]: + """List issue property options + + List issue property options :param project_id: Project ID (required) :type project_id: str @@ -1078,33 +2018,77 @@ def list_issue_property_options(self, project_id : Annotated[StrictStr, Field(.. :type property_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[IssuePropertyOptionAPI] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_issue_property_options_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_issue_property_options_with_http_info(project_id, property_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def list_issue_property_options_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], property_id : Annotated[StrictStr, Field(..., description="Property ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """List issue property options # noqa: E501 - - List issue property options # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_issue_property_options_with_http_info(project_id, property_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_issue_property_options_serialize( + project_id=project_id, + property_id=property_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "List[IssuePropertyOptionAPI]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_issue_property_options_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: Annotated[StrictStr, Field(description="Property ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[IssuePropertyOptionAPI]]: + """List issue property options + + List issue property options :param project_id: Project ID (required) :type project_id: str @@ -1112,124 +2096,224 @@ def list_issue_property_options_with_http_info(self, project_id : Annotated[Stri :type property_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[IssuePropertyOptionAPI], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._list_issue_property_options_serialize( + project_id=project_id, + property_id=property_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "List[IssuePropertyOptionAPI]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'project_id', - 'property_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def list_issue_property_options_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: Annotated[StrictStr, Field(description="Property ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List issue property options + + List issue property options + + :param project_id: Project ID (required) + :type project_id: str + :param property_id: Property ID (required) + :type property_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_issue_property_options_serialize( + project_id=project_id, + property_id=property_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_issue_property_options" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "List[IssuePropertyOptionAPI]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + def _list_issue_property_options_serialize( + self, + project_id, + property_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['property_id'] is not None: - _path_params['property_id'] = _params['property_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if property_id is not None: + _path_params['property_id'] = property_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "List[IssuePropertyOptionAPI]", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issue-properties/{property_id}/options/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issue-properties/{property_id}/options/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def list_issue_property_values(self, issue_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], property_id : Annotated[StrictStr, Field(..., description="Property ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> List[IssuePropertyValueAPIDetail]: # noqa: E501 - """List issue property values # noqa: E501 - List issue property values # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_issue_property_values(issue_id, project_id, property_id, slug, async_req=True) - >>> result = thread.get() + + @validate_call + def list_issue_property_values( + self, + issue_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: Annotated[StrictStr, Field(description="Property ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[IssuePropertyValueAPIDetail]: + """List issue property values + + List issue property values :param issue_id: (required) :type issue_id: str @@ -1239,33 +2323,79 @@ def list_issue_property_values(self, issue_id : StrictStr, project_id : Annotate :type property_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[IssuePropertyValueAPIDetail] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_issue_property_values_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_issue_property_values_with_http_info(issue_id, project_id, property_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def list_issue_property_values_with_http_info(self, issue_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], property_id : Annotated[StrictStr, Field(..., description="Property ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """List issue property values # noqa: E501 - - List issue property values # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_issue_property_values_with_http_info(issue_id, project_id, property_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_issue_property_values_serialize( + issue_id=issue_id, + project_id=project_id, + property_id=property_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "List[IssuePropertyValueAPIDetail]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_issue_property_values_with_http_info( + self, + issue_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: Annotated[StrictStr, Field(description="Property ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[IssuePropertyValueAPIDetail]]: + """List issue property values + + List issue property values :param issue_id: (required) :type issue_id: str @@ -1275,128 +2405,232 @@ def list_issue_property_values_with_http_info(self, issue_id : StrictStr, projec :type property_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[IssuePropertyValueAPIDetail], status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'issue_id', - 'project_id', - 'property_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_issue_property_values_serialize( + issue_id=issue_id, + project_id=project_id, + property_id=property_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_issue_property_values" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "List[IssuePropertyValueAPIDetail]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] + @validate_call + def list_issue_property_values_without_preload_content( + self, + issue_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: Annotated[StrictStr, Field(description="Property ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List issue property values + + List issue property values + + :param issue_id: (required) + :type issue_id: str + :param project_id: Project ID (required) + :type project_id: str + :param property_id: Property ID (required) + :type property_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_issue_property_values_serialize( + issue_id=issue_id, + project_id=project_id, + property_id=property_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "List[IssuePropertyValueAPIDetail]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - if _params['property_id'] is not None: - _path_params['property_id'] = _params['property_id'] - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + def _list_issue_property_values_serialize( + self, + issue_id, + project_id, + property_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if project_id is not None: + _path_params['project_id'] = project_id + if property_id is not None: + _path_params['property_id'] = property_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "List[IssuePropertyValueAPIDetail]", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/issue-properties/{property_id}/values/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/issue-properties/{property_id}/values/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def retrieve_issue_property(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], property_id : StrictStr, slug : Annotated[StrictStr, Field(..., description="Workspace slug")], type_id : Annotated[StrictStr, Field(..., description="Type ID")], **kwargs) -> IssuePropertyAPI: # noqa: E501 - """Get issue property by id # noqa: E501 - Get issue property by id # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.retrieve_issue_property(project_id, property_id, slug, type_id, async_req=True) - >>> result = thread.get() + + @validate_call + def retrieve_issue_property( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: StrictStr, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: Annotated[StrictStr, Field(description="Type ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IssuePropertyAPI: + """Get issue property by id + + Get issue property by id :param project_id: Project ID (required) :type project_id: str @@ -1406,33 +2640,161 @@ def retrieve_issue_property(self, project_id : Annotated[StrictStr, Field(..., d :type slug: str :param type_id: Type ID (required) :type type_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: IssuePropertyAPI - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the retrieve_issue_property_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.retrieve_issue_property_with_http_info(project_id, property_id, slug, type_id, **kwargs) # noqa: E501 - - @validate_arguments - def retrieve_issue_property_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], property_id : StrictStr, slug : Annotated[StrictStr, Field(..., description="Workspace slug")], type_id : Annotated[StrictStr, Field(..., description="Type ID")], **kwargs) -> ApiResponse: # noqa: E501 - """Get issue property by id # noqa: E501 - - Get issue property by id # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_issue_property_with_http_info(project_id, property_id, slug, type_id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._retrieve_issue_property_serialize( + project_id=project_id, + property_id=property_id, + slug=slug, + type_id=type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssuePropertyAPI", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_issue_property_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: StrictStr, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: Annotated[StrictStr, Field(description="Type ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IssuePropertyAPI]: + """Get issue property by id + + Get issue property by id + + :param project_id: Project ID (required) + :type project_id: str + :param property_id: (required) + :type property_id: str + :param slug: Workspace slug (required) + :type slug: str + :param type_id: Type ID (required) + :type type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_issue_property_serialize( + project_id=project_id, + property_id=property_id, + slug=slug, + type_id=type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssuePropertyAPI", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def retrieve_issue_property_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: StrictStr, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: Annotated[StrictStr, Field(description="Type ID")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get issue property by id + + Get issue property by id :param project_id: Project ID (required) :type project_id: str @@ -1442,128 +2804,150 @@ def retrieve_issue_property_with_http_info(self, project_id : Annotated[StrictSt :type slug: str :param type_id: Type ID (required) :type type_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(IssuePropertyAPI, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'project_id', - 'property_id', - 'slug', - 'type_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._retrieve_issue_property_serialize( + project_id=project_id, + property_id=property_id, + slug=slug, + type_id=type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method retrieve_issue_property" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssuePropertyAPI", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] - if _params['property_id'] is not None: - _path_params['property_id'] = _params['property_id'] + def _retrieve_issue_property_serialize( + self, + project_id, + property_id, + slug, + type_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _host = None - if _params['type_id'] is not None: - _path_params['type_id'] = _params['type_id'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if property_id is not None: + _path_params['property_id'] = property_id + if slug is not None: + _path_params['slug'] = slug + if type_id is not None: + _path_params['type_id'] = type_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "IssuePropertyAPI", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issue-types/{type_id}/issue-properties/{property_id}/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issue-types/{type_id}/issue-properties/{property_id}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def retrieve_issue_property_option(self, option_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], property_id : Annotated[StrictStr, Field(..., description="Property ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> IssuePropertyOptionAPI: # noqa: E501 - """Get issue property option by id # noqa: E501 - Get issue property option by id # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.retrieve_issue_property_option(option_id, project_id, property_id, slug, async_req=True) - >>> result = thread.get() + @validate_call + def retrieve_issue_property_option( + self, + option_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: Annotated[StrictStr, Field(description="Property ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IssuePropertyOptionAPI: + """Get issue property option by id + + Get issue property option by id :param option_id: (required) :type option_id: str @@ -1573,33 +2957,79 @@ def retrieve_issue_property_option(self, option_id : StrictStr, project_id : Ann :type property_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: IssuePropertyOptionAPI - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the retrieve_issue_property_option_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.retrieve_issue_property_option_with_http_info(option_id, project_id, property_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def retrieve_issue_property_option_with_http_info(self, option_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], property_id : Annotated[StrictStr, Field(..., description="Property ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Get issue property option by id # noqa: E501 - - Get issue property option by id # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_issue_property_option_with_http_info(option_id, project_id, property_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._retrieve_issue_property_option_serialize( + option_id=option_id, + project_id=project_id, + property_id=property_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssuePropertyOptionAPI", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_issue_property_option_with_http_info( + self, + option_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: Annotated[StrictStr, Field(description="Property ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IssuePropertyOptionAPI]: + """Get issue property option by id + + Get issue property option by id :param option_id: (required) :type option_id: str @@ -1609,128 +3039,233 @@ def retrieve_issue_property_option_with_http_info(self, option_id : StrictStr, p :type property_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(IssuePropertyOptionAPI, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'option_id', - 'project_id', - 'property_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._retrieve_issue_property_option_serialize( + option_id=option_id, + project_id=project_id, + property_id=property_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method retrieve_issue_property_option" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssuePropertyOptionAPI", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['option_id'] is not None: - _path_params['option_id'] = _params['option_id'] + @validate_call + def retrieve_issue_property_option_without_preload_content( + self, + option_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: Annotated[StrictStr, Field(description="Property ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get issue property option by id + + Get issue property option by id + + :param option_id: (required) + :type option_id: str + :param project_id: Project ID (required) + :type project_id: str + :param property_id: Property ID (required) + :type property_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_issue_property_option_serialize( + option_id=option_id, + project_id=project_id, + property_id=property_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssuePropertyOptionAPI", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_issue_property_option_serialize( + self, + option_id, + project_id, + property_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['property_id'] is not None: - _path_params['property_id'] = _params['property_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if option_id is not None: + _path_params['option_id'] = option_id + if project_id is not None: + _path_params['project_id'] = project_id + if property_id is not None: + _path_params['property_id'] = property_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "IssuePropertyOptionAPI", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issue-properties/{property_id}/options/{option_id}/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issue-properties/{property_id}/options/{option_id}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def update_issue_property(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], property_id : StrictStr, slug : Annotated[StrictStr, Field(..., description="Workspace slug")], type_id : Annotated[StrictStr, Field(..., description="Type ID")], patched_issue_property_api_request : Optional[PatchedIssuePropertyAPIRequest] = None, **kwargs) -> IssuePropertyAPI: # noqa: E501 - """Update an issue property # noqa: E501 - Update an issue property # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def update_issue_property( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: StrictStr, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: Annotated[StrictStr, Field(description="Type ID")], + patched_issue_property_api_request: Optional[PatchedIssuePropertyAPIRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IssuePropertyAPI: + """Update an issue property - >>> thread = api.update_issue_property(project_id, property_id, slug, type_id, patched_issue_property_api_request, async_req=True) - >>> result = thread.get() + Update an issue property :param project_id: Project ID (required) :type project_id: str @@ -1742,33 +3277,81 @@ def update_issue_property(self, project_id : Annotated[StrictStr, Field(..., des :type type_id: str :param patched_issue_property_api_request: :type patched_issue_property_api_request: PatchedIssuePropertyAPIRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: IssuePropertyAPI - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the update_issue_property_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.update_issue_property_with_http_info(project_id, property_id, slug, type_id, patched_issue_property_api_request, **kwargs) # noqa: E501 - - @validate_arguments - def update_issue_property_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], property_id : StrictStr, slug : Annotated[StrictStr, Field(..., description="Workspace slug")], type_id : Annotated[StrictStr, Field(..., description="Type ID")], patched_issue_property_api_request : Optional[PatchedIssuePropertyAPIRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update an issue property # noqa: E501 - - Update an issue property # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_issue_property_with_http_info(project_id, property_id, slug, type_id, patched_issue_property_api_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._update_issue_property_serialize( + project_id=project_id, + property_id=property_id, + slug=slug, + type_id=type_id, + patched_issue_property_api_request=patched_issue_property_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssuePropertyAPI", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_issue_property_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: StrictStr, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: Annotated[StrictStr, Field(description="Type ID")], + patched_issue_property_api_request: Optional[PatchedIssuePropertyAPIRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IssuePropertyAPI]: + """Update an issue property + + Update an issue property :param project_id: Project ID (required) :type project_id: str @@ -1780,139 +3363,256 @@ def update_issue_property_with_http_info(self, project_id : Annotated[StrictStr, :type type_id: str :param patched_issue_property_api_request: :type patched_issue_property_api_request: PatchedIssuePropertyAPIRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(IssuePropertyAPI, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'project_id', - 'property_id', - 'slug', - 'type_id', - 'patched_issue_property_api_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._update_issue_property_serialize( + project_id=project_id, + property_id=property_id, + slug=slug, + type_id=type_id, + patched_issue_property_api_request=patched_issue_property_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_issue_property" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssuePropertyAPI", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + @validate_call + def update_issue_property_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: StrictStr, + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: Annotated[StrictStr, Field(description="Type ID")], + patched_issue_property_api_request: Optional[PatchedIssuePropertyAPIRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update an issue property + + Update an issue property + + :param project_id: Project ID (required) + :type project_id: str + :param property_id: (required) + :type property_id: str + :param slug: Workspace slug (required) + :type slug: str + :param type_id: Type ID (required) + :type type_id: str + :param patched_issue_property_api_request: + :type patched_issue_property_api_request: PatchedIssuePropertyAPIRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_issue_property_serialize( + project_id=project_id, + property_id=property_id, + slug=slug, + type_id=type_id, + patched_issue_property_api_request=patched_issue_property_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssuePropertyAPI", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - if _params['property_id'] is not None: - _path_params['property_id'] = _params['property_id'] - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + def _update_issue_property_serialize( + self, + project_id, + property_id, + slug, + type_id, + patched_issue_property_api_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['type_id'] is not None: - _path_params['type_id'] = _params['type_id'] + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if property_id is not None: + _path_params['property_id'] = property_id + if slug is not None: + _path_params['slug'] = slug + if type_id is not None: + _path_params['type_id'] = type_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_issue_property_api_request'] is not None: - _body_params = _params['patched_issue_property_api_request'] + if patched_issue_property_api_request is not None: + _body_params = patched_issue_property_api_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "IssuePropertyAPI", - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issue-types/{type_id}/issue-properties/{property_id}/', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issue-types/{type_id}/issue-properties/{property_id}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def update_issue_property_option(self, option_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], property_id : Annotated[StrictStr, Field(..., description="Property ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], patched_issue_property_option_api_request : Optional[PatchedIssuePropertyOptionAPIRequest] = None, **kwargs) -> IssuePropertyOptionAPI: # noqa: E501 - """Update an issue property option # noqa: E501 - Update an issue property option # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_issue_property_option(option_id, project_id, property_id, slug, patched_issue_property_option_api_request, async_req=True) - >>> result = thread.get() + + @validate_call + def update_issue_property_option( + self, + option_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: Annotated[StrictStr, Field(description="Property ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_issue_property_option_api_request: Optional[PatchedIssuePropertyOptionAPIRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IssuePropertyOptionAPI: + """Update an issue property option + + Update an issue property option :param option_id: (required) :type option_id: str @@ -1924,33 +3624,82 @@ def update_issue_property_option(self, option_id : StrictStr, project_id : Annot :type slug: str :param patched_issue_property_option_api_request: :type patched_issue_property_option_api_request: PatchedIssuePropertyOptionAPIRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: IssuePropertyOptionAPI - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the update_issue_property_option_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.update_issue_property_option_with_http_info(option_id, project_id, property_id, slug, patched_issue_property_option_api_request, **kwargs) # noqa: E501 - - @validate_arguments - def update_issue_property_option_with_http_info(self, option_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], property_id : Annotated[StrictStr, Field(..., description="Property ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], patched_issue_property_option_api_request : Optional[PatchedIssuePropertyOptionAPIRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update an issue property option # noqa: E501 - - Update an issue property option # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_issue_property_option_with_http_info(option_id, project_id, property_id, slug, patched_issue_property_option_api_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._update_issue_property_option_serialize( + option_id=option_id, + project_id=project_id, + property_id=property_id, + slug=slug, + patched_issue_property_option_api_request=patched_issue_property_option_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssuePropertyOptionAPI", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_issue_property_option_with_http_info( + self, + option_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: Annotated[StrictStr, Field(description="Property ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_issue_property_option_api_request: Optional[PatchedIssuePropertyOptionAPIRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IssuePropertyOptionAPI]: + """Update an issue property option + + Update an issue property option :param option_id: (required) :type option_id: str @@ -1962,126 +3711,229 @@ def update_issue_property_option_with_http_info(self, option_id : StrictStr, pro :type slug: str :param patched_issue_property_option_api_request: :type patched_issue_property_option_api_request: PatchedIssuePropertyOptionAPIRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(IssuePropertyOptionAPI, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'option_id', - 'project_id', - 'property_id', - 'slug', - 'patched_issue_property_option_api_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._update_issue_property_option_serialize( + option_id=option_id, + project_id=project_id, + property_id=property_id, + slug=slug, + patched_issue_property_option_api_request=patched_issue_property_option_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_issue_property_option" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssuePropertyOptionAPI", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['option_id'] is not None: - _path_params['option_id'] = _params['option_id'] + @validate_call + def update_issue_property_option_without_preload_content( + self, + option_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + property_id: Annotated[StrictStr, Field(description="Property ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_issue_property_option_api_request: Optional[PatchedIssuePropertyOptionAPIRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update an issue property option + + Update an issue property option + + :param option_id: (required) + :type option_id: str + :param project_id: Project ID (required) + :type project_id: str + :param property_id: Property ID (required) + :type property_id: str + :param slug: Workspace slug (required) + :type slug: str + :param patched_issue_property_option_api_request: + :type patched_issue_property_option_api_request: PatchedIssuePropertyOptionAPIRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_issue_property_option_serialize( + option_id=option_id, + project_id=project_id, + property_id=property_id, + slug=slug, + patched_issue_property_option_api_request=patched_issue_property_option_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssuePropertyOptionAPI", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + def _update_issue_property_option_serialize( + self, + option_id, + project_id, + property_id, + slug, + patched_issue_property_option_api_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['property_id'] is not None: - _path_params['property_id'] = _params['property_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if option_id is not None: + _path_params['option_id'] = option_id + if project_id is not None: + _path_params['project_id'] = project_id + if property_id is not None: + _path_params['property_id'] = property_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_issue_property_option_api_request'] is not None: - _body_params = _params['patched_issue_property_option_api_request'] + if patched_issue_property_option_api_request is not None: + _body_params = patched_issue_property_option_api_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "IssuePropertyOptionAPI", - '400': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issue-properties/{property_id}/options/{option_id}/', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issue-properties/{property_id}/options/{option_id}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/plane/api/work_item_types_api.py b/plane/api/work_item_types_api.py index 8bfef06..d078096 100644 --- a/plane/api/work_item_types_api.py +++ b/plane/api/work_item_types_api.py @@ -12,26 +12,17 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 - -from pydantic import validate_arguments - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr - -from typing import List, Optional from plane.models.issue_type_api import IssueTypeAPI from plane.models.issue_type_api_request import IssueTypeAPIRequest from plane.models.patched_issue_type_api_request import PatchedIssueTypeAPIRequest -from plane.api_client import ApiClient +from plane.api_client import ApiClient, RequestSerialized from plane.api_response import ApiResponse -from plane.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from plane.rest import RESTResponseType class WorkItemTypesApi: @@ -46,16 +37,29 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def create_issue_type(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], issue_type_api_request : IssueTypeAPIRequest, **kwargs) -> IssueTypeAPI: # noqa: E501 - """Create a new issue type # noqa: E501 - Create a new issue type for a project # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_issue_type( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_type_api_request: IssueTypeAPIRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IssueTypeAPI: + """Create a new issue type - >>> thread = api.create_issue_type(project_id, slug, issue_type_api_request, async_req=True) - >>> result = thread.get() + Create a new issue type for a project :param project_id: Project ID (required) :type project_id: str @@ -63,33 +67,78 @@ def create_issue_type(self, project_id : Annotated[StrictStr, Field(..., descrip :type slug: str :param issue_type_api_request: (required) :type issue_type_api_request: IssueTypeAPIRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: IssueTypeAPI - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the create_issue_type_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.create_issue_type_with_http_info(project_id, slug, issue_type_api_request, **kwargs) # noqa: E501 - - @validate_arguments - def create_issue_type_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], issue_type_api_request : IssueTypeAPIRequest, **kwargs) -> ApiResponse: # noqa: E501 - """Create a new issue type # noqa: E501 - - Create a new issue type for a project # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_issue_type_with_http_info(project_id, slug, issue_type_api_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._create_issue_type_serialize( + project_id=project_id, + slug=slug, + issue_type_api_request=issue_type_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IssueTypeAPI", + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_issue_type_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_type_api_request: IssueTypeAPIRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IssueTypeAPI]: + """Create a new issue type + + Create a new issue type for a project :param project_id: Project ID (required) :type project_id: str @@ -97,132 +146,240 @@ def create_issue_type_with_http_info(self, project_id : Annotated[StrictStr, Fie :type slug: str :param issue_type_api_request: (required) :type issue_type_api_request: IssueTypeAPIRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(IssueTypeAPI, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._create_issue_type_serialize( + project_id=project_id, + slug=slug, + issue_type_api_request=issue_type_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IssueTypeAPI", + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'project_id', - 'slug', - 'issue_type_api_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def create_issue_type_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_type_api_request: IssueTypeAPIRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new issue type + + Create a new issue type for a project + + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param issue_type_api_request: (required) + :type issue_type_api_request: IssueTypeAPIRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_issue_type_serialize( + project_id=project_id, + slug=slug, + issue_type_api_request=issue_type_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_issue_type" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IssueTypeAPI", + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + def _create_issue_type_serialize( + self, + project_id, + slug, + issue_type_api_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['issue_type_api_request'] is not None: - _body_params = _params['issue_type_api_request'] + if issue_type_api_request is not None: + _body_params = issue_type_api_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '201': "IssueTypeAPI", - '409': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issue-types/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issue-types/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def delete_issue_type(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], type_id : StrictStr, **kwargs) -> None: # noqa: E501 - """Delete an issue type # noqa: E501 - Delete an issue type # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.delete_issue_type(project_id, slug, type_id, async_req=True) - >>> result = thread.get() + @validate_call + def delete_issue_type( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete an issue type + + Delete an issue type :param project_id: Project ID (required) :type project_id: str @@ -230,33 +387,78 @@ def delete_issue_type(self, project_id : Annotated[StrictStr, Field(..., descrip :type slug: str :param type_id: (required) :type type_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the delete_issue_type_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.delete_issue_type_with_http_info(project_id, slug, type_id, **kwargs) # noqa: E501 - - @validate_arguments - def delete_issue_type_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], type_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """Delete an issue type # noqa: E501 - - Delete an issue type # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_issue_type_with_http_info(project_id, slug, type_id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._delete_issue_type_serialize( + project_id=project_id, + slug=slug, + type_id=type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_issue_type_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete an issue type + + Delete an issue type :param project_id: Project ID (required) :type project_id: str @@ -264,266 +466,505 @@ def delete_issue_type_with_http_info(self, project_id : Annotated[StrictStr, Fie :type slug: str :param type_id: (required) :type type_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._delete_issue_type_serialize( + project_id=project_id, + slug=slug, + type_id=type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'project_id', - 'slug', - 'type_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def delete_issue_type_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete an issue type + + Delete an issue type + + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param type_id: (required) + :type type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_issue_type_serialize( + project_id=project_id, + slug=slug, + type_id=type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_issue_type" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + def _delete_issue_type_serialize( + self, + project_id, + slug, + type_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _host = None - if _params['type_id'] is not None: - _path_params['type_id'] = _params['type_id'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + if type_id is not None: + _path_params['type_id'] = type_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issue-types/{type_id}/', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issue-types/{type_id}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def list_issue_types(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> List[IssueTypeAPI]: # noqa: E501 - """List issue types # noqa: E501 - List all issue types for a project # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_issue_types(project_id, slug, async_req=True) - >>> result = thread.get() + @validate_call + def list_issue_types( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[IssueTypeAPI]: + """List issue types + + List all issue types for a project :param project_id: Project ID (required) :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[IssueTypeAPI] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_issue_types_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_issue_types_with_http_info(project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def list_issue_types_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """List issue types # noqa: E501 - - List all issue types for a project # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_issue_types_with_http_info(project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_issue_types_serialize( + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "List[IssueTypeAPI]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_issue_types_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[IssueTypeAPI]]: + """List issue types + + List all issue types for a project :param project_id: Project ID (required) :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[IssueTypeAPI], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._list_issue_types_serialize( + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "List[IssueTypeAPI]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def list_issue_types_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List issue types + + List all issue types for a project + + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_issue_types_serialize( + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_issue_types" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "List[IssueTypeAPI]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + def _list_issue_types_serialize( + self, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "List[IssueTypeAPI]", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issue-types/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issue-types/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def retrieve_issue_type(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], type_id : StrictStr, **kwargs) -> IssueTypeAPI: # noqa: E501 - """Retrieve an issue type by id # noqa: E501 - Retrieve an issue type by id # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.retrieve_issue_type(project_id, slug, type_id, async_req=True) - >>> result = thread.get() + + @validate_call + def retrieve_issue_type( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IssueTypeAPI: + """Retrieve an issue type by id + + Retrieve an issue type by id :param project_id: Project ID (required) :type project_id: str @@ -531,33 +972,77 @@ def retrieve_issue_type(self, project_id : Annotated[StrictStr, Field(..., descr :type slug: str :param type_id: (required) :type type_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: IssueTypeAPI - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the retrieve_issue_type_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.retrieve_issue_type_with_http_info(project_id, slug, type_id, **kwargs) # noqa: E501 - - @validate_arguments - def retrieve_issue_type_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], type_id : StrictStr, **kwargs) -> ApiResponse: # noqa: E501 - """Retrieve an issue type by id # noqa: E501 - - Retrieve an issue type by id # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_issue_type_with_http_info(project_id, slug, type_id, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._retrieve_issue_type_serialize( + project_id=project_id, + slug=slug, + type_id=type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueTypeAPI", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_issue_type_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IssueTypeAPI]: + """Retrieve an issue type by id + + Retrieve an issue type by id :param project_id: Project ID (required) :type project_id: str @@ -565,124 +1050,224 @@ def retrieve_issue_type_with_http_info(self, project_id : Annotated[StrictStr, F :type slug: str :param type_id: (required) :type type_id: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(IssueTypeAPI, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._retrieve_issue_type_serialize( + project_id=project_id, + slug=slug, + type_id=type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueTypeAPI", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'project_id', - 'slug', - 'type_id' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def retrieve_issue_type_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: StrictStr, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve an issue type by id + + Retrieve an issue type by id + + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param type_id: (required) + :type type_id: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_issue_type_serialize( + project_id=project_id, + slug=slug, + type_id=type_id, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method retrieve_issue_type" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueTypeAPI", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + def _retrieve_issue_type_serialize( + self, + project_id, + slug, + type_id, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _host = None - if _params['type_id'] is not None: - _path_params['type_id'] = _params['type_id'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + if type_id is not None: + _path_params['type_id'] = type_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "IssueTypeAPI", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issue-types/{type_id}/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issue-types/{type_id}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def update_issue_type(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], type_id : StrictStr, patched_issue_type_api_request : Optional[PatchedIssueTypeAPIRequest] = None, **kwargs) -> IssueTypeAPI: # noqa: E501 - """Update an issue type # noqa: E501 - Update an issue type # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def update_issue_type( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: StrictStr, + patched_issue_type_api_request: Optional[PatchedIssueTypeAPIRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IssueTypeAPI: + """Update an issue type - >>> thread = api.update_issue_type(project_id, slug, type_id, patched_issue_type_api_request, async_req=True) - >>> result = thread.get() + Update an issue type :param project_id: Project ID (required) :type project_id: str @@ -692,33 +1277,80 @@ def update_issue_type(self, project_id : Annotated[StrictStr, Field(..., descrip :type type_id: str :param patched_issue_type_api_request: :type patched_issue_type_api_request: PatchedIssueTypeAPIRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: IssueTypeAPI - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the update_issue_type_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.update_issue_type_with_http_info(project_id, slug, type_id, patched_issue_type_api_request, **kwargs) # noqa: E501 - - @validate_arguments - def update_issue_type_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], type_id : StrictStr, patched_issue_type_api_request : Optional[PatchedIssueTypeAPIRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update an issue type # noqa: E501 - - Update an issue type # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_issue_type_with_http_info(project_id, slug, type_id, patched_issue_type_api_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._update_issue_type_serialize( + project_id=project_id, + slug=slug, + type_id=type_id, + patched_issue_type_api_request=patched_issue_type_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueTypeAPI", + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_issue_type_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: StrictStr, + patched_issue_type_api_request: Optional[PatchedIssueTypeAPIRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IssueTypeAPI]: + """Update an issue type + + Update an issue type :param project_id: Project ID (required) :type project_id: str @@ -728,122 +1360,221 @@ def update_issue_type_with_http_info(self, project_id : Annotated[StrictStr, Fie :type type_id: str :param patched_issue_type_api_request: :type patched_issue_type_api_request: PatchedIssueTypeAPIRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(IssueTypeAPI, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'project_id', - 'slug', - 'type_id', - 'patched_issue_type_api_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._update_issue_type_serialize( + project_id=project_id, + slug=slug, + type_id=type_id, + patched_issue_type_api_request=patched_issue_type_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueTypeAPI", + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_issue_type_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + type_id: StrictStr, + patched_issue_type_api_request: Optional[PatchedIssueTypeAPIRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update an issue type + + Update an issue type + + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param type_id: (required) + :type type_id: str + :param patched_issue_type_api_request: + :type patched_issue_type_api_request: PatchedIssueTypeAPIRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_issue_type_serialize( + project_id=project_id, + slug=slug, + type_id=type_id, + patched_issue_type_api_request=patched_issue_type_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_issue_type" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueTypeAPI", + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + def _update_issue_type_serialize( + self, + project_id, + slug, + type_id, + patched_issue_type_api_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _host = None - if _params['type_id'] is not None: - _path_params['type_id'] = _params['type_id'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + if type_id is not None: + _path_params['type_id'] = type_id # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_issue_type_api_request'] is not None: - _body_params = _params['patched_issue_type_api_request'] + if patched_issue_type_api_request is not None: + _body_params = patched_issue_type_api_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "IssueTypeAPI", - '409': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issue-types/{type_id}/', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issue-types/{type_id}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/plane/api/work_item_worklogs_api.py b/plane/api/work_item_worklogs_api.py index b7b6dd1..c98c3e8 100644 --- a/plane/api/work_item_worklogs_api.py +++ b/plane/api/work_item_worklogs_api.py @@ -12,27 +12,18 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 - -from pydantic import validate_arguments - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictStr - -from typing import List, Optional from plane.models.issue_work_log_api import IssueWorkLogAPI from plane.models.issue_work_log_api_request import IssueWorkLogAPIRequest from plane.models.patched_issue_work_log_api_request import PatchedIssueWorkLogAPIRequest from plane.models.project_worklog_summary import ProjectWorklogSummary -from plane.api_client import ApiClient +from plane.api_client import ApiClient, RequestSerialized from plane.api_response import ApiResponse -from plane.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from plane.rest import RESTResponseType class WorkItemWorklogsApi: @@ -47,16 +38,30 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def create_issue_worklog(self, issue_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], issue_work_log_api_request : Optional[IssueWorkLogAPIRequest] = None, **kwargs) -> IssueWorkLogAPI: # noqa: E501 - """Create a new worklog entry # noqa: E501 - Create a new worklog entry # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_issue_worklog( + self, + issue_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_work_log_api_request: Optional[IssueWorkLogAPIRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IssueWorkLogAPI: + """Create a new worklog entry - >>> thread = api.create_issue_worklog(issue_id, project_id, slug, issue_work_log_api_request, async_req=True) - >>> result = thread.get() + Create a new worklog entry :param issue_id: (required) :type issue_id: str @@ -66,33 +71,80 @@ def create_issue_worklog(self, issue_id : StrictStr, project_id : Annotated[Stri :type slug: str :param issue_work_log_api_request: :type issue_work_log_api_request: IssueWorkLogAPIRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: IssueWorkLogAPI - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the create_issue_worklog_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.create_issue_worklog_with_http_info(issue_id, project_id, slug, issue_work_log_api_request, **kwargs) # noqa: E501 - - @validate_arguments - def create_issue_worklog_with_http_info(self, issue_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], issue_work_log_api_request : Optional[IssueWorkLogAPIRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Create a new worklog entry # noqa: E501 - - Create a new worklog entry # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_issue_worklog_with_http_info(issue_id, project_id, slug, issue_work_log_api_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._create_issue_worklog_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + issue_work_log_api_request=issue_work_log_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IssueWorkLogAPI", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_issue_worklog_with_http_info( + self, + issue_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_work_log_api_request: Optional[IssueWorkLogAPIRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IssueWorkLogAPI]: + """Create a new worklog entry + + Create a new worklog entry :param issue_id: (required) :type issue_id: str @@ -102,136 +154,249 @@ def create_issue_worklog_with_http_info(self, issue_id : StrictStr, project_id : :type slug: str :param issue_work_log_api_request: :type issue_work_log_api_request: IssueWorkLogAPIRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(IssueWorkLogAPI, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'issue_id', - 'project_id', - 'slug', - 'issue_work_log_api_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._create_issue_worklog_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + issue_work_log_api_request=issue_work_log_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IssueWorkLogAPI", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def create_issue_worklog_without_preload_content( + self, + issue_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_work_log_api_request: Optional[IssueWorkLogAPIRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create a new worklog entry + + Create a new worklog entry + + :param issue_id: (required) + :type issue_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param issue_work_log_api_request: + :type issue_work_log_api_request: IssueWorkLogAPIRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_issue_worklog_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + issue_work_log_api_request=issue_work_log_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_issue_worklog" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "IssueWorkLogAPI", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] + def _create_issue_worklog_serialize( + self, + issue_id, + project_id, + slug, + issue_work_log_api_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['issue_work_log_api_request'] is not None: - _body_params = _params['issue_work_log_api_request'] + if issue_work_log_api_request is not None: + _body_params = issue_work_log_api_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '201': "IssueWorkLogAPI", - '400': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/worklogs/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/worklogs/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def delete_issue_worklog(self, issue_id : StrictStr, pk : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> None: # noqa: E501 - """Delete a worklog entry # noqa: E501 - Delete a worklog entry # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def delete_issue_worklog( + self, + issue_id: StrictStr, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete a worklog entry - >>> thread = api.delete_issue_worklog(issue_id, pk, project_id, slug, async_req=True) - >>> result = thread.get() + Delete a worklog entry :param issue_id: (required) :type issue_id: str @@ -241,33 +406,79 @@ def delete_issue_worklog(self, issue_id : StrictStr, pk : StrictStr, project_id :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the delete_issue_worklog_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.delete_issue_worklog_with_http_info(issue_id, pk, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def delete_issue_worklog_with_http_info(self, issue_id : StrictStr, pk : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Delete a worklog entry # noqa: E501 - - Delete a worklog entry # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_issue_worklog_with_http_info(issue_id, pk, project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._delete_issue_worklog_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_issue_worklog_with_http_info( + self, + issue_id: StrictStr, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete a worklog entry + + Delete a worklog entry :param issue_id: (required) :type issue_id: str @@ -277,270 +488,511 @@ def delete_issue_worklog_with_http_info(self, issue_id : StrictStr, pk : StrictS :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - - _params = locals() - - _all_params = [ - 'issue_id', - 'pk', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._delete_issue_worklog_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_issue_worklog" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] + @validate_call + def delete_issue_worklog_without_preload_content( + self, + issue_id: StrictStr, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete a worklog entry - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + Delete a worklog entry - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + :param issue_id: (required) + :type issue_id: str + :param pk: (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_issue_worklog_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + def _delete_issue_worklog_serialize( + self, + issue_id, + pk, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/worklogs/{pk}/', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/worklogs/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def get_project_worklog_summary(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> List[ProjectWorklogSummary]: # noqa: E501 - """Get project worklog summary # noqa: E501 - Get project worklog summary # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_project_worklog_summary(project_id, slug, async_req=True) - >>> result = thread.get() + @validate_call + def get_project_worklog_summary( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[ProjectWorklogSummary]: + """Get project worklog summary + + Get project worklog summary :param project_id: Project ID (required) :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[ProjectWorklogSummary] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the get_project_worklog_summary_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.get_project_worklog_summary_with_http_info(project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def get_project_worklog_summary_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Get project worklog summary # noqa: E501 - - Get project worklog summary # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_project_worklog_summary_with_http_info(project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._get_project_worklog_summary_serialize( + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "List[ProjectWorklogSummary]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_project_worklog_summary_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[ProjectWorklogSummary]]: + """Get project worklog summary + + Get project worklog summary :param project_id: Project ID (required) :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[ProjectWorklogSummary], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_project_worklog_summary_serialize( + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "List[ProjectWorklogSummary]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def get_project_worklog_summary_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Get project worklog summary + + Get project worklog summary + + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_project_worklog_summary_serialize( + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_project_worklog_summary" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "List[ProjectWorklogSummary]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + def _get_project_worklog_summary_serialize( + self, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "List[ProjectWorklogSummary]", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/total-worklogs/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/total-worklogs/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def list_issue_worklogs(self, issue_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> List[IssueWorkLogAPI]: # noqa: E501 - """List worklog entries # noqa: E501 - List worklog entries # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_issue_worklogs(issue_id, project_id, slug, async_req=True) - >>> result = thread.get() + @validate_call + def list_issue_worklogs( + self, + issue_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> List[IssueWorkLogAPI]: + """List worklog entries + + List worklog entries :param issue_id: (required) :type issue_id: str @@ -548,33 +1000,77 @@ def list_issue_worklogs(self, issue_id : StrictStr, project_id : Annotated[Stric :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: List[IssueWorkLogAPI] - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_issue_worklogs_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_issue_worklogs_with_http_info(issue_id, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def list_issue_worklogs_with_http_info(self, issue_id : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """List worklog entries # noqa: E501 - - List worklog entries # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_issue_worklogs_with_http_info(issue_id, project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_issue_worklogs_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "List[IssueWorkLogAPI]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_issue_worklogs_with_http_info( + self, + issue_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[List[IssueWorkLogAPI]]: + """List worklog entries + + List worklog entries :param issue_id: (required) :type issue_id: str @@ -582,124 +1078,225 @@ def list_issue_worklogs_with_http_info(self, issue_id : StrictStr, project_id : :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(List[IssueWorkLogAPI], status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._list_issue_worklogs_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - _params = locals() + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "List[IssueWorkLogAPI]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _all_params = [ - 'issue_id', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + + @validate_call + def list_issue_worklogs_without_preload_content( + self, + issue_id: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List worklog entries + + List worklog entries + + :param issue_id: (required) + :type issue_id: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._list_issue_worklogs_serialize( + issue_id=issue_id, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_issue_worklogs" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "List[IssueWorkLogAPI]", + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] + def _list_issue_worklogs_serialize( + self, + issue_id, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "List[IssueWorkLogAPI]", - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/worklogs/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/worklogs/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def update_issue_worklog(self, issue_id : StrictStr, pk : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], patched_issue_work_log_api_request : Optional[PatchedIssueWorkLogAPIRequest] = None, **kwargs) -> IssueWorkLogAPI: # noqa: E501 - """Update a worklog entry # noqa: E501 - Update a worklog entry # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_issue_worklog(issue_id, pk, project_id, slug, patched_issue_work_log_api_request, async_req=True) - >>> result = thread.get() + + @validate_call + def update_issue_worklog( + self, + issue_id: StrictStr, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_issue_work_log_api_request: Optional[PatchedIssueWorkLogAPIRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IssueWorkLogAPI: + """Update a worklog entry + + Update a worklog entry :param issue_id: (required) :type issue_id: str @@ -711,33 +1308,82 @@ def update_issue_worklog(self, issue_id : StrictStr, pk : StrictStr, project_id :type slug: str :param patched_issue_work_log_api_request: :type patched_issue_work_log_api_request: PatchedIssueWorkLogAPIRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: IssueWorkLogAPI - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the update_issue_worklog_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.update_issue_worklog_with_http_info(issue_id, pk, project_id, slug, patched_issue_work_log_api_request, **kwargs) # noqa: E501 - - @validate_arguments - def update_issue_worklog_with_http_info(self, issue_id : StrictStr, pk : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], patched_issue_work_log_api_request : Optional[PatchedIssueWorkLogAPIRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Update a worklog entry # noqa: E501 - - Update a worklog entry # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_issue_worklog_with_http_info(issue_id, pk, project_id, slug, patched_issue_work_log_api_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._update_issue_worklog_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + patched_issue_work_log_api_request=patched_issue_work_log_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueWorkLogAPI", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_issue_worklog_with_http_info( + self, + issue_id: StrictStr, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_issue_work_log_api_request: Optional[PatchedIssueWorkLogAPIRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IssueWorkLogAPI]: + """Update a worklog entry + + Update a worklog entry :param issue_id: (required) :type issue_id: str @@ -749,126 +1395,229 @@ def update_issue_worklog_with_http_info(self, issue_id : StrictStr, pk : StrictS :type slug: str :param patched_issue_work_log_api_request: :type patched_issue_work_log_api_request: PatchedIssueWorkLogAPIRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(IssueWorkLogAPI, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'issue_id', - 'pk', - 'project_id', - 'slug', - 'patched_issue_work_log_api_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._update_issue_worklog_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + patched_issue_work_log_api_request=patched_issue_work_log_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_issue_worklog" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueWorkLogAPI", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['issue_id'] is not None: - _path_params['issue_id'] = _params['issue_id'] + @validate_call + def update_issue_worklog_without_preload_content( + self, + issue_id: StrictStr, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_issue_work_log_api_request: Optional[PatchedIssueWorkLogAPIRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Update a worklog entry - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + Update a worklog entry - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + :param issue_id: (required) + :type issue_id: str + :param pk: (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param patched_issue_work_log_api_request: + :type patched_issue_work_log_api_request: PatchedIssueWorkLogAPIRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_issue_worklog_serialize( + issue_id=issue_id, + pk=pk, + project_id=project_id, + slug=slug, + patched_issue_work_log_api_request=patched_issue_work_log_api_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueWorkLogAPI", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + def _update_issue_worklog_serialize( + self, + issue_id, + pk, + project_id, + slug, + patched_issue_work_log_api_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if issue_id is not None: + _path_params['issue_id'] = issue_id + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_issue_work_log_api_request'] is not None: - _body_params = _params['patched_issue_work_log_api_request'] + if patched_issue_work_log_api_request is not None: + _body_params = patched_issue_work_log_api_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "IssueWorkLogAPI", - '400': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/worklogs/{pk}/', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{issue_id}/worklogs/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/plane/api/work_items_api.py b/plane/api/work_items_api.py index 4edfd49..04930fa 100644 --- a/plane/api/work_items_api.py +++ b/plane/api/work_items_api.py @@ -12,15 +12,9 @@ Do not edit the class manually. """ # noqa: E501 - -import re # noqa: F401 - -from pydantic import validate_arguments - +from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt +from typing import Any, Dict, List, Optional, Tuple, Union from typing_extensions import Annotated -from pydantic import Field, StrictInt, StrictStr - -from typing import Optional from plane.models.issue import Issue from plane.models.issue_detail import IssueDetail @@ -29,12 +23,9 @@ from plane.models.paginated_work_item_response import PaginatedWorkItemResponse from plane.models.patched_issue_request import PatchedIssueRequest -from plane.api_client import ApiClient +from plane.api_client import ApiClient, RequestSerialized from plane.api_response import ApiResponse -from plane.exceptions import ( # noqa: F401 - ApiTypeError, - ApiValueError -) +from plane.rest import RESTResponseType class WorkItemsApi: @@ -49,16 +40,29 @@ def __init__(self, api_client=None) -> None: api_client = ApiClient.get_default() self.api_client = api_client - @validate_arguments - def create_work_item(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], issue_request : IssueRequest, **kwargs) -> Issue: # noqa: E501 - """Create work item # noqa: E501 - Create a new work item in the specified project with the provided details. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def create_work_item( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_request: IssueRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Issue: + """Create work item - >>> thread = api.create_work_item(project_id, slug, issue_request, async_req=True) - >>> result = thread.get() + Create a new work item in the specified project with the provided details. :param project_id: Project ID (required) :type project_id: str @@ -66,33 +70,79 @@ def create_work_item(self, project_id : Annotated[StrictStr, Field(..., descript :type slug: str :param issue_request: (required) :type issue_request: IssueRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Issue - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the create_work_item_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.create_work_item_with_http_info(project_id, slug, issue_request, **kwargs) # noqa: E501 - - @validate_arguments - def create_work_item_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], issue_request : IssueRequest, **kwargs) -> ApiResponse: # noqa: E501 - """Create work item # noqa: E501 - - Create a new work item in the specified project with the provided details. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.create_work_item_with_http_info(project_id, slug, issue_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._create_work_item_serialize( + project_id=project_id, + slug=slug, + issue_request=issue_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "Issue", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def create_work_item_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_request: IssueRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Issue]: + """Create work item + + Create a new work item in the specified project with the provided details. :param project_id: Project ID (required) :type project_id: str @@ -100,133 +150,242 @@ def create_work_item_with_http_info(self, project_id : Annotated[StrictStr, Fiel :type slug: str :param issue_request: (required) :type issue_request: IssueRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Issue, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._create_work_item_serialize( + project_id=project_id, + slug=slug, + issue_request=issue_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "Issue", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'project_id', - 'slug', - 'issue_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def create_work_item_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + issue_request: IssueRequest, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Create work item + + Create a new work item in the specified project with the provided details. + + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param issue_request: (required) + :type issue_request: IssueRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._create_work_item_serialize( + project_id=project_id, + slug=slug, + issue_request=issue_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method create_work_item" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '201': "Issue", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + def _create_work_item_serialize( + self, + project_id, + slug, + issue_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _host = None + + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['issue_request'] is not None: - _body_params = _params['issue_request'] + if issue_request is not None: + _body_params = issue_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '201': "Issue", - '400': None, - '409': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/', 'POST', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='POST', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + - @validate_arguments - def delete_work_item(self, pk : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> None: # noqa: E501 - """Delete work item # noqa: E501 - Permanently delete an existing work item from the project. Only admins or the item creator can perform this action. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def delete_work_item( + self, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> None: + """Delete work item - >>> thread = api.delete_work_item(pk, project_id, slug, async_req=True) - >>> result = thread.get() + Permanently delete an existing work item from the project. Only admins or the item creator can perform this action. :param pk: (required) :type pk: str @@ -234,33 +393,77 @@ def delete_work_item(self, pk : StrictStr, project_id : Annotated[StrictStr, Fie :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the delete_work_item_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.delete_work_item_with_http_info(pk, project_id, slug, **kwargs) # noqa: E501 - - @validate_arguments - def delete_work_item_with_http_info(self, pk : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Delete work item # noqa: E501 - - Permanently delete an existing work item from the project. Only admins or the item creator can perform this action. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.delete_work_item_with_http_info(pk, project_id, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._delete_work_item_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def delete_work_item_with_http_info( + self, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[None]: + """Delete work item + + Permanently delete an existing work item from the project. Only admins or the item creator can perform this action. :param pk: (required) :type pk: str @@ -268,115 +471,216 @@ def delete_work_item_with_http_info(self, pk : StrictStr, project_id : Annotated :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: None - """ + """ # noqa: E501 + + _param = self._delete_work_item_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'pk', - 'project_id', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def delete_work_item_without_preload_content( + self, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Delete work item + + Permanently delete an existing work item from the project. Only admins or the item creator can perform this action. + + :param pk: (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._delete_work_item_serialize( + pk=pk, + project_id=project_id, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method delete_work_item" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '204': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + def _delete_work_item_serialize( + self, + pk, + project_id, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = {} - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{pk}/', 'DELETE', - _path_params, - _query_params, - _header_params, + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='DELETE', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def get_workspace_work_item(self, issue_identifier : Annotated[StrictInt, Field(..., description="Issue sequence ID (numeric identifier within project)")], project_identifier : Annotated[StrictStr, Field(..., description="Project identifier (unique string within workspace)")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> Issue: # noqa: E501 - """Retrieve work item by identifiers # noqa: E501 - Retrieve a specific work item using workspace slug, project identifier, and issue identifier. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.get_workspace_work_item(issue_identifier, project_identifier, slug, async_req=True) - >>> result = thread.get() + @validate_call + def get_workspace_work_item( + self, + issue_identifier: Annotated[StrictInt, Field(description="Issue sequence ID (numeric identifier within project)")], + project_identifier: Annotated[StrictStr, Field(description="Project identifier (unique string within workspace)")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Issue: + """Retrieve work item by identifiers + + Retrieve a specific work item using workspace slug, project identifier, and issue identifier. :param issue_identifier: Issue sequence ID (numeric identifier within project) (required) :type issue_identifier: int @@ -384,33 +688,75 @@ def get_workspace_work_item(self, issue_identifier : Annotated[StrictInt, Field( :type project_identifier: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Issue - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the get_workspace_work_item_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.get_workspace_work_item_with_http_info(issue_identifier, project_identifier, slug, **kwargs) # noqa: E501 - - @validate_arguments - def get_workspace_work_item_with_http_info(self, issue_identifier : Annotated[StrictInt, Field(..., description="Issue sequence ID (numeric identifier within project)")], project_identifier : Annotated[StrictStr, Field(..., description="Project identifier (unique string within workspace)")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], **kwargs) -> ApiResponse: # noqa: E501 - """Retrieve work item by identifiers # noqa: E501 - - Retrieve a specific work item using workspace slug, project identifier, and issue identifier. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.get_workspace_work_item_with_http_info(issue_identifier, project_identifier, slug, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._get_workspace_work_item_serialize( + issue_identifier=issue_identifier, + project_identifier=project_identifier, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Issue", + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def get_workspace_work_item_with_http_info( + self, + issue_identifier: Annotated[StrictInt, Field(description="Issue sequence ID (numeric identifier within project)")], + project_identifier: Annotated[StrictStr, Field(description="Project identifier (unique string within workspace)")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Issue]: + """Retrieve work item by identifiers + + Retrieve a specific work item using workspace slug, project identifier, and issue identifier. :param issue_identifier: Issue sequence ID (numeric identifier within project) (required) :type issue_identifier: int @@ -418,122 +764,225 @@ def get_workspace_work_item_with_http_info(self, issue_identifier : Annotated[St :type project_identifier: str :param slug: Workspace slug (required) :type slug: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Issue, status_code(int), headers(HTTPHeaderDict)) - """ + """ # noqa: E501 + + _param = self._get_workspace_work_item_serialize( + issue_identifier=issue_identifier, + project_identifier=project_identifier, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "Issue", + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _params = locals() - _all_params = [ - 'issue_identifier', - 'project_identifier', - 'slug' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + @validate_call + def get_workspace_work_item_without_preload_content( + self, + issue_identifier: Annotated[StrictInt, Field(description="Issue sequence ID (numeric identifier within project)")], + project_identifier: Annotated[StrictStr, Field(description="Project identifier (unique string within workspace)")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve work item by identifiers + + Retrieve a specific work item using workspace slug, project identifier, and issue identifier. + + :param issue_identifier: Issue sequence ID (numeric identifier within project) (required) + :type issue_identifier: int + :param project_identifier: Project identifier (unique string within workspace) (required) + :type project_identifier: str + :param slug: Workspace slug (required) + :type slug: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._get_workspace_work_item_serialize( + issue_identifier=issue_identifier, + project_identifier=project_identifier, + slug=slug, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method get_workspace_work_item" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "Issue", + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['issue_identifier'] is not None: - _path_params['issue_identifier'] = _params['issue_identifier'] + def _get_workspace_work_item_serialize( + self, + issue_identifier, + project_identifier, + slug, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_identifier'] is not None: - _path_params['project_identifier'] = _params['project_identifier'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if issue_identifier is not None: + _path_params['issue_identifier'] = issue_identifier + if project_identifier is not None: + _path_params['project_identifier'] = project_identifier + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '200': "Issue", - '404': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/issues/{project_identifier}-{issue_identifier}/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/issues/{project_identifier}-{issue_identifier}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + - @validate_arguments - def list_work_items(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, external_id : Annotated[Optional[StrictStr], Field(description="External system identifier for filtering or lookup")] = None, external_source : Annotated[Optional[StrictStr], Field(description="External system source name for filtering or lookup")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> PaginatedWorkItemResponse: # noqa: E501 - """List work items # noqa: E501 - Retrieve a paginated list of all work items in a project. Supports filtering, ordering, and field selection through query parameters. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.list_work_items(project_id, slug, cursor, expand, external_id, external_source, fields, order_by, per_page, async_req=True) - >>> result = thread.get() + @validate_call + def list_work_items( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External system identifier for filtering or lookup")] = None, + external_source: Annotated[Optional[StrictStr], Field(description="External system source name for filtering or lookup")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> PaginatedWorkItemResponse: + """List work items + + Retrieve a paginated list of all work items in a project. Supports filtering, ordering, and field selection through query parameters. :param project_id: Project ID (required) :type project_id: str @@ -553,33 +1002,90 @@ def list_work_items(self, project_id : Annotated[StrictStr, Field(..., descripti :type order_by: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: PaginatedWorkItemResponse - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the list_work_items_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.list_work_items_with_http_info(project_id, slug, cursor, expand, external_id, external_source, fields, order_by, per_page, **kwargs) # noqa: E501 - - @validate_arguments - def list_work_items_with_http_info(self, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], cursor : Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, external_id : Annotated[Optional[StrictStr], Field(description="External system identifier for filtering or lookup")] = None, external_source : Annotated[Optional[StrictStr], Field(description="External system source name for filtering or lookup")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, per_page : Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """List work items # noqa: E501 - - Retrieve a paginated list of all work items in a project. Supports filtering, ordering, and field selection through query parameters. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.list_work_items_with_http_info(project_id, slug, cursor, expand, external_id, external_source, fields, order_by, per_page, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_work_items_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + external_id=external_id, + external_source=external_source, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedWorkItemResponse", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def list_work_items_with_http_info( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External system identifier for filtering or lookup")] = None, + external_source: Annotated[Optional[StrictStr], Field(description="External system source name for filtering or lookup")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[PaginatedWorkItemResponse]: + """List work items + + Retrieve a paginated list of all work items in a project. Supports filtering, ordering, and field selection through query parameters. :param project_id: Project ID (required) :type project_id: str @@ -599,157 +1105,98 @@ def list_work_items_with_http_info(self, project_id : Annotated[StrictStr, Field :type order_by: str :param per_page: Number of results per page (default: 20, max: 100) :type per_page: int - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(PaginatedWorkItemResponse, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'project_id', - 'slug', - 'cursor', - 'expand', - 'external_id', - 'external_source', - 'fields', - 'order_by', - 'per_page' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._list_work_items_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + external_id=external_id, + external_source=external_source, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method list_work_items" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} - - # process the path parameters - _path_params = {} - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] - - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] - - - # process the query parameters - _query_params = [] - if _params.get('cursor') is not None: # noqa: E501 - _query_params.append(('cursor', _params['cursor'])) - - if _params.get('expand') is not None: # noqa: E501 - _query_params.append(('expand', _params['expand'])) - - if _params.get('external_id') is not None: # noqa: E501 - _query_params.append(('external_id', _params['external_id'])) - - if _params.get('external_source') is not None: # noqa: E501 - _query_params.append(('external_source', _params['external_source'])) - - if _params.get('fields') is not None: # noqa: E501 - _query_params.append(('fields', _params['fields'])) - - if _params.get('order_by') is not None: # noqa: E501 - _query_params.append(('order_by', _params['order_by'])) - - if _params.get('per_page') is not None: # noqa: E501 - _query_params.append(('per_page', _params['per_page'])) - - # process the header parameters - _header_params = dict(_params.get('_headers', {})) - # process the form parameters - _form_params = [] - _files = {} - # process the body parameter - _body_params = None - # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 - - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { + _response_types_map: Dict[str, Optional[str]] = { '401': None, '403': None, '404': None, '200': "PaginatedWorkItemResponse", '400': None, } - - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/', 'GET', - _path_params, - _query_params, - _header_params, - body=_body_params, - post_params=_form_params, - files=_files, + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, response_types_map=_response_types_map, - auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), - collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + ) - @validate_arguments - def retrieve_work_item(self, pk : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, external_id : Annotated[Optional[StrictStr], Field(description="External system identifier for filtering or lookup")] = None, external_source : Annotated[Optional[StrictStr], Field(description="External system source name for filtering or lookup")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, **kwargs) -> IssueDetail: # noqa: E501 - """Retrieve work item # noqa: E501 - Retrieve details of a specific work item. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True + @validate_call + def list_work_items_without_preload_content( + self, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + cursor: Annotated[Optional[StrictStr], Field(description="Pagination cursor for getting next set of results")] = None, + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External system identifier for filtering or lookup")] = None, + external_source: Annotated[Optional[StrictStr], Field(description="External system source name for filtering or lookup")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + per_page: Annotated[Optional[StrictInt], Field(description="Number of results per page (default: 20, max: 100)")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """List work items - >>> thread = api.retrieve_work_item(pk, project_id, slug, expand, external_id, external_source, fields, order_by, async_req=True) - >>> result = thread.get() + Retrieve a paginated list of all work items in a project. Supports filtering, ordering, and field selection through query parameters. - :param pk: (required) - :type pk: str :param project_id: Project ID (required) :type project_id: str :param slug: Workspace slug (required) :type slug: str - :param expand: Comma-separated list of related fields to expand in response + :param cursor: Pagination cursor for getting next set of results + :type cursor: str + :param expand: Comma-separated list of related fields to expand in response :type expand: str :param external_id: External system identifier for filtering or lookup :type external_id: str @@ -759,33 +1206,191 @@ def retrieve_work_item(self, pk : StrictStr, project_id : Annotated[StrictStr, F :type fields: str :param order_by: Field to order results by. Prefix with '-' for descending order :type order_by: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param per_page: Number of results per page (default: 20, max: 100) + :type per_page: int + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: IssueDetail - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the retrieve_work_item_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.retrieve_work_item_with_http_info(pk, project_id, slug, expand, external_id, external_source, fields, order_by, **kwargs) # noqa: E501 - - @validate_arguments - def retrieve_work_item_with_http_info(self, pk : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], expand : Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, external_id : Annotated[Optional[StrictStr], Field(description="External system identifier for filtering or lookup")] = None, external_source : Annotated[Optional[StrictStr], Field(description="External system source name for filtering or lookup")] = None, fields : Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, order_by : Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Retrieve work item # noqa: E501 - - Retrieve details of a specific work item. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.retrieve_work_item_with_http_info(pk, project_id, slug, expand, external_id, external_source, fields, order_by, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._list_work_items_serialize( + project_id=project_id, + slug=slug, + cursor=cursor, + expand=expand, + external_id=external_id, + external_source=external_source, + fields=fields, + order_by=order_by, + per_page=per_page, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "PaginatedWorkItemResponse", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _list_work_items_serialize( + self, + project_id, + slug, + cursor, + expand, + external_id, + external_source, + fields, + order_by, + per_page, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + # process the query parameters + if cursor is not None: + + _query_params.append(('cursor', cursor)) + + if expand is not None: + + _query_params.append(('expand', expand)) + + if external_id is not None: + + _query_params.append(('external_id', external_id)) + + if external_source is not None: + + _query_params.append(('external_source', external_source)) + + if fields is not None: + + _query_params.append(('fields', fields)) + + if order_by is not None: + + _query_params.append(('order_by', order_by)) + + if per_page is not None: + + _query_params.append(('per_page', per_page)) + + # process the header parameters + # process the form parameters + # process the body parameter + + + # set the HTTP header `Accept` + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) + + + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] + + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, + body=_body_params, + post_params=_form_params, + files=_files, + auth_settings=_auth_settings, + collection_formats=_collection_formats, + _host=_host, + _request_auth=_request_auth + ) + + + + + @validate_call + def retrieve_work_item( + self, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External system identifier for filtering or lookup")] = None, + external_source: Annotated[Optional[StrictStr], Field(description="External system source name for filtering or lookup")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IssueDetail: + """Retrieve work item + + Retrieve details of a specific work item. :param pk: (required) :type pk: str @@ -803,145 +1408,376 @@ def retrieve_work_item_with_http_info(self, pk : StrictStr, project_id : Annotat :type fields: str :param order_by: Field to order results by. Prefix with '-' for descending order :type order_by: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(IssueDetail, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'pk', - 'project_id', - 'slug', - 'expand', - 'external_id', - 'external_source', - 'fields', - 'order_by' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._retrieve_work_item_serialize( + pk=pk, + project_id=project_id, + slug=slug, + expand=expand, + external_id=external_id, + external_source=external_source, + fields=fields, + order_by=order_by, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method retrieve_work_item" % _key - ) - _params[_key] = _val - del _params['kwargs'] - - _collection_formats = {} + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueDetail", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def retrieve_work_item_with_http_info( + self, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External system identifier for filtering or lookup")] = None, + external_source: Annotated[Optional[StrictStr], Field(description="External system source name for filtering or lookup")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IssueDetail]: + """Retrieve work item - # process the path parameters - _path_params = {} - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + Retrieve details of a specific work item. - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + :param pk: (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param expand: Comma-separated list of related fields to expand in response + :type expand: str + :param external_id: External system identifier for filtering or lookup + :type external_id: str + :param external_source: External system source name for filtering or lookup + :type external_source: str + :param fields: Comma-separated list of fields to include in response + :type fields: str + :param order_by: Field to order results by. Prefix with '-' for descending order + :type order_by: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_work_item_serialize( + pk=pk, + project_id=project_id, + slug=slug, + expand=expand, + external_id=external_id, + external_source=external_source, + fields=fields, + order_by=order_by, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueDetail", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - # process the query parameters - _query_params = [] - if _params.get('expand') is not None: # noqa: E501 - _query_params.append(('expand', _params['expand'])) + @validate_call + def retrieve_work_item_without_preload_content( + self, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + expand: Annotated[Optional[StrictStr], Field(description="Comma-separated list of related fields to expand in response")] = None, + external_id: Annotated[Optional[StrictStr], Field(description="External system identifier for filtering or lookup")] = None, + external_source: Annotated[Optional[StrictStr], Field(description="External system source name for filtering or lookup")] = None, + fields: Annotated[Optional[StrictStr], Field(description="Comma-separated list of fields to include in response")] = None, + order_by: Annotated[Optional[StrictStr], Field(description="Field to order results by. Prefix with '-' for descending order")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Retrieve work item - if _params.get('external_id') is not None: # noqa: E501 - _query_params.append(('external_id', _params['external_id'])) + Retrieve details of a specific work item. - if _params.get('external_source') is not None: # noqa: E501 - _query_params.append(('external_source', _params['external_source'])) + :param pk: (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param expand: Comma-separated list of related fields to expand in response + :type expand: str + :param external_id: External system identifier for filtering or lookup + :type external_id: str + :param external_source: External system source name for filtering or lookup + :type external_source: str + :param fields: Comma-separated list of fields to include in response + :type fields: str + :param order_by: Field to order results by. Prefix with '-' for descending order + :type order_by: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._retrieve_work_item_serialize( + pk=pk, + project_id=project_id, + slug=slug, + expand=expand, + external_id=external_id, + external_source=external_source, + fields=fields, + order_by=order_by, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) - if _params.get('fields') is not None: # noqa: E501 - _query_params.append(('fields', _params['fields'])) + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "IssueDetail", + '400': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response + + + def _retrieve_work_item_serialize( + self, + pk, + project_id, + slug, + expand, + external_id, + external_source, + fields, + order_by, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: + + _host = None + + _collection_formats: Dict[str, str] = { + } - if _params.get('order_by') is not None: # noqa: E501 - _query_params.append(('order_by', _params['order_by'])) + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug + # process the query parameters + if expand is not None: + + _query_params.append(('expand', expand)) + + if external_id is not None: + + _query_params.append(('external_id', external_id)) + + if external_source is not None: + + _query_params.append(('external_source', external_source)) + + if fields is not None: + + _query_params.append(('fields', fields)) + + if order_by is not None: + + _query_params.append(('order_by', order_by)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "IssueDetail", - '400': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{pk}/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def search_work_items(self, search : Annotated[StrictStr, Field(..., description="Search query to filter results by name, description, or identifier")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], limit : Annotated[Optional[StrictInt], Field(description="Maximum number of results to return")] = None, project_id : Annotated[Optional[StrictStr], Field(description="Project ID for filtering results within a specific project")] = None, workspace_search : Annotated[Optional[StrictStr], Field(description="Whether to search across entire workspace or within specific project")] = None, **kwargs) -> IssueSearch: # noqa: E501 - """search_work_items # noqa: E501 - Perform semantic search across issue names, sequence IDs, and project identifiers. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.search_work_items(search, slug, limit, project_id, workspace_search, async_req=True) - >>> result = thread.get() + + @validate_call + def search_work_items( + self, + search: Annotated[StrictStr, Field(description="Search query to filter results by name, description, or identifier")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + limit: Annotated[Optional[StrictInt], Field(description="Maximum number of results to return")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="Project ID for filtering results within a specific project")] = None, + workspace_search: Annotated[Optional[StrictStr], Field(description="Whether to search across entire workspace or within specific project")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> IssueSearch: + """search_work_items + + Perform semantic search across issue names, sequence IDs, and project identifiers. :param search: Search query to filter results by name, description, or identifier (required) :type search: str @@ -953,33 +1789,82 @@ def search_work_items(self, search : Annotated[StrictStr, Field(..., description :type project_id: str :param workspace_search: Whether to search across entire workspace or within specific project :type workspace_search: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: IssueSearch - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the search_work_items_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.search_work_items_with_http_info(search, slug, limit, project_id, workspace_search, **kwargs) # noqa: E501 - - @validate_arguments - def search_work_items_with_http_info(self, search : Annotated[StrictStr, Field(..., description="Search query to filter results by name, description, or identifier")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], limit : Annotated[Optional[StrictInt], Field(description="Maximum number of results to return")] = None, project_id : Annotated[Optional[StrictStr], Field(description="Project ID for filtering results within a specific project")] = None, workspace_search : Annotated[Optional[StrictStr], Field(description="Whether to search across entire workspace or within specific project")] = None, **kwargs) -> ApiResponse: # noqa: E501 - """search_work_items # noqa: E501 - - Perform semantic search across issue names, sequence IDs, and project identifiers. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.search_work_items_with_http_info(search, slug, limit, project_id, workspace_search, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._search_work_items_serialize( + search=search, + slug=slug, + limit=limit, + project_id=project_id, + workspace_search=workspace_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IssueSearch", + '400': None, + '401': None, + '403': None, + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def search_work_items_with_http_info( + self, + search: Annotated[StrictStr, Field(description="Search query to filter results by name, description, or identifier")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + limit: Annotated[Optional[StrictInt], Field(description="Maximum number of results to return")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="Project ID for filtering results within a specific project")] = None, + workspace_search: Annotated[Optional[StrictStr], Field(description="Whether to search across entire workspace or within specific project")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[IssueSearch]: + """search_work_items + + Perform semantic search across issue names, sequence IDs, and project identifiers. :param search: Search query to filter results by name, description, or identifier (required) :type search: str @@ -991,133 +1876,250 @@ def search_work_items_with_http_info(self, search : Annotated[StrictStr, Field(. :type project_id: str :param workspace_search: Whether to search across entire workspace or within specific project :type workspace_search: str - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(IssueSearch, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'search', - 'slug', - 'limit', - 'project_id', - 'workspace_search' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' - ] + """ # noqa: E501 + + _param = self._search_work_items_serialize( + search=search, + slug=slug, + limit=limit, + project_id=project_id, + workspace_search=workspace_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method search_work_items" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '200': "IssueSearch", + '400': None, + '401': None, + '403': None, + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + @validate_call + def search_work_items_without_preload_content( + self, + search: Annotated[StrictStr, Field(description="Search query to filter results by name, description, or identifier")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + limit: Annotated[Optional[StrictInt], Field(description="Maximum number of results to return")] = None, + project_id: Annotated[Optional[StrictStr], Field(description="Project ID for filtering results within a specific project")] = None, + workspace_search: Annotated[Optional[StrictStr], Field(description="Whether to search across entire workspace or within specific project")] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """search_work_items + Perform semantic search across issue names, sequence IDs, and project identifiers. - # process the query parameters - _query_params = [] - if _params.get('limit') is not None: # noqa: E501 - _query_params.append(('limit', _params['limit'])) + :param search: Search query to filter results by name, description, or identifier (required) + :type search: str + :param slug: Workspace slug (required) + :type slug: str + :param limit: Maximum number of results to return + :type limit: int + :param project_id: Project ID for filtering results within a specific project + :type project_id: str + :param workspace_search: Whether to search across entire workspace or within specific project + :type workspace_search: str + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._search_work_items_serialize( + search=search, + slug=slug, + limit=limit, + project_id=project_id, + workspace_search=workspace_search, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '200': "IssueSearch", + '400': None, + '401': None, + '403': None, + '404': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - if _params.get('project_id') is not None: # noqa: E501 - _query_params.append(('project_id', _params['project_id'])) - if _params.get('search') is not None: # noqa: E501 - _query_params.append(('search', _params['search'])) + def _search_work_items_serialize( + self, + search, + slug, + limit, + project_id, + workspace_search, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params.get('workspace_search') is not None: # noqa: E501 - _query_params.append(('workspace_search', _params['workspace_search'])) + _host = None + _collection_formats: Dict[str, str] = { + } + + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + + # process the path parameters + if slug is not None: + _path_params['slug'] = slug + # process the query parameters + if limit is not None: + + _query_params.append(('limit', limit)) + + if project_id is not None: + + _query_params.append(('project_id', project_id)) + + if search is not None: + + _query_params.append(('search', search)) + + if workspace_search is not None: + + _query_params.append(('workspace_search', workspace_search)) + # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None + + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) - # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - _response_types_map = { - '200': "IssueSearch", - '400': None, - '401': None, - '403': None, - '404': None, - } + # authentication setting + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/issues/search/', 'GET', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='GET', + resource_path='/api/v1/workspaces/{slug}/issues/search/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) - @validate_arguments - def update_work_item(self, pk : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], patched_issue_request : Optional[PatchedIssueRequest] = None, **kwargs) -> Issue: # noqa: E501 - """Partially update work item # noqa: E501 - Partially update an existing work item with the provided fields. Supports external ID validation to prevent conflicts. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - >>> thread = api.update_work_item(pk, project_id, slug, patched_issue_request, async_req=True) - >>> result = thread.get() + + @validate_call + def update_work_item( + self, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_issue_request: Optional[PatchedIssueRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> Issue: + """Partially update work item + + Partially update an existing work item with the provided fields. Supports external ID validation to prevent conflicts. :param pk: (required) :type pk: str @@ -1127,33 +2129,81 @@ def update_work_item(self, pk : StrictStr, project_id : Annotated[StrictStr, Fie :type slug: str :param patched_issue_request: :type patched_issue_request: PatchedIssueRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _request_timeout: timeout setting for this request. - If one number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: Issue - """ - kwargs['_return_http_data_only'] = True - if '_preload_content' in kwargs: - message = "Error! Please call the update_work_item_with_http_info method with `_preload_content` instead and obtain raw data from ApiResponse.raw_data" # noqa: E501 - raise ValueError(message) - return self.update_work_item_with_http_info(pk, project_id, slug, patched_issue_request, **kwargs) # noqa: E501 - - @validate_arguments - def update_work_item_with_http_info(self, pk : StrictStr, project_id : Annotated[StrictStr, Field(..., description="Project ID")], slug : Annotated[StrictStr, Field(..., description="Workspace slug")], patched_issue_request : Optional[PatchedIssueRequest] = None, **kwargs) -> ApiResponse: # noqa: E501 - """Partially update work item # noqa: E501 - - Partially update an existing work item with the provided fields. Supports external ID validation to prevent conflicts. # noqa: E501 - This method makes a synchronous HTTP request by default. To make an - asynchronous HTTP request, please pass async_req=True - - >>> thread = api.update_work_item_with_http_info(pk, project_id, slug, patched_issue_request, async_req=True) - >>> result = thread.get() + """ # noqa: E501 + + _param = self._update_work_item_serialize( + pk=pk, + project_id=project_id, + slug=slug, + patched_issue_request=patched_issue_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Issue", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ).data + + + @validate_call + def update_work_item_with_http_info( + self, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_issue_request: Optional[PatchedIssueRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] + ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> ApiResponse[Issue]: + """Partially update work item + + Partially update an existing work item with the provided fields. Supports external ID validation to prevent conflicts. :param pk: (required) :type pk: str @@ -1163,123 +2213,223 @@ def update_work_item_with_http_info(self, pk : StrictStr, project_id : Annotated :type slug: str :param patched_issue_request: :type patched_issue_request: PatchedIssueRequest - :param async_req: Whether to execute the request asynchronously. - :type async_req: bool, optional - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :type _preload_content: bool, optional - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :type _return_http_data_only: bool, optional :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. + request; this effectively ignores the + authentication in the spec for a single request. :type _request_auth: dict, optional - :type _content_type: string, optional: force content-type for the request + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional :return: Returns the result object. - If the method is called asynchronously, - returns the request thread. - :rtype: tuple(Issue, status_code(int), headers(HTTPHeaderDict)) - """ - - _params = locals() - - _all_params = [ - 'pk', - 'project_id', - 'slug', - 'patched_issue_request' - ] - _all_params.extend( - [ - 'async_req', - '_return_http_data_only', - '_preload_content', - '_request_timeout', - '_request_auth', - '_content_type', - '_headers' + """ # noqa: E501 + + _param = self._update_work_item_serialize( + pk=pk, + project_id=project_id, + slug=slug, + patched_issue_request=patched_issue_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index + ) + + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Issue", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + response_data.read() + return self.api_client.response_deserialize( + response_data=response_data, + response_types_map=_response_types_map, + ) + + + @validate_call + def update_work_item_without_preload_content( + self, + pk: StrictStr, + project_id: Annotated[StrictStr, Field(description="Project ID")], + slug: Annotated[StrictStr, Field(description="Workspace slug")], + patched_issue_request: Optional[PatchedIssueRequest] = None, + _request_timeout: Union[ + None, + Annotated[StrictFloat, Field(gt=0)], + Tuple[ + Annotated[StrictFloat, Field(gt=0)], + Annotated[StrictFloat, Field(gt=0)] ] + ] = None, + _request_auth: Optional[Dict[StrictStr, Any]] = None, + _content_type: Optional[StrictStr] = None, + _headers: Optional[Dict[StrictStr, Any]] = None, + _host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0, + ) -> RESTResponseType: + """Partially update work item + + Partially update an existing work item with the provided fields. Supports external ID validation to prevent conflicts. + + :param pk: (required) + :type pk: str + :param project_id: Project ID (required) + :type project_id: str + :param slug: Workspace slug (required) + :type slug: str + :param patched_issue_request: + :type patched_issue_request: PatchedIssueRequest + :param _request_timeout: timeout setting for this request. If one + number provided, it will be total request + timeout. It can also be a pair (tuple) of + (connection, read) timeouts. + :type _request_timeout: int, tuple(int, int), optional + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the + authentication in the spec for a single request. + :type _request_auth: dict, optional + :param _content_type: force content-type for the request. + :type _content_type: str, Optional + :param _headers: set to override the headers for a single + request; this effectively ignores the headers + in the spec for a single request. + :type _headers: dict, optional + :param _host_index: set to override the host_index for a single + request; this effectively ignores the host_index + in the spec for a single request. + :type _host_index: int, optional + :return: Returns the result object. + """ # noqa: E501 + + _param = self._update_work_item_serialize( + pk=pk, + project_id=project_id, + slug=slug, + patched_issue_request=patched_issue_request, + _request_auth=_request_auth, + _content_type=_content_type, + _headers=_headers, + _host_index=_host_index ) - # validate the arguments - for _key, _val in _params['kwargs'].items(): - if _key not in _all_params: - raise ApiTypeError( - "Got an unexpected keyword argument '%s'" - " to method update_work_item" % _key - ) - _params[_key] = _val - del _params['kwargs'] + _response_types_map: Dict[str, Optional[str]] = { + '401': None, + '403': None, + '404': None, + '200': "Issue", + '400': None, + '409': None, + } + response_data = self.api_client.call_api( + *_param, + _request_timeout=_request_timeout + ) + return response_data.response - _collection_formats = {} - # process the path parameters - _path_params = {} - if _params['pk'] is not None: - _path_params['pk'] = _params['pk'] + def _update_work_item_serialize( + self, + pk, + project_id, + slug, + patched_issue_request, + _request_auth, + _content_type, + _headers, + _host_index, + ) -> RequestSerialized: - if _params['project_id'] is not None: - _path_params['project_id'] = _params['project_id'] + _host = None - if _params['slug'] is not None: - _path_params['slug'] = _params['slug'] + _collection_formats: Dict[str, str] = { + } + _path_params: Dict[str, str] = {} + _query_params: List[Tuple[str, str]] = [] + _header_params: Dict[str, Optional[str]] = _headers or {} + _form_params: List[Tuple[str, str]] = [] + _files: Dict[ + str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]] + ] = {} + _body_params: Optional[bytes] = None + # process the path parameters + if pk is not None: + _path_params['pk'] = pk + if project_id is not None: + _path_params['project_id'] = project_id + if slug is not None: + _path_params['slug'] = slug # process the query parameters - _query_params = [] # process the header parameters - _header_params = dict(_params.get('_headers', {})) # process the form parameters - _form_params = [] - _files = {} # process the body parameter - _body_params = None - if _params['patched_issue_request'] is not None: - _body_params = _params['patched_issue_request'] + if patched_issue_request is not None: + _body_params = patched_issue_request + # set the HTTP header `Accept` - _header_params['Accept'] = self.api_client.select_header_accept( - ['application/json']) # noqa: E501 + if 'Accept' not in _header_params: + _header_params['Accept'] = self.api_client.select_header_accept( + [ + 'application/json' + ] + ) # set the HTTP header `Content-Type` - _content_types_list = _params.get('_content_type', - self.api_client.select_header_content_type( - ['application/json', 'application/x-www-form-urlencoded', 'multipart/form-data'])) - if _content_types_list: - _header_params['Content-Type'] = _content_types_list + if _content_type: + _header_params['Content-Type'] = _content_type + else: + _default_content_type = ( + self.api_client.select_header_content_type( + [ + 'application/json', + 'application/x-www-form-urlencoded', + 'multipart/form-data' + ] + ) + ) + if _default_content_type is not None: + _header_params['Content-Type'] = _default_content_type # authentication setting - _auth_settings = ['ApiKeyAuthentication', 'OAuth2Authentication', 'OAuth2Authentication'] # noqa: E501 - - _response_types_map = { - '401': None, - '403': None, - '404': None, - '200': "Issue", - '400': None, - '409': None, - } + _auth_settings: List[str] = [ + 'ApiKeyAuthentication', + 'OAuth2Authentication', + 'OAuth2Authentication' + ] - return self.api_client.call_api( - '/api/v1/workspaces/{slug}/projects/{project_id}/issues/{pk}/', 'PATCH', - _path_params, - _query_params, - _header_params, + return self.api_client.param_serialize( + method='PATCH', + resource_path='/api/v1/workspaces/{slug}/projects/{project_id}/issues/{pk}/', + path_params=_path_params, + query_params=_query_params, + header_params=_header_params, body=_body_params, post_params=_form_params, files=_files, - response_types_map=_response_types_map, auth_settings=_auth_settings, - async_req=_params.get('async_req'), - _return_http_data_only=_params.get('_return_http_data_only'), # noqa: E501 - _preload_content=_params.get('_preload_content', True), - _request_timeout=_params.get('_request_timeout'), collection_formats=_collection_formats, - _request_auth=_params.get('_request_auth')) + _host=_host, + _request_auth=_request_auth + ) + + diff --git a/plane/api_client.py b/plane/api_client.py index 2b29b26..74c8a89 100644 --- a/plane/api_client.py +++ b/plane/api_client.py @@ -13,25 +13,30 @@ """ # noqa: E501 -import atexit import datetime from dateutil.parser import parse +from enum import Enum +import decimal import json import mimetypes -from multiprocessing.pool import ThreadPool import os import re import tempfile from urllib.parse import quote +from typing import Tuple, Optional, List, Dict, Union from pydantic import SecretStr from plane.configuration import Configuration -from plane.api_response import ApiResponse +from plane.api_response import ApiResponse, T as ApiResponseT import plane.models from plane import rest -from plane.exceptions import ApiValueError, ApiException +from plane.exceptions import ( + ApiValueError, + ApiException +) +RequestSerialized = Tuple[str, str, Dict[str, str], Optional[str], List[str]] class ApiClient: """Generic API client for OpenAPI client library builds. @@ -47,8 +52,6 @@ class ApiClient: the API. :param cookie: a cookie to include in the header when making calls to the API - :param pool_threads: The number of threads to use for async requests - to the API. More threads means more concurrent API requests. """ PRIMITIVE_TYPES = (float, bool, bytes, str, int) @@ -60,17 +63,22 @@ class ApiClient: 'bool': bool, 'date': datetime.date, 'datetime': datetime.datetime, + 'decimal': decimal.Decimal, 'object': object, } _pool = None - def __init__(self, configuration=None, header_name=None, header_value=None, - cookie=None, pool_threads=1) -> None: + def __init__( + self, + configuration=None, + header_name=None, + header_value=None, + cookie=None + ) -> None: # use default configuration if none is provided if configuration is None: configuration = Configuration.get_default() self.configuration = configuration - self.pool_threads = pool_threads self.rest_client = rest.RESTClientObject(configuration) self.default_headers = {} @@ -78,32 +86,14 @@ def __init__(self, configuration=None, header_name=None, header_value=None, self.default_headers[header_name] = header_value self.cookie = cookie # Set default User-Agent. - self.user_agent = 'OpenAPI-Generator/0.1.6/python' + self.user_agent = 'OpenAPI-Generator/0.1.7/python' self.client_side_validation = configuration.client_side_validation def __enter__(self): return self def __exit__(self, exc_type, exc_value, traceback): - self.close() - - def close(self): - if self._pool: - self._pool.close() - self._pool.join() - self._pool = None - if hasattr(atexit, 'unregister'): - atexit.unregister(self.close) - - @property - def pool(self): - """Create thread pool on first request - avoids instantiating unused threadpool for blocking clients. - """ - if self._pool is None: - atexit.register(self.close) - self._pool = ThreadPool(self.pool_threads) - return self._pool + pass @property def user_agent(self): @@ -144,13 +134,42 @@ def set_default(cls, default): """ cls._default = default - def __call_api( - self, resource_path, method, path_params=None, - query_params=None, header_params=None, body=None, post_params=None, - files=None, response_types_map=None, auth_settings=None, - _return_http_data_only=None, collection_formats=None, - _preload_content=True, _request_timeout=None, _host=None, - _request_auth=None): + def param_serialize( + self, + method, + resource_path, + path_params=None, + query_params=None, + header_params=None, + body=None, + post_params=None, + files=None, auth_settings=None, + collection_formats=None, + _host=None, + _request_auth=None + ) -> RequestSerialized: + + """Builds the HTTP request params needed by the request. + :param method: Method to call. + :param resource_path: Path to method endpoint. + :param path_params: Path parameters in the url. + :param query_params: Query parameters in the url. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param auth_settings list: Auth Settings names for the request. + :param files dict: key -> filename, value -> filepath, + for `multipart/form-data`. + :param collection_formats: dict of collection formats for path, query, + header, and post parameters. + :param _request_auth: set to override the auth_settings for an a single + request; this effectively ignores the authentication + in the spec for a single request. + :return: tuple of form (path, http_method, query_params, header_params, + body, post_params, files) + """ config = self.configuration @@ -161,14 +180,17 @@ def __call_api( header_params['Cookie'] = self.cookie if header_params: header_params = self.sanitize_for_serialization(header_params) - header_params = dict(self.parameters_to_tuples(header_params, - collection_formats)) + header_params = dict( + self.parameters_to_tuples(header_params,collection_formats) + ) # path parameters if path_params: path_params = self.sanitize_for_serialization(path_params) - path_params = self.parameters_to_tuples(path_params, - collection_formats) + path_params = self.parameters_to_tuples( + path_params, + collection_formats + ) for k, v in path_params: # specified safe chars, encode everything resource_path = resource_path.replace( @@ -180,22 +202,30 @@ def __call_api( if post_params or files: post_params = post_params if post_params else [] post_params = self.sanitize_for_serialization(post_params) - post_params = self.parameters_to_tuples(post_params, - collection_formats) - post_params.extend(self.files_parameters(files)) + post_params = self.parameters_to_tuples( + post_params, + collection_formats + ) + if files: + post_params.extend(self.files_parameters(files)) # auth setting self.update_params_for_auth( - header_params, query_params, auth_settings, - resource_path, method, body, - request_auth=_request_auth) + header_params, + query_params, + auth_settings, + resource_path, + method, + body, + request_auth=_request_auth + ) # body if body: body = self.sanitize_for_serialization(body) # request url - if _host is None: + if _host is None or self.configuration.ignore_operation_servers: url = self.configuration.host + resource_path else: # use server/host defined in path or operation instead @@ -204,59 +234,99 @@ def __call_api( # query parameters if query_params: query_params = self.sanitize_for_serialization(query_params) - url_query = self.parameters_to_url_query(query_params, - collection_formats) + url_query = self.parameters_to_url_query( + query_params, + collection_formats + ) url += "?" + url_query + return method, url, header_params, body, post_params + + + def call_api( + self, + method, + url, + header_params=None, + body=None, + post_params=None, + _request_timeout=None + ) -> rest.RESTResponse: + """Makes the HTTP request (synchronous) + :param method: Method to call. + :param url: Path to method endpoint. + :param header_params: Header parameters to be + placed in the request header. + :param body: Request body. + :param post_params dict: Request post form parameters, + for `application/x-www-form-urlencoded`, `multipart/form-data`. + :param _request_timeout: timeout setting for this request. + :return: RESTResponse + """ + try: # perform request and return response - response_data = self.request( + response_data = self.rest_client.request( method, url, - query_params=query_params, headers=header_params, - post_params=post_params, body=body, - _preload_content=_preload_content, - _request_timeout=_request_timeout) + body=body, post_params=post_params, + _request_timeout=_request_timeout + ) + except ApiException as e: - if e.body: - e.body = e.body.decode('utf-8') raise e - self.last_response = response_data - - return_data = None # assuming deserialization is not needed - # data needs deserialization or returns HTTP data (deserialized) only - if _preload_content or _return_http_data_only: - response_type = response_types_map.get(str(response_data.status), None) - if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: - # if not found, look for '1XX', '2XX', etc. - response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) - - if response_type == "bytearray": - response_data.data = response_data.data - else: - match = None - content_type = response_data.getheader('content-type') - if content_type is not None: - match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) - encoding = match.group(1) if match else "utf-8" - response_data.data = response_data.data.decode(encoding) - - # deserialize response data - if response_type == "bytearray": - return_data = response_data.data - elif response_type: - return_data = self.deserialize(response_data, response_type) - else: - return_data = None - - if _return_http_data_only: - return return_data - else: - return ApiResponse(status_code = response_data.status, - data = return_data, - headers = response_data.getheaders(), - raw_data = response_data.data) + return response_data + + def response_deserialize( + self, + response_data: rest.RESTResponse, + response_types_map: Optional[Dict[str, ApiResponseT]]=None + ) -> ApiResponse[ApiResponseT]: + """Deserializes response into an object. + :param response_data: RESTResponse object to be deserialized. + :param response_types_map: dict of response types. + :return: ApiResponse + """ + + msg = "RESTResponse.read() must be called before passing it to response_deserialize()" + assert response_data.data is not None, msg + + response_type = response_types_map.get(str(response_data.status), None) + if not response_type and isinstance(response_data.status, int) and 100 <= response_data.status <= 599: + # if not found, look for '1XX', '2XX', etc. + response_type = response_types_map.get(str(response_data.status)[0] + "XX", None) + + # deserialize response data + response_text = None + return_data = None + try: + if response_type == "bytearray": + return_data = response_data.data + elif response_type == "file": + return_data = self.__deserialize_file(response_data) + elif response_type is not None: + match = None + content_type = response_data.getheader('content-type') + if content_type is not None: + match = re.search(r"charset=([a-zA-Z\-\d]+)[\s;]?", content_type) + encoding = match.group(1) if match else "utf-8" + response_text = response_data.data.decode(encoding) + return_data = self.deserialize(response_text, response_type, content_type) + finally: + if not 200 <= response_data.status <= 299: + raise ApiException.from_response( + http_resp=response_data, + body=response_text, + data=return_data, + ) + + return ApiResponse( + status_code = response_data.status, + data = return_data, + headers = response_data.getheaders(), + raw_data = response_data.data + ) def sanitize_for_serialization(self, obj): """Builds a JSON POST object. @@ -266,6 +336,7 @@ def sanitize_for_serialization(self, obj): If obj is str, int, long, float, bool, return directly. If obj is datetime.datetime, datetime.date convert to string in iso8601 format. + If obj is decimal.Decimal return string representation. If obj is list, sanitize each element in the list. If obj is dict, return the dict. If obj is OpenAPI model, return the properties dict. @@ -275,20 +346,26 @@ def sanitize_for_serialization(self, obj): """ if obj is None: return None + elif isinstance(obj, Enum): + return obj.value elif isinstance(obj, SecretStr): return obj.get_secret_value() elif isinstance(obj, self.PRIMITIVE_TYPES): return obj elif isinstance(obj, list): - return [self.sanitize_for_serialization(sub_obj) - for sub_obj in obj] + return [ + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ] elif isinstance(obj, tuple): - return tuple(self.sanitize_for_serialization(sub_obj) - for sub_obj in obj) + return tuple( + self.sanitize_for_serialization(sub_obj) for sub_obj in obj + ) elif isinstance(obj, (datetime.datetime, datetime.date)): return obj.isoformat() + elif isinstance(obj, decimal.Decimal): + return str(obj) - if isinstance(obj, dict): + elif isinstance(obj, dict): obj_dict = obj else: # Convert model obj to dict except @@ -301,28 +378,40 @@ def sanitize_for_serialization(self, obj): else: obj_dict = obj.__dict__ - return {key: self.sanitize_for_serialization(val) - for key, val in obj_dict.items()} + return { + key: self.sanitize_for_serialization(val) + for key, val in obj_dict.items() + } - def deserialize(self, response, response_type): + def deserialize(self, response_text: str, response_type: str, content_type: Optional[str]): """Deserializes response into an object. :param response: RESTResponse object to be deserialized. :param response_type: class literal for deserialized object, or string of class name. + :param content_type: content type of response. :return: deserialized object. """ - # handle file downloading - # save response body into a tmp file and return the instance - if response_type == "file": - return self.__deserialize_file(response) # fetch data from response object - try: - data = json.loads(response.data) - except ValueError: - data = response.data + if content_type is None: + try: + data = json.loads(response_text) + except ValueError: + data = response_text + elif re.match(r'^application/(json|[\w!#$&.+-^_]+\+json)\s*(;|$)', content_type, re.IGNORECASE): + if response_text == "": + data = "" + else: + data = json.loads(response_text) + elif re.match(r'^text\/[a-z.+-]+\s*(;|$)', content_type, re.IGNORECASE): + data = response_text + else: + raise ApiException( + status=0, + reason="Unsupported content type: {0}".format(content_type) + ) return self.__deserialize(data, response_type) @@ -339,12 +428,16 @@ def __deserialize(self, data, klass): if isinstance(klass, str): if klass.startswith('List['): - sub_kls = re.match(r'List\[(.*)]', klass).group(1) + m = re.match(r'List\[(.*)]', klass) + assert m is not None, "Malformed List type definition" + sub_kls = m.group(1) return [self.__deserialize(sub_data, sub_kls) for sub_data in data] if klass.startswith('Dict['): - sub_kls = re.match(r'Dict\[([^,]*), (.*)]', klass).group(2) + m = re.match(r'Dict\[([^,]*), (.*)]', klass) + assert m is not None, "Malformed Dict type definition" + sub_kls = m.group(2) return {k: self.__deserialize(v, sub_kls) for k, v in data.items()} @@ -362,139 +455,13 @@ def __deserialize(self, data, klass): return self.__deserialize_date(data) elif klass == datetime.datetime: return self.__deserialize_datetime(data) + elif klass == decimal.Decimal: + return decimal.Decimal(data) + elif issubclass(klass, Enum): + return self.__deserialize_enum(data, klass) else: return self.__deserialize_model(data, klass) - def call_api(self, resource_path, method, - path_params=None, query_params=None, header_params=None, - body=None, post_params=None, files=None, - response_types_map=None, auth_settings=None, - async_req=None, _return_http_data_only=None, - collection_formats=None, _preload_content=True, - _request_timeout=None, _host=None, _request_auth=None): - """Makes the HTTP request (synchronous) and returns deserialized data. - - To make an async_req request, set the async_req parameter. - - :param resource_path: Path to method endpoint. - :param method: Method to call. - :param path_params: Path parameters in the url. - :param query_params: Query parameters in the url. - :param header_params: Header parameters to be - placed in the request header. - :param body: Request body. - :param post_params dict: Request post form parameters, - for `application/x-www-form-urlencoded`, `multipart/form-data`. - :param auth_settings list: Auth Settings names for the request. - :param response: Response data type. - :param files dict: key -> filename, value -> filepath, - for `multipart/form-data`. - :param async_req bool: execute request asynchronously - :param _return_http_data_only: response data instead of ApiResponse - object with status code, headers, etc - :param _preload_content: if False, the ApiResponse.data will - be set to none and raw_data will store the - HTTP response body without reading/decoding. - Default is True. - :param collection_formats: dict of collection formats for path, query, - header, and post parameters. - :param _request_timeout: timeout setting for this request. If one - number provided, it will be total request - timeout. It can also be a pair (tuple) of - (connection, read) timeouts. - :param _request_auth: set to override the auth_settings for an a single - request; this effectively ignores the authentication - in the spec for a single request. - :type _request_token: dict, optional - :return: - If async_req parameter is True, - the request will be called asynchronously. - The method will return the request thread. - If parameter async_req is False or missing, - then the method will return the response directly. - """ - args = ( - resource_path, - method, - path_params, - query_params, - header_params, - body, - post_params, - files, - response_types_map, - auth_settings, - _return_http_data_only, - collection_formats, - _preload_content, - _request_timeout, - _host, - _request_auth, - ) - if not async_req: - return self.__call_api(*args) - - return self.pool.apply_async(self.__call_api, args) - - def request(self, method, url, query_params=None, headers=None, - post_params=None, body=None, _preload_content=True, - _request_timeout=None): - """Makes the HTTP request using RESTClient.""" - if method == "GET": - return self.rest_client.get_request(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "HEAD": - return self.rest_client.head_request(url, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - headers=headers) - elif method == "OPTIONS": - return self.rest_client.options_request(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout) - elif method == "POST": - return self.rest_client.post_request(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PUT": - return self.rest_client.put_request(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "PATCH": - return self.rest_client.patch_request(url, - query_params=query_params, - headers=headers, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - elif method == "DELETE": - return self.rest_client.delete_request(url, - query_params=query_params, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - else: - raise ApiValueError( - "http method must be `GET`, `HEAD`, `OPTIONS`," - " `POST`, `PATCH`, `PUT` or `DELETE`." - ) - def parameters_to_tuples(self, params, collection_formats): """Get parameters as list of tuples, formatting collections. @@ -502,10 +469,10 @@ def parameters_to_tuples(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: Parameters as list of tuples, collections formatted """ - new_params = [] + new_params: List[Tuple[str, str]] = [] if collection_formats is None: collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: if k in collection_formats: collection_format = collection_formats[k] if collection_format == 'multi': @@ -532,10 +499,10 @@ def parameters_to_url_query(self, params, collection_formats): :param dict collection_formats: Parameter collection formats :return: URL query string (e.g. a=Hello%20World&b=123) """ - new_params = [] + new_params: List[Tuple[str, str]] = [] if collection_formats is None: collection_formats = {} - for k, v in params.items() if isinstance(params, dict) else params: # noqa: E501 + for k, v in params.items() if isinstance(params, dict) else params: if isinstance(v, bool): v = str(v).lower() if isinstance(v, (int, float)): @@ -557,44 +524,56 @@ def parameters_to_url_query(self, params, collection_formats): else: # csv is the default delimiter = ',' new_params.append( - (k, delimiter.join(quote(str(value)) for value in v))) + (k, delimiter.join(quote(str(value)) for value in v)) + ) else: new_params.append((k, quote(str(v)))) return "&".join(["=".join(map(str, item)) for item in new_params]) - def files_parameters(self, files=None): + def files_parameters( + self, + files: Dict[str, Union[str, bytes, List[str], List[bytes], Tuple[str, bytes]]], + ): """Builds form parameters. :param files: File parameters. :return: Form parameters with files. """ params = [] - - if files: - for k, v in files.items(): - if not v: - continue - file_names = v if type(v) is list else [v] - for n in file_names: - with open(n, 'rb') as f: - filename = os.path.basename(f.name) - filedata = f.read() - mimetype = (mimetypes.guess_type(filename)[0] or - 'application/octet-stream') - params.append( - tuple([k, tuple([filename, filedata, mimetype])])) - + for k, v in files.items(): + if isinstance(v, str): + with open(v, 'rb') as f: + filename = os.path.basename(f.name) + filedata = f.read() + elif isinstance(v, bytes): + filename = k + filedata = v + elif isinstance(v, tuple): + filename, filedata = v + elif isinstance(v, list): + for file_param in v: + params.extend(self.files_parameters({k: file_param})) + continue + else: + raise ValueError("Unsupported file value") + mimetype = ( + mimetypes.guess_type(filename)[0] + or 'application/octet-stream' + ) + params.append( + tuple([k, tuple([filename, filedata, mimetype])]) + ) return params - def select_header_accept(self, accepts): + def select_header_accept(self, accepts: List[str]) -> Optional[str]: """Returns `Accept` based on an array of accepts provided. :param accepts: List of headers. :return: Accept (e.g. application/json). """ if not accepts: - return + return None for accept in accepts: if re.search('json', accept, re.IGNORECASE): @@ -617,9 +596,16 @@ def select_header_content_type(self, content_types): return content_types[0] - def update_params_for_auth(self, headers, queries, auth_settings, - resource_path, method, body, - request_auth=None): + def update_params_for_auth( + self, + headers, + queries, + auth_settings, + resource_path, + method, + body, + request_auth=None + ) -> None: """Updates header and query params based on authentication setting. :param headers: Header parameters dict to be updated. @@ -636,21 +622,36 @@ def update_params_for_auth(self, headers, queries, auth_settings, return if request_auth: - self._apply_auth_params(headers, queries, - resource_path, method, body, - request_auth) - return - - for auth in auth_settings: - auth_setting = self.configuration.auth_settings().get(auth) - if auth_setting: - self._apply_auth_params(headers, queries, - resource_path, method, body, - auth_setting) - - def _apply_auth_params(self, headers, queries, - resource_path, method, body, - auth_setting): + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + request_auth + ) + else: + for auth in auth_settings: + auth_setting = self.configuration.auth_settings().get(auth) + if auth_setting: + self._apply_auth_params( + headers, + queries, + resource_path, + method, + body, + auth_setting + ) + + def _apply_auth_params( + self, + headers, + queries, + resource_path, + method, + body, + auth_setting + ) -> None: """Updates the request parameters based on a single auth_setting :param headers: Header parameters dict to be updated. @@ -679,6 +680,9 @@ def __deserialize_file(self, response): Saves response body into a file in a temporary folder, using the filename from the `Content-Disposition` header if provided. + handle file downloading + save response body into a tmp file and return the instance + :param response: RESTResponse. :return: file path. """ @@ -688,8 +692,12 @@ def __deserialize_file(self, response): content_disposition = response.getheader("Content-Disposition") if content_disposition: - filename = re.search(r'filename=[\'"]?([^\'"\s]+)[\'"]?', - content_disposition).group(1) + m = re.search( + r'filename=[\'"]?([^\'"\s]+)[\'"]?', + content_disposition + ) + assert m is not None, "Unexpected 'content-disposition' header value" + filename = m.group(1) path = os.path.join(os.path.dirname(path), filename) with open(path, "wb") as f: @@ -756,6 +764,24 @@ def __deserialize_datetime(self, string): ) ) + def __deserialize_enum(self, data, klass): + """Deserializes primitive type to enum. + + :param data: primitive type. + :param klass: class literal. + :return: enum value. + """ + try: + return klass(data) + except ValueError: + raise rest.ApiException( + status=0, + reason=( + "Failed to parse `{0}` as `{1}`" + .format(data, klass) + ) + ) + def __deserialize_model(self, data, klass): """Deserializes list or dict to model. diff --git a/plane/api_response.py b/plane/api_response.py index a0b62b9..9bc7c11 100644 --- a/plane/api_response.py +++ b/plane/api_response.py @@ -1,25 +1,21 @@ """API response object.""" from __future__ import annotations -from typing import Any, Dict, Optional -from pydantic import Field, StrictInt, StrictStr +from typing import Optional, Generic, Mapping, TypeVar +from pydantic import Field, StrictInt, StrictBytes, BaseModel -class ApiResponse: +T = TypeVar("T") + +class ApiResponse(BaseModel, Generic[T]): """ API response object """ - status_code: Optional[StrictInt] = Field(None, description="HTTP status code") - headers: Optional[Dict[StrictStr, StrictStr]] = Field(None, description="HTTP headers") - data: Optional[Any] = Field(None, description="Deserialized data given the data type") - raw_data: Optional[Any] = Field(None, description="Raw data (HTTP response body)") + status_code: StrictInt = Field(description="HTTP status code") + headers: Optional[Mapping[str, str]] = Field(None, description="HTTP headers") + data: T = Field(description="Deserialized data given the data type") + raw_data: StrictBytes = Field(description="Raw data (HTTP response body)") - def __init__(self, - status_code=None, - headers=None, - data=None, - raw_data=None) -> None: - self.status_code = status_code - self.headers = headers - self.data = data - self.raw_data = raw_data + model_config = { + "arbitrary_types_allowed": True + } diff --git a/plane/configuration.py b/plane/configuration.py index 3f6ddf5..5fdc984 100644 --- a/plane/configuration.py +++ b/plane/configuration.py @@ -14,12 +14,16 @@ import copy +import http.client as httplib import logging +from logging import FileHandler import multiprocessing import sys +from typing import Any, ClassVar, Dict, List, Literal, Optional, TypedDict, Union +from typing_extensions import NotRequired, Self + import urllib3 -import http.client as httplib JSON_SCHEMA_VALIDATION_KEYWORDS = { 'multipleOf', 'maximum', 'exclusiveMaximum', @@ -27,10 +31,116 @@ 'minLength', 'pattern', 'maxItems', 'minItems' } +ServerVariablesT = Dict[str, str] + +GenericAuthSetting = TypedDict( + "GenericAuthSetting", + { + "type": str, + "in": str, + "key": str, + "value": str, + }, +) + + +OAuth2AuthSetting = TypedDict( + "OAuth2AuthSetting", + { + "type": Literal["oauth2"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +APIKeyAuthSetting = TypedDict( + "APIKeyAuthSetting", + { + "type": Literal["api_key"], + "in": str, + "key": str, + "value": Optional[str], + }, +) + + +BasicAuthSetting = TypedDict( + "BasicAuthSetting", + { + "type": Literal["basic"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": Optional[str], + }, +) + + +BearerFormatAuthSetting = TypedDict( + "BearerFormatAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "format": Literal["JWT"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +BearerAuthSetting = TypedDict( + "BearerAuthSetting", + { + "type": Literal["bearer"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": str, + }, +) + + +HTTPSignatureAuthSetting = TypedDict( + "HTTPSignatureAuthSetting", + { + "type": Literal["http-signature"], + "in": Literal["header"], + "key": Literal["Authorization"], + "value": None, + }, +) + + +AuthSettings = TypedDict( + "AuthSettings", + { + "ApiKeyAuthentication": APIKeyAuthSetting, + "OAuth2Authentication": OAuth2AuthSetting, + "OAuth2Authentication": OAuth2AuthSetting, + }, + total=False, +) + + +class HostSettingVariable(TypedDict): + description: str + default_value: str + enum_values: List[str] + + +class HostSetting(TypedDict): + url: str + description: str + variables: NotRequired[Dict[str, HostSettingVariable]] + + class Configuration: """This class contains various settings of the API client. :param host: Base url. + :param ignore_operation_servers + Boolean to ignore operation servers for the API client. + Config will use `host` as the base url regardless of the operation servers. :param api_key: Dict to store API key(s). Each entry in the dict specifies an API key. The dict key is the name of the security scheme in the OAS specification. @@ -53,6 +163,9 @@ class Configuration: values before. :param ssl_ca_cert: str - the path to a file of concatenated CA certificates in PEM format. + :param retries: Number of retries for API requests. + :param ca_cert_data: verify the peer using concatenated CA certificate data + in PEM (str) or DER (bytes) format. :Example: @@ -76,16 +189,27 @@ class Configuration: Cookie: JSESSIONID abc123 """ - _default = None - - def __init__(self, host=None, - api_key=None, api_key_prefix=None, - username=None, password=None, - access_token=None, - server_index=None, server_variables=None, - server_operation_index=None, server_operation_variables=None, - ssl_ca_cert=None, - ) -> None: + _default: ClassVar[Optional[Self]] = None + + def __init__( + self, + host: Optional[str]=None, + api_key: Optional[Dict[str, str]]=None, + api_key_prefix: Optional[Dict[str, str]]=None, + username: Optional[str]=None, + password: Optional[str]=None, + access_token: Optional[str]=None, + server_index: Optional[int]=None, + server_variables: Optional[ServerVariablesT]=None, + server_operation_index: Optional[Dict[int, int]]=None, + server_operation_variables: Optional[Dict[int, ServerVariablesT]]=None, + ignore_operation_servers: bool=False, + ssl_ca_cert: Optional[str]=None, + retries: Optional[int] = None, + ca_cert_data: Optional[Union[str, bytes]] = None, + *, + debug: Optional[bool] = None, + ) -> None: """Constructor """ self._base_path = "https://api.plane.so" if host is None else host @@ -99,6 +223,9 @@ def __init__(self, host=None, self.server_operation_variables = server_operation_variables or {} """Default server variables """ + self.ignore_operation_servers = ignore_operation_servers + """Ignore operation servers + """ self.temp_folder_path = None """Temp file folder for downloading files """ @@ -136,13 +263,16 @@ def __init__(self, host=None, self.logger_stream_handler = None """Log stream handler """ - self.logger_file_handler = None + self.logger_file_handler: Optional[FileHandler] = None """Log file handler """ self.logger_file = None """Debug file location """ - self.debug = False + if debug is not None: + self.debug = debug + else: + self.__debug = False """Debug switch """ @@ -154,6 +284,10 @@ def __init__(self, host=None, self.ssl_ca_cert = ssl_ca_cert """Set this to customize the certificate file to verify the peer. """ + self.ca_cert_data = ca_cert_data + """Set this to verify the peer using PEM (str) or DER (bytes) + certificate data. + """ self.cert_file = None """client certificate file """ @@ -176,7 +310,7 @@ def __init__(self, host=None, cpu_count * 5 is used as default value to increase performance. """ - self.proxy = None + self.proxy: Optional[str] = None """Proxy URL """ self.proxy_headers = None @@ -185,7 +319,7 @@ def __init__(self, host=None, self.safe_chars_for_path_param = '' """Safe chars for path_param """ - self.retries = None + self.retries = retries """Adding retries to override urllib3 default value 3 """ # Enable client side validation @@ -203,7 +337,7 @@ def __init__(self, host=None, """date format """ - def __deepcopy__(self, memo): + def __deepcopy__(self, memo: Dict[int, Any]) -> Self: cls = self.__class__ result = cls.__new__(cls) memo[id(self)] = result @@ -217,11 +351,11 @@ def __deepcopy__(self, memo): result.debug = self.debug return result - def __setattr__(self, name, value): + def __setattr__(self, name: str, value: Any) -> None: object.__setattr__(self, name, value) @classmethod - def set_default(cls, default): + def set_default(cls, default: Optional[Self]) -> None: """Set default instance of configuration. It stores default configuration, which can be @@ -232,7 +366,7 @@ def set_default(cls, default): cls._default = default @classmethod - def get_default_copy(cls): + def get_default_copy(cls) -> Self: """Deprecated. Please use `get_default` instead. Deprecated. Please use `get_default` instead. @@ -242,7 +376,7 @@ def get_default_copy(cls): return cls.get_default() @classmethod - def get_default(cls): + def get_default(cls) -> Self: """Return the default configuration. This method returns newly created, based on default constructor, @@ -252,11 +386,11 @@ def get_default(cls): :return: The configuration object. """ if cls._default is None: - cls._default = Configuration() + cls._default = cls() return cls._default @property - def logger_file(self): + def logger_file(self) -> Optional[str]: """The logger file. If the logger_file is None, then add stream handler and remove file @@ -268,7 +402,7 @@ def logger_file(self): return self.__logger_file @logger_file.setter - def logger_file(self, value): + def logger_file(self, value: Optional[str]) -> None: """The logger file. If the logger_file is None, then add stream handler and remove file @@ -287,7 +421,7 @@ def logger_file(self, value): logger.addHandler(self.logger_file_handler) @property - def debug(self): + def debug(self) -> bool: """Debug status :param value: The debug status, True or False. @@ -296,7 +430,7 @@ def debug(self): return self.__debug @debug.setter - def debug(self, value): + def debug(self, value: bool) -> None: """Debug status :param value: The debug status, True or False. @@ -318,7 +452,7 @@ def debug(self, value): httplib.HTTPConnection.debuglevel = 0 @property - def logger_format(self): + def logger_format(self) -> str: """The logger format. The logger_formatter will be updated when sets logger_format. @@ -329,7 +463,7 @@ def logger_format(self): return self.__logger_format @logger_format.setter - def logger_format(self, value): + def logger_format(self, value: str) -> None: """The logger format. The logger_formatter will be updated when sets logger_format. @@ -340,7 +474,7 @@ def logger_format(self, value): self.__logger_format = value self.logger_formatter = logging.Formatter(self.__logger_format) - def get_api_key_with_prefix(self, identifier, alias=None): + def get_api_key_with_prefix(self, identifier: str, alias: Optional[str]=None) -> Optional[str]: """Gets API key (with prefix if set). :param identifier: The identifier of apiKey. @@ -357,7 +491,9 @@ def get_api_key_with_prefix(self, identifier, alias=None): else: return key - def get_basic_auth_token(self): + return None + + def get_basic_auth_token(self) -> Optional[str]: """Gets HTTP basic authentication header (string). :return: The token for basic HTTP authentication. @@ -372,12 +508,12 @@ def get_basic_auth_token(self): basic_auth=username + ':' + password ).get('authorization') - def auth_settings(self): + def auth_settings(self)-> AuthSettings: """Gets Auth Settings dict for api client. :return: The Auth Settings information dict. """ - auth = {} + auth: AuthSettings = {} if 'ApiKeyAuthentication' in self.api_key: auth['ApiKeyAuthentication'] = { 'type': 'api_key', @@ -403,7 +539,7 @@ def auth_settings(self): } return auth - def to_debug_report(self): + def to_debug_report(self) -> str: """Gets the essential information for debugging. :return: The report for debugging. @@ -412,10 +548,10 @@ def to_debug_report(self): "OS: {env}\n"\ "Python Version: {pyversion}\n"\ "Version of the API: 0.0.1\n"\ - "SDK Package Version: 0.1.6".\ + "SDK Package Version: 0.1.7".\ format(env=sys.platform, pyversion=sys.version) - def get_host_settings(self): + def get_host_settings(self) -> List[HostSetting]: """Gets an array of host settings :return: An array of host settings @@ -431,7 +567,12 @@ def get_host_settings(self): } ] - def get_host_from_settings(self, index, variables=None, servers=None): + def get_host_from_settings( + self, + index: Optional[int], + variables: Optional[ServerVariablesT]=None, + servers: Optional[List[HostSetting]]=None, + ) -> str: """Gets host URL based on the index and variables :param index: array index of the host settings :param variables: hash of variable and the corresponding value @@ -471,12 +612,12 @@ def get_host_from_settings(self, index, variables=None, servers=None): return url @property - def host(self): + def host(self) -> str: """Return generated host.""" return self.get_host_from_settings(self.server_index, variables=self.server_variables) @host.setter - def host(self, value): + def host(self, value: str) -> None: """Fix base path.""" self._base_path = value self.server_index = None diff --git a/plane/exceptions.py b/plane/exceptions.py index 143b1b8..054b70f 100644 --- a/plane/exceptions.py +++ b/plane/exceptions.py @@ -12,6 +12,8 @@ Do not edit the class manually. """ # noqa: E501 +from typing import Any, Optional +from typing_extensions import Self class OpenApiException(Exception): """The base exception class for all OpenAPIExceptions""" @@ -102,17 +104,63 @@ def __init__(self, msg, path_to_item=None) -> None: class ApiException(OpenApiException): - def __init__(self, status=None, reason=None, http_resp=None) -> None: + def __init__( + self, + status=None, + reason=None, + http_resp=None, + *, + body: Optional[str] = None, + data: Optional[Any] = None, + ) -> None: + self.status = status + self.reason = reason + self.body = body + self.data = data + self.headers = None + if http_resp: - self.status = http_resp.status - self.reason = http_resp.reason - self.body = http_resp.data + if self.status is None: + self.status = http_resp.status + if self.reason is None: + self.reason = http_resp.reason + if self.body is None: + try: + self.body = http_resp.data.decode('utf-8') + except Exception: + pass self.headers = http_resp.getheaders() - else: - self.status = status - self.reason = reason - self.body = None - self.headers = None + + @classmethod + def from_response( + cls, + *, + http_resp, + body: Optional[str], + data: Optional[Any], + ) -> Self: + if http_resp.status == 400: + raise BadRequestException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 401: + raise UnauthorizedException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 403: + raise ForbiddenException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 404: + raise NotFoundException(http_resp=http_resp, body=body, data=data) + + # Added new conditions for 409 and 422 + if http_resp.status == 409: + raise ConflictException(http_resp=http_resp, body=body, data=data) + + if http_resp.status == 422: + raise UnprocessableEntityException(http_resp=http_resp, body=body, data=data) + + if 500 <= http_resp.status <= 599: + raise ServiceException(http_resp=http_resp, body=body, data=data) + raise ApiException(http_resp=http_resp, body=body, data=data) def __str__(self): """Custom error messages for exception""" @@ -122,38 +170,40 @@ def __str__(self): error_message += "HTTP response headers: {0}\n".format( self.headers) - if self.body: - error_message += "HTTP response body: {0}\n".format(self.body) + if self.data or self.body: + error_message += "HTTP response body: {0}\n".format(self.data or self.body) return error_message + class BadRequestException(ApiException): + pass - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(BadRequestException, self).__init__(status, reason, http_resp) class NotFoundException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(NotFoundException, self).__init__(status, reason, http_resp) + pass class UnauthorizedException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(UnauthorizedException, self).__init__(status, reason, http_resp) + pass class ForbiddenException(ApiException): - - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(ForbiddenException, self).__init__(status, reason, http_resp) + pass class ServiceException(ApiException): + pass + + +class ConflictException(ApiException): + """Exception for HTTP 409 Conflict.""" + pass + - def __init__(self, status=None, reason=None, http_resp=None) -> None: - super(ServiceException, self).__init__(status, reason, http_resp) +class UnprocessableEntityException(ApiException): + """Exception for HTTP 422 Unprocessable Entity.""" + pass def render_path(path_to_item): diff --git a/plane/models/access_enum.py b/plane/models/access_enum.py index 72eab26..780ba2c 100644 --- a/plane/models/access_enum.py +++ b/plane/models/access_enum.py @@ -13,12 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import re # noqa: F401 -from aenum import Enum - - - +from enum import Enum +from typing_extensions import Self class AccessEnum(str, Enum): @@ -33,8 +31,8 @@ class AccessEnum(str, Enum): EXTERNAL = 'EXTERNAL' @classmethod - def from_json(cls, json_str: str) -> AccessEnum: # noqa: F821 + def from_json(cls, json_str: str) -> Self: """Create an instance of AccessEnum from a JSON string""" - return AccessEnum(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/plane/models/cycle.py b/plane/models/cycle.py index ba8d96c..d13c526 100644 --- a/plane/models/cycle.py +++ b/plane/models/cycle.py @@ -19,14 +19,17 @@ import json from datetime import datetime -from typing import Any, Optional, Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, conint, constr +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated from plane.models.timezone_enum import TimezoneEnum +from typing import Set +from typing_extensions import Self class Cycle(BaseModel): """ - Cycle serializer with comprehensive project metrics and time tracking. Provides cycle details including work item counts by status, progress estimates, and time-bound iteration data for project management and sprint planning. # noqa: E501 - """ + Cycle serializer with comprehensive project metrics and time tracking. Provides cycle details including work item counts by status, progress estimates, and time-bound iteration data for project management and sprint planning. + """ # noqa: E501 id: Optional[StrictStr] = None total_issues: Optional[StrictInt] = None cancelled_issues: Optional[StrictInt] = None @@ -40,135 +43,168 @@ class Cycle(BaseModel): created_at: Optional[datetime] = None updated_at: Optional[datetime] = None deleted_at: Optional[datetime] = None - name: constr(strict=True, max_length=255) = Field(...) + name: Annotated[str, Field(strict=True, max_length=255)] description: Optional[StrictStr] = None start_date: Optional[datetime] = None end_date: Optional[datetime] = None view_props: Optional[Any] = None sort_order: Optional[Union[StrictFloat, StrictInt]] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None progress_snapshot: Optional[Any] = None archived_at: Optional[datetime] = None logo_props: Optional[Any] = None timezone: Optional[TimezoneEnum] = None - version: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None + version: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None created_by: Optional[StrictStr] = None updated_by: Optional[StrictStr] = None project: Optional[StrictStr] = None workspace: Optional[StrictStr] = None owned_by: Optional[StrictStr] = None - __properties = ["id", "total_issues", "cancelled_issues", "completed_issues", "started_issues", "unstarted_issues", "backlog_issues", "total_estimates", "completed_estimates", "started_estimates", "created_at", "updated_at", "deleted_at", "name", "description", "start_date", "end_date", "view_props", "sort_order", "external_source", "external_id", "progress_snapshot", "archived_at", "logo_props", "timezone", "version", "created_by", "updated_by", "project", "workspace", "owned_by"] + __properties: ClassVar[List[str]] = ["id", "total_issues", "cancelled_issues", "completed_issues", "started_issues", "unstarted_issues", "backlog_issues", "total_estimates", "completed_estimates", "started_estimates", "created_at", "updated_at", "deleted_at", "name", "description", "start_date", "end_date", "view_props", "sort_order", "external_source", "external_id", "progress_snapshot", "archived_at", "logo_props", "timezone", "version", "created_by", "updated_by", "project", "workspace", "owned_by"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Cycle: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Cycle from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "total_issues", - "cancelled_issues", - "completed_issues", - "started_issues", - "unstarted_issues", - "backlog_issues", - "total_estimates", - "completed_estimates", - "started_estimates", - "created_at", - "updated_at", - "deleted_at", - "created_by", - "updated_by", - "project", - "workspace", - "owned_by", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "total_issues", + "cancelled_issues", + "completed_issues", + "started_issues", + "unstarted_issues", + "backlog_issues", + "total_estimates", + "completed_estimates", + "started_estimates", + "created_at", + "updated_at", + "deleted_at", + "created_by", + "updated_by", + "project", + "workspace", + "owned_by", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if deleted_at (nullable) is None - # and __fields_set__ contains the field - if self.deleted_at is None and "deleted_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.deleted_at is None and "deleted_at" in self.model_fields_set: _dict['deleted_at'] = None # set to None if start_date (nullable) is None - # and __fields_set__ contains the field - if self.start_date is None and "start_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.start_date is None and "start_date" in self.model_fields_set: _dict['start_date'] = None # set to None if end_date (nullable) is None - # and __fields_set__ contains the field - if self.end_date is None and "end_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.end_date is None and "end_date" in self.model_fields_set: _dict['end_date'] = None # set to None if view_props (nullable) is None - # and __fields_set__ contains the field - if self.view_props is None and "view_props" in self.__fields_set__: + # and model_fields_set contains the field + if self.view_props is None and "view_props" in self.model_fields_set: _dict['view_props'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if progress_snapshot (nullable) is None - # and __fields_set__ contains the field - if self.progress_snapshot is None and "progress_snapshot" in self.__fields_set__: + # and model_fields_set contains the field + if self.progress_snapshot is None and "progress_snapshot" in self.model_fields_set: _dict['progress_snapshot'] = None # set to None if archived_at (nullable) is None - # and __fields_set__ contains the field - if self.archived_at is None and "archived_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.archived_at is None and "archived_at" in self.model_fields_set: _dict['archived_at'] = None # set to None if logo_props (nullable) is None - # and __fields_set__ contains the field - if self.logo_props is None and "logo_props" in self.__fields_set__: + # and model_fields_set contains the field + if self.logo_props is None and "logo_props" in self.model_fields_set: _dict['logo_props'] = None # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if updated_by (nullable) is None - # and __fields_set__ contains the field - if self.updated_by is None and "updated_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: _dict['updated_by'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Cycle: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Cycle from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Cycle.parse_obj(obj) + return cls.model_validate(obj) - _obj = Cycle.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "total_issues": obj.get("total_issues"), "cancelled_issues": obj.get("cancelled_issues"), diff --git a/plane/models/cycle_create_request.py b/plane/models/cycle_create_request.py index 9e41e87..f39eac2 100644 --- a/plane/models/cycle_create_request.py +++ b/plane/models/cycle_create_request.py @@ -19,80 +19,98 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from plane.models.timezone_enum import TimezoneEnum +from typing import Set +from typing_extensions import Self class CycleCreateRequest(BaseModel): """ - Serializer for creating cycles with timezone handling and date validation. Manages cycle creation including project timezone conversion, date range validation, and UTC normalization for time-bound iteration planning and sprint management. # noqa: E501 - """ - name: constr(strict=True, max_length=255, min_length=1) = Field(...) + Serializer for creating cycles with timezone handling and date validation. Manages cycle creation including project timezone conversion, date range validation, and UTC normalization for time-bound iteration planning and sprint management. + """ # noqa: E501 + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] description: Optional[StrictStr] = None start_date: Optional[datetime] = None end_date: Optional[datetime] = None - owned_by: StrictStr = Field(...) - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + owned_by: StrictStr + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None timezone: Optional[TimezoneEnum] = None - __properties = ["name", "description", "start_date", "end_date", "owned_by", "external_source", "external_id", "timezone"] + __properties: ClassVar[List[str]] = ["name", "description", "start_date", "end_date", "owned_by", "external_source", "external_id", "timezone"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> CycleCreateRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of CycleCreateRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if start_date (nullable) is None - # and __fields_set__ contains the field - if self.start_date is None and "start_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.start_date is None and "start_date" in self.model_fields_set: _dict['start_date'] = None # set to None if end_date (nullable) is None - # and __fields_set__ contains the field - if self.end_date is None and "end_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.end_date is None and "end_date" in self.model_fields_set: _dict['end_date'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> CycleCreateRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of CycleCreateRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return CycleCreateRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = CycleCreateRequest.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description"), "start_date": obj.get("start_date"), diff --git a/plane/models/cycle_issue.py b/plane/models/cycle_issue.py index 7be8b3f..bd60349 100644 --- a/plane/models/cycle_issue.py +++ b/plane/models/cycle_issue.py @@ -19,84 +19,108 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Set +from typing_extensions import Self class CycleIssue(BaseModel): """ - Serializer for cycle-issue relationships with sub-issue counting. Manages the association between cycles and work items, including hierarchical issue tracking for nested work item structures. # noqa: E501 - """ + Serializer for cycle-issue relationships with sub-issue counting. Manages the association between cycles and work items, including hierarchical issue tracking for nested work item structures. + """ # noqa: E501 id: Optional[StrictStr] = None sub_issues_count: Optional[StrictInt] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None - deleted_at: Optional[datetime] = Field(...) + deleted_at: Optional[datetime] created_by: Optional[StrictStr] = None updated_by: Optional[StrictStr] = None project: Optional[StrictStr] = None workspace: Optional[StrictStr] = None - issue: StrictStr = Field(...) + issue: StrictStr cycle: Optional[StrictStr] = None - __properties = ["id", "sub_issues_count", "created_at", "updated_at", "deleted_at", "created_by", "updated_by", "project", "workspace", "issue", "cycle"] + __properties: ClassVar[List[str]] = ["id", "sub_issues_count", "created_at", "updated_at", "deleted_at", "created_by", "updated_by", "project", "workspace", "issue", "cycle"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> CycleIssue: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of CycleIssue from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "sub_issues_count", - "created_at", - "updated_at", - "project", - "workspace", - "cycle", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "sub_issues_count", + "created_at", + "updated_at", + "project", + "workspace", + "cycle", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if deleted_at (nullable) is None - # and __fields_set__ contains the field - if self.deleted_at is None and "deleted_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.deleted_at is None and "deleted_at" in self.model_fields_set: _dict['deleted_at'] = None # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if updated_by (nullable) is None - # and __fields_set__ contains the field - if self.updated_by is None and "updated_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: _dict['updated_by'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> CycleIssue: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of CycleIssue from a dict""" if obj is None: return None if not isinstance(obj, dict): - return CycleIssue.parse_obj(obj) + return cls.model_validate(obj) - _obj = CycleIssue.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "sub_issues_count": obj.get("sub_issues_count"), "created_at": obj.get("created_at"), diff --git a/plane/models/cycle_issue_request_request.py b/plane/models/cycle_issue_request_request.py index 50c9357..56c740c 100644 --- a/plane/models/cycle_issue_request_request.py +++ b/plane/models/cycle_issue_request_request.py @@ -18,52 +18,69 @@ import re # noqa: F401 import json - -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class CycleIssueRequestRequest(BaseModel): """ - Serializer for bulk work item assignment to cycles. Validates work item ID lists for batch operations including cycle assignment and sprint planning workflows. # noqa: E501 - """ - issues: conlist(StrictStr) = Field(default=..., description="List of issue IDs to add to the cycle") - __properties = ["issues"] + Serializer for bulk work item assignment to cycles. Validates work item ID lists for batch operations including cycle assignment and sprint planning workflows. + """ # noqa: E501 + issues: List[StrictStr] = Field(description="List of issue IDs to add to the cycle") + __properties: ClassVar[List[str]] = ["issues"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> CycleIssueRequestRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of CycleIssueRequestRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> CycleIssueRequestRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of CycleIssueRequestRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return CycleIssueRequestRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = CycleIssueRequestRequest.parse_obj({ + _obj = cls.model_validate({ "issues": obj.get("issues") }) return _obj diff --git a/plane/models/cycle_lite.py b/plane/models/cycle_lite.py index af16865..fcab522 100644 --- a/plane/models/cycle_lite.py +++ b/plane/models/cycle_lite.py @@ -19,132 +19,153 @@ import json from datetime import datetime -from typing import Any, Optional, Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, conint, constr +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated from plane.models.timezone_enum import TimezoneEnum +from typing import Set +from typing_extensions import Self class CycleLite(BaseModel): """ - Lightweight cycle serializer for minimal data transfer. Provides essential cycle information without computed metrics, optimized for list views and reference lookups. # noqa: E501 - """ + Lightweight cycle serializer for minimal data transfer. Provides essential cycle information without computed metrics, optimized for list views and reference lookups. + """ # noqa: E501 id: Optional[StrictStr] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None deleted_at: Optional[datetime] = None - name: constr(strict=True, max_length=255) = Field(...) + name: Annotated[str, Field(strict=True, max_length=255)] description: Optional[StrictStr] = None start_date: Optional[datetime] = None end_date: Optional[datetime] = None view_props: Optional[Any] = None sort_order: Optional[Union[StrictFloat, StrictInt]] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None progress_snapshot: Optional[Any] = None archived_at: Optional[datetime] = None logo_props: Optional[Any] = None timezone: Optional[TimezoneEnum] = None - version: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None + version: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None created_by: Optional[StrictStr] = None updated_by: Optional[StrictStr] = None - project: StrictStr = Field(...) - workspace: StrictStr = Field(...) - owned_by: StrictStr = Field(...) - __properties = ["id", "created_at", "updated_at", "deleted_at", "name", "description", "start_date", "end_date", "view_props", "sort_order", "external_source", "external_id", "progress_snapshot", "archived_at", "logo_props", "timezone", "version", "created_by", "updated_by", "project", "workspace", "owned_by"] + project: StrictStr + workspace: StrictStr + owned_by: StrictStr + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "deleted_at", "name", "description", "start_date", "end_date", "view_props", "sort_order", "external_source", "external_id", "progress_snapshot", "archived_at", "logo_props", "timezone", "version", "created_by", "updated_by", "project", "workspace", "owned_by"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> CycleLite: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of CycleLite from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "created_at", - "updated_at", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "created_at", + "updated_at", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if deleted_at (nullable) is None - # and __fields_set__ contains the field - if self.deleted_at is None and "deleted_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.deleted_at is None and "deleted_at" in self.model_fields_set: _dict['deleted_at'] = None # set to None if start_date (nullable) is None - # and __fields_set__ contains the field - if self.start_date is None and "start_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.start_date is None and "start_date" in self.model_fields_set: _dict['start_date'] = None # set to None if end_date (nullable) is None - # and __fields_set__ contains the field - if self.end_date is None and "end_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.end_date is None and "end_date" in self.model_fields_set: _dict['end_date'] = None # set to None if view_props (nullable) is None - # and __fields_set__ contains the field - if self.view_props is None and "view_props" in self.__fields_set__: + # and model_fields_set contains the field + if self.view_props is None and "view_props" in self.model_fields_set: _dict['view_props'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if progress_snapshot (nullable) is None - # and __fields_set__ contains the field - if self.progress_snapshot is None and "progress_snapshot" in self.__fields_set__: + # and model_fields_set contains the field + if self.progress_snapshot is None and "progress_snapshot" in self.model_fields_set: _dict['progress_snapshot'] = None # set to None if archived_at (nullable) is None - # and __fields_set__ contains the field - if self.archived_at is None and "archived_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.archived_at is None and "archived_at" in self.model_fields_set: _dict['archived_at'] = None # set to None if logo_props (nullable) is None - # and __fields_set__ contains the field - if self.logo_props is None and "logo_props" in self.__fields_set__: + # and model_fields_set contains the field + if self.logo_props is None and "logo_props" in self.model_fields_set: _dict['logo_props'] = None # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if updated_by (nullable) is None - # and __fields_set__ contains the field - if self.updated_by is None and "updated_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: _dict['updated_by'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> CycleLite: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of CycleLite from a dict""" if obj is None: return None if not isinstance(obj, dict): - return CycleLite.parse_obj(obj) + return cls.model_validate(obj) - _obj = CycleLite.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), diff --git a/plane/models/entity_type_enum.py b/plane/models/entity_type_enum.py index 3667782..0332cc0 100644 --- a/plane/models/entity_type_enum.py +++ b/plane/models/entity_type_enum.py @@ -13,12 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import re # noqa: F401 -from aenum import Enum - - - +from enum import Enum +from typing_extensions import Self class EntityTypeEnum(str, Enum): @@ -33,8 +31,8 @@ class EntityTypeEnum(str, Enum): USER_COVER = 'USER_COVER' @classmethod - def from_json(cls, json_str: str) -> EntityTypeEnum: # noqa: F821 + def from_json(cls, json_str: str) -> Self: """Create an instance of EntityTypeEnum from a JSON string""" - return EntityTypeEnum(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/plane/models/generic_asset_upload_request.py b/plane/models/generic_asset_upload_request.py index 780ab89..b92605c 100644 --- a/plane/models/generic_asset_upload_request.py +++ b/plane/models/generic_asset_upload_request.py @@ -18,58 +18,75 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self class GenericAssetUploadRequest(BaseModel): """ - Serializer for generic asset upload requests with project association. Validates metadata for generating presigned URLs for workspace assets including project association, external system tracking, and file validation for document management and content storage workflows. # noqa: E501 - """ - name: constr(strict=True, min_length=1) = Field(default=..., description="Original filename of the asset") - type: Optional[constr(strict=True, min_length=1)] = Field(default=None, description="MIME type of the file") - size: StrictInt = Field(default=..., description="File size in bytes") + Serializer for generic asset upload requests with project association. Validates metadata for generating presigned URLs for workspace assets including project association, external system tracking, and file validation for document management and content storage workflows. + """ # noqa: E501 + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Original filename of the asset") + type: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="MIME type of the file") + size: StrictInt = Field(description="File size in bytes") project_id: Optional[StrictStr] = Field(default=None, description="UUID of the project to associate with the asset") - external_id: Optional[constr(strict=True, min_length=1)] = Field(default=None, description="External identifier for the asset (for integration tracking)") - external_source: Optional[constr(strict=True, min_length=1)] = Field(default=None, description="External source system (for integration tracking)") - __properties = ["name", "type", "size", "project_id", "external_id", "external_source"] + external_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="External identifier for the asset (for integration tracking)") + external_source: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="External source system (for integration tracking)") + __properties: ClassVar[List[str]] = ["name", "type", "size", "project_id", "external_id", "external_source"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> GenericAssetUploadRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of GenericAssetUploadRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> GenericAssetUploadRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of GenericAssetUploadRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return GenericAssetUploadRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = GenericAssetUploadRequest.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "type": obj.get("type"), "size": obj.get("size"), diff --git a/plane/models/get_workspace_members200_response_inner.py b/plane/models/get_workspace_members200_response_inner.py index c33036d..dfc33d7 100644 --- a/plane/models/get_workspace_members200_response_inner.py +++ b/plane/models/get_workspace_members200_response_inner.py @@ -18,14 +18,15 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Set +from typing_extensions import Self class GetWorkspaceMembers200ResponseInner(BaseModel): """ GetWorkspaceMembers200ResponseInner - """ + """ # noqa: E501 id: Optional[StrictStr] = None first_name: Optional[StrictStr] = None last_name: Optional[StrictStr] = None @@ -34,56 +35,78 @@ class GetWorkspaceMembers200ResponseInner(BaseModel): avatar_url: Optional[StrictStr] = Field(default=None, description="Avatar URL") display_name: Optional[StrictStr] = None role: Optional[StrictInt] = Field(default=None, description="Member role in the workspace") - __properties = ["id", "first_name", "last_name", "email", "avatar", "avatar_url", "display_name", "role"] + __properties: ClassVar[List[str]] = ["id", "first_name", "last_name", "email", "avatar", "avatar_url", "display_name", "role"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> GetWorkspaceMembers200ResponseInner: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of GetWorkspaceMembers200ResponseInner from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "first_name", - "last_name", - "email", - "avatar", - "avatar_url", - "display_name", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "first_name", + "last_name", + "email", + "avatar", + "avatar_url", + "display_name", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if email (nullable) is None - # and __fields_set__ contains the field - if self.email is None and "email" in self.__fields_set__: + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: _dict['email'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> GetWorkspaceMembers200ResponseInner: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of GetWorkspaceMembers200ResponseInner from a dict""" if obj is None: return None if not isinstance(obj, dict): - return GetWorkspaceMembers200ResponseInner.parse_obj(obj) + return cls.model_validate(obj) - _obj = GetWorkspaceMembers200ResponseInner.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "first_name": obj.get("first_name"), "last_name": obj.get("last_name"), diff --git a/plane/models/group_enum.py b/plane/models/group_enum.py index 909e14d..386278b 100644 --- a/plane/models/group_enum.py +++ b/plane/models/group_enum.py @@ -13,12 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import re # noqa: F401 -from aenum import Enum - - - +from enum import Enum +from typing_extensions import Self class GroupEnum(str, Enum): @@ -37,8 +35,8 @@ class GroupEnum(str, Enum): TRIAGE = 'triage' @classmethod - def from_json(cls, json_str: str) -> GroupEnum: # noqa: F821 + def from_json(cls, json_str: str) -> Self: """Create an instance of GroupEnum from a JSON string""" - return GroupEnum(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/plane/models/intake_issue.py b/plane/models/intake_issue.py index 47f4838..b828753 100644 --- a/plane/models/intake_issue.py +++ b/plane/models/intake_issue.py @@ -19,15 +19,18 @@ import json from datetime import datetime -from typing import Any, Optional -from pydantic import BaseModel, Field, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from plane.models.intake_work_item_status_enum import IntakeWorkItemStatusEnum from plane.models.issue_expand import IssueExpand +from typing import Set +from typing_extensions import Self class IntakeIssue(BaseModel): """ - Comprehensive serializer for intake work items with expanded issue details. Provides full intake work item data including embedded issue information, status tracking, and triage metadata for issue queue management. # noqa: E501 - """ + Comprehensive serializer for intake work items with expanded issue details. Provides full intake work item data including embedded issue information, status tracking, and triage metadata for issue queue management. + """ # noqa: E501 id: Optional[StrictStr] = None issue_detail: Optional[IssueExpand] = None inbox: Optional[StrictStr] = None @@ -36,121 +39,146 @@ class IntakeIssue(BaseModel): deleted_at: Optional[datetime] = None status: Optional[IntakeWorkItemStatusEnum] = None snoozed_till: Optional[datetime] = None - source: Optional[constr(strict=True, max_length=255)] = None + source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None source_email: Optional[StrictStr] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None extra: Optional[Any] = None created_by: Optional[StrictStr] = None updated_by: Optional[StrictStr] = None project: Optional[StrictStr] = None workspace: Optional[StrictStr] = None - intake: StrictStr = Field(...) + intake: StrictStr issue: Optional[StrictStr] = None duplicate_to: Optional[StrictStr] = None - __properties = ["id", "issue_detail", "inbox", "created_at", "updated_at", "deleted_at", "status", "snoozed_till", "source", "source_email", "external_source", "external_id", "extra", "created_by", "updated_by", "project", "workspace", "intake", "issue", "duplicate_to"] + __properties: ClassVar[List[str]] = ["id", "issue_detail", "inbox", "created_at", "updated_at", "deleted_at", "status", "snoozed_till", "source", "source_email", "external_source", "external_id", "extra", "created_by", "updated_by", "project", "workspace", "intake", "issue", "duplicate_to"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IntakeIssue: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IntakeIssue from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "issue_detail", - "inbox", - "created_at", - "updated_at", - "created_by", - "updated_by", - "project", - "workspace", - "issue", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "issue_detail", + "inbox", + "created_at", + "updated_at", + "created_by", + "updated_by", + "project", + "workspace", + "issue", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of issue_detail if self.issue_detail: _dict['issue_detail'] = self.issue_detail.to_dict() # set to None if deleted_at (nullable) is None - # and __fields_set__ contains the field - if self.deleted_at is None and "deleted_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.deleted_at is None and "deleted_at" in self.model_fields_set: _dict['deleted_at'] = None # set to None if snoozed_till (nullable) is None - # and __fields_set__ contains the field - if self.snoozed_till is None and "snoozed_till" in self.__fields_set__: + # and model_fields_set contains the field + if self.snoozed_till is None and "snoozed_till" in self.model_fields_set: _dict['snoozed_till'] = None # set to None if source (nullable) is None - # and __fields_set__ contains the field - if self.source is None and "source" in self.__fields_set__: + # and model_fields_set contains the field + if self.source is None and "source" in self.model_fields_set: _dict['source'] = None # set to None if source_email (nullable) is None - # and __fields_set__ contains the field - if self.source_email is None and "source_email" in self.__fields_set__: + # and model_fields_set contains the field + if self.source_email is None and "source_email" in self.model_fields_set: _dict['source_email'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if extra (nullable) is None - # and __fields_set__ contains the field - if self.extra is None and "extra" in self.__fields_set__: + # and model_fields_set contains the field + if self.extra is None and "extra" in self.model_fields_set: _dict['extra'] = None # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if updated_by (nullable) is None - # and __fields_set__ contains the field - if self.updated_by is None and "updated_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: _dict['updated_by'] = None # set to None if duplicate_to (nullable) is None - # and __fields_set__ contains the field - if self.duplicate_to is None and "duplicate_to" in self.__fields_set__: + # and model_fields_set contains the field + if self.duplicate_to is None and "duplicate_to" in self.model_fields_set: _dict['duplicate_to'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> IntakeIssue: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IntakeIssue from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IntakeIssue.parse_obj(obj) + return cls.model_validate(obj) - _obj = IntakeIssue.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), - "issue_detail": IssueExpand.from_dict(obj.get("issue_detail")) if obj.get("issue_detail") is not None else None, + "issue_detail": IssueExpand.from_dict(obj["issue_detail"]) if obj.get("issue_detail") is not None else None, "inbox": obj.get("inbox"), "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), diff --git a/plane/models/intake_issue_create_request.py b/plane/models/intake_issue_create_request.py index 6e0c124..f8357e9 100644 --- a/plane/models/intake_issue_create_request.py +++ b/plane/models/intake_issue_create_request.py @@ -19,84 +19,102 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from plane.models.intake_work_item_status_enum import IntakeWorkItemStatusEnum from plane.models.issue_for_intake_request import IssueForIntakeRequest +from typing import Set +from typing_extensions import Self class IntakeIssueCreateRequest(BaseModel): """ - Serializer for creating intake work items with embedded issue data. Manages intake work item creation including nested issue creation, status assignment, and source tracking for issue queue management. # noqa: E501 - """ - issue: IssueForIntakeRequest = Field(default=..., description="Issue data for the intake issue") - intake: StrictStr = Field(...) + Serializer for creating intake work items with embedded issue data. Manages intake work item creation including nested issue creation, status assignment, and source tracking for issue queue management. + """ # noqa: E501 + issue: IssueForIntakeRequest = Field(description="Issue data for the intake issue") + intake: StrictStr status: Optional[IntakeWorkItemStatusEnum] = None snoozed_till: Optional[datetime] = None duplicate_to: Optional[StrictStr] = None - source: Optional[constr(strict=True, max_length=255)] = None + source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None source_email: Optional[StrictStr] = None - __properties = ["issue", "intake", "status", "snoozed_till", "duplicate_to", "source", "source_email"] + __properties: ClassVar[List[str]] = ["issue", "intake", "status", "snoozed_till", "duplicate_to", "source", "source_email"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IntakeIssueCreateRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IntakeIssueCreateRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of issue if self.issue: _dict['issue'] = self.issue.to_dict() # set to None if snoozed_till (nullable) is None - # and __fields_set__ contains the field - if self.snoozed_till is None and "snoozed_till" in self.__fields_set__: + # and model_fields_set contains the field + if self.snoozed_till is None and "snoozed_till" in self.model_fields_set: _dict['snoozed_till'] = None # set to None if duplicate_to (nullable) is None - # and __fields_set__ contains the field - if self.duplicate_to is None and "duplicate_to" in self.__fields_set__: + # and model_fields_set contains the field + if self.duplicate_to is None and "duplicate_to" in self.model_fields_set: _dict['duplicate_to'] = None # set to None if source (nullable) is None - # and __fields_set__ contains the field - if self.source is None and "source" in self.__fields_set__: + # and model_fields_set contains the field + if self.source is None and "source" in self.model_fields_set: _dict['source'] = None # set to None if source_email (nullable) is None - # and __fields_set__ contains the field - if self.source_email is None and "source_email" in self.__fields_set__: + # and model_fields_set contains the field + if self.source_email is None and "source_email" in self.model_fields_set: _dict['source_email'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> IntakeIssueCreateRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IntakeIssueCreateRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IntakeIssueCreateRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = IntakeIssueCreateRequest.parse_obj({ - "issue": IssueForIntakeRequest.from_dict(obj.get("issue")) if obj.get("issue") is not None else None, + _obj = cls.model_validate({ + "issue": IssueForIntakeRequest.from_dict(obj["issue"]) if obj.get("issue") is not None else None, "intake": obj.get("intake"), "status": obj.get("status"), "snoozed_till": obj.get("snoozed_till"), diff --git a/plane/models/intake_work_item_status_enum.py b/plane/models/intake_work_item_status_enum.py index 4e161ab..5d4b9e1 100644 --- a/plane/models/intake_work_item_status_enum.py +++ b/plane/models/intake_work_item_status_enum.py @@ -13,12 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import re # noqa: F401 -from aenum import Enum - - - +from enum import Enum +from typing_extensions import Self class IntakeWorkItemStatusEnum(int, Enum): @@ -36,8 +34,8 @@ class IntakeWorkItemStatusEnum(int, Enum): NUMBER_2 = 2 @classmethod - def from_json(cls, json_str: str) -> IntakeWorkItemStatusEnum: # noqa: F821 + def from_json(cls, json_str: str) -> Self: """Create an instance of IntakeWorkItemStatusEnum from a JSON string""" - return IntakeWorkItemStatusEnum(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/plane/models/issue.py b/plane/models/issue.py index 31e45f6..8702503 100644 --- a/plane/models/issue.py +++ b/plane/models/issue.py @@ -19,34 +19,37 @@ import json from datetime import date, datetime -from typing import Optional, Union -from pydantic import BaseModel, Field, StrictBool, StrictBytes, StrictFloat, StrictInt, StrictStr, conint, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated from plane.models.priority_enum import PriorityEnum +from typing import Set +from typing_extensions import Self class Issue(BaseModel): """ - Comprehensive work item serializer with full relationship management. Handles complete work item lifecycle including assignees, labels, validation, and related model updates. Supports dynamic field expansion and HTML content processing. # noqa: E501 - """ + Comprehensive work item serializer with full relationship management. Handles complete work item lifecycle including assignees, labels, validation, and related model updates. Supports dynamic field expansion and HTML content processing. + """ # noqa: E501 id: Optional[StrictStr] = None type_id: Optional[StrictStr] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None deleted_at: Optional[datetime] = None - point: Optional[conint(strict=True, le=12, ge=0)] = None - name: constr(strict=True, max_length=255) = Field(...) + point: Optional[Annotated[int, Field(le=12, strict=True, ge=0)]] = None + name: Annotated[str, Field(strict=True, max_length=255)] description_html: Optional[StrictStr] = None description_stripped: Optional[StrictStr] = None description_binary: Optional[Union[StrictBytes, StrictStr]] = None priority: Optional[PriorityEnum] = None start_date: Optional[date] = None target_date: Optional[date] = None - sequence_id: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None + sequence_id: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None sort_order: Optional[Union[StrictFloat, StrictInt]] = None completed_at: Optional[datetime] = None archived_at: Optional[date] = None is_draft: Optional[StrictBool] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None created_by: Optional[StrictStr] = None updated_by: Optional[StrictStr] = None project: Optional[StrictStr] = None @@ -55,136 +58,158 @@ class Issue(BaseModel): state: Optional[StrictStr] = None estimate_point: Optional[StrictStr] = None type: Optional[StrictStr] = None - __properties = ["id", "type_id", "created_at", "updated_at", "deleted_at", "point", "name", "description_html", "description_stripped", "description_binary", "priority", "start_date", "target_date", "sequence_id", "sort_order", "completed_at", "archived_at", "is_draft", "external_source", "external_id", "created_by", "updated_by", "project", "workspace", "parent", "state", "estimate_point", "type"] + __properties: ClassVar[List[str]] = ["id", "type_id", "created_at", "updated_at", "deleted_at", "point", "name", "description_html", "description_stripped", "description_binary", "priority", "start_date", "target_date", "sequence_id", "sort_order", "completed_at", "archived_at", "is_draft", "external_source", "external_id", "created_by", "updated_by", "project", "workspace", "parent", "state", "estimate_point", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Issue: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Issue from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "created_at", - "updated_at", - "description_binary", - "updated_by", - "project", - "workspace", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "created_at", + "updated_at", + "description_binary", + "updated_by", + "project", + "workspace", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if type_id (nullable) is None - # and __fields_set__ contains the field - if self.type_id is None and "type_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.type_id is None and "type_id" in self.model_fields_set: _dict['type_id'] = None # set to None if deleted_at (nullable) is None - # and __fields_set__ contains the field - if self.deleted_at is None and "deleted_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.deleted_at is None and "deleted_at" in self.model_fields_set: _dict['deleted_at'] = None # set to None if point (nullable) is None - # and __fields_set__ contains the field - if self.point is None and "point" in self.__fields_set__: + # and model_fields_set contains the field + if self.point is None and "point" in self.model_fields_set: _dict['point'] = None # set to None if description_stripped (nullable) is None - # and __fields_set__ contains the field - if self.description_stripped is None and "description_stripped" in self.__fields_set__: + # and model_fields_set contains the field + if self.description_stripped is None and "description_stripped" in self.model_fields_set: _dict['description_stripped'] = None # set to None if description_binary (nullable) is None - # and __fields_set__ contains the field - if self.description_binary is None and "description_binary" in self.__fields_set__: + # and model_fields_set contains the field + if self.description_binary is None and "description_binary" in self.model_fields_set: _dict['description_binary'] = None # set to None if start_date (nullable) is None - # and __fields_set__ contains the field - if self.start_date is None and "start_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.start_date is None and "start_date" in self.model_fields_set: _dict['start_date'] = None # set to None if target_date (nullable) is None - # and __fields_set__ contains the field - if self.target_date is None and "target_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.target_date is None and "target_date" in self.model_fields_set: _dict['target_date'] = None # set to None if completed_at (nullable) is None - # and __fields_set__ contains the field - if self.completed_at is None and "completed_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.completed_at is None and "completed_at" in self.model_fields_set: _dict['completed_at'] = None # set to None if archived_at (nullable) is None - # and __fields_set__ contains the field - if self.archived_at is None and "archived_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.archived_at is None and "archived_at" in self.model_fields_set: _dict['archived_at'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if updated_by (nullable) is None - # and __fields_set__ contains the field - if self.updated_by is None and "updated_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: _dict['updated_by'] = None # set to None if parent (nullable) is None - # and __fields_set__ contains the field - if self.parent is None and "parent" in self.__fields_set__: + # and model_fields_set contains the field + if self.parent is None and "parent" in self.model_fields_set: _dict['parent'] = None # set to None if state (nullable) is None - # and __fields_set__ contains the field - if self.state is None and "state" in self.__fields_set__: + # and model_fields_set contains the field + if self.state is None and "state" in self.model_fields_set: _dict['state'] = None # set to None if estimate_point (nullable) is None - # and __fields_set__ contains the field - if self.estimate_point is None and "estimate_point" in self.__fields_set__: + # and model_fields_set contains the field + if self.estimate_point is None and "estimate_point" in self.model_fields_set: _dict['estimate_point'] = None # set to None if type (nullable) is None - # and __fields_set__ contains the field - if self.type is None and "type" in self.__fields_set__: + # and model_fields_set contains the field + if self.type is None and "type" in self.model_fields_set: _dict['type'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Issue: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Issue from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Issue.parse_obj(obj) + return cls.model_validate(obj) - _obj = Issue.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "type_id": obj.get("type_id"), "created_at": obj.get("created_at"), diff --git a/plane/models/issue_activity.py b/plane/models/issue_activity.py index c6d488f..80eeb90 100644 --- a/plane/models/issue_activity.py +++ b/plane/models/issue_activity.py @@ -19,122 +19,143 @@ import json from datetime import datetime -from typing import Optional, Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, conlist, constr +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self class IssueActivity(BaseModel): """ - Serializer for work item activity and change history. Tracks and represents work item modifications, state changes, and user interactions for audit trails and activity feeds. # noqa: E501 - """ + Serializer for work item activity and change history. Tracks and represents work item modifications, state changes, and user interactions for audit trails and activity feeds. + """ # noqa: E501 id: Optional[StrictStr] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None deleted_at: Optional[datetime] = None - verb: Optional[constr(strict=True, max_length=255)] = None - field: Optional[constr(strict=True, max_length=255)] = None + verb: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + var_field: Optional[Annotated[str, Field(strict=True, max_length=255)]] = Field(default=None, alias="field") old_value: Optional[StrictStr] = None new_value: Optional[StrictStr] = None comment: Optional[StrictStr] = None - attachments: Optional[conlist(constr(strict=True, max_length=200), max_items=10)] = None + attachments: Optional[Annotated[List[Annotated[str, Field(strict=True, max_length=200)]], Field(max_length=10)]] = None old_identifier: Optional[StrictStr] = None new_identifier: Optional[StrictStr] = None epoch: Optional[Union[StrictFloat, StrictInt]] = None - project: StrictStr = Field(...) - workspace: StrictStr = Field(...) + project: StrictStr + workspace: StrictStr issue: Optional[StrictStr] = None issue_comment: Optional[StrictStr] = None actor: Optional[StrictStr] = None - __properties = ["id", "created_at", "updated_at", "deleted_at", "verb", "field", "old_value", "new_value", "comment", "attachments", "old_identifier", "new_identifier", "epoch", "project", "workspace", "issue", "issue_comment", "actor"] + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "deleted_at", "verb", "field", "old_value", "new_value", "comment", "attachments", "old_identifier", "new_identifier", "epoch", "project", "workspace", "issue", "issue_comment", "actor"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssueActivity: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssueActivity from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "created_at", - "updated_at", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "created_at", + "updated_at", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if deleted_at (nullable) is None - # and __fields_set__ contains the field - if self.deleted_at is None and "deleted_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.deleted_at is None and "deleted_at" in self.model_fields_set: _dict['deleted_at'] = None - # set to None if field (nullable) is None - # and __fields_set__ contains the field - if self.field is None and "field" in self.__fields_set__: + # set to None if var_field (nullable) is None + # and model_fields_set contains the field + if self.var_field is None and "var_field" in self.model_fields_set: _dict['field'] = None # set to None if old_value (nullable) is None - # and __fields_set__ contains the field - if self.old_value is None and "old_value" in self.__fields_set__: + # and model_fields_set contains the field + if self.old_value is None and "old_value" in self.model_fields_set: _dict['old_value'] = None # set to None if new_value (nullable) is None - # and __fields_set__ contains the field - if self.new_value is None and "new_value" in self.__fields_set__: + # and model_fields_set contains the field + if self.new_value is None and "new_value" in self.model_fields_set: _dict['new_value'] = None # set to None if old_identifier (nullable) is None - # and __fields_set__ contains the field - if self.old_identifier is None and "old_identifier" in self.__fields_set__: + # and model_fields_set contains the field + if self.old_identifier is None and "old_identifier" in self.model_fields_set: _dict['old_identifier'] = None # set to None if new_identifier (nullable) is None - # and __fields_set__ contains the field - if self.new_identifier is None and "new_identifier" in self.__fields_set__: + # and model_fields_set contains the field + if self.new_identifier is None and "new_identifier" in self.model_fields_set: _dict['new_identifier'] = None # set to None if epoch (nullable) is None - # and __fields_set__ contains the field - if self.epoch is None and "epoch" in self.__fields_set__: + # and model_fields_set contains the field + if self.epoch is None and "epoch" in self.model_fields_set: _dict['epoch'] = None # set to None if issue (nullable) is None - # and __fields_set__ contains the field - if self.issue is None and "issue" in self.__fields_set__: + # and model_fields_set contains the field + if self.issue is None and "issue" in self.model_fields_set: _dict['issue'] = None # set to None if issue_comment (nullable) is None - # and __fields_set__ contains the field - if self.issue_comment is None and "issue_comment" in self.__fields_set__: + # and model_fields_set contains the field + if self.issue_comment is None and "issue_comment" in self.model_fields_set: _dict['issue_comment'] = None # set to None if actor (nullable) is None - # and __fields_set__ contains the field - if self.actor is None and "actor" in self.__fields_set__: + # and model_fields_set contains the field + if self.actor is None and "actor" in self.model_fields_set: _dict['actor'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> IssueActivity: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssueActivity from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssueActivity.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssueActivity.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), diff --git a/plane/models/issue_attachment.py b/plane/models/issue_attachment.py index ad024e4..3544594 100644 --- a/plane/models/issue_attachment.py +++ b/plane/models/issue_attachment.py @@ -19,25 +19,28 @@ import json from datetime import datetime -from typing import Any, Optional, Union -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self class IssueAttachment(BaseModel): """ - Serializer for work item file attachments. Manages file asset associations with work items including metadata, storage information, and access control for document management. # noqa: E501 - """ + Serializer for work item file attachments. Manages file asset associations with work items including metadata, storage information, and access control for document management. + """ # noqa: E501 id: Optional[StrictStr] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None deleted_at: Optional[datetime] = None attributes: Optional[Any] = None - asset: StrictStr = Field(...) - entity_type: Optional[constr(strict=True, max_length=255)] = None - entity_identifier: Optional[constr(strict=True, max_length=255)] = None + asset: StrictStr + entity_type: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + entity_identifier: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None is_deleted: Optional[StrictBool] = None is_archived: Optional[StrictBool] = None - external_id: Optional[constr(strict=True, max_length=255)] = None - external_source: Optional[constr(strict=True, max_length=255)] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None size: Optional[Union[StrictFloat, StrictInt]] = None is_uploaded: Optional[StrictBool] = None storage_metadata: Optional[Any] = None @@ -50,131 +53,153 @@ class IssueAttachment(BaseModel): issue: Optional[StrictStr] = None comment: Optional[StrictStr] = None page: Optional[StrictStr] = None - __properties = ["id", "created_at", "updated_at", "deleted_at", "attributes", "asset", "entity_type", "entity_identifier", "is_deleted", "is_archived", "external_id", "external_source", "size", "is_uploaded", "storage_metadata", "created_by", "updated_by", "user", "workspace", "draft_issue", "project", "issue", "comment", "page"] + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "deleted_at", "attributes", "asset", "entity_type", "entity_identifier", "is_deleted", "is_archived", "external_id", "external_source", "size", "is_uploaded", "storage_metadata", "created_by", "updated_by", "user", "workspace", "draft_issue", "project", "issue", "comment", "page"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssueAttachment: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssueAttachment from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "created_at", - "updated_at", - "updated_by", - "workspace", - "project", - "issue", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "created_at", + "updated_at", + "updated_by", + "workspace", + "project", + "issue", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if deleted_at (nullable) is None - # and __fields_set__ contains the field - if self.deleted_at is None and "deleted_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.deleted_at is None and "deleted_at" in self.model_fields_set: _dict['deleted_at'] = None # set to None if attributes (nullable) is None - # and __fields_set__ contains the field - if self.attributes is None and "attributes" in self.__fields_set__: + # and model_fields_set contains the field + if self.attributes is None and "attributes" in self.model_fields_set: _dict['attributes'] = None # set to None if entity_type (nullable) is None - # and __fields_set__ contains the field - if self.entity_type is None and "entity_type" in self.__fields_set__: + # and model_fields_set contains the field + if self.entity_type is None and "entity_type" in self.model_fields_set: _dict['entity_type'] = None # set to None if entity_identifier (nullable) is None - # and __fields_set__ contains the field - if self.entity_identifier is None and "entity_identifier" in self.__fields_set__: + # and model_fields_set contains the field + if self.entity_identifier is None and "entity_identifier" in self.model_fields_set: _dict['entity_identifier'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if storage_metadata (nullable) is None - # and __fields_set__ contains the field - if self.storage_metadata is None and "storage_metadata" in self.__fields_set__: + # and model_fields_set contains the field + if self.storage_metadata is None and "storage_metadata" in self.model_fields_set: _dict['storage_metadata'] = None # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if updated_by (nullable) is None - # and __fields_set__ contains the field - if self.updated_by is None and "updated_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: _dict['updated_by'] = None # set to None if user (nullable) is None - # and __fields_set__ contains the field - if self.user is None and "user" in self.__fields_set__: + # and model_fields_set contains the field + if self.user is None and "user" in self.model_fields_set: _dict['user'] = None # set to None if workspace (nullable) is None - # and __fields_set__ contains the field - if self.workspace is None and "workspace" in self.__fields_set__: + # and model_fields_set contains the field + if self.workspace is None and "workspace" in self.model_fields_set: _dict['workspace'] = None # set to None if draft_issue (nullable) is None - # and __fields_set__ contains the field - if self.draft_issue is None and "draft_issue" in self.__fields_set__: + # and model_fields_set contains the field + if self.draft_issue is None and "draft_issue" in self.model_fields_set: _dict['draft_issue'] = None # set to None if project (nullable) is None - # and __fields_set__ contains the field - if self.project is None and "project" in self.__fields_set__: + # and model_fields_set contains the field + if self.project is None and "project" in self.model_fields_set: _dict['project'] = None # set to None if issue (nullable) is None - # and __fields_set__ contains the field - if self.issue is None and "issue" in self.__fields_set__: + # and model_fields_set contains the field + if self.issue is None and "issue" in self.model_fields_set: _dict['issue'] = None # set to None if comment (nullable) is None - # and __fields_set__ contains the field - if self.comment is None and "comment" in self.__fields_set__: + # and model_fields_set contains the field + if self.comment is None and "comment" in self.model_fields_set: _dict['comment'] = None # set to None if page (nullable) is None - # and __fields_set__ contains the field - if self.page is None and "page" in self.__fields_set__: + # and model_fields_set contains the field + if self.page is None and "page" in self.model_fields_set: _dict['page'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> IssueAttachment: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssueAttachment from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssueAttachment.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssueAttachment.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), diff --git a/plane/models/issue_attachment_upload_request.py b/plane/models/issue_attachment_upload_request.py index 7f81d0b..c9e5a1e 100644 --- a/plane/models/issue_attachment_upload_request.py +++ b/plane/models/issue_attachment_upload_request.py @@ -18,57 +18,74 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictInt, constr +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self class IssueAttachmentUploadRequest(BaseModel): """ - Serializer for work item attachment upload request validation. Handles file upload metadata validation including size, type, and external integration tracking for secure work item document attachment workflows. # noqa: E501 - """ - name: constr(strict=True, min_length=1) = Field(default=..., description="Original filename of the asset") - type: Optional[constr(strict=True, min_length=1)] = Field(default=None, description="MIME type of the file") - size: StrictInt = Field(default=..., description="File size in bytes") - external_id: Optional[constr(strict=True, min_length=1)] = Field(default=None, description="External identifier for the asset (for integration tracking)") - external_source: Optional[constr(strict=True, min_length=1)] = Field(default=None, description="External source system (for integration tracking)") - __properties = ["name", "type", "size", "external_id", "external_source"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + Serializer for work item attachment upload request validation. Handles file upload metadata validation including size, type, and external integration tracking for secure work item document attachment workflows. + """ # noqa: E501 + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Original filename of the asset") + type: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="MIME type of the file") + size: StrictInt = Field(description="File size in bytes") + external_id: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="External identifier for the asset (for integration tracking)") + external_source: Optional[Annotated[str, Field(min_length=1, strict=True)]] = Field(default=None, description="External source system (for integration tracking)") + __properties: ClassVar[List[str]] = ["name", "type", "size", "external_id", "external_source"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssueAttachmentUploadRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssueAttachmentUploadRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> IssueAttachmentUploadRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssueAttachmentUploadRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssueAttachmentUploadRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssueAttachmentUploadRequest.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "type": obj.get("type"), "size": obj.get("size"), diff --git a/plane/models/issue_comment.py b/plane/models/issue_comment.py index d7a2aa1..bbcc900 100644 --- a/plane/models/issue_comment.py +++ b/plane/models/issue_comment.py @@ -19,14 +19,17 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, StrictBool, StrictStr, conlist, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from plane.models.access_enum import AccessEnum +from typing import Set +from typing_extensions import Self class IssueComment(BaseModel): """ - Full serializer for work item comments with membership context. Provides complete comment data including member status, content formatting, and edit tracking for collaborative work item discussions. # noqa: E501 - """ + Full serializer for work item comments with membership context. Provides complete comment data including member status, content formatting, and edit tracking for collaborative work item discussions. + """ # noqa: E501 id: Optional[StrictStr] = None is_member: Optional[StrictBool] = None created_at: Optional[datetime] = None @@ -34,10 +37,10 @@ class IssueComment(BaseModel): deleted_at: Optional[datetime] = None comment_stripped: Optional[StrictStr] = None comment_html: Optional[StrictStr] = None - attachments: Optional[conlist(constr(strict=True, max_length=200), max_items=10)] = None + attachments: Optional[Annotated[List[Annotated[str, Field(strict=True, max_length=200)]], Field(max_length=10)]] = None access: Optional[AccessEnum] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None edited_at: Optional[datetime] = None created_by: Optional[StrictStr] = None updated_by: Optional[StrictStr] = None @@ -45,88 +48,112 @@ class IssueComment(BaseModel): workspace: Optional[StrictStr] = None issue: Optional[StrictStr] = None actor: Optional[StrictStr] = None - __properties = ["id", "is_member", "created_at", "updated_at", "deleted_at", "comment_stripped", "comment_html", "attachments", "access", "external_source", "external_id", "edited_at", "created_by", "updated_by", "project", "workspace", "issue", "actor"] + __properties: ClassVar[List[str]] = ["id", "is_member", "created_at", "updated_at", "deleted_at", "comment_stripped", "comment_html", "attachments", "access", "external_source", "external_id", "edited_at", "created_by", "updated_by", "project", "workspace", "issue", "actor"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssueComment: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssueComment from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "is_member", - "created_at", - "updated_at", - "created_by", - "updated_by", - "project", - "workspace", - "issue", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "is_member", + "created_at", + "updated_at", + "created_by", + "updated_by", + "project", + "workspace", + "issue", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if deleted_at (nullable) is None - # and __fields_set__ contains the field - if self.deleted_at is None and "deleted_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.deleted_at is None and "deleted_at" in self.model_fields_set: _dict['deleted_at'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if edited_at (nullable) is None - # and __fields_set__ contains the field - if self.edited_at is None and "edited_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.edited_at is None and "edited_at" in self.model_fields_set: _dict['edited_at'] = None # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if updated_by (nullable) is None - # and __fields_set__ contains the field - if self.updated_by is None and "updated_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: _dict['updated_by'] = None # set to None if actor (nullable) is None - # and __fields_set__ contains the field - if self.actor is None and "actor" in self.__fields_set__: + # and model_fields_set contains the field + if self.actor is None and "actor" in self.model_fields_set: _dict['actor'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> IssueComment: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssueComment from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssueComment.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssueComment.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "is_member": obj.get("is_member"), "created_at": obj.get("created_at"), diff --git a/plane/models/issue_comment_create_request.py b/plane/models/issue_comment_create_request.py index b302609..88dffa6 100644 --- a/plane/models/issue_comment_create_request.py +++ b/plane/models/issue_comment_create_request.py @@ -18,73 +18,90 @@ import re # noqa: F401 import json - -from typing import Any, Optional -from pydantic import BaseModel, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from plane.models.access_enum import AccessEnum +from typing import Set +from typing_extensions import Self class IssueCommentCreateRequest(BaseModel): """ - Serializer for creating work item comments. Handles comment creation with JSON and HTML content support, access control, and external integration tracking. # noqa: E501 - """ + Serializer for creating work item comments. Handles comment creation with JSON and HTML content support, access control, and external integration tracking. + """ # noqa: E501 comment_json: Optional[Any] = None comment_html: Optional[StrictStr] = None access: Optional[AccessEnum] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None - __properties = ["comment_json", "comment_html", "access", "external_source", "external_id"] + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + __properties: ClassVar[List[str]] = ["comment_json", "comment_html", "access", "external_source", "external_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssueCommentCreateRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssueCommentCreateRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if comment_json (nullable) is None - # and __fields_set__ contains the field - if self.comment_json is None and "comment_json" in self.__fields_set__: + # and model_fields_set contains the field + if self.comment_json is None and "comment_json" in self.model_fields_set: _dict['comment_json'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> IssueCommentCreateRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssueCommentCreateRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssueCommentCreateRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssueCommentCreateRequest.parse_obj({ + _obj = cls.model_validate({ "comment_json": obj.get("comment_json"), "comment_html": obj.get("comment_html"), "access": obj.get("access"), diff --git a/plane/models/issue_detail.py b/plane/models/issue_detail.py index 6def41f..294a98a 100644 --- a/plane/models/issue_detail.py +++ b/plane/models/issue_detail.py @@ -19,38 +19,41 @@ import json from datetime import date, datetime -from typing import Optional, Union -from pydantic import BaseModel, Field, StrictBool, StrictBytes, StrictFloat, StrictInt, StrictStr, conint, conlist, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated from plane.models.label import Label from plane.models.priority_enum import PriorityEnum from plane.models.user_lite import UserLite +from typing import Set +from typing_extensions import Self class IssueDetail(BaseModel): """ - Comprehensive work item serializer with full relationship management. Handles complete work item lifecycle including assignees, labels, validation, and related model updates. Supports dynamic field expansion and HTML content processing. # noqa: E501 - """ + Comprehensive work item serializer with full relationship management. Handles complete work item lifecycle including assignees, labels, validation, and related model updates. Supports dynamic field expansion and HTML content processing. + """ # noqa: E501 id: Optional[StrictStr] = None - assignees: conlist(UserLite) = Field(...) - labels: conlist(Label) = Field(...) + assignees: List[UserLite] + labels: List[Label] type_id: Optional[StrictStr] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None deleted_at: Optional[datetime] = None - point: Optional[conint(strict=True, le=12, ge=0)] = None - name: constr(strict=True, max_length=255) = Field(...) + point: Optional[Annotated[int, Field(le=12, strict=True, ge=0)]] = None + name: Annotated[str, Field(strict=True, max_length=255)] description_html: Optional[StrictStr] = None description_stripped: Optional[StrictStr] = None description_binary: Optional[Union[StrictBytes, StrictStr]] = None priority: Optional[PriorityEnum] = None start_date: Optional[date] = None target_date: Optional[date] = None - sequence_id: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None + sequence_id: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None sort_order: Optional[Union[StrictFloat, StrictInt]] = None completed_at: Optional[datetime] = None archived_at: Optional[date] = None is_draft: Optional[StrictBool] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None created_by: Optional[StrictStr] = None updated_by: Optional[StrictStr] = None project: Optional[StrictStr] = None @@ -59,153 +62,175 @@ class IssueDetail(BaseModel): state: Optional[StrictStr] = None estimate_point: Optional[StrictStr] = None type: Optional[StrictStr] = None - __properties = ["id", "assignees", "labels", "type_id", "created_at", "updated_at", "deleted_at", "point", "name", "description_html", "description_stripped", "description_binary", "priority", "start_date", "target_date", "sequence_id", "sort_order", "completed_at", "archived_at", "is_draft", "external_source", "external_id", "created_by", "updated_by", "project", "workspace", "parent", "state", "estimate_point", "type"] + __properties: ClassVar[List[str]] = ["id", "assignees", "labels", "type_id", "created_at", "updated_at", "deleted_at", "point", "name", "description_html", "description_stripped", "description_binary", "priority", "start_date", "target_date", "sequence_id", "sort_order", "completed_at", "archived_at", "is_draft", "external_source", "external_id", "created_by", "updated_by", "project", "workspace", "parent", "state", "estimate_point", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssueDetail: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssueDetail from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "created_at", - "updated_at", - "description_binary", - "updated_by", - "project", - "workspace", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "created_at", + "updated_at", + "description_binary", + "updated_by", + "project", + "workspace", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in assignees (list) _items = [] if self.assignees: - for _item in self.assignees: - if _item: - _items.append(_item.to_dict()) + for _item_assignees in self.assignees: + if _item_assignees: + _items.append(_item_assignees.to_dict()) _dict['assignees'] = _items # override the default output from pydantic by calling `to_dict()` of each item in labels (list) _items = [] if self.labels: - for _item in self.labels: - if _item: - _items.append(_item.to_dict()) + for _item_labels in self.labels: + if _item_labels: + _items.append(_item_labels.to_dict()) _dict['labels'] = _items # set to None if type_id (nullable) is None - # and __fields_set__ contains the field - if self.type_id is None and "type_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.type_id is None and "type_id" in self.model_fields_set: _dict['type_id'] = None # set to None if deleted_at (nullable) is None - # and __fields_set__ contains the field - if self.deleted_at is None and "deleted_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.deleted_at is None and "deleted_at" in self.model_fields_set: _dict['deleted_at'] = None # set to None if point (nullable) is None - # and __fields_set__ contains the field - if self.point is None and "point" in self.__fields_set__: + # and model_fields_set contains the field + if self.point is None and "point" in self.model_fields_set: _dict['point'] = None # set to None if description_stripped (nullable) is None - # and __fields_set__ contains the field - if self.description_stripped is None and "description_stripped" in self.__fields_set__: + # and model_fields_set contains the field + if self.description_stripped is None and "description_stripped" in self.model_fields_set: _dict['description_stripped'] = None # set to None if description_binary (nullable) is None - # and __fields_set__ contains the field - if self.description_binary is None and "description_binary" in self.__fields_set__: + # and model_fields_set contains the field + if self.description_binary is None and "description_binary" in self.model_fields_set: _dict['description_binary'] = None # set to None if start_date (nullable) is None - # and __fields_set__ contains the field - if self.start_date is None and "start_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.start_date is None and "start_date" in self.model_fields_set: _dict['start_date'] = None # set to None if target_date (nullable) is None - # and __fields_set__ contains the field - if self.target_date is None and "target_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.target_date is None and "target_date" in self.model_fields_set: _dict['target_date'] = None # set to None if completed_at (nullable) is None - # and __fields_set__ contains the field - if self.completed_at is None and "completed_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.completed_at is None and "completed_at" in self.model_fields_set: _dict['completed_at'] = None # set to None if archived_at (nullable) is None - # and __fields_set__ contains the field - if self.archived_at is None and "archived_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.archived_at is None and "archived_at" in self.model_fields_set: _dict['archived_at'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if updated_by (nullable) is None - # and __fields_set__ contains the field - if self.updated_by is None and "updated_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: _dict['updated_by'] = None # set to None if parent (nullable) is None - # and __fields_set__ contains the field - if self.parent is None and "parent" in self.__fields_set__: + # and model_fields_set contains the field + if self.parent is None and "parent" in self.model_fields_set: _dict['parent'] = None # set to None if state (nullable) is None - # and __fields_set__ contains the field - if self.state is None and "state" in self.__fields_set__: + # and model_fields_set contains the field + if self.state is None and "state" in self.model_fields_set: _dict['state'] = None # set to None if estimate_point (nullable) is None - # and __fields_set__ contains the field - if self.estimate_point is None and "estimate_point" in self.__fields_set__: + # and model_fields_set contains the field + if self.estimate_point is None and "estimate_point" in self.model_fields_set: _dict['estimate_point'] = None # set to None if type (nullable) is None - # and __fields_set__ contains the field - if self.type is None and "type" in self.__fields_set__: + # and model_fields_set contains the field + if self.type is None and "type" in self.model_fields_set: _dict['type'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> IssueDetail: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssueDetail from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssueDetail.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssueDetail.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), - "assignees": [UserLite.from_dict(_item) for _item in obj.get("assignees")] if obj.get("assignees") is not None else None, - "labels": [Label.from_dict(_item) for _item in obj.get("labels")] if obj.get("labels") is not None else None, + "assignees": [UserLite.from_dict(_item) for _item in obj["assignees"]] if obj.get("assignees") is not None else None, + "labels": [Label.from_dict(_item) for _item in obj["labels"]] if obj.get("labels") is not None else None, "type_id": obj.get("type_id"), "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), diff --git a/plane/models/issue_expand.py b/plane/models/issue_expand.py index 2904a22..b66f35b 100644 --- a/plane/models/issue_expand.py +++ b/plane/models/issue_expand.py @@ -19,17 +19,20 @@ import json from datetime import date, datetime -from typing import Any, Optional, Union -from pydantic import BaseModel, Field, StrictBool, StrictBytes, StrictFloat, StrictInt, StrictStr, conint, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictBytes, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated from plane.models.cycle_lite import CycleLite from plane.models.module_lite import ModuleLite from plane.models.priority_enum import PriorityEnum from plane.models.state_lite import StateLite +from typing import Set +from typing_extensions import Self class IssueExpand(BaseModel): """ - Extended work item serializer with full relationship expansion. Provides work items with expanded related data including cycles, modules, labels, assignees, and states for comprehensive data representation. # noqa: E501 - """ + Extended work item serializer with full relationship expansion. Provides work items with expanded related data including cycles, modules, labels, assignees, and states for comprehensive data representation. + """ # noqa: E501 id: Optional[StrictStr] = None cycle: Optional[CycleLite] = None module: Optional[ModuleLite] = None @@ -39,8 +42,8 @@ class IssueExpand(BaseModel): created_at: Optional[datetime] = None updated_at: Optional[datetime] = None deleted_at: Optional[datetime] = None - point: Optional[conint(strict=True, le=12, ge=0)] = None - name: constr(strict=True, max_length=255) = Field(...) + point: Optional[Annotated[int, Field(le=12, strict=True, ge=0)]] = None + name: Annotated[str, Field(strict=True, max_length=255)] description: Optional[Any] = None description_html: Optional[StrictStr] = None description_stripped: Optional[StrictStr] = None @@ -48,13 +51,13 @@ class IssueExpand(BaseModel): priority: Optional[PriorityEnum] = None start_date: Optional[date] = None target_date: Optional[date] = None - sequence_id: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None + sequence_id: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None sort_order: Optional[Union[StrictFloat, StrictInt]] = None completed_at: Optional[datetime] = None archived_at: Optional[date] = None is_draft: Optional[StrictBool] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None created_by: Optional[StrictStr] = None updated_by: Optional[StrictStr] = None project: Optional[StrictStr] = None @@ -62,45 +65,73 @@ class IssueExpand(BaseModel): parent: Optional[StrictStr] = None estimate_point: Optional[StrictStr] = None type: Optional[StrictStr] = None - __properties = ["id", "cycle", "module", "labels", "assignees", "state", "created_at", "updated_at", "deleted_at", "point", "name", "description", "description_html", "description_stripped", "description_binary", "priority", "start_date", "target_date", "sequence_id", "sort_order", "completed_at", "archived_at", "is_draft", "external_source", "external_id", "created_by", "updated_by", "project", "workspace", "parent", "estimate_point", "type"] + __properties: ClassVar[List[str]] = ["id", "cycle", "module", "labels", "assignees", "state", "created_at", "updated_at", "deleted_at", "point", "name", "description", "description_html", "description_stripped", "description_binary", "priority", "start_date", "target_date", "sequence_id", "sort_order", "completed_at", "archived_at", "is_draft", "external_source", "external_id", "created_by", "updated_by", "project", "workspace", "parent", "estimate_point", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssueExpand: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssueExpand from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "cycle", - "module", - "labels", - "assignees", - "state", - "created_at", - "updated_at", - "description_binary", - "created_by", - "updated_by", - "project", - "workspace", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "cycle", + "module", + "labels", + "assignees", + "state", + "created_at", + "updated_at", + "description_binary", + "created_by", + "updated_by", + "project", + "workspace", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of cycle if self.cycle: _dict['cycle'] = self.cycle.to_dict() @@ -111,103 +142,103 @@ def to_dict(self): if self.state: _dict['state'] = self.state.to_dict() # set to None if deleted_at (nullable) is None - # and __fields_set__ contains the field - if self.deleted_at is None and "deleted_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.deleted_at is None and "deleted_at" in self.model_fields_set: _dict['deleted_at'] = None # set to None if point (nullable) is None - # and __fields_set__ contains the field - if self.point is None and "point" in self.__fields_set__: + # and model_fields_set contains the field + if self.point is None and "point" in self.model_fields_set: _dict['point'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if description_stripped (nullable) is None - # and __fields_set__ contains the field - if self.description_stripped is None and "description_stripped" in self.__fields_set__: + # and model_fields_set contains the field + if self.description_stripped is None and "description_stripped" in self.model_fields_set: _dict['description_stripped'] = None # set to None if description_binary (nullable) is None - # and __fields_set__ contains the field - if self.description_binary is None and "description_binary" in self.__fields_set__: + # and model_fields_set contains the field + if self.description_binary is None and "description_binary" in self.model_fields_set: _dict['description_binary'] = None # set to None if start_date (nullable) is None - # and __fields_set__ contains the field - if self.start_date is None and "start_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.start_date is None and "start_date" in self.model_fields_set: _dict['start_date'] = None # set to None if target_date (nullable) is None - # and __fields_set__ contains the field - if self.target_date is None and "target_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.target_date is None and "target_date" in self.model_fields_set: _dict['target_date'] = None # set to None if completed_at (nullable) is None - # and __fields_set__ contains the field - if self.completed_at is None and "completed_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.completed_at is None and "completed_at" in self.model_fields_set: _dict['completed_at'] = None # set to None if archived_at (nullable) is None - # and __fields_set__ contains the field - if self.archived_at is None and "archived_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.archived_at is None and "archived_at" in self.model_fields_set: _dict['archived_at'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if updated_by (nullable) is None - # and __fields_set__ contains the field - if self.updated_by is None and "updated_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: _dict['updated_by'] = None # set to None if parent (nullable) is None - # and __fields_set__ contains the field - if self.parent is None and "parent" in self.__fields_set__: + # and model_fields_set contains the field + if self.parent is None and "parent" in self.model_fields_set: _dict['parent'] = None # set to None if estimate_point (nullable) is None - # and __fields_set__ contains the field - if self.estimate_point is None and "estimate_point" in self.__fields_set__: + # and model_fields_set contains the field + if self.estimate_point is None and "estimate_point" in self.model_fields_set: _dict['estimate_point'] = None # set to None if type (nullable) is None - # and __fields_set__ contains the field - if self.type is None and "type" in self.__fields_set__: + # and model_fields_set contains the field + if self.type is None and "type" in self.model_fields_set: _dict['type'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> IssueExpand: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssueExpand from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssueExpand.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssueExpand.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), - "cycle": CycleLite.from_dict(obj.get("cycle")) if obj.get("cycle") is not None else None, - "module": ModuleLite.from_dict(obj.get("module")) if obj.get("module") is not None else None, + "cycle": CycleLite.from_dict(obj["cycle"]) if obj.get("cycle") is not None else None, + "module": ModuleLite.from_dict(obj["module"]) if obj.get("module") is not None else None, "labels": obj.get("labels"), "assignees": obj.get("assignees"), - "state": StateLite.from_dict(obj.get("state")) if obj.get("state") is not None else None, + "state": StateLite.from_dict(obj["state"]) if obj.get("state") is not None else None, "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), "deleted_at": obj.get("deleted_at"), diff --git a/plane/models/issue_for_intake_request.py b/plane/models/issue_for_intake_request.py index e4da3c3..e79893a 100644 --- a/plane/models/issue_for_intake_request.py +++ b/plane/models/issue_for_intake_request.py @@ -18,62 +18,79 @@ import re # noqa: F401 import json - -from typing import Any, Optional -from pydantic import BaseModel, Field, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from plane.models.priority_enum import PriorityEnum +from typing import Set +from typing_extensions import Self class IssueForIntakeRequest(BaseModel): """ - Serializer for work item data within intake submissions. Handles essential work item fields for intake processing including content validation and priority assignment for triage workflows. # noqa: E501 - """ - name: constr(strict=True, max_length=255, min_length=1) = Field(...) + Serializer for work item data within intake submissions. Handles essential work item fields for intake processing including content validation and priority assignment for triage workflows. + """ # noqa: E501 + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] description: Optional[Any] = None description_html: Optional[StrictStr] = None priority: Optional[PriorityEnum] = None - __properties = ["name", "description", "description_html", "priority"] + __properties: ClassVar[List[str]] = ["name", "description", "description_html", "priority"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssueForIntakeRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssueForIntakeRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> IssueForIntakeRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssueForIntakeRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssueForIntakeRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssueForIntakeRequest.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description"), "description_html": obj.get("description_html"), diff --git a/plane/models/issue_link.py b/plane/models/issue_link.py index cab75d6..8e8444e 100644 --- a/plane/models/issue_link.py +++ b/plane/models/issue_link.py @@ -19,96 +19,122 @@ import json from datetime import datetime -from typing import Any, Optional -from pydantic import BaseModel, Field, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self class IssueLink(BaseModel): """ - Full serializer for work item external links. Provides complete link information including metadata and timestamps for managing external resource associations with work items. # noqa: E501 - """ + Full serializer for work item external links. Provides complete link information including metadata and timestamps for managing external resource associations with work items. + """ # noqa: E501 id: Optional[StrictStr] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None deleted_at: Optional[datetime] = None - title: Optional[constr(strict=True, max_length=255)] = None - url: StrictStr = Field(...) + title: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + url: StrictStr metadata: Optional[Any] = None created_by: Optional[StrictStr] = None updated_by: Optional[StrictStr] = None project: Optional[StrictStr] = None workspace: Optional[StrictStr] = None issue: Optional[StrictStr] = None - __properties = ["id", "created_at", "updated_at", "deleted_at", "title", "url", "metadata", "created_by", "updated_by", "project", "workspace", "issue"] + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "deleted_at", "title", "url", "metadata", "created_by", "updated_by", "project", "workspace", "issue"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssueLink: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssueLink from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "created_at", - "updated_at", - "created_by", - "updated_by", - "project", - "workspace", - "issue", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "created_at", + "updated_at", + "created_by", + "updated_by", + "project", + "workspace", + "issue", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if deleted_at (nullable) is None - # and __fields_set__ contains the field - if self.deleted_at is None and "deleted_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.deleted_at is None and "deleted_at" in self.model_fields_set: _dict['deleted_at'] = None # set to None if title (nullable) is None - # and __fields_set__ contains the field - if self.title is None and "title" in self.__fields_set__: + # and model_fields_set contains the field + if self.title is None and "title" in self.model_fields_set: _dict['title'] = None # set to None if metadata (nullable) is None - # and __fields_set__ contains the field - if self.metadata is None and "metadata" in self.__fields_set__: + # and model_fields_set contains the field + if self.metadata is None and "metadata" in self.model_fields_set: _dict['metadata'] = None # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if updated_by (nullable) is None - # and __fields_set__ contains the field - if self.updated_by is None and "updated_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: _dict['updated_by'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> IssueLink: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssueLink from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssueLink.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssueLink.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), diff --git a/plane/models/issue_link_create_request.py b/plane/models/issue_link_create_request.py index 93fe582..0724de1 100644 --- a/plane/models/issue_link_create_request.py +++ b/plane/models/issue_link_create_request.py @@ -18,53 +18,70 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, constr +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List +from typing_extensions import Annotated +from typing import Optional, Set +from typing_extensions import Self class IssueLinkCreateRequest(BaseModel): """ - Serializer for creating work item external links with validation. Handles URL validation, format checking, and duplicate prevention for attaching external resources to work items. # noqa: E501 - """ - url: constr(strict=True, min_length=1) = Field(...) - __properties = ["url"] + Serializer for creating work item external links with validation. Handles URL validation, format checking, and duplicate prevention for attaching external resources to work items. + """ # noqa: E501 + url: Annotated[str, Field(min_length=1, strict=True)] + __properties: ClassVar[List[str]] = ["url"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssueLinkCreateRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssueLinkCreateRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> IssueLinkCreateRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssueLinkCreateRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssueLinkCreateRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssueLinkCreateRequest.parse_obj({ + _obj = cls.model_validate({ "url": obj.get("url") }) return _obj diff --git a/plane/models/issue_property_api.py b/plane/models/issue_property_api.py index 2a87fe6..c1d09c2 100644 --- a/plane/models/issue_property_api.py +++ b/plane/models/issue_property_api.py @@ -19,139 +19,169 @@ import json from datetime import datetime -from typing import Any, Optional, Union -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, conlist, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated from plane.models.property_type_enum import PropertyTypeEnum from plane.models.relation_type_enum import RelationTypeEnum +from typing import Set +from typing_extensions import Self class IssuePropertyAPI(BaseModel): """ IssuePropertyAPI - """ + """ # noqa: E501 id: Optional[StrictStr] = None deleted_at: Optional[datetime] = None relation_type: Optional[RelationTypeEnum] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None name: Optional[StrictStr] = None - display_name: constr(strict=True, max_length=255) = Field(...) + display_name: Annotated[str, Field(strict=True, max_length=255)] description: Optional[StrictStr] = None logo_props: Optional[Any] = None sort_order: Optional[Union[StrictFloat, StrictInt]] = None - property_type: PropertyTypeEnum = Field(...) + property_type: PropertyTypeEnum is_required: Optional[StrictBool] = None - default_value: Optional[conlist(StrictStr)] = None + default_value: Optional[List[StrictStr]] = None settings: Optional[Any] = None is_active: Optional[StrictBool] = None is_multi: Optional[StrictBool] = None validation_rules: Optional[Any] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None created_by: Optional[StrictStr] = None updated_by: Optional[StrictStr] = None workspace: Optional[StrictStr] = None project: Optional[StrictStr] = None issue_type: Optional[StrictStr] = None - __properties = ["id", "deleted_at", "relation_type", "created_at", "updated_at", "name", "display_name", "description", "logo_props", "sort_order", "property_type", "is_required", "default_value", "settings", "is_active", "is_multi", "validation_rules", "external_source", "external_id", "created_by", "updated_by", "workspace", "project", "issue_type"] + __properties: ClassVar[List[str]] = ["id", "deleted_at", "relation_type", "created_at", "updated_at", "name", "display_name", "description", "logo_props", "sort_order", "property_type", "is_required", "default_value", "settings", "is_active", "is_multi", "validation_rules", "external_source", "external_id", "created_by", "updated_by", "workspace", "project", "issue_type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssuePropertyAPI: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssuePropertyAPI from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "deleted_at", - "created_at", - "updated_at", - "name", - "logo_props", - "sort_order", - "created_by", - "updated_by", - "workspace", - "project", - "issue_type", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "deleted_at", + "created_at", + "updated_at", + "name", + "logo_props", + "sort_order", + "created_by", + "updated_by", + "workspace", + "project", + "issue_type", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if deleted_at (nullable) is None - # and __fields_set__ contains the field - if self.deleted_at is None and "deleted_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.deleted_at is None and "deleted_at" in self.model_fields_set: _dict['deleted_at'] = None # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if logo_props (nullable) is None - # and __fields_set__ contains the field - if self.logo_props is None and "logo_props" in self.__fields_set__: + # and model_fields_set contains the field + if self.logo_props is None and "logo_props" in self.model_fields_set: _dict['logo_props'] = None # set to None if settings (nullable) is None - # and __fields_set__ contains the field - if self.settings is None and "settings" in self.__fields_set__: + # and model_fields_set contains the field + if self.settings is None and "settings" in self.model_fields_set: _dict['settings'] = None # set to None if validation_rules (nullable) is None - # and __fields_set__ contains the field - if self.validation_rules is None and "validation_rules" in self.__fields_set__: + # and model_fields_set contains the field + if self.validation_rules is None and "validation_rules" in self.model_fields_set: _dict['validation_rules'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if updated_by (nullable) is None - # and __fields_set__ contains the field - if self.updated_by is None and "updated_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: _dict['updated_by'] = None # set to None if project (nullable) is None - # and __fields_set__ contains the field - if self.project is None and "project" in self.__fields_set__: + # and model_fields_set contains the field + if self.project is None and "project" in self.model_fields_set: _dict['project'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> IssuePropertyAPI: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssuePropertyAPI from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssuePropertyAPI.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssuePropertyAPI.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "deleted_at": obj.get("deleted_at"), "relation_type": obj.get("relation_type"), diff --git a/plane/models/issue_property_api_request.py b/plane/models/issue_property_api_request.py index 1a0fa24..ff3e8b3 100644 --- a/plane/models/issue_property_api_request.py +++ b/plane/models/issue_property_api_request.py @@ -18,91 +18,108 @@ import re # noqa: F401 import json - -from typing import Any, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from plane.models.property_type_enum import PropertyTypeEnum from plane.models.relation_type_enum import RelationTypeEnum +from typing import Set +from typing_extensions import Self class IssuePropertyAPIRequest(BaseModel): """ IssuePropertyAPIRequest - """ + """ # noqa: E501 relation_type: Optional[RelationTypeEnum] = None - display_name: constr(strict=True, max_length=255, min_length=1) = Field(...) + display_name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] description: Optional[StrictStr] = None - property_type: PropertyTypeEnum = Field(...) + property_type: PropertyTypeEnum is_required: Optional[StrictBool] = None - default_value: Optional[conlist(constr(strict=True, min_length=1))] = None + default_value: Optional[List[Annotated[str, Field(min_length=1, strict=True)]]] = None settings: Optional[Any] = None is_active: Optional[StrictBool] = None is_multi: Optional[StrictBool] = None validation_rules: Optional[Any] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None - __properties = ["relation_type", "display_name", "description", "property_type", "is_required", "default_value", "settings", "is_active", "is_multi", "validation_rules", "external_source", "external_id"] + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + __properties: ClassVar[List[str]] = ["relation_type", "display_name", "description", "property_type", "is_required", "default_value", "settings", "is_active", "is_multi", "validation_rules", "external_source", "external_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssuePropertyAPIRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssuePropertyAPIRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if settings (nullable) is None - # and __fields_set__ contains the field - if self.settings is None and "settings" in self.__fields_set__: + # and model_fields_set contains the field + if self.settings is None and "settings" in self.model_fields_set: _dict['settings'] = None # set to None if validation_rules (nullable) is None - # and __fields_set__ contains the field - if self.validation_rules is None and "validation_rules" in self.__fields_set__: + # and model_fields_set contains the field + if self.validation_rules is None and "validation_rules" in self.model_fields_set: _dict['validation_rules'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> IssuePropertyAPIRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssuePropertyAPIRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssuePropertyAPIRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssuePropertyAPIRequest.parse_obj({ + _obj = cls.model_validate({ "relation_type": obj.get("relation_type"), "display_name": obj.get("display_name"), "description": obj.get("description"), diff --git a/plane/models/issue_property_option_api.py b/plane/models/issue_property_option_api.py index 78800f2..5890a15 100644 --- a/plane/models/issue_property_option_api.py +++ b/plane/models/issue_property_option_api.py @@ -19,120 +19,149 @@ import json from datetime import datetime -from typing import Any, Optional, Union -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self class IssuePropertyOptionAPI(BaseModel): """ IssuePropertyOptionAPI - """ + """ # noqa: E501 id: Optional[StrictStr] = None deleted_at: Optional[datetime] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None - name: constr(strict=True, max_length=255) = Field(...) + name: Annotated[str, Field(strict=True, max_length=255)] sort_order: Optional[Union[StrictFloat, StrictInt]] = None description: Optional[StrictStr] = None logo_props: Optional[Any] = None is_active: Optional[StrictBool] = None is_default: Optional[StrictBool] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None created_by: Optional[StrictStr] = None updated_by: Optional[StrictStr] = None workspace: Optional[StrictStr] = None project: Optional[StrictStr] = None var_property: Optional[StrictStr] = Field(default=None, alias="property") parent: Optional[StrictStr] = None - __properties = ["id", "deleted_at", "created_at", "updated_at", "name", "sort_order", "description", "logo_props", "is_active", "is_default", "external_source", "external_id", "created_by", "updated_by", "workspace", "project", "property", "parent"] + __properties: ClassVar[List[str]] = ["id", "deleted_at", "created_at", "updated_at", "name", "sort_order", "description", "logo_props", "is_active", "is_default", "external_source", "external_id", "created_by", "updated_by", "workspace", "project", "property", "parent"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssuePropertyOptionAPI: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssuePropertyOptionAPI from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "deleted_at", - "created_at", - "updated_at", - "sort_order", - "logo_props", - "created_by", - "updated_by", - "workspace", - "project", - "var_property", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "deleted_at", + "created_at", + "updated_at", + "sort_order", + "logo_props", + "created_by", + "updated_by", + "workspace", + "project", + "var_property", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if deleted_at (nullable) is None - # and __fields_set__ contains the field - if self.deleted_at is None and "deleted_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.deleted_at is None and "deleted_at" in self.model_fields_set: _dict['deleted_at'] = None # set to None if logo_props (nullable) is None - # and __fields_set__ contains the field - if self.logo_props is None and "logo_props" in self.__fields_set__: + # and model_fields_set contains the field + if self.logo_props is None and "logo_props" in self.model_fields_set: _dict['logo_props'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if updated_by (nullable) is None - # and __fields_set__ contains the field - if self.updated_by is None and "updated_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: _dict['updated_by'] = None # set to None if project (nullable) is None - # and __fields_set__ contains the field - if self.project is None and "project" in self.__fields_set__: + # and model_fields_set contains the field + if self.project is None and "project" in self.model_fields_set: _dict['project'] = None # set to None if parent (nullable) is None - # and __fields_set__ contains the field - if self.parent is None and "parent" in self.__fields_set__: + # and model_fields_set contains the field + if self.parent is None and "parent" in self.model_fields_set: _dict['parent'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> IssuePropertyOptionAPI: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssuePropertyOptionAPI from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssuePropertyOptionAPI.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssuePropertyOptionAPI.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "deleted_at": obj.get("deleted_at"), "created_at": obj.get("created_at"), @@ -149,7 +178,7 @@ def from_dict(cls, obj: dict) -> IssuePropertyOptionAPI: "updated_by": obj.get("updated_by"), "workspace": obj.get("workspace"), "project": obj.get("project"), - "var_property": obj.get("property"), + "property": obj.get("property"), "parent": obj.get("parent") }) return _obj diff --git a/plane/models/issue_property_option_api_request.py b/plane/models/issue_property_option_api_request.py index 73958ae..26d1052 100644 --- a/plane/models/issue_property_option_api_request.py +++ b/plane/models/issue_property_option_api_request.py @@ -18,74 +18,91 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self class IssuePropertyOptionAPIRequest(BaseModel): """ IssuePropertyOptionAPIRequest - """ - name: constr(strict=True, max_length=255, min_length=1) = Field(...) + """ # noqa: E501 + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] description: Optional[StrictStr] = None is_active: Optional[StrictBool] = None is_default: Optional[StrictBool] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None parent: Optional[StrictStr] = None - __properties = ["name", "description", "is_active", "is_default", "external_source", "external_id", "parent"] + __properties: ClassVar[List[str]] = ["name", "description", "is_active", "is_default", "external_source", "external_id", "parent"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssuePropertyOptionAPIRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssuePropertyOptionAPIRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if parent (nullable) is None - # and __fields_set__ contains the field - if self.parent is None and "parent" in self.__fields_set__: + # and model_fields_set contains the field + if self.parent is None and "parent" in self.model_fields_set: _dict['parent'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> IssuePropertyOptionAPIRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssuePropertyOptionAPIRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssuePropertyOptionAPIRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssuePropertyOptionAPIRequest.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description"), "is_active": obj.get("is_active"), diff --git a/plane/models/issue_property_value_api.py b/plane/models/issue_property_value_api.py index 1e1ecc0..df4ee75 100644 --- a/plane/models/issue_property_value_api.py +++ b/plane/models/issue_property_value_api.py @@ -19,13 +19,16 @@ import json from datetime import datetime -from typing import Optional, Union -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self class IssuePropertyValueAPI(BaseModel): """ IssuePropertyValueAPI - """ + """ # noqa: E501 id: Optional[StrictStr] = None deleted_at: Optional[datetime] = None created_at: Optional[datetime] = None @@ -35,106 +38,129 @@ class IssuePropertyValueAPI(BaseModel): value_decimal: Optional[Union[StrictFloat, StrictInt]] = None value_datetime: Optional[datetime] = None value_uuid: Optional[StrictStr] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None created_by: Optional[StrictStr] = None updated_by: Optional[StrictStr] = None workspace: Optional[StrictStr] = None project: Optional[StrictStr] = None - issue: StrictStr = Field(...) - var_property: StrictStr = Field(default=..., alias="property") + issue: StrictStr + var_property: StrictStr = Field(alias="property") value_option: Optional[StrictStr] = None - __properties = ["id", "deleted_at", "created_at", "updated_at", "value_text", "value_boolean", "value_decimal", "value_datetime", "value_uuid", "external_source", "external_id", "created_by", "updated_by", "workspace", "project", "issue", "property", "value_option"] + __properties: ClassVar[List[str]] = ["id", "deleted_at", "created_at", "updated_at", "value_text", "value_boolean", "value_decimal", "value_datetime", "value_uuid", "external_source", "external_id", "created_by", "updated_by", "workspace", "project", "issue", "property", "value_option"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssuePropertyValueAPI: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssuePropertyValueAPI from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "deleted_at", - "created_at", - "updated_at", - "created_by", - "updated_by", - "workspace", - "project", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "deleted_at", + "created_at", + "updated_at", + "created_by", + "updated_by", + "workspace", + "project", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if deleted_at (nullable) is None - # and __fields_set__ contains the field - if self.deleted_at is None and "deleted_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.deleted_at is None and "deleted_at" in self.model_fields_set: _dict['deleted_at'] = None # set to None if value_datetime (nullable) is None - # and __fields_set__ contains the field - if self.value_datetime is None and "value_datetime" in self.__fields_set__: + # and model_fields_set contains the field + if self.value_datetime is None and "value_datetime" in self.model_fields_set: _dict['value_datetime'] = None # set to None if value_uuid (nullable) is None - # and __fields_set__ contains the field - if self.value_uuid is None and "value_uuid" in self.__fields_set__: + # and model_fields_set contains the field + if self.value_uuid is None and "value_uuid" in self.model_fields_set: _dict['value_uuid'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if updated_by (nullable) is None - # and __fields_set__ contains the field - if self.updated_by is None and "updated_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: _dict['updated_by'] = None # set to None if project (nullable) is None - # and __fields_set__ contains the field - if self.project is None and "project" in self.__fields_set__: + # and model_fields_set contains the field + if self.project is None and "project" in self.model_fields_set: _dict['project'] = None # set to None if value_option (nullable) is None - # and __fields_set__ contains the field - if self.value_option is None and "value_option" in self.__fields_set__: + # and model_fields_set contains the field + if self.value_option is None and "value_option" in self.model_fields_set: _dict['value_option'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> IssuePropertyValueAPI: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssuePropertyValueAPI from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssuePropertyValueAPI.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssuePropertyValueAPI.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "deleted_at": obj.get("deleted_at"), "created_at": obj.get("created_at"), @@ -151,7 +177,7 @@ def from_dict(cls, obj: dict) -> IssuePropertyValueAPI: "workspace": obj.get("workspace"), "project": obj.get("project"), "issue": obj.get("issue"), - "var_property": obj.get("property"), + "property": obj.get("property"), "value_option": obj.get("value_option") }) return _obj diff --git a/plane/models/issue_property_value_api_detail.py b/plane/models/issue_property_value_api_detail.py index fee60f1..8772156 100644 --- a/plane/models/issue_property_value_api_detail.py +++ b/plane/models/issue_property_value_api_detail.py @@ -18,53 +18,70 @@ import re # noqa: F401 import json - -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class IssuePropertyValueAPIDetail(BaseModel): """ - Serializer for aggregated issue property values response. This serializer handles the response format from the query_annotator method which returns property_id and values (ArrayAgg of property values). # noqa: E501 - """ - property_id: StrictStr = Field(default=..., description="The ID of the issue property") - values: conlist(StrictStr) = Field(default=..., description="List of aggregated property values for the given property") - __properties = ["property_id", "values"] + Serializer for aggregated issue property values response. This serializer handles the response format from the query_annotator method which returns property_id and values (ArrayAgg of property values). + """ # noqa: E501 + property_id: StrictStr = Field(description="The ID of the issue property") + values: List[StrictStr] = Field(description="List of aggregated property values for the given property") + __properties: ClassVar[List[str]] = ["property_id", "values"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssuePropertyValueAPIDetail: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssuePropertyValueAPIDetail from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> IssuePropertyValueAPIDetail: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssuePropertyValueAPIDetail from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssuePropertyValueAPIDetail.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssuePropertyValueAPIDetail.parse_obj({ + _obj = cls.model_validate({ "property_id": obj.get("property_id"), "values": obj.get("values") }) diff --git a/plane/models/issue_property_value_api_request.py b/plane/models/issue_property_value_api_request.py index 9daa218..c4b92e2 100644 --- a/plane/models/issue_property_value_api_request.py +++ b/plane/models/issue_property_value_api_request.py @@ -19,86 +19,104 @@ import json from datetime import datetime -from typing import Optional, Union -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self class IssuePropertyValueAPIRequest(BaseModel): """ IssuePropertyValueAPIRequest - """ + """ # noqa: E501 value_text: Optional[StrictStr] = None value_boolean: Optional[StrictBool] = None value_decimal: Optional[Union[StrictFloat, StrictInt]] = None value_datetime: Optional[datetime] = None value_uuid: Optional[StrictStr] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None - issue: StrictStr = Field(...) - var_property: StrictStr = Field(default=..., alias="property") + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + issue: StrictStr + var_property: StrictStr = Field(alias="property") value_option: Optional[StrictStr] = None - __properties = ["value_text", "value_boolean", "value_decimal", "value_datetime", "value_uuid", "external_source", "external_id", "issue", "property", "value_option"] + __properties: ClassVar[List[str]] = ["value_text", "value_boolean", "value_decimal", "value_datetime", "value_uuid", "external_source", "external_id", "issue", "property", "value_option"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssuePropertyValueAPIRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssuePropertyValueAPIRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if value_datetime (nullable) is None - # and __fields_set__ contains the field - if self.value_datetime is None and "value_datetime" in self.__fields_set__: + # and model_fields_set contains the field + if self.value_datetime is None and "value_datetime" in self.model_fields_set: _dict['value_datetime'] = None # set to None if value_uuid (nullable) is None - # and __fields_set__ contains the field - if self.value_uuid is None and "value_uuid" in self.__fields_set__: + # and model_fields_set contains the field + if self.value_uuid is None and "value_uuid" in self.model_fields_set: _dict['value_uuid'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if value_option (nullable) is None - # and __fields_set__ contains the field - if self.value_option is None and "value_option" in self.__fields_set__: + # and model_fields_set contains the field + if self.value_option is None and "value_option" in self.model_fields_set: _dict['value_option'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> IssuePropertyValueAPIRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssuePropertyValueAPIRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssuePropertyValueAPIRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssuePropertyValueAPIRequest.parse_obj({ + _obj = cls.model_validate({ "value_text": obj.get("value_text"), "value_boolean": obj.get("value_boolean"), "value_decimal": obj.get("value_decimal"), @@ -107,7 +125,7 @@ def from_dict(cls, obj: dict) -> IssuePropertyValueAPIRequest: "external_source": obj.get("external_source"), "external_id": obj.get("external_id"), "issue": obj.get("issue"), - "var_property": obj.get("property"), + "property": obj.get("property"), "value_option": obj.get("value_option") }) return _obj diff --git a/plane/models/issue_request.py b/plane/models/issue_request.py index d199767..c5bd6f5 100644 --- a/plane/models/issue_request.py +++ b/plane/models/issue_request.py @@ -19,150 +19,168 @@ import json from datetime import date, datetime -from typing import Optional, Union -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, conint, conlist, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated from plane.models.priority_enum import PriorityEnum +from typing import Set +from typing_extensions import Self class IssueRequest(BaseModel): """ - Comprehensive work item serializer with full relationship management. Handles complete work item lifecycle including assignees, labels, validation, and related model updates. Supports dynamic field expansion and HTML content processing. # noqa: E501 - """ - assignees: Optional[conlist(StrictStr)] = None - labels: Optional[conlist(StrictStr)] = None + Comprehensive work item serializer with full relationship management. Handles complete work item lifecycle including assignees, labels, validation, and related model updates. Supports dynamic field expansion and HTML content processing. + """ # noqa: E501 + assignees: Optional[List[StrictStr]] = None + labels: Optional[List[StrictStr]] = None type_id: Optional[StrictStr] = None deleted_at: Optional[datetime] = None - point: Optional[conint(strict=True, le=12, ge=0)] = None - name: constr(strict=True, max_length=255, min_length=1) = Field(...) + point: Optional[Annotated[int, Field(le=12, strict=True, ge=0)]] = None + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] description_html: Optional[StrictStr] = None description_stripped: Optional[StrictStr] = None priority: Optional[PriorityEnum] = None start_date: Optional[date] = None target_date: Optional[date] = None - sequence_id: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None + sequence_id: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None sort_order: Optional[Union[StrictFloat, StrictInt]] = None completed_at: Optional[datetime] = None archived_at: Optional[date] = None is_draft: Optional[StrictBool] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None created_by: Optional[StrictStr] = None parent: Optional[StrictStr] = None state: Optional[StrictStr] = None estimate_point: Optional[StrictStr] = None type: Optional[StrictStr] = None - __properties = ["assignees", "labels", "type_id", "deleted_at", "point", "name", "description_html", "description_stripped", "priority", "start_date", "target_date", "sequence_id", "sort_order", "completed_at", "archived_at", "is_draft", "external_source", "external_id", "created_by", "parent", "state", "estimate_point", "type"] + __properties: ClassVar[List[str]] = ["assignees", "labels", "type_id", "deleted_at", "point", "name", "description_html", "description_stripped", "priority", "start_date", "target_date", "sequence_id", "sort_order", "completed_at", "archived_at", "is_draft", "external_source", "external_id", "created_by", "parent", "state", "estimate_point", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssueRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssueRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if type_id (nullable) is None - # and __fields_set__ contains the field - if self.type_id is None and "type_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.type_id is None and "type_id" in self.model_fields_set: _dict['type_id'] = None # set to None if deleted_at (nullable) is None - # and __fields_set__ contains the field - if self.deleted_at is None and "deleted_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.deleted_at is None and "deleted_at" in self.model_fields_set: _dict['deleted_at'] = None # set to None if point (nullable) is None - # and __fields_set__ contains the field - if self.point is None and "point" in self.__fields_set__: + # and model_fields_set contains the field + if self.point is None and "point" in self.model_fields_set: _dict['point'] = None # set to None if description_stripped (nullable) is None - # and __fields_set__ contains the field - if self.description_stripped is None and "description_stripped" in self.__fields_set__: + # and model_fields_set contains the field + if self.description_stripped is None and "description_stripped" in self.model_fields_set: _dict['description_stripped'] = None # set to None if start_date (nullable) is None - # and __fields_set__ contains the field - if self.start_date is None and "start_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.start_date is None and "start_date" in self.model_fields_set: _dict['start_date'] = None # set to None if target_date (nullable) is None - # and __fields_set__ contains the field - if self.target_date is None and "target_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.target_date is None and "target_date" in self.model_fields_set: _dict['target_date'] = None # set to None if completed_at (nullable) is None - # and __fields_set__ contains the field - if self.completed_at is None and "completed_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.completed_at is None and "completed_at" in self.model_fields_set: _dict['completed_at'] = None # set to None if archived_at (nullable) is None - # and __fields_set__ contains the field - if self.archived_at is None and "archived_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.archived_at is None and "archived_at" in self.model_fields_set: _dict['archived_at'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if parent (nullable) is None - # and __fields_set__ contains the field - if self.parent is None and "parent" in self.__fields_set__: + # and model_fields_set contains the field + if self.parent is None and "parent" in self.model_fields_set: _dict['parent'] = None # set to None if state (nullable) is None - # and __fields_set__ contains the field - if self.state is None and "state" in self.__fields_set__: + # and model_fields_set contains the field + if self.state is None and "state" in self.model_fields_set: _dict['state'] = None # set to None if estimate_point (nullable) is None - # and __fields_set__ contains the field - if self.estimate_point is None and "estimate_point" in self.__fields_set__: + # and model_fields_set contains the field + if self.estimate_point is None and "estimate_point" in self.model_fields_set: _dict['estimate_point'] = None # set to None if type (nullable) is None - # and __fields_set__ contains the field - if self.type is None and "type" in self.__fields_set__: + # and model_fields_set contains the field + if self.type is None and "type" in self.model_fields_set: _dict['type'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> IssueRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssueRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssueRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssueRequest.parse_obj({ + _obj = cls.model_validate({ "assignees": obj.get("assignees"), "labels": obj.get("labels"), "type_id": obj.get("type_id"), diff --git a/plane/models/issue_search.py b/plane/models/issue_search.py index da324dc..f206bcf 100644 --- a/plane/models/issue_search.py +++ b/plane/models/issue_search.py @@ -18,61 +18,78 @@ import re # noqa: F401 import json - -from pydantic import BaseModel, Field, conlist +from pydantic import BaseModel, ConfigDict +from typing import Any, ClassVar, Dict, List from plane.models.issue_search_item import IssueSearchItem +from typing import Optional, Set +from typing_extensions import Self class IssueSearch(BaseModel): """ - Search results for work items. Provides list of issues with their identifiers, names, and project context. # noqa: E501 - """ - issues: conlist(IssueSearchItem) = Field(...) - __properties = ["issues"] + Search results for work items. Provides list of issues with their identifiers, names, and project context. + """ # noqa: E501 + issues: List[IssueSearchItem] + __properties: ClassVar[List[str]] = ["issues"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssueSearch: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssueSearch from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in issues (list) _items = [] if self.issues: - for _item in self.issues: - if _item: - _items.append(_item.to_dict()) + for _item_issues in self.issues: + if _item_issues: + _items.append(_item_issues.to_dict()) _dict['issues'] = _items return _dict @classmethod - def from_dict(cls, obj: dict) -> IssueSearch: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssueSearch from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssueSearch.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssueSearch.parse_obj({ - "issues": [IssueSearchItem.from_dict(_item) for _item in obj.get("issues")] if obj.get("issues") is not None else None + _obj = cls.model_validate({ + "issues": [IssueSearchItem.from_dict(_item) for _item in obj["issues"]] if obj.get("issues") is not None else None }) return _obj diff --git a/plane/models/issue_search_item.py b/plane/models/issue_search_item.py index fd33586..54dae7f 100644 --- a/plane/models/issue_search_item.py +++ b/plane/models/issue_search_item.py @@ -18,58 +18,74 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class IssueSearchItem(BaseModel): """ - Individual issue component for search results. Provides standardized search result structure including work item identifiers, project context, and workspace information for search API responses. # noqa: E501 - """ - id: StrictStr = Field(default=..., description="Issue ID") - name: StrictStr = Field(default=..., description="Issue name") - sequence_id: StrictStr = Field(default=..., description="Issue sequence ID") - project__identifier: StrictStr = Field(default=..., description="Project identifier") - project_id: StrictStr = Field(default=..., description="Project ID") - workspace__slug: StrictStr = Field(default=..., description="Workspace slug") - __properties = ["id", "name", "sequence_id", "project__identifier", "project_id", "workspace__slug"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + Individual issue component for search results. Provides standardized search result structure including work item identifiers, project context, and workspace information for search API responses. + """ # noqa: E501 + id: StrictStr = Field(description="Issue ID") + name: StrictStr = Field(description="Issue name") + sequence_id: StrictStr = Field(description="Issue sequence ID") + project__identifier: StrictStr = Field(description="Project identifier") + project_id: StrictStr = Field(description="Project ID") + workspace__slug: StrictStr = Field(description="Workspace slug") + __properties: ClassVar[List[str]] = ["id", "name", "sequence_id", "project__identifier", "project_id", "workspace__slug"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssueSearchItem: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssueSearchItem from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> IssueSearchItem: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssueSearchItem from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssueSearchItem.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssueSearchItem.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "name": obj.get("name"), "sequence_id": obj.get("sequence_id"), diff --git a/plane/models/issue_type_api.py b/plane/models/issue_type_api.py index f89127c..01e7cfb 100644 --- a/plane/models/issue_type_api.py +++ b/plane/models/issue_type_api.py @@ -19,108 +19,136 @@ import json from datetime import datetime -from typing import Any, Optional, Union -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, conlist, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self class IssueTypeAPI(BaseModel): """ IssueTypeAPI - """ + """ # noqa: E501 id: Optional[StrictStr] = None deleted_at: Optional[datetime] = None - project_ids: Optional[conlist(StrictStr)] = None + project_ids: Optional[List[StrictStr]] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None - name: constr(strict=True, max_length=255) = Field(...) + name: Annotated[str, Field(strict=True, max_length=255)] description: Optional[StrictStr] = None logo_props: Optional[Any] = None is_epic: Optional[StrictBool] = None is_default: Optional[StrictBool] = None is_active: Optional[StrictBool] = None level: Optional[Union[StrictFloat, StrictInt]] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None created_by: Optional[StrictStr] = None updated_by: Optional[StrictStr] = None workspace: Optional[StrictStr] = None - __properties = ["id", "deleted_at", "project_ids", "created_at", "updated_at", "name", "description", "logo_props", "is_epic", "is_default", "is_active", "level", "external_source", "external_id", "created_by", "updated_by", "workspace"] + __properties: ClassVar[List[str]] = ["id", "deleted_at", "project_ids", "created_at", "updated_at", "name", "description", "logo_props", "is_epic", "is_default", "is_active", "level", "external_source", "external_id", "created_by", "updated_by", "workspace"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssueTypeAPI: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssueTypeAPI from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "deleted_at", - "created_at", - "updated_at", - "logo_props", - "is_default", - "level", - "created_by", - "updated_by", - "workspace", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "deleted_at", + "created_at", + "updated_at", + "logo_props", + "is_default", + "level", + "created_by", + "updated_by", + "workspace", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if deleted_at (nullable) is None - # and __fields_set__ contains the field - if self.deleted_at is None and "deleted_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.deleted_at is None and "deleted_at" in self.model_fields_set: _dict['deleted_at'] = None # set to None if logo_props (nullable) is None - # and __fields_set__ contains the field - if self.logo_props is None and "logo_props" in self.__fields_set__: + # and model_fields_set contains the field + if self.logo_props is None and "logo_props" in self.model_fields_set: _dict['logo_props'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if updated_by (nullable) is None - # and __fields_set__ contains the field - if self.updated_by is None and "updated_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: _dict['updated_by'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> IssueTypeAPI: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssueTypeAPI from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssueTypeAPI.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssueTypeAPI.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "deleted_at": obj.get("deleted_at"), "project_ids": obj.get("project_ids"), diff --git a/plane/models/issue_type_api_request.py b/plane/models/issue_type_api_request.py index 45a1af2..c435b14 100644 --- a/plane/models/issue_type_api_request.py +++ b/plane/models/issue_type_api_request.py @@ -18,69 +18,86 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, conlist, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self class IssueTypeAPIRequest(BaseModel): """ IssueTypeAPIRequest - """ - project_ids: Optional[conlist(StrictStr)] = None - name: constr(strict=True, max_length=255, min_length=1) = Field(...) + """ # noqa: E501 + project_ids: Optional[List[StrictStr]] = None + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] description: Optional[StrictStr] = None is_epic: Optional[StrictBool] = None is_active: Optional[StrictBool] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None - __properties = ["project_ids", "name", "description", "is_epic", "is_active", "external_source", "external_id"] + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + __properties: ClassVar[List[str]] = ["project_ids", "name", "description", "is_epic", "is_active", "external_source", "external_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssueTypeAPIRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssueTypeAPIRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> IssueTypeAPIRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssueTypeAPIRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssueTypeAPIRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssueTypeAPIRequest.parse_obj({ + _obj = cls.model_validate({ "project_ids": obj.get("project_ids"), "name": obj.get("name"), "description": obj.get("description"), diff --git a/plane/models/issue_work_log_api.py b/plane/models/issue_work_log_api.py index f8b0653..c079906 100644 --- a/plane/models/issue_work_log_api.py +++ b/plane/models/issue_work_log_api.py @@ -19,77 +19,101 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, StrictStr, conint +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self class IssueWorkLogAPI(BaseModel): """ IssueWorkLogAPI - """ + """ # noqa: E501 id: Optional[StrictStr] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None description: Optional[StrictStr] = None - duration: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None + duration: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None created_by: Optional[StrictStr] = None updated_by: Optional[StrictStr] = None project_id: Optional[StrictStr] = None workspace_id: Optional[StrictStr] = None logged_by: Optional[StrictStr] = None - __properties = ["id", "created_at", "updated_at", "description", "duration", "created_by", "updated_by", "project_id", "workspace_id", "logged_by"] + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "description", "duration", "created_by", "updated_by", "project_id", "workspace_id", "logged_by"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssueWorkLogAPI: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssueWorkLogAPI from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "created_at", - "updated_at", - "project_id", - "workspace_id", - "logged_by", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "created_at", + "updated_at", + "project_id", + "workspace_id", + "logged_by", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if updated_by (nullable) is None - # and __fields_set__ contains the field - if self.updated_by is None and "updated_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: _dict['updated_by'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> IssueWorkLogAPI: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssueWorkLogAPI from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssueWorkLogAPI.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssueWorkLogAPI.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), diff --git a/plane/models/issue_work_log_api_request.py b/plane/models/issue_work_log_api_request.py index cd6fbdc..27fe927 100644 --- a/plane/models/issue_work_log_api_request.py +++ b/plane/models/issue_work_log_api_request.py @@ -18,66 +18,83 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictStr, conint +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self class IssueWorkLogAPIRequest(BaseModel): """ IssueWorkLogAPIRequest - """ + """ # noqa: E501 description: Optional[StrictStr] = None - duration: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None + duration: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None created_by: Optional[StrictStr] = None updated_by: Optional[StrictStr] = None - __properties = ["description", "duration", "created_by", "updated_by"] + __properties: ClassVar[List[str]] = ["description", "duration", "created_by", "updated_by"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> IssueWorkLogAPIRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of IssueWorkLogAPIRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if updated_by (nullable) is None - # and __fields_set__ contains the field - if self.updated_by is None and "updated_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: _dict['updated_by'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> IssueWorkLogAPIRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of IssueWorkLogAPIRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return IssueWorkLogAPIRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = IssueWorkLogAPIRequest.parse_obj({ + _obj = cls.model_validate({ "description": obj.get("description"), "duration": obj.get("duration"), "created_by": obj.get("created_by"), diff --git a/plane/models/label.py b/plane/models/label.py index 6b15cac..69a8717 100644 --- a/plane/models/label.py +++ b/plane/models/label.py @@ -19,109 +19,135 @@ import json from datetime import datetime -from typing import Optional, Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self class Label(BaseModel): """ - Full serializer for work item labels with complete metadata. Provides comprehensive label information including hierarchical relationships, visual properties, and organizational data for work item tagging. # noqa: E501 - """ + Full serializer for work item labels with complete metadata. Provides comprehensive label information including hierarchical relationships, visual properties, and organizational data for work item tagging. + """ # noqa: E501 id: Optional[StrictStr] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None deleted_at: Optional[datetime] = None - name: constr(strict=True, max_length=255) = Field(...) + name: Annotated[str, Field(strict=True, max_length=255)] description: Optional[StrictStr] = None - color: Optional[constr(strict=True, max_length=255)] = None + color: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None sort_order: Optional[Union[StrictFloat, StrictInt]] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None created_by: Optional[StrictStr] = None updated_by: Optional[StrictStr] = None workspace: Optional[StrictStr] = None project: Optional[StrictStr] = None parent: Optional[StrictStr] = None - __properties = ["id", "created_at", "updated_at", "deleted_at", "name", "description", "color", "sort_order", "external_source", "external_id", "created_by", "updated_by", "workspace", "project", "parent"] + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "deleted_at", "name", "description", "color", "sort_order", "external_source", "external_id", "created_by", "updated_by", "workspace", "project", "parent"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Label: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Label from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "created_at", - "updated_at", - "deleted_at", - "created_by", - "updated_by", - "workspace", - "project", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "created_at", + "updated_at", + "deleted_at", + "created_by", + "updated_by", + "workspace", + "project", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if deleted_at (nullable) is None - # and __fields_set__ contains the field - if self.deleted_at is None and "deleted_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.deleted_at is None and "deleted_at" in self.model_fields_set: _dict['deleted_at'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if updated_by (nullable) is None - # and __fields_set__ contains the field - if self.updated_by is None and "updated_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: _dict['updated_by'] = None # set to None if project (nullable) is None - # and __fields_set__ contains the field - if self.project is None and "project" in self.__fields_set__: + # and model_fields_set contains the field + if self.project is None and "project" in self.model_fields_set: _dict['project'] = None # set to None if parent (nullable) is None - # and __fields_set__ contains the field - if self.parent is None and "parent" in self.__fields_set__: + # and model_fields_set contains the field + if self.parent is None and "parent" in self.model_fields_set: _dict['parent'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Label: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Label from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Label.parse_obj(obj) + return cls.model_validate(obj) - _obj = Label.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), diff --git a/plane/models/label_create_update_request.py b/plane/models/label_create_update_request.py index e6a87af..cc3b34a 100644 --- a/plane/models/label_create_update_request.py +++ b/plane/models/label_create_update_request.py @@ -18,74 +18,91 @@ import re # noqa: F401 import json - -from typing import Optional, Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self class LabelCreateUpdateRequest(BaseModel): """ - Serializer for creating and updating work item labels. Manages label metadata including colors, descriptions, hierarchy, and sorting for work item categorization and filtering. # noqa: E501 - """ - name: constr(strict=True, max_length=255, min_length=1) = Field(...) - color: Optional[constr(strict=True, max_length=255)] = None + Serializer for creating and updating work item labels. Manages label metadata including colors, descriptions, hierarchy, and sorting for work item categorization and filtering. + """ # noqa: E501 + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] + color: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None description: Optional[StrictStr] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None parent: Optional[StrictStr] = None sort_order: Optional[Union[StrictFloat, StrictInt]] = None - __properties = ["name", "color", "description", "external_source", "external_id", "parent", "sort_order"] + __properties: ClassVar[List[str]] = ["name", "color", "description", "external_source", "external_id", "parent", "sort_order"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> LabelCreateUpdateRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of LabelCreateUpdateRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if parent (nullable) is None - # and __fields_set__ contains the field - if self.parent is None and "parent" in self.__fields_set__: + # and model_fields_set contains the field + if self.parent is None and "parent" in self.model_fields_set: _dict['parent'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> LabelCreateUpdateRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of LabelCreateUpdateRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return LabelCreateUpdateRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = LabelCreateUpdateRequest.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "color": obj.get("color"), "description": obj.get("description"), diff --git a/plane/models/module.py b/plane/models/module.py index d435fe4..5379fd2 100644 --- a/plane/models/module.py +++ b/plane/models/module.py @@ -19,14 +19,17 @@ import json from datetime import date, datetime -from typing import Any, Optional, Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated from plane.models.module_status_enum import ModuleStatusEnum +from typing import Set +from typing_extensions import Self class Module(BaseModel): """ - Comprehensive module serializer with work item metrics and member management. Provides complete module data including work item counts by status, member relationships, and progress tracking for feature-based project organization. # noqa: E501 - """ + Comprehensive module serializer with work item metrics and member management. Provides complete module data including work item counts by status, member relationships, and progress tracking for feature-based project organization. + """ # noqa: E501 id: Optional[StrictStr] = None total_issues: Optional[StrictInt] = None cancelled_issues: Optional[StrictInt] = None @@ -37,7 +40,7 @@ class Module(BaseModel): created_at: Optional[datetime] = None updated_at: Optional[datetime] = None deleted_at: Optional[datetime] = None - name: constr(strict=True, max_length=255) = Field(...) + name: Annotated[str, Field(strict=True, max_length=255)] description: Optional[StrictStr] = None description_text: Optional[Any] = None description_html: Optional[Any] = None @@ -46,8 +49,8 @@ class Module(BaseModel): status: Optional[ModuleStatusEnum] = None view_props: Optional[Any] = None sort_order: Optional[Union[StrictFloat, StrictInt]] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None archived_at: Optional[datetime] = None logo_props: Optional[Any] = None created_by: Optional[StrictStr] = None @@ -55,123 +58,152 @@ class Module(BaseModel): project: Optional[StrictStr] = None workspace: Optional[StrictStr] = None lead: Optional[StrictStr] = None - __properties = ["id", "total_issues", "cancelled_issues", "completed_issues", "started_issues", "unstarted_issues", "backlog_issues", "created_at", "updated_at", "deleted_at", "name", "description", "description_text", "description_html", "start_date", "target_date", "status", "view_props", "sort_order", "external_source", "external_id", "archived_at", "logo_props", "created_by", "updated_by", "project", "workspace", "lead"] + __properties: ClassVar[List[str]] = ["id", "total_issues", "cancelled_issues", "completed_issues", "started_issues", "unstarted_issues", "backlog_issues", "created_at", "updated_at", "deleted_at", "name", "description", "description_text", "description_html", "start_date", "target_date", "status", "view_props", "sort_order", "external_source", "external_id", "archived_at", "logo_props", "created_by", "updated_by", "project", "workspace", "lead"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Module: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Module from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "total_issues", - "cancelled_issues", - "completed_issues", - "started_issues", - "unstarted_issues", - "backlog_issues", - "created_at", - "updated_at", - "deleted_at", - "created_by", - "updated_by", - "project", - "workspace", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "total_issues", + "cancelled_issues", + "completed_issues", + "started_issues", + "unstarted_issues", + "backlog_issues", + "created_at", + "updated_at", + "deleted_at", + "created_by", + "updated_by", + "project", + "workspace", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if deleted_at (nullable) is None - # and __fields_set__ contains the field - if self.deleted_at is None and "deleted_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.deleted_at is None and "deleted_at" in self.model_fields_set: _dict['deleted_at'] = None # set to None if description_text (nullable) is None - # and __fields_set__ contains the field - if self.description_text is None and "description_text" in self.__fields_set__: + # and model_fields_set contains the field + if self.description_text is None and "description_text" in self.model_fields_set: _dict['description_text'] = None # set to None if description_html (nullable) is None - # and __fields_set__ contains the field - if self.description_html is None and "description_html" in self.__fields_set__: + # and model_fields_set contains the field + if self.description_html is None and "description_html" in self.model_fields_set: _dict['description_html'] = None # set to None if start_date (nullable) is None - # and __fields_set__ contains the field - if self.start_date is None and "start_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.start_date is None and "start_date" in self.model_fields_set: _dict['start_date'] = None # set to None if target_date (nullable) is None - # and __fields_set__ contains the field - if self.target_date is None and "target_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.target_date is None and "target_date" in self.model_fields_set: _dict['target_date'] = None # set to None if view_props (nullable) is None - # and __fields_set__ contains the field - if self.view_props is None and "view_props" in self.__fields_set__: + # and model_fields_set contains the field + if self.view_props is None and "view_props" in self.model_fields_set: _dict['view_props'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if archived_at (nullable) is None - # and __fields_set__ contains the field - if self.archived_at is None and "archived_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.archived_at is None and "archived_at" in self.model_fields_set: _dict['archived_at'] = None # set to None if logo_props (nullable) is None - # and __fields_set__ contains the field - if self.logo_props is None and "logo_props" in self.__fields_set__: + # and model_fields_set contains the field + if self.logo_props is None and "logo_props" in self.model_fields_set: _dict['logo_props'] = None # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if updated_by (nullable) is None - # and __fields_set__ contains the field - if self.updated_by is None and "updated_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: _dict['updated_by'] = None # set to None if lead (nullable) is None - # and __fields_set__ contains the field - if self.lead is None and "lead" in self.__fields_set__: + # and model_fields_set contains the field + if self.lead is None and "lead" in self.model_fields_set: _dict['lead'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Module: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Module from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Module.parse_obj(obj) + return cls.model_validate(obj) - _obj = Module.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "total_issues": obj.get("total_issues"), "cancelled_issues": obj.get("cancelled_issues"), diff --git a/plane/models/module_create_request.py b/plane/models/module_create_request.py index ab6cdc2..8758608 100644 --- a/plane/models/module_create_request.py +++ b/plane/models/module_create_request.py @@ -19,86 +19,104 @@ import json from datetime import date -from typing import Optional -from pydantic import BaseModel, Field, StrictStr, conlist, constr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from plane.models.module_status_enum import ModuleStatusEnum +from typing import Set +from typing_extensions import Self class ModuleCreateRequest(BaseModel): """ - Serializer for creating modules with member validation and date checking. Handles module creation including member assignment validation, date range verification, and duplicate name prevention for feature-based project organization setup. # noqa: E501 - """ - name: constr(strict=True, max_length=255, min_length=1) = Field(...) + Serializer for creating modules with member validation and date checking. Handles module creation including member assignment validation, date range verification, and duplicate name prevention for feature-based project organization setup. + """ # noqa: E501 + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] description: Optional[StrictStr] = None start_date: Optional[date] = None target_date: Optional[date] = None status: Optional[ModuleStatusEnum] = None lead: Optional[StrictStr] = None - members: Optional[conlist(StrictStr)] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None - __properties = ["name", "description", "start_date", "target_date", "status", "lead", "members", "external_source", "external_id"] + members: Optional[List[StrictStr]] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + __properties: ClassVar[List[str]] = ["name", "description", "start_date", "target_date", "status", "lead", "members", "external_source", "external_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ModuleCreateRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ModuleCreateRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if start_date (nullable) is None - # and __fields_set__ contains the field - if self.start_date is None and "start_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.start_date is None and "start_date" in self.model_fields_set: _dict['start_date'] = None # set to None if target_date (nullable) is None - # and __fields_set__ contains the field - if self.target_date is None and "target_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.target_date is None and "target_date" in self.model_fields_set: _dict['target_date'] = None # set to None if lead (nullable) is None - # and __fields_set__ contains the field - if self.lead is None and "lead" in self.__fields_set__: + # and model_fields_set contains the field + if self.lead is None and "lead" in self.model_fields_set: _dict['lead'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> ModuleCreateRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ModuleCreateRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ModuleCreateRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = ModuleCreateRequest.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description"), "start_date": obj.get("start_date"), diff --git a/plane/models/module_issue.py b/plane/models/module_issue.py index faec8ee..3d5aa1e 100644 --- a/plane/models/module_issue.py +++ b/plane/models/module_issue.py @@ -19,86 +19,112 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Set +from typing_extensions import Self class ModuleIssue(BaseModel): """ - Serializer for module-work item relationships with sub-item counting. Manages the association between modules and work items, including hierarchical issue tracking for nested work item structures. # noqa: E501 - """ + Serializer for module-work item relationships with sub-item counting. Manages the association between modules and work items, including hierarchical issue tracking for nested work item structures. + """ # noqa: E501 id: Optional[StrictStr] = None sub_issues_count: Optional[StrictInt] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None - deleted_at: Optional[datetime] = Field(...) + deleted_at: Optional[datetime] created_by: Optional[StrictStr] = None updated_by: Optional[StrictStr] = None project: Optional[StrictStr] = None workspace: Optional[StrictStr] = None module: Optional[StrictStr] = None - issue: StrictStr = Field(...) - __properties = ["id", "sub_issues_count", "created_at", "updated_at", "deleted_at", "created_by", "updated_by", "project", "workspace", "module", "issue"] + issue: StrictStr + __properties: ClassVar[List[str]] = ["id", "sub_issues_count", "created_at", "updated_at", "deleted_at", "created_by", "updated_by", "project", "workspace", "module", "issue"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ModuleIssue: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ModuleIssue from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "sub_issues_count", - "created_at", - "updated_at", - "created_by", - "updated_by", - "project", - "workspace", - "module", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "sub_issues_count", + "created_at", + "updated_at", + "created_by", + "updated_by", + "project", + "workspace", + "module", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if deleted_at (nullable) is None - # and __fields_set__ contains the field - if self.deleted_at is None and "deleted_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.deleted_at is None and "deleted_at" in self.model_fields_set: _dict['deleted_at'] = None # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if updated_by (nullable) is None - # and __fields_set__ contains the field - if self.updated_by is None and "updated_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: _dict['updated_by'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> ModuleIssue: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ModuleIssue from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ModuleIssue.parse_obj(obj) + return cls.model_validate(obj) - _obj = ModuleIssue.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "sub_issues_count": obj.get("sub_issues_count"), "created_at": obj.get("created_at"), diff --git a/plane/models/module_issue_request_request.py b/plane/models/module_issue_request_request.py index 4cd57a3..cc5d1e6 100644 --- a/plane/models/module_issue_request_request.py +++ b/plane/models/module_issue_request_request.py @@ -18,52 +18,69 @@ import re # noqa: F401 import json - -from pydantic import BaseModel, Field, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class ModuleIssueRequestRequest(BaseModel): """ - Serializer for bulk work item assignment to modules. Validates work item ID lists for batch operations including module assignment and work item organization workflows. # noqa: E501 - """ - issues: conlist(StrictStr) = Field(default=..., description="List of issue IDs to add to the module") - __properties = ["issues"] + Serializer for bulk work item assignment to modules. Validates work item ID lists for batch operations including module assignment and work item organization workflows. + """ # noqa: E501 + issues: List[StrictStr] = Field(description="List of issue IDs to add to the module") + __properties: ClassVar[List[str]] = ["issues"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ModuleIssueRequestRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ModuleIssueRequestRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> ModuleIssueRequestRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ModuleIssueRequestRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ModuleIssueRequestRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = ModuleIssueRequestRequest.parse_obj({ + _obj = cls.model_validate({ "issues": obj.get("issues") }) return _obj diff --git a/plane/models/module_lite.py b/plane/models/module_lite.py index a0e759d..6513442 100644 --- a/plane/models/module_lite.py +++ b/plane/models/module_lite.py @@ -19,19 +19,22 @@ import json from datetime import date, datetime -from typing import Any, Optional, Union -from pydantic import BaseModel, Field, StrictFloat, StrictInt, StrictStr, conlist, constr +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated from plane.models.module_status_enum import ModuleStatusEnum +from typing import Set +from typing_extensions import Self class ModuleLite(BaseModel): """ - Lightweight module serializer for minimal data transfer. Provides essential module information without computed metrics, optimized for list views and reference lookups. # noqa: E501 - """ + Lightweight module serializer for minimal data transfer. Provides essential module information without computed metrics, optimized for list views and reference lookups. + """ # noqa: E501 id: Optional[StrictStr] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None - deleted_at: Optional[datetime] = Field(...) - name: constr(strict=True, max_length=255) = Field(...) + deleted_at: Optional[datetime] + name: Annotated[str, Field(strict=True, max_length=255)] description: Optional[StrictStr] = None description_text: Optional[Any] = None description_html: Optional[Any] = None @@ -40,123 +43,142 @@ class ModuleLite(BaseModel): status: Optional[ModuleStatusEnum] = None view_props: Optional[Any] = None sort_order: Optional[Union[StrictFloat, StrictInt]] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None archived_at: Optional[datetime] = None logo_props: Optional[Any] = None created_by: Optional[StrictStr] = None updated_by: Optional[StrictStr] = None - project: StrictStr = Field(...) - workspace: StrictStr = Field(...) + project: StrictStr + workspace: StrictStr lead: Optional[StrictStr] = None - members: Optional[conlist(StrictStr)] = None - __properties = ["id", "created_at", "updated_at", "deleted_at", "name", "description", "description_text", "description_html", "start_date", "target_date", "status", "view_props", "sort_order", "external_source", "external_id", "archived_at", "logo_props", "created_by", "updated_by", "project", "workspace", "lead", "members"] + members: Optional[List[StrictStr]] = None + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "deleted_at", "name", "description", "description_text", "description_html", "start_date", "target_date", "status", "view_props", "sort_order", "external_source", "external_id", "archived_at", "logo_props", "created_by", "updated_by", "project", "workspace", "lead", "members"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ModuleLite: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ModuleLite from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "created_at", - "updated_at", - "members", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "created_at", + "updated_at", + "members", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if deleted_at (nullable) is None - # and __fields_set__ contains the field - if self.deleted_at is None and "deleted_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.deleted_at is None and "deleted_at" in self.model_fields_set: _dict['deleted_at'] = None # set to None if description_text (nullable) is None - # and __fields_set__ contains the field - if self.description_text is None and "description_text" in self.__fields_set__: + # and model_fields_set contains the field + if self.description_text is None and "description_text" in self.model_fields_set: _dict['description_text'] = None # set to None if description_html (nullable) is None - # and __fields_set__ contains the field - if self.description_html is None and "description_html" in self.__fields_set__: + # and model_fields_set contains the field + if self.description_html is None and "description_html" in self.model_fields_set: _dict['description_html'] = None # set to None if start_date (nullable) is None - # and __fields_set__ contains the field - if self.start_date is None and "start_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.start_date is None and "start_date" in self.model_fields_set: _dict['start_date'] = None # set to None if target_date (nullable) is None - # and __fields_set__ contains the field - if self.target_date is None and "target_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.target_date is None and "target_date" in self.model_fields_set: _dict['target_date'] = None # set to None if view_props (nullable) is None - # and __fields_set__ contains the field - if self.view_props is None and "view_props" in self.__fields_set__: + # and model_fields_set contains the field + if self.view_props is None and "view_props" in self.model_fields_set: _dict['view_props'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if archived_at (nullable) is None - # and __fields_set__ contains the field - if self.archived_at is None and "archived_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.archived_at is None and "archived_at" in self.model_fields_set: _dict['archived_at'] = None # set to None if logo_props (nullable) is None - # and __fields_set__ contains the field - if self.logo_props is None and "logo_props" in self.__fields_set__: + # and model_fields_set contains the field + if self.logo_props is None and "logo_props" in self.model_fields_set: _dict['logo_props'] = None # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if updated_by (nullable) is None - # and __fields_set__ contains the field - if self.updated_by is None and "updated_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: _dict['updated_by'] = None # set to None if lead (nullable) is None - # and __fields_set__ contains the field - if self.lead is None and "lead" in self.__fields_set__: + # and model_fields_set contains the field + if self.lead is None and "lead" in self.model_fields_set: _dict['lead'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> ModuleLite: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ModuleLite from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ModuleLite.parse_obj(obj) + return cls.model_validate(obj) - _obj = ModuleLite.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), diff --git a/plane/models/module_status_enum.py b/plane/models/module_status_enum.py index e1cd00c..e7ed7bd 100644 --- a/plane/models/module_status_enum.py +++ b/plane/models/module_status_enum.py @@ -13,12 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import re # noqa: F401 -from aenum import Enum - - - +from enum import Enum +from typing_extensions import Self class ModuleStatusEnum(str, Enum): @@ -37,8 +35,8 @@ class ModuleStatusEnum(str, Enum): CANCELLED = 'cancelled' @classmethod - def from_json(cls, json_str: str) -> ModuleStatusEnum: # noqa: F821 + def from_json(cls, json_str: str) -> Self: """Create an instance of ModuleStatusEnum from a JSON string""" - return ModuleStatusEnum(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/plane/models/network_enum.py b/plane/models/network_enum.py index 8cba737..b1790d8 100644 --- a/plane/models/network_enum.py +++ b/plane/models/network_enum.py @@ -13,12 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import re # noqa: F401 -from aenum import Enum - - - +from enum import Enum +from typing_extensions import Self class NetworkEnum(int, Enum): @@ -33,8 +31,8 @@ class NetworkEnum(int, Enum): NUMBER_2 = 2 @classmethod - def from_json(cls, json_str: str) -> NetworkEnum: # noqa: F821 + def from_json(cls, json_str: str) -> Self: """Create an instance of NetworkEnum from a JSON string""" - return NetworkEnum(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/plane/models/paginated_archived_cycle_response.py b/plane/models/paginated_archived_cycle_response.py index d408442..aab8182 100644 --- a/plane/models/paginated_archived_cycle_response.py +++ b/plane/models/paginated_archived_cycle_response.py @@ -18,87 +18,103 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from plane.models.cycle import Cycle +from typing import Set +from typing_extensions import Self class PaginatedArchivedCycleResponse(BaseModel): """ PaginatedArchivedCycleResponse - """ - grouped_by: Optional[StrictStr] = Field(...) - sub_grouped_by: Optional[StrictStr] = Field(...) - total_count: StrictInt = Field(...) - next_cursor: StrictStr = Field(...) - prev_cursor: StrictStr = Field(...) - next_page_results: StrictBool = Field(...) - prev_page_results: StrictBool = Field(...) - count: StrictInt = Field(...) - total_pages: StrictInt = Field(...) - total_results: StrictInt = Field(...) - extra_stats: Optional[StrictStr] = Field(...) - results: conlist(Cycle) = Field(...) - __properties = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + grouped_by: Optional[StrictStr] + sub_grouped_by: Optional[StrictStr] + total_count: StrictInt + next_cursor: StrictStr + prev_cursor: StrictStr + next_page_results: StrictBool + prev_page_results: StrictBool + count: StrictInt + total_pages: StrictInt + total_results: StrictInt + extra_stats: Optional[StrictStr] + results: List[Cycle] + __properties: ClassVar[List[str]] = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PaginatedArchivedCycleResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PaginatedArchivedCycleResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # set to None if grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.grouped_by is None and "grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.grouped_by is None and "grouped_by" in self.model_fields_set: _dict['grouped_by'] = None # set to None if sub_grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.sub_grouped_by is None and "sub_grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.sub_grouped_by is None and "sub_grouped_by" in self.model_fields_set: _dict['sub_grouped_by'] = None # set to None if extra_stats (nullable) is None - # and __fields_set__ contains the field - if self.extra_stats is None and "extra_stats" in self.__fields_set__: + # and model_fields_set contains the field + if self.extra_stats is None and "extra_stats" in self.model_fields_set: _dict['extra_stats'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PaginatedArchivedCycleResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PaginatedArchivedCycleResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PaginatedArchivedCycleResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = PaginatedArchivedCycleResponse.parse_obj({ + _obj = cls.model_validate({ "grouped_by": obj.get("grouped_by"), "sub_grouped_by": obj.get("sub_grouped_by"), "total_count": obj.get("total_count"), @@ -110,7 +126,7 @@ def from_dict(cls, obj: dict) -> PaginatedArchivedCycleResponse: "total_pages": obj.get("total_pages"), "total_results": obj.get("total_results"), "extra_stats": obj.get("extra_stats"), - "results": [Cycle.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + "results": [Cycle.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/plane/models/paginated_archived_module_response.py b/plane/models/paginated_archived_module_response.py index fe1dbcd..d4531d0 100644 --- a/plane/models/paginated_archived_module_response.py +++ b/plane/models/paginated_archived_module_response.py @@ -18,87 +18,103 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from plane.models.module import Module +from typing import Set +from typing_extensions import Self class PaginatedArchivedModuleResponse(BaseModel): """ PaginatedArchivedModuleResponse - """ - grouped_by: Optional[StrictStr] = Field(...) - sub_grouped_by: Optional[StrictStr] = Field(...) - total_count: StrictInt = Field(...) - next_cursor: StrictStr = Field(...) - prev_cursor: StrictStr = Field(...) - next_page_results: StrictBool = Field(...) - prev_page_results: StrictBool = Field(...) - count: StrictInt = Field(...) - total_pages: StrictInt = Field(...) - total_results: StrictInt = Field(...) - extra_stats: Optional[StrictStr] = Field(...) - results: conlist(Module) = Field(...) - __properties = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + grouped_by: Optional[StrictStr] + sub_grouped_by: Optional[StrictStr] + total_count: StrictInt + next_cursor: StrictStr + prev_cursor: StrictStr + next_page_results: StrictBool + prev_page_results: StrictBool + count: StrictInt + total_pages: StrictInt + total_results: StrictInt + extra_stats: Optional[StrictStr] + results: List[Module] + __properties: ClassVar[List[str]] = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PaginatedArchivedModuleResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PaginatedArchivedModuleResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # set to None if grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.grouped_by is None and "grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.grouped_by is None and "grouped_by" in self.model_fields_set: _dict['grouped_by'] = None # set to None if sub_grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.sub_grouped_by is None and "sub_grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.sub_grouped_by is None and "sub_grouped_by" in self.model_fields_set: _dict['sub_grouped_by'] = None # set to None if extra_stats (nullable) is None - # and __fields_set__ contains the field - if self.extra_stats is None and "extra_stats" in self.__fields_set__: + # and model_fields_set contains the field + if self.extra_stats is None and "extra_stats" in self.model_fields_set: _dict['extra_stats'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PaginatedArchivedModuleResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PaginatedArchivedModuleResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PaginatedArchivedModuleResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = PaginatedArchivedModuleResponse.parse_obj({ + _obj = cls.model_validate({ "grouped_by": obj.get("grouped_by"), "sub_grouped_by": obj.get("sub_grouped_by"), "total_count": obj.get("total_count"), @@ -110,7 +126,7 @@ def from_dict(cls, obj: dict) -> PaginatedArchivedModuleResponse: "total_pages": obj.get("total_pages"), "total_results": obj.get("total_results"), "extra_stats": obj.get("extra_stats"), - "results": [Module.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + "results": [Module.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/plane/models/paginated_cycle_issue_response.py b/plane/models/paginated_cycle_issue_response.py index 67e8e4d..bb37965 100644 --- a/plane/models/paginated_cycle_issue_response.py +++ b/plane/models/paginated_cycle_issue_response.py @@ -18,87 +18,103 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from plane.models.cycle_issue import CycleIssue +from typing import Set +from typing_extensions import Self class PaginatedCycleIssueResponse(BaseModel): """ PaginatedCycleIssueResponse - """ - grouped_by: Optional[StrictStr] = Field(...) - sub_grouped_by: Optional[StrictStr] = Field(...) - total_count: StrictInt = Field(...) - next_cursor: StrictStr = Field(...) - prev_cursor: StrictStr = Field(...) - next_page_results: StrictBool = Field(...) - prev_page_results: StrictBool = Field(...) - count: StrictInt = Field(...) - total_pages: StrictInt = Field(...) - total_results: StrictInt = Field(...) - extra_stats: Optional[StrictStr] = Field(...) - results: conlist(CycleIssue) = Field(...) - __properties = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + grouped_by: Optional[StrictStr] + sub_grouped_by: Optional[StrictStr] + total_count: StrictInt + next_cursor: StrictStr + prev_cursor: StrictStr + next_page_results: StrictBool + prev_page_results: StrictBool + count: StrictInt + total_pages: StrictInt + total_results: StrictInt + extra_stats: Optional[StrictStr] + results: List[CycleIssue] + __properties: ClassVar[List[str]] = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PaginatedCycleIssueResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PaginatedCycleIssueResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # set to None if grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.grouped_by is None and "grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.grouped_by is None and "grouped_by" in self.model_fields_set: _dict['grouped_by'] = None # set to None if sub_grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.sub_grouped_by is None and "sub_grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.sub_grouped_by is None and "sub_grouped_by" in self.model_fields_set: _dict['sub_grouped_by'] = None # set to None if extra_stats (nullable) is None - # and __fields_set__ contains the field - if self.extra_stats is None and "extra_stats" in self.__fields_set__: + # and model_fields_set contains the field + if self.extra_stats is None and "extra_stats" in self.model_fields_set: _dict['extra_stats'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PaginatedCycleIssueResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PaginatedCycleIssueResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PaginatedCycleIssueResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = PaginatedCycleIssueResponse.parse_obj({ + _obj = cls.model_validate({ "grouped_by": obj.get("grouped_by"), "sub_grouped_by": obj.get("sub_grouped_by"), "total_count": obj.get("total_count"), @@ -110,7 +126,7 @@ def from_dict(cls, obj: dict) -> PaginatedCycleIssueResponse: "total_pages": obj.get("total_pages"), "total_results": obj.get("total_results"), "extra_stats": obj.get("extra_stats"), - "results": [CycleIssue.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + "results": [CycleIssue.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/plane/models/paginated_cycle_response.py b/plane/models/paginated_cycle_response.py index 1ab3de1..03310ed 100644 --- a/plane/models/paginated_cycle_response.py +++ b/plane/models/paginated_cycle_response.py @@ -18,87 +18,103 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from plane.models.cycle import Cycle +from typing import Set +from typing_extensions import Self class PaginatedCycleResponse(BaseModel): """ PaginatedCycleResponse - """ - grouped_by: Optional[StrictStr] = Field(...) - sub_grouped_by: Optional[StrictStr] = Field(...) - total_count: StrictInt = Field(...) - next_cursor: StrictStr = Field(...) - prev_cursor: StrictStr = Field(...) - next_page_results: StrictBool = Field(...) - prev_page_results: StrictBool = Field(...) - count: StrictInt = Field(...) - total_pages: StrictInt = Field(...) - total_results: StrictInt = Field(...) - extra_stats: Optional[StrictStr] = Field(...) - results: conlist(Cycle) = Field(...) - __properties = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + grouped_by: Optional[StrictStr] + sub_grouped_by: Optional[StrictStr] + total_count: StrictInt + next_cursor: StrictStr + prev_cursor: StrictStr + next_page_results: StrictBool + prev_page_results: StrictBool + count: StrictInt + total_pages: StrictInt + total_results: StrictInt + extra_stats: Optional[StrictStr] + results: List[Cycle] + __properties: ClassVar[List[str]] = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PaginatedCycleResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PaginatedCycleResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # set to None if grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.grouped_by is None and "grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.grouped_by is None and "grouped_by" in self.model_fields_set: _dict['grouped_by'] = None # set to None if sub_grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.sub_grouped_by is None and "sub_grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.sub_grouped_by is None and "sub_grouped_by" in self.model_fields_set: _dict['sub_grouped_by'] = None # set to None if extra_stats (nullable) is None - # and __fields_set__ contains the field - if self.extra_stats is None and "extra_stats" in self.__fields_set__: + # and model_fields_set contains the field + if self.extra_stats is None and "extra_stats" in self.model_fields_set: _dict['extra_stats'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PaginatedCycleResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PaginatedCycleResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PaginatedCycleResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = PaginatedCycleResponse.parse_obj({ + _obj = cls.model_validate({ "grouped_by": obj.get("grouped_by"), "sub_grouped_by": obj.get("sub_grouped_by"), "total_count": obj.get("total_count"), @@ -110,7 +126,7 @@ def from_dict(cls, obj: dict) -> PaginatedCycleResponse: "total_pages": obj.get("total_pages"), "total_results": obj.get("total_results"), "extra_stats": obj.get("extra_stats"), - "results": [Cycle.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + "results": [Cycle.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/plane/models/paginated_intake_issue_response.py b/plane/models/paginated_intake_issue_response.py index 3ec8adc..dd23515 100644 --- a/plane/models/paginated_intake_issue_response.py +++ b/plane/models/paginated_intake_issue_response.py @@ -18,87 +18,103 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from plane.models.intake_issue import IntakeIssue +from typing import Set +from typing_extensions import Self class PaginatedIntakeIssueResponse(BaseModel): """ PaginatedIntakeIssueResponse - """ - grouped_by: Optional[StrictStr] = Field(...) - sub_grouped_by: Optional[StrictStr] = Field(...) - total_count: StrictInt = Field(...) - next_cursor: StrictStr = Field(...) - prev_cursor: StrictStr = Field(...) - next_page_results: StrictBool = Field(...) - prev_page_results: StrictBool = Field(...) - count: StrictInt = Field(...) - total_pages: StrictInt = Field(...) - total_results: StrictInt = Field(...) - extra_stats: Optional[StrictStr] = Field(...) - results: conlist(IntakeIssue) = Field(...) - __properties = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + grouped_by: Optional[StrictStr] + sub_grouped_by: Optional[StrictStr] + total_count: StrictInt + next_cursor: StrictStr + prev_cursor: StrictStr + next_page_results: StrictBool + prev_page_results: StrictBool + count: StrictInt + total_pages: StrictInt + total_results: StrictInt + extra_stats: Optional[StrictStr] + results: List[IntakeIssue] + __properties: ClassVar[List[str]] = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PaginatedIntakeIssueResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PaginatedIntakeIssueResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # set to None if grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.grouped_by is None and "grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.grouped_by is None and "grouped_by" in self.model_fields_set: _dict['grouped_by'] = None # set to None if sub_grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.sub_grouped_by is None and "sub_grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.sub_grouped_by is None and "sub_grouped_by" in self.model_fields_set: _dict['sub_grouped_by'] = None # set to None if extra_stats (nullable) is None - # and __fields_set__ contains the field - if self.extra_stats is None and "extra_stats" in self.__fields_set__: + # and model_fields_set contains the field + if self.extra_stats is None and "extra_stats" in self.model_fields_set: _dict['extra_stats'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PaginatedIntakeIssueResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PaginatedIntakeIssueResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PaginatedIntakeIssueResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = PaginatedIntakeIssueResponse.parse_obj({ + _obj = cls.model_validate({ "grouped_by": obj.get("grouped_by"), "sub_grouped_by": obj.get("sub_grouped_by"), "total_count": obj.get("total_count"), @@ -110,7 +126,7 @@ def from_dict(cls, obj: dict) -> PaginatedIntakeIssueResponse: "total_pages": obj.get("total_pages"), "total_results": obj.get("total_results"), "extra_stats": obj.get("extra_stats"), - "results": [IntakeIssue.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + "results": [IntakeIssue.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/plane/models/paginated_issue_activity_detail_response.py b/plane/models/paginated_issue_activity_detail_response.py index 2f70b97..700da5c 100644 --- a/plane/models/paginated_issue_activity_detail_response.py +++ b/plane/models/paginated_issue_activity_detail_response.py @@ -18,87 +18,103 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from plane.models.issue_activity import IssueActivity +from typing import Set +from typing_extensions import Self class PaginatedIssueActivityDetailResponse(BaseModel): """ PaginatedIssueActivityDetailResponse - """ - grouped_by: Optional[StrictStr] = Field(...) - sub_grouped_by: Optional[StrictStr] = Field(...) - total_count: StrictInt = Field(...) - next_cursor: StrictStr = Field(...) - prev_cursor: StrictStr = Field(...) - next_page_results: StrictBool = Field(...) - prev_page_results: StrictBool = Field(...) - count: StrictInt = Field(...) - total_pages: StrictInt = Field(...) - total_results: StrictInt = Field(...) - extra_stats: Optional[StrictStr] = Field(...) - results: conlist(IssueActivity) = Field(...) - __properties = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + grouped_by: Optional[StrictStr] + sub_grouped_by: Optional[StrictStr] + total_count: StrictInt + next_cursor: StrictStr + prev_cursor: StrictStr + next_page_results: StrictBool + prev_page_results: StrictBool + count: StrictInt + total_pages: StrictInt + total_results: StrictInt + extra_stats: Optional[StrictStr] + results: List[IssueActivity] + __properties: ClassVar[List[str]] = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PaginatedIssueActivityDetailResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PaginatedIssueActivityDetailResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # set to None if grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.grouped_by is None and "grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.grouped_by is None and "grouped_by" in self.model_fields_set: _dict['grouped_by'] = None # set to None if sub_grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.sub_grouped_by is None and "sub_grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.sub_grouped_by is None and "sub_grouped_by" in self.model_fields_set: _dict['sub_grouped_by'] = None # set to None if extra_stats (nullable) is None - # and __fields_set__ contains the field - if self.extra_stats is None and "extra_stats" in self.__fields_set__: + # and model_fields_set contains the field + if self.extra_stats is None and "extra_stats" in self.model_fields_set: _dict['extra_stats'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PaginatedIssueActivityDetailResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PaginatedIssueActivityDetailResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PaginatedIssueActivityDetailResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = PaginatedIssueActivityDetailResponse.parse_obj({ + _obj = cls.model_validate({ "grouped_by": obj.get("grouped_by"), "sub_grouped_by": obj.get("sub_grouped_by"), "total_count": obj.get("total_count"), @@ -110,7 +126,7 @@ def from_dict(cls, obj: dict) -> PaginatedIssueActivityDetailResponse: "total_pages": obj.get("total_pages"), "total_results": obj.get("total_results"), "extra_stats": obj.get("extra_stats"), - "results": [IssueActivity.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + "results": [IssueActivity.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/plane/models/paginated_issue_activity_response.py b/plane/models/paginated_issue_activity_response.py index bf07321..1d423fd 100644 --- a/plane/models/paginated_issue_activity_response.py +++ b/plane/models/paginated_issue_activity_response.py @@ -18,87 +18,103 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from plane.models.issue_activity import IssueActivity +from typing import Set +from typing_extensions import Self class PaginatedIssueActivityResponse(BaseModel): """ PaginatedIssueActivityResponse - """ - grouped_by: Optional[StrictStr] = Field(...) - sub_grouped_by: Optional[StrictStr] = Field(...) - total_count: StrictInt = Field(...) - next_cursor: StrictStr = Field(...) - prev_cursor: StrictStr = Field(...) - next_page_results: StrictBool = Field(...) - prev_page_results: StrictBool = Field(...) - count: StrictInt = Field(...) - total_pages: StrictInt = Field(...) - total_results: StrictInt = Field(...) - extra_stats: Optional[StrictStr] = Field(...) - results: conlist(IssueActivity) = Field(...) - __properties = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + grouped_by: Optional[StrictStr] + sub_grouped_by: Optional[StrictStr] + total_count: StrictInt + next_cursor: StrictStr + prev_cursor: StrictStr + next_page_results: StrictBool + prev_page_results: StrictBool + count: StrictInt + total_pages: StrictInt + total_results: StrictInt + extra_stats: Optional[StrictStr] + results: List[IssueActivity] + __properties: ClassVar[List[str]] = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PaginatedIssueActivityResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PaginatedIssueActivityResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # set to None if grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.grouped_by is None and "grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.grouped_by is None and "grouped_by" in self.model_fields_set: _dict['grouped_by'] = None # set to None if sub_grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.sub_grouped_by is None and "sub_grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.sub_grouped_by is None and "sub_grouped_by" in self.model_fields_set: _dict['sub_grouped_by'] = None # set to None if extra_stats (nullable) is None - # and __fields_set__ contains the field - if self.extra_stats is None and "extra_stats" in self.__fields_set__: + # and model_fields_set contains the field + if self.extra_stats is None and "extra_stats" in self.model_fields_set: _dict['extra_stats'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PaginatedIssueActivityResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PaginatedIssueActivityResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PaginatedIssueActivityResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = PaginatedIssueActivityResponse.parse_obj({ + _obj = cls.model_validate({ "grouped_by": obj.get("grouped_by"), "sub_grouped_by": obj.get("sub_grouped_by"), "total_count": obj.get("total_count"), @@ -110,7 +126,7 @@ def from_dict(cls, obj: dict) -> PaginatedIssueActivityResponse: "total_pages": obj.get("total_pages"), "total_results": obj.get("total_results"), "extra_stats": obj.get("extra_stats"), - "results": [IssueActivity.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + "results": [IssueActivity.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/plane/models/paginated_issue_comment_response.py b/plane/models/paginated_issue_comment_response.py index 744766a..8d3af9c 100644 --- a/plane/models/paginated_issue_comment_response.py +++ b/plane/models/paginated_issue_comment_response.py @@ -18,87 +18,103 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from plane.models.issue_comment import IssueComment +from typing import Set +from typing_extensions import Self class PaginatedIssueCommentResponse(BaseModel): """ PaginatedIssueCommentResponse - """ - grouped_by: Optional[StrictStr] = Field(...) - sub_grouped_by: Optional[StrictStr] = Field(...) - total_count: StrictInt = Field(...) - next_cursor: StrictStr = Field(...) - prev_cursor: StrictStr = Field(...) - next_page_results: StrictBool = Field(...) - prev_page_results: StrictBool = Field(...) - count: StrictInt = Field(...) - total_pages: StrictInt = Field(...) - total_results: StrictInt = Field(...) - extra_stats: Optional[StrictStr] = Field(...) - results: conlist(IssueComment) = Field(...) - __properties = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + grouped_by: Optional[StrictStr] + sub_grouped_by: Optional[StrictStr] + total_count: StrictInt + next_cursor: StrictStr + prev_cursor: StrictStr + next_page_results: StrictBool + prev_page_results: StrictBool + count: StrictInt + total_pages: StrictInt + total_results: StrictInt + extra_stats: Optional[StrictStr] + results: List[IssueComment] + __properties: ClassVar[List[str]] = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PaginatedIssueCommentResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PaginatedIssueCommentResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # set to None if grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.grouped_by is None and "grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.grouped_by is None and "grouped_by" in self.model_fields_set: _dict['grouped_by'] = None # set to None if sub_grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.sub_grouped_by is None and "sub_grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.sub_grouped_by is None and "sub_grouped_by" in self.model_fields_set: _dict['sub_grouped_by'] = None # set to None if extra_stats (nullable) is None - # and __fields_set__ contains the field - if self.extra_stats is None and "extra_stats" in self.__fields_set__: + # and model_fields_set contains the field + if self.extra_stats is None and "extra_stats" in self.model_fields_set: _dict['extra_stats'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PaginatedIssueCommentResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PaginatedIssueCommentResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PaginatedIssueCommentResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = PaginatedIssueCommentResponse.parse_obj({ + _obj = cls.model_validate({ "grouped_by": obj.get("grouped_by"), "sub_grouped_by": obj.get("sub_grouped_by"), "total_count": obj.get("total_count"), @@ -110,7 +126,7 @@ def from_dict(cls, obj: dict) -> PaginatedIssueCommentResponse: "total_pages": obj.get("total_pages"), "total_results": obj.get("total_results"), "extra_stats": obj.get("extra_stats"), - "results": [IssueComment.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + "results": [IssueComment.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/plane/models/paginated_issue_link_detail_response.py b/plane/models/paginated_issue_link_detail_response.py index 55d29f2..c18d7be 100644 --- a/plane/models/paginated_issue_link_detail_response.py +++ b/plane/models/paginated_issue_link_detail_response.py @@ -18,87 +18,103 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from plane.models.issue_link import IssueLink +from typing import Set +from typing_extensions import Self class PaginatedIssueLinkDetailResponse(BaseModel): """ PaginatedIssueLinkDetailResponse - """ - grouped_by: Optional[StrictStr] = Field(...) - sub_grouped_by: Optional[StrictStr] = Field(...) - total_count: StrictInt = Field(...) - next_cursor: StrictStr = Field(...) - prev_cursor: StrictStr = Field(...) - next_page_results: StrictBool = Field(...) - prev_page_results: StrictBool = Field(...) - count: StrictInt = Field(...) - total_pages: StrictInt = Field(...) - total_results: StrictInt = Field(...) - extra_stats: Optional[StrictStr] = Field(...) - results: conlist(IssueLink) = Field(...) - __properties = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + grouped_by: Optional[StrictStr] + sub_grouped_by: Optional[StrictStr] + total_count: StrictInt + next_cursor: StrictStr + prev_cursor: StrictStr + next_page_results: StrictBool + prev_page_results: StrictBool + count: StrictInt + total_pages: StrictInt + total_results: StrictInt + extra_stats: Optional[StrictStr] + results: List[IssueLink] + __properties: ClassVar[List[str]] = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PaginatedIssueLinkDetailResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PaginatedIssueLinkDetailResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # set to None if grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.grouped_by is None and "grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.grouped_by is None and "grouped_by" in self.model_fields_set: _dict['grouped_by'] = None # set to None if sub_grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.sub_grouped_by is None and "sub_grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.sub_grouped_by is None and "sub_grouped_by" in self.model_fields_set: _dict['sub_grouped_by'] = None # set to None if extra_stats (nullable) is None - # and __fields_set__ contains the field - if self.extra_stats is None and "extra_stats" in self.__fields_set__: + # and model_fields_set contains the field + if self.extra_stats is None and "extra_stats" in self.model_fields_set: _dict['extra_stats'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PaginatedIssueLinkDetailResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PaginatedIssueLinkDetailResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PaginatedIssueLinkDetailResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = PaginatedIssueLinkDetailResponse.parse_obj({ + _obj = cls.model_validate({ "grouped_by": obj.get("grouped_by"), "sub_grouped_by": obj.get("sub_grouped_by"), "total_count": obj.get("total_count"), @@ -110,7 +126,7 @@ def from_dict(cls, obj: dict) -> PaginatedIssueLinkDetailResponse: "total_pages": obj.get("total_pages"), "total_results": obj.get("total_results"), "extra_stats": obj.get("extra_stats"), - "results": [IssueLink.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + "results": [IssueLink.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/plane/models/paginated_issue_link_response.py b/plane/models/paginated_issue_link_response.py index d8e9600..da4d4e6 100644 --- a/plane/models/paginated_issue_link_response.py +++ b/plane/models/paginated_issue_link_response.py @@ -18,87 +18,103 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from plane.models.issue_link import IssueLink +from typing import Set +from typing_extensions import Self class PaginatedIssueLinkResponse(BaseModel): """ PaginatedIssueLinkResponse - """ - grouped_by: Optional[StrictStr] = Field(...) - sub_grouped_by: Optional[StrictStr] = Field(...) - total_count: StrictInt = Field(...) - next_cursor: StrictStr = Field(...) - prev_cursor: StrictStr = Field(...) - next_page_results: StrictBool = Field(...) - prev_page_results: StrictBool = Field(...) - count: StrictInt = Field(...) - total_pages: StrictInt = Field(...) - total_results: StrictInt = Field(...) - extra_stats: Optional[StrictStr] = Field(...) - results: conlist(IssueLink) = Field(...) - __properties = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + grouped_by: Optional[StrictStr] + sub_grouped_by: Optional[StrictStr] + total_count: StrictInt + next_cursor: StrictStr + prev_cursor: StrictStr + next_page_results: StrictBool + prev_page_results: StrictBool + count: StrictInt + total_pages: StrictInt + total_results: StrictInt + extra_stats: Optional[StrictStr] + results: List[IssueLink] + __properties: ClassVar[List[str]] = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PaginatedIssueLinkResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PaginatedIssueLinkResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # set to None if grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.grouped_by is None and "grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.grouped_by is None and "grouped_by" in self.model_fields_set: _dict['grouped_by'] = None # set to None if sub_grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.sub_grouped_by is None and "sub_grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.sub_grouped_by is None and "sub_grouped_by" in self.model_fields_set: _dict['sub_grouped_by'] = None # set to None if extra_stats (nullable) is None - # and __fields_set__ contains the field - if self.extra_stats is None and "extra_stats" in self.__fields_set__: + # and model_fields_set contains the field + if self.extra_stats is None and "extra_stats" in self.model_fields_set: _dict['extra_stats'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PaginatedIssueLinkResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PaginatedIssueLinkResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PaginatedIssueLinkResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = PaginatedIssueLinkResponse.parse_obj({ + _obj = cls.model_validate({ "grouped_by": obj.get("grouped_by"), "sub_grouped_by": obj.get("sub_grouped_by"), "total_count": obj.get("total_count"), @@ -110,7 +126,7 @@ def from_dict(cls, obj: dict) -> PaginatedIssueLinkResponse: "total_pages": obj.get("total_pages"), "total_results": obj.get("total_results"), "extra_stats": obj.get("extra_stats"), - "results": [IssueLink.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + "results": [IssueLink.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/plane/models/paginated_label_response.py b/plane/models/paginated_label_response.py index c4a40b4..5007ff3 100644 --- a/plane/models/paginated_label_response.py +++ b/plane/models/paginated_label_response.py @@ -18,87 +18,103 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from plane.models.label import Label +from typing import Set +from typing_extensions import Self class PaginatedLabelResponse(BaseModel): """ PaginatedLabelResponse - """ - grouped_by: Optional[StrictStr] = Field(...) - sub_grouped_by: Optional[StrictStr] = Field(...) - total_count: StrictInt = Field(...) - next_cursor: StrictStr = Field(...) - prev_cursor: StrictStr = Field(...) - next_page_results: StrictBool = Field(...) - prev_page_results: StrictBool = Field(...) - count: StrictInt = Field(...) - total_pages: StrictInt = Field(...) - total_results: StrictInt = Field(...) - extra_stats: Optional[StrictStr] = Field(...) - results: conlist(Label) = Field(...) - __properties = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + grouped_by: Optional[StrictStr] + sub_grouped_by: Optional[StrictStr] + total_count: StrictInt + next_cursor: StrictStr + prev_cursor: StrictStr + next_page_results: StrictBool + prev_page_results: StrictBool + count: StrictInt + total_pages: StrictInt + total_results: StrictInt + extra_stats: Optional[StrictStr] + results: List[Label] + __properties: ClassVar[List[str]] = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PaginatedLabelResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PaginatedLabelResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # set to None if grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.grouped_by is None and "grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.grouped_by is None and "grouped_by" in self.model_fields_set: _dict['grouped_by'] = None # set to None if sub_grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.sub_grouped_by is None and "sub_grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.sub_grouped_by is None and "sub_grouped_by" in self.model_fields_set: _dict['sub_grouped_by'] = None # set to None if extra_stats (nullable) is None - # and __fields_set__ contains the field - if self.extra_stats is None and "extra_stats" in self.__fields_set__: + # and model_fields_set contains the field + if self.extra_stats is None and "extra_stats" in self.model_fields_set: _dict['extra_stats'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PaginatedLabelResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PaginatedLabelResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PaginatedLabelResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = PaginatedLabelResponse.parse_obj({ + _obj = cls.model_validate({ "grouped_by": obj.get("grouped_by"), "sub_grouped_by": obj.get("sub_grouped_by"), "total_count": obj.get("total_count"), @@ -110,7 +126,7 @@ def from_dict(cls, obj: dict) -> PaginatedLabelResponse: "total_pages": obj.get("total_pages"), "total_results": obj.get("total_results"), "extra_stats": obj.get("extra_stats"), - "results": [Label.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + "results": [Label.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/plane/models/paginated_module_issue_response.py b/plane/models/paginated_module_issue_response.py index b03f306..44ad5d1 100644 --- a/plane/models/paginated_module_issue_response.py +++ b/plane/models/paginated_module_issue_response.py @@ -18,87 +18,103 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from plane.models.issue import Issue +from typing import Set +from typing_extensions import Self class PaginatedModuleIssueResponse(BaseModel): """ PaginatedModuleIssueResponse - """ - grouped_by: Optional[StrictStr] = Field(...) - sub_grouped_by: Optional[StrictStr] = Field(...) - total_count: StrictInt = Field(...) - next_cursor: StrictStr = Field(...) - prev_cursor: StrictStr = Field(...) - next_page_results: StrictBool = Field(...) - prev_page_results: StrictBool = Field(...) - count: StrictInt = Field(...) - total_pages: StrictInt = Field(...) - total_results: StrictInt = Field(...) - extra_stats: Optional[StrictStr] = Field(...) - results: conlist(Issue) = Field(...) - __properties = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + grouped_by: Optional[StrictStr] + sub_grouped_by: Optional[StrictStr] + total_count: StrictInt + next_cursor: StrictStr + prev_cursor: StrictStr + next_page_results: StrictBool + prev_page_results: StrictBool + count: StrictInt + total_pages: StrictInt + total_results: StrictInt + extra_stats: Optional[StrictStr] + results: List[Issue] + __properties: ClassVar[List[str]] = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PaginatedModuleIssueResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PaginatedModuleIssueResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # set to None if grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.grouped_by is None and "grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.grouped_by is None and "grouped_by" in self.model_fields_set: _dict['grouped_by'] = None # set to None if sub_grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.sub_grouped_by is None and "sub_grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.sub_grouped_by is None and "sub_grouped_by" in self.model_fields_set: _dict['sub_grouped_by'] = None # set to None if extra_stats (nullable) is None - # and __fields_set__ contains the field - if self.extra_stats is None and "extra_stats" in self.__fields_set__: + # and model_fields_set contains the field + if self.extra_stats is None and "extra_stats" in self.model_fields_set: _dict['extra_stats'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PaginatedModuleIssueResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PaginatedModuleIssueResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PaginatedModuleIssueResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = PaginatedModuleIssueResponse.parse_obj({ + _obj = cls.model_validate({ "grouped_by": obj.get("grouped_by"), "sub_grouped_by": obj.get("sub_grouped_by"), "total_count": obj.get("total_count"), @@ -110,7 +126,7 @@ def from_dict(cls, obj: dict) -> PaginatedModuleIssueResponse: "total_pages": obj.get("total_pages"), "total_results": obj.get("total_results"), "extra_stats": obj.get("extra_stats"), - "results": [Issue.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + "results": [Issue.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/plane/models/paginated_module_response.py b/plane/models/paginated_module_response.py index 6d8b9e8..0db3734 100644 --- a/plane/models/paginated_module_response.py +++ b/plane/models/paginated_module_response.py @@ -18,87 +18,103 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from plane.models.module import Module +from typing import Set +from typing_extensions import Self class PaginatedModuleResponse(BaseModel): """ PaginatedModuleResponse - """ - grouped_by: Optional[StrictStr] = Field(...) - sub_grouped_by: Optional[StrictStr] = Field(...) - total_count: StrictInt = Field(...) - next_cursor: StrictStr = Field(...) - prev_cursor: StrictStr = Field(...) - next_page_results: StrictBool = Field(...) - prev_page_results: StrictBool = Field(...) - count: StrictInt = Field(...) - total_pages: StrictInt = Field(...) - total_results: StrictInt = Field(...) - extra_stats: Optional[StrictStr] = Field(...) - results: conlist(Module) = Field(...) - __properties = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + grouped_by: Optional[StrictStr] + sub_grouped_by: Optional[StrictStr] + total_count: StrictInt + next_cursor: StrictStr + prev_cursor: StrictStr + next_page_results: StrictBool + prev_page_results: StrictBool + count: StrictInt + total_pages: StrictInt + total_results: StrictInt + extra_stats: Optional[StrictStr] + results: List[Module] + __properties: ClassVar[List[str]] = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PaginatedModuleResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PaginatedModuleResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # set to None if grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.grouped_by is None and "grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.grouped_by is None and "grouped_by" in self.model_fields_set: _dict['grouped_by'] = None # set to None if sub_grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.sub_grouped_by is None and "sub_grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.sub_grouped_by is None and "sub_grouped_by" in self.model_fields_set: _dict['sub_grouped_by'] = None # set to None if extra_stats (nullable) is None - # and __fields_set__ contains the field - if self.extra_stats is None and "extra_stats" in self.__fields_set__: + # and model_fields_set contains the field + if self.extra_stats is None and "extra_stats" in self.model_fields_set: _dict['extra_stats'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PaginatedModuleResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PaginatedModuleResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PaginatedModuleResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = PaginatedModuleResponse.parse_obj({ + _obj = cls.model_validate({ "grouped_by": obj.get("grouped_by"), "sub_grouped_by": obj.get("sub_grouped_by"), "total_count": obj.get("total_count"), @@ -110,7 +126,7 @@ def from_dict(cls, obj: dict) -> PaginatedModuleResponse: "total_pages": obj.get("total_pages"), "total_results": obj.get("total_results"), "extra_stats": obj.get("extra_stats"), - "results": [Module.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + "results": [Module.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/plane/models/paginated_project_response.py b/plane/models/paginated_project_response.py index f72730d..0d6a6e0 100644 --- a/plane/models/paginated_project_response.py +++ b/plane/models/paginated_project_response.py @@ -18,87 +18,103 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from plane.models.project import Project +from typing import Set +from typing_extensions import Self class PaginatedProjectResponse(BaseModel): """ PaginatedProjectResponse - """ - grouped_by: Optional[StrictStr] = Field(...) - sub_grouped_by: Optional[StrictStr] = Field(...) - total_count: StrictInt = Field(...) - next_cursor: StrictStr = Field(...) - prev_cursor: StrictStr = Field(...) - next_page_results: StrictBool = Field(...) - prev_page_results: StrictBool = Field(...) - count: StrictInt = Field(...) - total_pages: StrictInt = Field(...) - total_results: StrictInt = Field(...) - extra_stats: Optional[StrictStr] = Field(...) - results: conlist(Project) = Field(...) - __properties = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + grouped_by: Optional[StrictStr] + sub_grouped_by: Optional[StrictStr] + total_count: StrictInt + next_cursor: StrictStr + prev_cursor: StrictStr + next_page_results: StrictBool + prev_page_results: StrictBool + count: StrictInt + total_pages: StrictInt + total_results: StrictInt + extra_stats: Optional[StrictStr] + results: List[Project] + __properties: ClassVar[List[str]] = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PaginatedProjectResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PaginatedProjectResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # set to None if grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.grouped_by is None and "grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.grouped_by is None and "grouped_by" in self.model_fields_set: _dict['grouped_by'] = None # set to None if sub_grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.sub_grouped_by is None and "sub_grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.sub_grouped_by is None and "sub_grouped_by" in self.model_fields_set: _dict['sub_grouped_by'] = None # set to None if extra_stats (nullable) is None - # and __fields_set__ contains the field - if self.extra_stats is None and "extra_stats" in self.__fields_set__: + # and model_fields_set contains the field + if self.extra_stats is None and "extra_stats" in self.model_fields_set: _dict['extra_stats'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PaginatedProjectResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PaginatedProjectResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PaginatedProjectResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = PaginatedProjectResponse.parse_obj({ + _obj = cls.model_validate({ "grouped_by": obj.get("grouped_by"), "sub_grouped_by": obj.get("sub_grouped_by"), "total_count": obj.get("total_count"), @@ -110,7 +126,7 @@ def from_dict(cls, obj: dict) -> PaginatedProjectResponse: "total_pages": obj.get("total_pages"), "total_results": obj.get("total_results"), "extra_stats": obj.get("extra_stats"), - "results": [Project.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + "results": [Project.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/plane/models/paginated_state_response.py b/plane/models/paginated_state_response.py index 5e6403f..fc38266 100644 --- a/plane/models/paginated_state_response.py +++ b/plane/models/paginated_state_response.py @@ -18,87 +18,103 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from plane.models.state import State +from typing import Set +from typing_extensions import Self class PaginatedStateResponse(BaseModel): """ PaginatedStateResponse - """ - grouped_by: Optional[StrictStr] = Field(...) - sub_grouped_by: Optional[StrictStr] = Field(...) - total_count: StrictInt = Field(...) - next_cursor: StrictStr = Field(...) - prev_cursor: StrictStr = Field(...) - next_page_results: StrictBool = Field(...) - prev_page_results: StrictBool = Field(...) - count: StrictInt = Field(...) - total_pages: StrictInt = Field(...) - total_results: StrictInt = Field(...) - extra_stats: Optional[StrictStr] = Field(...) - results: conlist(State) = Field(...) - __properties = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + grouped_by: Optional[StrictStr] + sub_grouped_by: Optional[StrictStr] + total_count: StrictInt + next_cursor: StrictStr + prev_cursor: StrictStr + next_page_results: StrictBool + prev_page_results: StrictBool + count: StrictInt + total_pages: StrictInt + total_results: StrictInt + extra_stats: Optional[StrictStr] + results: List[State] + __properties: ClassVar[List[str]] = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PaginatedStateResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PaginatedStateResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # set to None if grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.grouped_by is None and "grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.grouped_by is None and "grouped_by" in self.model_fields_set: _dict['grouped_by'] = None # set to None if sub_grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.sub_grouped_by is None and "sub_grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.sub_grouped_by is None and "sub_grouped_by" in self.model_fields_set: _dict['sub_grouped_by'] = None # set to None if extra_stats (nullable) is None - # and __fields_set__ contains the field - if self.extra_stats is None and "extra_stats" in self.__fields_set__: + # and model_fields_set contains the field + if self.extra_stats is None and "extra_stats" in self.model_fields_set: _dict['extra_stats'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PaginatedStateResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PaginatedStateResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PaginatedStateResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = PaginatedStateResponse.parse_obj({ + _obj = cls.model_validate({ "grouped_by": obj.get("grouped_by"), "sub_grouped_by": obj.get("sub_grouped_by"), "total_count": obj.get("total_count"), @@ -110,7 +126,7 @@ def from_dict(cls, obj: dict) -> PaginatedStateResponse: "total_pages": obj.get("total_pages"), "total_results": obj.get("total_results"), "extra_stats": obj.get("extra_stats"), - "results": [State.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + "results": [State.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/plane/models/paginated_work_item_response.py b/plane/models/paginated_work_item_response.py index 122fe26..90f963c 100644 --- a/plane/models/paginated_work_item_response.py +++ b/plane/models/paginated_work_item_response.py @@ -18,87 +18,103 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictInt, StrictStr, conlist +from pydantic import BaseModel, ConfigDict, StrictBool, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from plane.models.issue import Issue +from typing import Set +from typing_extensions import Self class PaginatedWorkItemResponse(BaseModel): """ PaginatedWorkItemResponse - """ - grouped_by: Optional[StrictStr] = Field(...) - sub_grouped_by: Optional[StrictStr] = Field(...) - total_count: StrictInt = Field(...) - next_cursor: StrictStr = Field(...) - prev_cursor: StrictStr = Field(...) - next_page_results: StrictBool = Field(...) - prev_page_results: StrictBool = Field(...) - count: StrictInt = Field(...) - total_pages: StrictInt = Field(...) - total_results: StrictInt = Field(...) - extra_stats: Optional[StrictStr] = Field(...) - results: conlist(Issue) = Field(...) - __properties = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] - - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True + """ # noqa: E501 + grouped_by: Optional[StrictStr] + sub_grouped_by: Optional[StrictStr] + total_count: StrictInt + next_cursor: StrictStr + prev_cursor: StrictStr + next_page_results: StrictBool + prev_page_results: StrictBool + count: StrictInt + total_pages: StrictInt + total_results: StrictInt + extra_stats: Optional[StrictStr] + results: List[Issue] + __properties: ClassVar[List[str]] = ["grouped_by", "sub_grouped_by", "total_count", "next_cursor", "prev_cursor", "next_page_results", "prev_page_results", "count", "total_pages", "total_results", "extra_stats", "results"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) + def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PaginatedWorkItemResponse: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PaginatedWorkItemResponse from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of each item in results (list) _items = [] if self.results: - for _item in self.results: - if _item: - _items.append(_item.to_dict()) + for _item_results in self.results: + if _item_results: + _items.append(_item_results.to_dict()) _dict['results'] = _items # set to None if grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.grouped_by is None and "grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.grouped_by is None and "grouped_by" in self.model_fields_set: _dict['grouped_by'] = None # set to None if sub_grouped_by (nullable) is None - # and __fields_set__ contains the field - if self.sub_grouped_by is None and "sub_grouped_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.sub_grouped_by is None and "sub_grouped_by" in self.model_fields_set: _dict['sub_grouped_by'] = None # set to None if extra_stats (nullable) is None - # and __fields_set__ contains the field - if self.extra_stats is None and "extra_stats" in self.__fields_set__: + # and model_fields_set contains the field + if self.extra_stats is None and "extra_stats" in self.model_fields_set: _dict['extra_stats'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PaginatedWorkItemResponse: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PaginatedWorkItemResponse from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PaginatedWorkItemResponse.parse_obj(obj) + return cls.model_validate(obj) - _obj = PaginatedWorkItemResponse.parse_obj({ + _obj = cls.model_validate({ "grouped_by": obj.get("grouped_by"), "sub_grouped_by": obj.get("sub_grouped_by"), "total_count": obj.get("total_count"), @@ -110,7 +126,7 @@ def from_dict(cls, obj: dict) -> PaginatedWorkItemResponse: "total_pages": obj.get("total_pages"), "total_results": obj.get("total_results"), "extra_stats": obj.get("extra_stats"), - "results": [Issue.from_dict(_item) for _item in obj.get("results")] if obj.get("results") is not None else None + "results": [Issue.from_dict(_item) for _item in obj["results"]] if obj.get("results") is not None else None }) return _obj diff --git a/plane/models/patched_asset_update_request.py b/plane/models/patched_asset_update_request.py index 6d3e9a8..d5d685e 100644 --- a/plane/models/patched_asset_update_request.py +++ b/plane/models/patched_asset_update_request.py @@ -18,58 +18,74 @@ import re # noqa: F401 import json - -from typing import Any, Optional -from pydantic import BaseModel, Field +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing import Set +from typing_extensions import Self class PatchedAssetUpdateRequest(BaseModel): """ - Serializer for asset status updates after successful upload completion. Handles post-upload asset metadata updates including attribute modifications and upload confirmation for S3-based file storage workflows. # noqa: E501 - """ + Serializer for asset status updates after successful upload completion. Handles post-upload asset metadata updates including attribute modifications and upload confirmation for S3-based file storage workflows. + """ # noqa: E501 attributes: Optional[Any] = Field(default=None, description="Additional attributes to update for the asset") - __properties = ["attributes"] + __properties: ClassVar[List[str]] = ["attributes"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedAssetUpdateRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedAssetUpdateRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if attributes (nullable) is None - # and __fields_set__ contains the field - if self.attributes is None and "attributes" in self.__fields_set__: + # and model_fields_set contains the field + if self.attributes is None and "attributes" in self.model_fields_set: _dict['attributes'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedAssetUpdateRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedAssetUpdateRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedAssetUpdateRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedAssetUpdateRequest.parse_obj({ + _obj = cls.model_validate({ "attributes": obj.get("attributes") }) return _obj diff --git a/plane/models/patched_cycle_update_request.py b/plane/models/patched_cycle_update_request.py index ecc5922..fbf1a9f 100644 --- a/plane/models/patched_cycle_update_request.py +++ b/plane/models/patched_cycle_update_request.py @@ -19,80 +19,98 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from plane.models.timezone_enum import TimezoneEnum +from typing import Set +from typing_extensions import Self class PatchedCycleUpdateRequest(BaseModel): """ - Serializer for updating cycles with enhanced ownership management. Extends cycle creation with update-specific features including ownership assignment and modification tracking for cycle lifecycle management. # noqa: E501 - """ - name: Optional[constr(strict=True, max_length=255, min_length=1)] = None + Serializer for updating cycles with enhanced ownership management. Extends cycle creation with update-specific features including ownership assignment and modification tracking for cycle lifecycle management. + """ # noqa: E501 + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None description: Optional[StrictStr] = None start_date: Optional[datetime] = None end_date: Optional[datetime] = None owned_by: Optional[StrictStr] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None timezone: Optional[TimezoneEnum] = None - __properties = ["name", "description", "start_date", "end_date", "owned_by", "external_source", "external_id", "timezone"] + __properties: ClassVar[List[str]] = ["name", "description", "start_date", "end_date", "owned_by", "external_source", "external_id", "timezone"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedCycleUpdateRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedCycleUpdateRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if start_date (nullable) is None - # and __fields_set__ contains the field - if self.start_date is None and "start_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.start_date is None and "start_date" in self.model_fields_set: _dict['start_date'] = None # set to None if end_date (nullable) is None - # and __fields_set__ contains the field - if self.end_date is None and "end_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.end_date is None and "end_date" in self.model_fields_set: _dict['end_date'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedCycleUpdateRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedCycleUpdateRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedCycleUpdateRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedCycleUpdateRequest.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description"), "start_date": obj.get("start_date"), diff --git a/plane/models/patched_generic_asset_update_request.py b/plane/models/patched_generic_asset_update_request.py index 53e2d5d..1f3a857 100644 --- a/plane/models/patched_generic_asset_update_request.py +++ b/plane/models/patched_generic_asset_update_request.py @@ -18,53 +18,69 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool +from pydantic import BaseModel, ConfigDict, Field, StrictBool +from typing import Any, ClassVar, Dict, List, Optional +from typing import Set +from typing_extensions import Self class PatchedGenericAssetUpdateRequest(BaseModel): """ - Serializer for generic asset upload confirmation and status management. Handles post-upload status updates for workspace assets including upload completion marking and metadata finalization. # noqa: E501 - """ + Serializer for generic asset upload confirmation and status management. Handles post-upload status updates for workspace assets including upload completion marking and metadata finalization. + """ # noqa: E501 is_uploaded: Optional[StrictBool] = Field(default=True, description="Whether the asset has been successfully uploaded") - __properties = ["is_uploaded"] + __properties: ClassVar[List[str]] = ["is_uploaded"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedGenericAssetUpdateRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedGenericAssetUpdateRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedGenericAssetUpdateRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedGenericAssetUpdateRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedGenericAssetUpdateRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedGenericAssetUpdateRequest.parse_obj({ + _obj = cls.model_validate({ "is_uploaded": obj.get("is_uploaded") if obj.get("is_uploaded") is not None else True }) return _obj diff --git a/plane/models/patched_intake_issue_update_request.py b/plane/models/patched_intake_issue_update_request.py index 2f0c59c..63bed29 100644 --- a/plane/models/patched_intake_issue_update_request.py +++ b/plane/models/patched_intake_issue_update_request.py @@ -19,88 +19,106 @@ import json from datetime import datetime -from typing import Optional -from pydantic import BaseModel, Field, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from plane.models.intake_work_item_status_enum import IntakeWorkItemStatusEnum from plane.models.issue_for_intake_request import IssueForIntakeRequest +from typing import Set +from typing_extensions import Self class PatchedIntakeIssueUpdateRequest(BaseModel): """ - Serializer for updating intake work items and their associated issues. Handles intake work item modifications including status changes, triage decisions, and embedded issue updates for issue queue processing workflows. # noqa: E501 - """ + Serializer for updating intake work items and their associated issues. Handles intake work item modifications including status changes, triage decisions, and embedded issue updates for issue queue processing workflows. + """ # noqa: E501 status: Optional[IntakeWorkItemStatusEnum] = None snoozed_till: Optional[datetime] = None duplicate_to: Optional[StrictStr] = None - source: Optional[constr(strict=True, max_length=255)] = None + source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None source_email: Optional[StrictStr] = None issue: Optional[IssueForIntakeRequest] = Field(default=None, description="Issue data to update in the intake issue") - __properties = ["status", "snoozed_till", "duplicate_to", "source", "source_email", "issue"] + __properties: ClassVar[List[str]] = ["status", "snoozed_till", "duplicate_to", "source", "source_email", "issue"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedIntakeIssueUpdateRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedIntakeIssueUpdateRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # override the default output from pydantic by calling `to_dict()` of issue if self.issue: _dict['issue'] = self.issue.to_dict() # set to None if snoozed_till (nullable) is None - # and __fields_set__ contains the field - if self.snoozed_till is None and "snoozed_till" in self.__fields_set__: + # and model_fields_set contains the field + if self.snoozed_till is None and "snoozed_till" in self.model_fields_set: _dict['snoozed_till'] = None # set to None if duplicate_to (nullable) is None - # and __fields_set__ contains the field - if self.duplicate_to is None and "duplicate_to" in self.__fields_set__: + # and model_fields_set contains the field + if self.duplicate_to is None and "duplicate_to" in self.model_fields_set: _dict['duplicate_to'] = None # set to None if source (nullable) is None - # and __fields_set__ contains the field - if self.source is None and "source" in self.__fields_set__: + # and model_fields_set contains the field + if self.source is None and "source" in self.model_fields_set: _dict['source'] = None # set to None if source_email (nullable) is None - # and __fields_set__ contains the field - if self.source_email is None and "source_email" in self.__fields_set__: + # and model_fields_set contains the field + if self.source_email is None and "source_email" in self.model_fields_set: _dict['source_email'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedIntakeIssueUpdateRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedIntakeIssueUpdateRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedIntakeIssueUpdateRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedIntakeIssueUpdateRequest.parse_obj({ + _obj = cls.model_validate({ "status": obj.get("status"), "snoozed_till": obj.get("snoozed_till"), "duplicate_to": obj.get("duplicate_to"), "source": obj.get("source"), "source_email": obj.get("source_email"), - "issue": IssueForIntakeRequest.from_dict(obj.get("issue")) if obj.get("issue") is not None else None + "issue": IssueForIntakeRequest.from_dict(obj["issue"]) if obj.get("issue") is not None else None }) return _obj diff --git a/plane/models/patched_issue_comment_create_request.py b/plane/models/patched_issue_comment_create_request.py index 6691474..0938eba 100644 --- a/plane/models/patched_issue_comment_create_request.py +++ b/plane/models/patched_issue_comment_create_request.py @@ -18,73 +18,90 @@ import re # noqa: F401 import json - -from typing import Any, Optional -from pydantic import BaseModel, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from plane.models.access_enum import AccessEnum +from typing import Set +from typing_extensions import Self class PatchedIssueCommentCreateRequest(BaseModel): """ - Serializer for creating work item comments. Handles comment creation with JSON and HTML content support, access control, and external integration tracking. # noqa: E501 - """ + Serializer for creating work item comments. Handles comment creation with JSON and HTML content support, access control, and external integration tracking. + """ # noqa: E501 comment_json: Optional[Any] = None comment_html: Optional[StrictStr] = None access: Optional[AccessEnum] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None - __properties = ["comment_json", "comment_html", "access", "external_source", "external_id"] + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + __properties: ClassVar[List[str]] = ["comment_json", "comment_html", "access", "external_source", "external_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedIssueCommentCreateRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedIssueCommentCreateRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if comment_json (nullable) is None - # and __fields_set__ contains the field - if self.comment_json is None and "comment_json" in self.__fields_set__: + # and model_fields_set contains the field + if self.comment_json is None and "comment_json" in self.model_fields_set: _dict['comment_json'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedIssueCommentCreateRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedIssueCommentCreateRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedIssueCommentCreateRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedIssueCommentCreateRequest.parse_obj({ + _obj = cls.model_validate({ "comment_json": obj.get("comment_json"), "comment_html": obj.get("comment_html"), "access": obj.get("access"), diff --git a/plane/models/patched_issue_link_update_request.py b/plane/models/patched_issue_link_update_request.py index ff354f9..5e8895e 100644 --- a/plane/models/patched_issue_link_update_request.py +++ b/plane/models/patched_issue_link_update_request.py @@ -18,53 +18,70 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, constr +from pydantic import BaseModel, ConfigDict, Field +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self class PatchedIssueLinkUpdateRequest(BaseModel): """ - Serializer for updating work item external links. Extends link creation with update-specific validation to prevent URL conflicts and maintain link integrity during modifications. # noqa: E501 - """ - url: Optional[constr(strict=True, min_length=1)] = None - __properties = ["url"] + Serializer for updating work item external links. Extends link creation with update-specific validation to prevent URL conflicts and maintain link integrity during modifications. + """ # noqa: E501 + url: Optional[Annotated[str, Field(min_length=1, strict=True)]] = None + __properties: ClassVar[List[str]] = ["url"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedIssueLinkUpdateRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedIssueLinkUpdateRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedIssueLinkUpdateRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedIssueLinkUpdateRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedIssueLinkUpdateRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedIssueLinkUpdateRequest.parse_obj({ + _obj = cls.model_validate({ "url": obj.get("url") }) return _obj diff --git a/plane/models/patched_issue_property_api_request.py b/plane/models/patched_issue_property_api_request.py index 7c46d3b..7f43469 100644 --- a/plane/models/patched_issue_property_api_request.py +++ b/plane/models/patched_issue_property_api_request.py @@ -18,91 +18,108 @@ import re # noqa: F401 import json - -from typing import Any, Optional -from pydantic import BaseModel, StrictBool, StrictStr, conlist, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from plane.models.property_type_enum import PropertyTypeEnum from plane.models.relation_type_enum import RelationTypeEnum +from typing import Set +from typing_extensions import Self class PatchedIssuePropertyAPIRequest(BaseModel): """ PatchedIssuePropertyAPIRequest - """ + """ # noqa: E501 relation_type: Optional[RelationTypeEnum] = None - display_name: Optional[constr(strict=True, max_length=255, min_length=1)] = None + display_name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None description: Optional[StrictStr] = None property_type: Optional[PropertyTypeEnum] = None is_required: Optional[StrictBool] = None - default_value: Optional[conlist(constr(strict=True, min_length=1))] = None + default_value: Optional[List[Annotated[str, Field(min_length=1, strict=True)]]] = None settings: Optional[Any] = None is_active: Optional[StrictBool] = None is_multi: Optional[StrictBool] = None validation_rules: Optional[Any] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None - __properties = ["relation_type", "display_name", "description", "property_type", "is_required", "default_value", "settings", "is_active", "is_multi", "validation_rules", "external_source", "external_id"] + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + __properties: ClassVar[List[str]] = ["relation_type", "display_name", "description", "property_type", "is_required", "default_value", "settings", "is_active", "is_multi", "validation_rules", "external_source", "external_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedIssuePropertyAPIRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedIssuePropertyAPIRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if description (nullable) is None - # and __fields_set__ contains the field - if self.description is None and "description" in self.__fields_set__: + # and model_fields_set contains the field + if self.description is None and "description" in self.model_fields_set: _dict['description'] = None # set to None if settings (nullable) is None - # and __fields_set__ contains the field - if self.settings is None and "settings" in self.__fields_set__: + # and model_fields_set contains the field + if self.settings is None and "settings" in self.model_fields_set: _dict['settings'] = None # set to None if validation_rules (nullable) is None - # and __fields_set__ contains the field - if self.validation_rules is None and "validation_rules" in self.__fields_set__: + # and model_fields_set contains the field + if self.validation_rules is None and "validation_rules" in self.model_fields_set: _dict['validation_rules'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedIssuePropertyAPIRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedIssuePropertyAPIRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedIssuePropertyAPIRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedIssuePropertyAPIRequest.parse_obj({ + _obj = cls.model_validate({ "relation_type": obj.get("relation_type"), "display_name": obj.get("display_name"), "description": obj.get("description"), diff --git a/plane/models/patched_issue_property_option_api_request.py b/plane/models/patched_issue_property_option_api_request.py index c7ed492..2ffb019 100644 --- a/plane/models/patched_issue_property_option_api_request.py +++ b/plane/models/patched_issue_property_option_api_request.py @@ -18,74 +18,91 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictBool, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self class PatchedIssuePropertyOptionAPIRequest(BaseModel): """ PatchedIssuePropertyOptionAPIRequest - """ - name: Optional[constr(strict=True, max_length=255, min_length=1)] = None + """ # noqa: E501 + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None description: Optional[StrictStr] = None is_active: Optional[StrictBool] = None is_default: Optional[StrictBool] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None parent: Optional[StrictStr] = None - __properties = ["name", "description", "is_active", "is_default", "external_source", "external_id", "parent"] + __properties: ClassVar[List[str]] = ["name", "description", "is_active", "is_default", "external_source", "external_id", "parent"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedIssuePropertyOptionAPIRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedIssuePropertyOptionAPIRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if parent (nullable) is None - # and __fields_set__ contains the field - if self.parent is None and "parent" in self.__fields_set__: + # and model_fields_set contains the field + if self.parent is None and "parent" in self.model_fields_set: _dict['parent'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedIssuePropertyOptionAPIRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedIssuePropertyOptionAPIRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedIssuePropertyOptionAPIRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedIssuePropertyOptionAPIRequest.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description"), "is_active": obj.get("is_active"), diff --git a/plane/models/patched_issue_request.py b/plane/models/patched_issue_request.py index bdb97a7..7cf757f 100644 --- a/plane/models/patched_issue_request.py +++ b/plane/models/patched_issue_request.py @@ -19,150 +19,168 @@ import json from datetime import date, datetime -from typing import Optional, Union -from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr, conint, conlist, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated from plane.models.priority_enum import PriorityEnum +from typing import Set +from typing_extensions import Self class PatchedIssueRequest(BaseModel): """ - Comprehensive work item serializer with full relationship management. Handles complete work item lifecycle including assignees, labels, validation, and related model updates. Supports dynamic field expansion and HTML content processing. # noqa: E501 - """ - assignees: Optional[conlist(StrictStr)] = None - labels: Optional[conlist(StrictStr)] = None + Comprehensive work item serializer with full relationship management. Handles complete work item lifecycle including assignees, labels, validation, and related model updates. Supports dynamic field expansion and HTML content processing. + """ # noqa: E501 + assignees: Optional[List[StrictStr]] = None + labels: Optional[List[StrictStr]] = None type_id: Optional[StrictStr] = None deleted_at: Optional[datetime] = None - point: Optional[conint(strict=True, le=12, ge=0)] = None - name: Optional[constr(strict=True, max_length=255, min_length=1)] = None + point: Optional[Annotated[int, Field(le=12, strict=True, ge=0)]] = None + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None description_html: Optional[StrictStr] = None description_stripped: Optional[StrictStr] = None priority: Optional[PriorityEnum] = None start_date: Optional[date] = None target_date: Optional[date] = None - sequence_id: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None + sequence_id: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None sort_order: Optional[Union[StrictFloat, StrictInt]] = None completed_at: Optional[datetime] = None archived_at: Optional[date] = None is_draft: Optional[StrictBool] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None created_by: Optional[StrictStr] = None parent: Optional[StrictStr] = None state: Optional[StrictStr] = None estimate_point: Optional[StrictStr] = None type: Optional[StrictStr] = None - __properties = ["assignees", "labels", "type_id", "deleted_at", "point", "name", "description_html", "description_stripped", "priority", "start_date", "target_date", "sequence_id", "sort_order", "completed_at", "archived_at", "is_draft", "external_source", "external_id", "created_by", "parent", "state", "estimate_point", "type"] + __properties: ClassVar[List[str]] = ["assignees", "labels", "type_id", "deleted_at", "point", "name", "description_html", "description_stripped", "priority", "start_date", "target_date", "sequence_id", "sort_order", "completed_at", "archived_at", "is_draft", "external_source", "external_id", "created_by", "parent", "state", "estimate_point", "type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedIssueRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedIssueRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if type_id (nullable) is None - # and __fields_set__ contains the field - if self.type_id is None and "type_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.type_id is None and "type_id" in self.model_fields_set: _dict['type_id'] = None # set to None if deleted_at (nullable) is None - # and __fields_set__ contains the field - if self.deleted_at is None and "deleted_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.deleted_at is None and "deleted_at" in self.model_fields_set: _dict['deleted_at'] = None # set to None if point (nullable) is None - # and __fields_set__ contains the field - if self.point is None and "point" in self.__fields_set__: + # and model_fields_set contains the field + if self.point is None and "point" in self.model_fields_set: _dict['point'] = None # set to None if description_stripped (nullable) is None - # and __fields_set__ contains the field - if self.description_stripped is None and "description_stripped" in self.__fields_set__: + # and model_fields_set contains the field + if self.description_stripped is None and "description_stripped" in self.model_fields_set: _dict['description_stripped'] = None # set to None if start_date (nullable) is None - # and __fields_set__ contains the field - if self.start_date is None and "start_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.start_date is None and "start_date" in self.model_fields_set: _dict['start_date'] = None # set to None if target_date (nullable) is None - # and __fields_set__ contains the field - if self.target_date is None and "target_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.target_date is None and "target_date" in self.model_fields_set: _dict['target_date'] = None # set to None if completed_at (nullable) is None - # and __fields_set__ contains the field - if self.completed_at is None and "completed_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.completed_at is None and "completed_at" in self.model_fields_set: _dict['completed_at'] = None # set to None if archived_at (nullable) is None - # and __fields_set__ contains the field - if self.archived_at is None and "archived_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.archived_at is None and "archived_at" in self.model_fields_set: _dict['archived_at'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if parent (nullable) is None - # and __fields_set__ contains the field - if self.parent is None and "parent" in self.__fields_set__: + # and model_fields_set contains the field + if self.parent is None and "parent" in self.model_fields_set: _dict['parent'] = None # set to None if state (nullable) is None - # and __fields_set__ contains the field - if self.state is None and "state" in self.__fields_set__: + # and model_fields_set contains the field + if self.state is None and "state" in self.model_fields_set: _dict['state'] = None # set to None if estimate_point (nullable) is None - # and __fields_set__ contains the field - if self.estimate_point is None and "estimate_point" in self.__fields_set__: + # and model_fields_set contains the field + if self.estimate_point is None and "estimate_point" in self.model_fields_set: _dict['estimate_point'] = None # set to None if type (nullable) is None - # and __fields_set__ contains the field - if self.type is None and "type" in self.__fields_set__: + # and model_fields_set contains the field + if self.type is None and "type" in self.model_fields_set: _dict['type'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedIssueRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedIssueRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedIssueRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedIssueRequest.parse_obj({ + _obj = cls.model_validate({ "assignees": obj.get("assignees"), "labels": obj.get("labels"), "type_id": obj.get("type_id"), diff --git a/plane/models/patched_issue_type_api_request.py b/plane/models/patched_issue_type_api_request.py index 60e30b2..4f1bb62 100644 --- a/plane/models/patched_issue_type_api_request.py +++ b/plane/models/patched_issue_type_api_request.py @@ -18,69 +18,86 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictBool, StrictStr, conlist, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self class PatchedIssueTypeAPIRequest(BaseModel): """ PatchedIssueTypeAPIRequest - """ - project_ids: Optional[conlist(StrictStr)] = None - name: Optional[constr(strict=True, max_length=255, min_length=1)] = None + """ # noqa: E501 + project_ids: Optional[List[StrictStr]] = None + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None description: Optional[StrictStr] = None is_epic: Optional[StrictBool] = None is_active: Optional[StrictBool] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None - __properties = ["project_ids", "name", "description", "is_epic", "is_active", "external_source", "external_id"] + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + __properties: ClassVar[List[str]] = ["project_ids", "name", "description", "is_epic", "is_active", "external_source", "external_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedIssueTypeAPIRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedIssueTypeAPIRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedIssueTypeAPIRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedIssueTypeAPIRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedIssueTypeAPIRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedIssueTypeAPIRequest.parse_obj({ + _obj = cls.model_validate({ "project_ids": obj.get("project_ids"), "name": obj.get("name"), "description": obj.get("description"), diff --git a/plane/models/patched_issue_work_log_api_request.py b/plane/models/patched_issue_work_log_api_request.py index c0b2b9f..50a7fa3 100644 --- a/plane/models/patched_issue_work_log_api_request.py +++ b/plane/models/patched_issue_work_log_api_request.py @@ -18,66 +18,83 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictStr, conint +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self class PatchedIssueWorkLogAPIRequest(BaseModel): """ PatchedIssueWorkLogAPIRequest - """ + """ # noqa: E501 description: Optional[StrictStr] = None - duration: Optional[conint(strict=True, le=2147483647, ge=-2147483648)] = None + duration: Optional[Annotated[int, Field(le=2147483647, strict=True, ge=-2147483648)]] = None created_by: Optional[StrictStr] = None updated_by: Optional[StrictStr] = None - __properties = ["description", "duration", "created_by", "updated_by"] + __properties: ClassVar[List[str]] = ["description", "duration", "created_by", "updated_by"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedIssueWorkLogAPIRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedIssueWorkLogAPIRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if updated_by (nullable) is None - # and __fields_set__ contains the field - if self.updated_by is None and "updated_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: _dict['updated_by'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedIssueWorkLogAPIRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedIssueWorkLogAPIRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedIssueWorkLogAPIRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedIssueWorkLogAPIRequest.parse_obj({ + _obj = cls.model_validate({ "description": obj.get("description"), "duration": obj.get("duration"), "created_by": obj.get("created_by"), diff --git a/plane/models/patched_label_create_update_request.py b/plane/models/patched_label_create_update_request.py index a16c43f..374bc0f 100644 --- a/plane/models/patched_label_create_update_request.py +++ b/plane/models/patched_label_create_update_request.py @@ -18,74 +18,91 @@ import re # noqa: F401 import json - -from typing import Optional, Union -from pydantic import BaseModel, StrictFloat, StrictInt, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated +from typing import Set +from typing_extensions import Self class PatchedLabelCreateUpdateRequest(BaseModel): """ - Serializer for creating and updating work item labels. Manages label metadata including colors, descriptions, hierarchy, and sorting for work item categorization and filtering. # noqa: E501 - """ - name: Optional[constr(strict=True, max_length=255, min_length=1)] = None - color: Optional[constr(strict=True, max_length=255)] = None + Serializer for creating and updating work item labels. Manages label metadata including colors, descriptions, hierarchy, and sorting for work item categorization and filtering. + """ # noqa: E501 + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None + color: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None description: Optional[StrictStr] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None parent: Optional[StrictStr] = None sort_order: Optional[Union[StrictFloat, StrictInt]] = None - __properties = ["name", "color", "description", "external_source", "external_id", "parent", "sort_order"] + __properties: ClassVar[List[str]] = ["name", "color", "description", "external_source", "external_id", "parent", "sort_order"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedLabelCreateUpdateRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedLabelCreateUpdateRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if parent (nullable) is None - # and __fields_set__ contains the field - if self.parent is None and "parent" in self.__fields_set__: + # and model_fields_set contains the field + if self.parent is None and "parent" in self.model_fields_set: _dict['parent'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedLabelCreateUpdateRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedLabelCreateUpdateRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedLabelCreateUpdateRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedLabelCreateUpdateRequest.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "color": obj.get("color"), "description": obj.get("description"), diff --git a/plane/models/patched_module_update_request.py b/plane/models/patched_module_update_request.py index e7ff287..076ae01 100644 --- a/plane/models/patched_module_update_request.py +++ b/plane/models/patched_module_update_request.py @@ -19,86 +19,104 @@ import json from datetime import date -from typing import Optional -from pydantic import BaseModel, StrictStr, conlist, constr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from plane.models.module_status_enum import ModuleStatusEnum +from typing import Set +from typing_extensions import Self class PatchedModuleUpdateRequest(BaseModel): """ - Serializer for updating modules with enhanced validation and member management. Extends module creation with update-specific validations including member reassignment, name conflict checking, and relationship management for module modifications. # noqa: E501 - """ - name: Optional[constr(strict=True, max_length=255, min_length=1)] = None + Serializer for updating modules with enhanced validation and member management. Extends module creation with update-specific validations including member reassignment, name conflict checking, and relationship management for module modifications. + """ # noqa: E501 + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None description: Optional[StrictStr] = None start_date: Optional[date] = None target_date: Optional[date] = None status: Optional[ModuleStatusEnum] = None lead: Optional[StrictStr] = None - members: Optional[conlist(StrictStr)] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None - __properties = ["name", "description", "start_date", "target_date", "status", "lead", "members", "external_source", "external_id"] + members: Optional[List[StrictStr]] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + __properties: ClassVar[List[str]] = ["name", "description", "start_date", "target_date", "status", "lead", "members", "external_source", "external_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedModuleUpdateRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedModuleUpdateRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if start_date (nullable) is None - # and __fields_set__ contains the field - if self.start_date is None and "start_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.start_date is None and "start_date" in self.model_fields_set: _dict['start_date'] = None # set to None if target_date (nullable) is None - # and __fields_set__ contains the field - if self.target_date is None and "target_date" in self.__fields_set__: + # and model_fields_set contains the field + if self.target_date is None and "target_date" in self.model_fields_set: _dict['target_date'] = None # set to None if lead (nullable) is None - # and __fields_set__ contains the field - if self.lead is None and "lead" in self.__fields_set__: + # and model_fields_set contains the field + if self.lead is None and "lead" in self.model_fields_set: _dict['lead'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedModuleUpdateRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedModuleUpdateRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedModuleUpdateRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedModuleUpdateRequest.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description"), "start_date": obj.get("start_date"), diff --git a/plane/models/patched_project_update_request.py b/plane/models/patched_project_update_request.py index c649a22..58ae30e 100644 --- a/plane/models/patched_project_update_request.py +++ b/plane/models/patched_project_update_request.py @@ -18,22 +18,24 @@ import re # noqa: F401 import json - -from typing import Any, Optional -from pydantic import BaseModel, StrictBool, StrictStr, conint, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from plane.models.timezone_enum import TimezoneEnum +from typing import Set +from typing_extensions import Self class PatchedProjectUpdateRequest(BaseModel): """ - Serializer for updating projects with enhanced state and estimation management. Extends project creation with update-specific validations including default state assignment, estimation configuration, and project setting modifications. # noqa: E501 - """ - name: Optional[constr(strict=True, max_length=255, min_length=1)] = None + Serializer for updating projects with enhanced state and estimation management. Extends project creation with update-specific validations including default state assignment, estimation configuration, and project setting modifications. + """ # noqa: E501 + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None description: Optional[StrictStr] = None project_lead: Optional[StrictStr] = None default_assignee: Optional[StrictStr] = None - identifier: Optional[constr(strict=True, max_length=12, min_length=1)] = None + identifier: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=12)]] = None icon_prop: Optional[Any] = None - emoji: Optional[constr(strict=True, max_length=255)] = None + emoji: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None cover_image: Optional[StrictStr] = None module_view: Optional[StrictBool] = None cycle_view: Optional[StrictBool] = None @@ -41,84 +43,99 @@ class PatchedProjectUpdateRequest(BaseModel): page_view: Optional[StrictBool] = None intake_view: Optional[StrictBool] = None guest_view_all_features: Optional[StrictBool] = None - archive_in: Optional[conint(strict=True, le=12, ge=0)] = None - close_in: Optional[conint(strict=True, le=12, ge=0)] = None + archive_in: Optional[Annotated[int, Field(le=12, strict=True, ge=0)]] = None + close_in: Optional[Annotated[int, Field(le=12, strict=True, ge=0)]] = None timezone: Optional[TimezoneEnum] = None default_state: Optional[StrictStr] = None estimate: Optional[StrictStr] = None - __properties = ["name", "description", "project_lead", "default_assignee", "identifier", "icon_prop", "emoji", "cover_image", "module_view", "cycle_view", "issue_views_view", "page_view", "intake_view", "guest_view_all_features", "archive_in", "close_in", "timezone", "default_state", "estimate"] + __properties: ClassVar[List[str]] = ["name", "description", "project_lead", "default_assignee", "identifier", "icon_prop", "emoji", "cover_image", "module_view", "cycle_view", "issue_views_view", "page_view", "intake_view", "guest_view_all_features", "archive_in", "close_in", "timezone", "default_state", "estimate"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedProjectUpdateRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedProjectUpdateRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if project_lead (nullable) is None - # and __fields_set__ contains the field - if self.project_lead is None and "project_lead" in self.__fields_set__: + # and model_fields_set contains the field + if self.project_lead is None and "project_lead" in self.model_fields_set: _dict['project_lead'] = None # set to None if default_assignee (nullable) is None - # and __fields_set__ contains the field - if self.default_assignee is None and "default_assignee" in self.__fields_set__: + # and model_fields_set contains the field + if self.default_assignee is None and "default_assignee" in self.model_fields_set: _dict['default_assignee'] = None # set to None if icon_prop (nullable) is None - # and __fields_set__ contains the field - if self.icon_prop is None and "icon_prop" in self.__fields_set__: + # and model_fields_set contains the field + if self.icon_prop is None and "icon_prop" in self.model_fields_set: _dict['icon_prop'] = None # set to None if emoji (nullable) is None - # and __fields_set__ contains the field - if self.emoji is None and "emoji" in self.__fields_set__: + # and model_fields_set contains the field + if self.emoji is None and "emoji" in self.model_fields_set: _dict['emoji'] = None # set to None if cover_image (nullable) is None - # and __fields_set__ contains the field - if self.cover_image is None and "cover_image" in self.__fields_set__: + # and model_fields_set contains the field + if self.cover_image is None and "cover_image" in self.model_fields_set: _dict['cover_image'] = None # set to None if default_state (nullable) is None - # and __fields_set__ contains the field - if self.default_state is None and "default_state" in self.__fields_set__: + # and model_fields_set contains the field + if self.default_state is None and "default_state" in self.model_fields_set: _dict['default_state'] = None # set to None if estimate (nullable) is None - # and __fields_set__ contains the field - if self.estimate is None and "estimate" in self.__fields_set__: + # and model_fields_set contains the field + if self.estimate is None and "estimate" in self.model_fields_set: _dict['estimate'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedProjectUpdateRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedProjectUpdateRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedProjectUpdateRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedProjectUpdateRequest.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description"), "project_lead": obj.get("project_lead"), diff --git a/plane/models/patched_state_request.py b/plane/models/patched_state_request.py index 7958cd7..ea0f156 100644 --- a/plane/models/patched_state_request.py +++ b/plane/models/patched_state_request.py @@ -18,72 +18,89 @@ import re # noqa: F401 import json - -from typing import Optional, Union -from pydantic import BaseModel, StrictBool, StrictFloat, StrictInt, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated from plane.models.group_enum import GroupEnum +from typing import Set +from typing_extensions import Self class PatchedStateRequest(BaseModel): """ - Serializer for work item states with default state management. Handles state creation and updates including default state validation and automatic default state switching for workflow management. # noqa: E501 - """ - name: Optional[constr(strict=True, max_length=255, min_length=1)] = None + Serializer for work item states with default state management. Handles state creation and updates including default state validation and automatic default state switching for workflow management. + """ # noqa: E501 + name: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None description: Optional[StrictStr] = None - color: Optional[constr(strict=True, max_length=255, min_length=1)] = None + color: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=255)]] = None sequence: Optional[Union[StrictFloat, StrictInt]] = None group: Optional[GroupEnum] = None is_triage: Optional[StrictBool] = None default: Optional[StrictBool] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None - __properties = ["name", "description", "color", "sequence", "group", "is_triage", "default", "external_source", "external_id"] + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + __properties: ClassVar[List[str]] = ["name", "description", "color", "sequence", "group", "is_triage", "default", "external_source", "external_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> PatchedStateRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of PatchedStateRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> PatchedStateRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of PatchedStateRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return PatchedStateRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = PatchedStateRequest.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description"), "color": obj.get("color"), diff --git a/plane/models/priority_enum.py b/plane/models/priority_enum.py index 62ce487..5a996d6 100644 --- a/plane/models/priority_enum.py +++ b/plane/models/priority_enum.py @@ -13,12 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import re # noqa: F401 -from aenum import Enum - - - +from enum import Enum +from typing_extensions import Self class PriorityEnum(str, Enum): @@ -36,8 +34,8 @@ class PriorityEnum(str, Enum): NONE = 'none' @classmethod - def from_json(cls, json_str: str) -> PriorityEnum: # noqa: F821 + def from_json(cls, json_str: str) -> Self: """Create an instance of PriorityEnum from a JSON string""" - return PriorityEnum(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/plane/models/project.py b/plane/models/project.py index 6cc0ac4..e790df8 100644 --- a/plane/models/project.py +++ b/plane/models/project.py @@ -19,15 +19,18 @@ import json from datetime import datetime -from typing import Any, Optional, Union -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, conint, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated from plane.models.network_enum import NetworkEnum from plane.models.timezone_enum import TimezoneEnum +from typing import Set +from typing_extensions import Self class Project(BaseModel): """ - Comprehensive project serializer with metrics and member context. Provides complete project data including member counts, cycle/module totals, deployment status, and user-specific context for project management. # noqa: E501 - """ + Comprehensive project serializer with metrics and member context. Provides complete project data including member counts, cycle/module totals, deployment status, and user-specific context for project management. + """ # noqa: E501 id: Optional[StrictStr] = None total_members: Optional[StrictInt] = None total_cycles: Optional[StrictInt] = None @@ -40,12 +43,12 @@ class Project(BaseModel): created_at: Optional[datetime] = None updated_at: Optional[datetime] = None deleted_at: Optional[datetime] = None - name: constr(strict=True, max_length=255) = Field(...) + name: Annotated[str, Field(strict=True, max_length=255)] description: Optional[StrictStr] = None description_text: Optional[Any] = None description_html: Optional[Any] = None network: Optional[NetworkEnum] = None - identifier: constr(strict=True, max_length=12) = Field(...) + identifier: Annotated[str, Field(strict=True, max_length=12)] emoji: Optional[StrictStr] = None icon_prop: Optional[Any] = None module_view: Optional[StrictBool] = None @@ -57,13 +60,13 @@ class Project(BaseModel): is_issue_type_enabled: Optional[StrictBool] = None guest_view_all_features: Optional[StrictBool] = None cover_image: Optional[StrictStr] = None - archive_in: Optional[conint(strict=True, le=12, ge=0)] = None - close_in: Optional[conint(strict=True, le=12, ge=0)] = None + archive_in: Optional[Annotated[int, Field(le=12, strict=True, ge=0)]] = None + close_in: Optional[Annotated[int, Field(le=12, strict=True, ge=0)]] = None logo_props: Optional[Any] = None archived_at: Optional[datetime] = None timezone: Optional[TimezoneEnum] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None created_by: Optional[StrictStr] = None updated_by: Optional[StrictStr] = None workspace: Optional[StrictStr] = None @@ -72,145 +75,176 @@ class Project(BaseModel): cover_image_asset: Optional[StrictStr] = None estimate: Optional[StrictStr] = None default_state: Optional[StrictStr] = None - __properties = ["id", "total_members", "total_cycles", "total_modules", "is_member", "sort_order", "member_role", "is_deployed", "cover_image_url", "created_at", "updated_at", "deleted_at", "name", "description", "description_text", "description_html", "network", "identifier", "emoji", "icon_prop", "module_view", "cycle_view", "issue_views_view", "page_view", "intake_view", "is_time_tracking_enabled", "is_issue_type_enabled", "guest_view_all_features", "cover_image", "archive_in", "close_in", "logo_props", "archived_at", "timezone", "external_source", "external_id", "created_by", "updated_by", "workspace", "default_assignee", "project_lead", "cover_image_asset", "estimate", "default_state"] + __properties: ClassVar[List[str]] = ["id", "total_members", "total_cycles", "total_modules", "is_member", "sort_order", "member_role", "is_deployed", "cover_image_url", "created_at", "updated_at", "deleted_at", "name", "description", "description_text", "description_html", "network", "identifier", "emoji", "icon_prop", "module_view", "cycle_view", "issue_views_view", "page_view", "intake_view", "is_time_tracking_enabled", "is_issue_type_enabled", "guest_view_all_features", "cover_image", "archive_in", "close_in", "logo_props", "archived_at", "timezone", "external_source", "external_id", "created_by", "updated_by", "workspace", "default_assignee", "project_lead", "cover_image_asset", "estimate", "default_state"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> Project: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of Project from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "total_members", - "total_cycles", - "total_modules", - "is_member", - "sort_order", - "member_role", - "is_deployed", - "cover_image_url", - "created_at", - "updated_at", - "deleted_at", - "emoji", - "created_by", - "updated_by", - "workspace", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "total_members", + "total_cycles", + "total_modules", + "is_member", + "sort_order", + "member_role", + "is_deployed", + "cover_image_url", + "created_at", + "updated_at", + "deleted_at", + "emoji", + "created_by", + "updated_by", + "workspace", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if deleted_at (nullable) is None - # and __fields_set__ contains the field - if self.deleted_at is None and "deleted_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.deleted_at is None and "deleted_at" in self.model_fields_set: _dict['deleted_at'] = None # set to None if description_text (nullable) is None - # and __fields_set__ contains the field - if self.description_text is None and "description_text" in self.__fields_set__: + # and model_fields_set contains the field + if self.description_text is None and "description_text" in self.model_fields_set: _dict['description_text'] = None # set to None if description_html (nullable) is None - # and __fields_set__ contains the field - if self.description_html is None and "description_html" in self.__fields_set__: + # and model_fields_set contains the field + if self.description_html is None and "description_html" in self.model_fields_set: _dict['description_html'] = None # set to None if emoji (nullable) is None - # and __fields_set__ contains the field - if self.emoji is None and "emoji" in self.__fields_set__: + # and model_fields_set contains the field + if self.emoji is None and "emoji" in self.model_fields_set: _dict['emoji'] = None # set to None if icon_prop (nullable) is None - # and __fields_set__ contains the field - if self.icon_prop is None and "icon_prop" in self.__fields_set__: + # and model_fields_set contains the field + if self.icon_prop is None and "icon_prop" in self.model_fields_set: _dict['icon_prop'] = None # set to None if cover_image (nullable) is None - # and __fields_set__ contains the field - if self.cover_image is None and "cover_image" in self.__fields_set__: + # and model_fields_set contains the field + if self.cover_image is None and "cover_image" in self.model_fields_set: _dict['cover_image'] = None # set to None if logo_props (nullable) is None - # and __fields_set__ contains the field - if self.logo_props is None and "logo_props" in self.__fields_set__: + # and model_fields_set contains the field + if self.logo_props is None and "logo_props" in self.model_fields_set: _dict['logo_props'] = None # set to None if archived_at (nullable) is None - # and __fields_set__ contains the field - if self.archived_at is None and "archived_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.archived_at is None and "archived_at" in self.model_fields_set: _dict['archived_at'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if updated_by (nullable) is None - # and __fields_set__ contains the field - if self.updated_by is None and "updated_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: _dict['updated_by'] = None # set to None if default_assignee (nullable) is None - # and __fields_set__ contains the field - if self.default_assignee is None and "default_assignee" in self.__fields_set__: + # and model_fields_set contains the field + if self.default_assignee is None and "default_assignee" in self.model_fields_set: _dict['default_assignee'] = None # set to None if project_lead (nullable) is None - # and __fields_set__ contains the field - if self.project_lead is None and "project_lead" in self.__fields_set__: + # and model_fields_set contains the field + if self.project_lead is None and "project_lead" in self.model_fields_set: _dict['project_lead'] = None # set to None if cover_image_asset (nullable) is None - # and __fields_set__ contains the field - if self.cover_image_asset is None and "cover_image_asset" in self.__fields_set__: + # and model_fields_set contains the field + if self.cover_image_asset is None and "cover_image_asset" in self.model_fields_set: _dict['cover_image_asset'] = None # set to None if estimate (nullable) is None - # and __fields_set__ contains the field - if self.estimate is None and "estimate" in self.__fields_set__: + # and model_fields_set contains the field + if self.estimate is None and "estimate" in self.model_fields_set: _dict['estimate'] = None # set to None if default_state (nullable) is None - # and __fields_set__ contains the field - if self.default_state is None and "default_state" in self.__fields_set__: + # and model_fields_set contains the field + if self.default_state is None and "default_state" in self.model_fields_set: _dict['default_state'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> Project: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of Project from a dict""" if obj is None: return None if not isinstance(obj, dict): - return Project.parse_obj(obj) + return cls.model_validate(obj) - _obj = Project.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "total_members": obj.get("total_members"), "total_cycles": obj.get("total_cycles"), diff --git a/plane/models/project_create_request.py b/plane/models/project_create_request.py index 07a36b8..b4898dc 100644 --- a/plane/models/project_create_request.py +++ b/plane/models/project_create_request.py @@ -18,22 +18,24 @@ import re # noqa: F401 import json - -from typing import Any, Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr, conint, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from plane.models.timezone_enum import TimezoneEnum +from typing import Set +from typing_extensions import Self class ProjectCreateRequest(BaseModel): """ - Serializer for creating projects with workspace validation. Handles project creation including identifier validation, member verification, and workspace association for new project initialization. # noqa: E501 - """ - name: constr(strict=True, max_length=255, min_length=1) = Field(...) + Serializer for creating projects with workspace validation. Handles project creation including identifier validation, member verification, and workspace association for new project initialization. + """ # noqa: E501 + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] description: Optional[StrictStr] = None project_lead: Optional[StrictStr] = None default_assignee: Optional[StrictStr] = None - identifier: constr(strict=True, max_length=12, min_length=1) = Field(...) + identifier: Annotated[str, Field(min_length=1, strict=True, max_length=12)] icon_prop: Optional[Any] = None - emoji: Optional[constr(strict=True, max_length=255)] = None + emoji: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None cover_image: Optional[StrictStr] = None module_view: Optional[StrictBool] = None cycle_view: Optional[StrictBool] = None @@ -41,72 +43,87 @@ class ProjectCreateRequest(BaseModel): page_view: Optional[StrictBool] = None intake_view: Optional[StrictBool] = None guest_view_all_features: Optional[StrictBool] = None - archive_in: Optional[conint(strict=True, le=12, ge=0)] = None - close_in: Optional[conint(strict=True, le=12, ge=0)] = None + archive_in: Optional[Annotated[int, Field(le=12, strict=True, ge=0)]] = None + close_in: Optional[Annotated[int, Field(le=12, strict=True, ge=0)]] = None timezone: Optional[TimezoneEnum] = None - __properties = ["name", "description", "project_lead", "default_assignee", "identifier", "icon_prop", "emoji", "cover_image", "module_view", "cycle_view", "issue_views_view", "page_view", "intake_view", "guest_view_all_features", "archive_in", "close_in", "timezone"] + __properties: ClassVar[List[str]] = ["name", "description", "project_lead", "default_assignee", "identifier", "icon_prop", "emoji", "cover_image", "module_view", "cycle_view", "issue_views_view", "page_view", "intake_view", "guest_view_all_features", "archive_in", "close_in", "timezone"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ProjectCreateRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ProjectCreateRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if project_lead (nullable) is None - # and __fields_set__ contains the field - if self.project_lead is None and "project_lead" in self.__fields_set__: + # and model_fields_set contains the field + if self.project_lead is None and "project_lead" in self.model_fields_set: _dict['project_lead'] = None # set to None if default_assignee (nullable) is None - # and __fields_set__ contains the field - if self.default_assignee is None and "default_assignee" in self.__fields_set__: + # and model_fields_set contains the field + if self.default_assignee is None and "default_assignee" in self.model_fields_set: _dict['default_assignee'] = None # set to None if icon_prop (nullable) is None - # and __fields_set__ contains the field - if self.icon_prop is None and "icon_prop" in self.__fields_set__: + # and model_fields_set contains the field + if self.icon_prop is None and "icon_prop" in self.model_fields_set: _dict['icon_prop'] = None # set to None if emoji (nullable) is None - # and __fields_set__ contains the field - if self.emoji is None and "emoji" in self.__fields_set__: + # and model_fields_set contains the field + if self.emoji is None and "emoji" in self.model_fields_set: _dict['emoji'] = None # set to None if cover_image (nullable) is None - # and __fields_set__ contains the field - if self.cover_image is None and "cover_image" in self.__fields_set__: + # and model_fields_set contains the field + if self.cover_image is None and "cover_image" in self.model_fields_set: _dict['cover_image'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> ProjectCreateRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ProjectCreateRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ProjectCreateRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = ProjectCreateRequest.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description"), "project_lead": obj.get("project_lead"), diff --git a/plane/models/project_worklog_summary.py b/plane/models/project_worklog_summary.py index 9cde94c..644fd09 100644 --- a/plane/models/project_worklog_summary.py +++ b/plane/models/project_worklog_summary.py @@ -18,54 +18,70 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictInt, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class ProjectWorklogSummary(BaseModel): """ - Serializer for project worklog summary with aggregated duration per issue # noqa: E501 - """ - issue_id: StrictStr = Field(default=..., description="ID of the work item") - duration: StrictInt = Field(default=..., description="Total duration logged for this work item in seconds") - __properties = ["issue_id", "duration"] + Serializer for project worklog summary with aggregated duration per issue + """ # noqa: E501 + issue_id: StrictStr = Field(description="ID of the work item") + duration: StrictInt = Field(description="Total duration logged for this work item in seconds") + __properties: ClassVar[List[str]] = ["issue_id", "duration"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> ProjectWorklogSummary: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of ProjectWorklogSummary from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> ProjectWorklogSummary: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of ProjectWorklogSummary from a dict""" if obj is None: return None if not isinstance(obj, dict): - return ProjectWorklogSummary.parse_obj(obj) + return cls.model_validate(obj) - _obj = ProjectWorklogSummary.parse_obj({ + _obj = cls.model_validate({ "issue_id": obj.get("issue_id"), "duration": obj.get("duration") }) diff --git a/plane/models/property_type_enum.py b/plane/models/property_type_enum.py index 5bd10b0..7b8d1fe 100644 --- a/plane/models/property_type_enum.py +++ b/plane/models/property_type_enum.py @@ -13,12 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import re # noqa: F401 -from aenum import Enum - - - +from enum import Enum +from typing_extensions import Self class PropertyTypeEnum(str, Enum): @@ -40,8 +38,8 @@ class PropertyTypeEnum(str, Enum): FILE = 'FILE' @classmethod - def from_json(cls, json_str: str) -> PropertyTypeEnum: # noqa: F821 + def from_json(cls, json_str: str) -> Self: """Create an instance of PropertyTypeEnum from a JSON string""" - return PropertyTypeEnum(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/plane/models/relation_type_enum.py b/plane/models/relation_type_enum.py index 33e0b07..63786dd 100644 --- a/plane/models/relation_type_enum.py +++ b/plane/models/relation_type_enum.py @@ -13,12 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import re # noqa: F401 -from aenum import Enum - - - +from enum import Enum +from typing_extensions import Self class RelationTypeEnum(str, Enum): @@ -33,8 +31,8 @@ class RelationTypeEnum(str, Enum): USER = 'USER' @classmethod - def from_json(cls, json_str: str) -> RelationTypeEnum: # noqa: F821 + def from_json(cls, json_str: str) -> Self: """Create an instance of RelationTypeEnum from a JSON string""" - return RelationTypeEnum(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/plane/models/retrieve_work_item_attachment400_response.py b/plane/models/retrieve_work_item_attachment400_response.py index 3765a8f..ef3549a 100644 --- a/plane/models/retrieve_work_item_attachment400_response.py +++ b/plane/models/retrieve_work_item_attachment400_response.py @@ -18,54 +18,70 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictBool, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Set +from typing_extensions import Self class RetrieveWorkItemAttachment400Response(BaseModel): """ RetrieveWorkItemAttachment400Response - """ + """ # noqa: E501 error: Optional[StrictStr] = Field(default=None, description="Error message") status: Optional[StrictBool] = Field(default=None, description="Request status") - __properties = ["error", "status"] + __properties: ClassVar[List[str]] = ["error", "status"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> RetrieveWorkItemAttachment400Response: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of RetrieveWorkItemAttachment400Response from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> RetrieveWorkItemAttachment400Response: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of RetrieveWorkItemAttachment400Response from a dict""" if obj is None: return None if not isinstance(obj, dict): - return RetrieveWorkItemAttachment400Response.parse_obj(obj) + return cls.model_validate(obj) - _obj = RetrieveWorkItemAttachment400Response.parse_obj({ + _obj = cls.model_validate({ "error": obj.get("error"), "status": obj.get("status") }) diff --git a/plane/models/state.py b/plane/models/state.py index 3381032..9c33d89 100644 --- a/plane/models/state.py +++ b/plane/models/state.py @@ -19,102 +19,128 @@ import json from datetime import datetime -from typing import Optional, Union -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated from plane.models.group_enum import GroupEnum +from typing import Set +from typing_extensions import Self class State(BaseModel): """ - Serializer for work item states with default state management. Handles state creation and updates including default state validation and automatic default state switching for workflow management. # noqa: E501 - """ + Serializer for work item states with default state management. Handles state creation and updates including default state validation and automatic default state switching for workflow management. + """ # noqa: E501 id: Optional[StrictStr] = None created_at: Optional[datetime] = None updated_at: Optional[datetime] = None deleted_at: Optional[datetime] = None - name: constr(strict=True, max_length=255) = Field(...) + name: Annotated[str, Field(strict=True, max_length=255)] description: Optional[StrictStr] = None - color: constr(strict=True, max_length=255) = Field(...) + color: Annotated[str, Field(strict=True, max_length=255)] sequence: Optional[Union[StrictFloat, StrictInt]] = None group: Optional[GroupEnum] = None is_triage: Optional[StrictBool] = None default: Optional[StrictBool] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None created_by: Optional[StrictStr] = None updated_by: Optional[StrictStr] = None project: Optional[StrictStr] = None workspace: Optional[StrictStr] = None - __properties = ["id", "created_at", "updated_at", "deleted_at", "name", "description", "color", "sequence", "group", "is_triage", "default", "external_source", "external_id", "created_by", "updated_by", "project", "workspace"] + __properties: ClassVar[List[str]] = ["id", "created_at", "updated_at", "deleted_at", "name", "description", "color", "sequence", "group", "is_triage", "default", "external_source", "external_id", "created_by", "updated_by", "project", "workspace"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> State: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of State from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "created_at", - "updated_at", - "deleted_at", - "created_by", - "updated_by", - "project", - "workspace", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "created_at", + "updated_at", + "deleted_at", + "created_by", + "updated_by", + "project", + "workspace", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if deleted_at (nullable) is None - # and __fields_set__ contains the field - if self.deleted_at is None and "deleted_at" in self.__fields_set__: + # and model_fields_set contains the field + if self.deleted_at is None and "deleted_at" in self.model_fields_set: _dict['deleted_at'] = None # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None # set to None if created_by (nullable) is None - # and __fields_set__ contains the field - if self.created_by is None and "created_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.created_by is None and "created_by" in self.model_fields_set: _dict['created_by'] = None # set to None if updated_by (nullable) is None - # and __fields_set__ contains the field - if self.updated_by is None and "updated_by" in self.__fields_set__: + # and model_fields_set contains the field + if self.updated_by is None and "updated_by" in self.model_fields_set: _dict['updated_by'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> State: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of State from a dict""" if obj is None: return None if not isinstance(obj, dict): - return State.parse_obj(obj) + return cls.model_validate(obj) - _obj = State.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "created_at": obj.get("created_at"), "updated_at": obj.get("updated_at"), diff --git a/plane/models/state_lite.py b/plane/models/state_lite.py index 03f73f7..169a43a 100644 --- a/plane/models/state_lite.py +++ b/plane/models/state_lite.py @@ -18,61 +18,81 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, StrictStr +from pydantic import BaseModel, ConfigDict, StrictStr +from typing import Any, ClassVar, Dict, List, Optional from plane.models.group_enum import GroupEnum +from typing import Set +from typing_extensions import Self class StateLite(BaseModel): """ - Lightweight state serializer for minimal data transfer. Provides essential state information including visual properties and grouping data optimized for UI display and filtering. # noqa: E501 - """ + Lightweight state serializer for minimal data transfer. Provides essential state information including visual properties and grouping data optimized for UI display and filtering. + """ # noqa: E501 id: Optional[StrictStr] = None name: Optional[StrictStr] = None color: Optional[StrictStr] = None group: Optional[GroupEnum] = None - __properties = ["id", "name", "color", "group"] + __properties: ClassVar[List[str]] = ["id", "name", "color", "group"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StateLite: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StateLite from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "name", - "color", - "group", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "name", + "color", + "group", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> StateLite: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StateLite from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StateLite.parse_obj(obj) + return cls.model_validate(obj) - _obj = StateLite.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "name": obj.get("name"), "color": obj.get("color"), diff --git a/plane/models/state_request.py b/plane/models/state_request.py index e7564f2..935eb0f 100644 --- a/plane/models/state_request.py +++ b/plane/models/state_request.py @@ -18,72 +18,89 @@ import re # noqa: F401 import json - -from typing import Optional, Union -from pydantic import BaseModel, Field, StrictBool, StrictFloat, StrictInt, StrictStr, constr +from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr +from typing import Any, ClassVar, Dict, List, Optional, Union +from typing_extensions import Annotated from plane.models.group_enum import GroupEnum +from typing import Set +from typing_extensions import Self class StateRequest(BaseModel): """ - Serializer for work item states with default state management. Handles state creation and updates including default state validation and automatic default state switching for workflow management. # noqa: E501 - """ - name: constr(strict=True, max_length=255, min_length=1) = Field(...) + Serializer for work item states with default state management. Handles state creation and updates including default state validation and automatic default state switching for workflow management. + """ # noqa: E501 + name: Annotated[str, Field(min_length=1, strict=True, max_length=255)] description: Optional[StrictStr] = None - color: constr(strict=True, max_length=255, min_length=1) = Field(...) + color: Annotated[str, Field(min_length=1, strict=True, max_length=255)] sequence: Optional[Union[StrictFloat, StrictInt]] = None group: Optional[GroupEnum] = None is_triage: Optional[StrictBool] = None default: Optional[StrictBool] = None - external_source: Optional[constr(strict=True, max_length=255)] = None - external_id: Optional[constr(strict=True, max_length=255)] = None - __properties = ["name", "description", "color", "sequence", "group", "is_triage", "default", "external_source", "external_id"] + external_source: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + external_id: Optional[Annotated[str, Field(strict=True, max_length=255)]] = None + __properties: ClassVar[List[str]] = ["name", "description", "color", "sequence", "group", "is_triage", "default", "external_source", "external_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> StateRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of StateRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if external_source (nullable) is None - # and __fields_set__ contains the field - if self.external_source is None and "external_source" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_source is None and "external_source" in self.model_fields_set: _dict['external_source'] = None # set to None if external_id (nullable) is None - # and __fields_set__ contains the field - if self.external_id is None and "external_id" in self.__fields_set__: + # and model_fields_set contains the field + if self.external_id is None and "external_id" in self.model_fields_set: _dict['external_id'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> StateRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of StateRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return StateRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = StateRequest.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "description": obj.get("description"), "color": obj.get("color"), diff --git a/plane/models/timezone_enum.py b/plane/models/timezone_enum.py index bb6565f..4c14dd6 100644 --- a/plane/models/timezone_enum.py +++ b/plane/models/timezone_enum.py @@ -13,12 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import re # noqa: F401 -from aenum import Enum - - - +from enum import Enum +from typing_extensions import Self class TimezoneEnum(str, Enum): @@ -464,8 +462,8 @@ class TimezoneEnum(str, Enum): UTC = 'UTC' @classmethod - def from_json(cls, json_str: str) -> TimezoneEnum: # noqa: F821 + def from_json(cls, json_str: str) -> Self: """Create an instance of TimezoneEnum from a JSON string""" - return TimezoneEnum(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/plane/models/transfer_cycle_issue_request_request.py b/plane/models/transfer_cycle_issue_request_request.py index 41af339..6f447be 100644 --- a/plane/models/transfer_cycle_issue_request_request.py +++ b/plane/models/transfer_cycle_issue_request_request.py @@ -18,53 +18,69 @@ import re # noqa: F401 import json - - -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List +from typing import Optional, Set +from typing_extensions import Self class TransferCycleIssueRequestRequest(BaseModel): """ - Serializer for transferring work items between cycles. Handles work item migration between cycles including validation and relationship updates for sprint reallocation workflows. # noqa: E501 - """ - new_cycle_id: StrictStr = Field(default=..., description="ID of the target cycle to transfer issues to") - __properties = ["new_cycle_id"] + Serializer for transferring work items between cycles. Handles work item migration between cycles including validation and relationship updates for sprint reallocation workflows. + """ # noqa: E501 + new_cycle_id: StrictStr = Field(description="ID of the target cycle to transfer issues to") + __properties: ClassVar[List[str]] = ["new_cycle_id"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> TransferCycleIssueRequestRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TransferCycleIssueRequestRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> TransferCycleIssueRequestRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TransferCycleIssueRequestRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TransferCycleIssueRequestRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = TransferCycleIssueRequestRequest.parse_obj({ + _obj = cls.model_validate({ "new_cycle_id": obj.get("new_cycle_id") }) return _obj diff --git a/plane/models/transfer_cycle_work_items200_response.py b/plane/models/transfer_cycle_work_items200_response.py index 47107f4..f635e59 100644 --- a/plane/models/transfer_cycle_work_items200_response.py +++ b/plane/models/transfer_cycle_work_items200_response.py @@ -18,53 +18,69 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Set +from typing_extensions import Self class TransferCycleWorkItems200Response(BaseModel): """ TransferCycleWorkItems200Response - """ + """ # noqa: E501 message: Optional[StrictStr] = Field(default=None, description="Success message") - __properties = ["message"] + __properties: ClassVar[List[str]] = ["message"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> TransferCycleWorkItems200Response: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TransferCycleWorkItems200Response from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> TransferCycleWorkItems200Response: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TransferCycleWorkItems200Response from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TransferCycleWorkItems200Response.parse_obj(obj) + return cls.model_validate(obj) - _obj = TransferCycleWorkItems200Response.parse_obj({ + _obj = cls.model_validate({ "message": obj.get("message") }) return _obj diff --git a/plane/models/transfer_cycle_work_items400_response.py b/plane/models/transfer_cycle_work_items400_response.py index a40f731..908bdf6 100644 --- a/plane/models/transfer_cycle_work_items400_response.py +++ b/plane/models/transfer_cycle_work_items400_response.py @@ -18,53 +18,69 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Set +from typing_extensions import Self class TransferCycleWorkItems400Response(BaseModel): """ TransferCycleWorkItems400Response - """ + """ # noqa: E501 error: Optional[StrictStr] = Field(default=None, description="Error message") - __properties = ["error"] + __properties: ClassVar[List[str]] = ["error"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> TransferCycleWorkItems400Response: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of TransferCycleWorkItems400Response from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> TransferCycleWorkItems400Response: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of TransferCycleWorkItems400Response from a dict""" if obj is None: return None if not isinstance(obj, dict): - return TransferCycleWorkItems400Response.parse_obj(obj) + return cls.model_validate(obj) - _obj = TransferCycleWorkItems400Response.parse_obj({ + _obj = cls.model_validate({ "error": obj.get("error") }) return _obj diff --git a/plane/models/type_enum.py b/plane/models/type_enum.py index e75fc14..2591328 100644 --- a/plane/models/type_enum.py +++ b/plane/models/type_enum.py @@ -13,12 +13,10 @@ """ # noqa: E501 +from __future__ import annotations import json -import re # noqa: F401 -from aenum import Enum - - - +from enum import Enum +from typing_extensions import Self class TypeEnum(str, Enum): @@ -36,8 +34,8 @@ class TypeEnum(str, Enum): IMAGE_SLASH_GIF = 'image/gif' @classmethod - def from_json(cls, json_str: str) -> TypeEnum: # noqa: F821 + def from_json(cls, json_str: str) -> Self: """Create an instance of TypeEnum from a JSON string""" - return TypeEnum(json.loads(json_str)) + return cls(json.loads(json_str)) diff --git a/plane/models/user_asset_upload_request.py b/plane/models/user_asset_upload_request.py index 09e78ab..bfef710 100644 --- a/plane/models/user_asset_upload_request.py +++ b/plane/models/user_asset_upload_request.py @@ -18,58 +18,75 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictInt, constr +from pydantic import BaseModel, ConfigDict, Field, StrictInt +from typing import Any, ClassVar, Dict, List, Optional +from typing_extensions import Annotated from plane.models.entity_type_enum import EntityTypeEnum from plane.models.type_enum import TypeEnum +from typing import Set +from typing_extensions import Self class UserAssetUploadRequest(BaseModel): """ - Serializer for user asset upload requests. This serializer validates the metadata required to generate a presigned URL for uploading user profile assets (avatar or cover image) directly to S3 storage. Supports JPEG, PNG, WebP, JPG, and GIF image formats with size validation. # noqa: E501 - """ - name: constr(strict=True, min_length=1) = Field(default=..., description="Original filename of the asset") + Serializer for user asset upload requests. This serializer validates the metadata required to generate a presigned URL for uploading user profile assets (avatar or cover image) directly to S3 storage. Supports JPEG, PNG, WebP, JPG, and GIF image formats with size validation. + """ # noqa: E501 + name: Annotated[str, Field(min_length=1, strict=True)] = Field(description="Original filename of the asset") type: Optional[TypeEnum] = Field(default=None, description="MIME type of the file * `image/jpeg` - JPEG * `image/png` - PNG * `image/webp` - WebP * `image/jpg` - JPG * `image/gif` - GIF") - size: StrictInt = Field(default=..., description="File size in bytes") - entity_type: EntityTypeEnum = Field(default=..., description="Type of user asset * `USER_AVATAR` - User Avatar * `USER_COVER` - User Cover") - __properties = ["name", "type", "size", "entity_type"] + size: StrictInt = Field(description="File size in bytes") + entity_type: EntityTypeEnum = Field(description="Type of user asset * `USER_AVATAR` - User Avatar * `USER_COVER` - User Cover") + __properties: ClassVar[List[str]] = ["name", "type", "size", "entity_type"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> UserAssetUploadRequest: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UserAssetUploadRequest from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + """ + excluded_fields: Set[str] = set([ + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) return _dict @classmethod - def from_dict(cls, obj: dict) -> UserAssetUploadRequest: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UserAssetUploadRequest from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UserAssetUploadRequest.parse_obj(obj) + return cls.model_validate(obj) - _obj = UserAssetUploadRequest.parse_obj({ + _obj = cls.model_validate({ "name": obj.get("name"), "type": obj.get("type"), "size": obj.get("size"), diff --git a/plane/models/user_lite.py b/plane/models/user_lite.py index e2358dc..5fa50fd 100644 --- a/plane/models/user_lite.py +++ b/plane/models/user_lite.py @@ -18,14 +18,15 @@ import re # noqa: F401 import json - -from typing import Optional -from pydantic import BaseModel, Field, StrictStr +from pydantic import BaseModel, ConfigDict, Field, StrictStr +from typing import Any, ClassVar, Dict, List, Optional +from typing import Set +from typing_extensions import Self class UserLite(BaseModel): """ - Lightweight user serializer for minimal data transfer. Provides essential user information including names, avatar, and contact details optimized for member lists, assignee displays, and user references. # noqa: E501 - """ + Lightweight user serializer for minimal data transfer. Provides essential user information including names, avatar, and contact details optimized for member lists, assignee displays, and user references. + """ # noqa: E501 id: Optional[StrictStr] = None first_name: Optional[StrictStr] = None last_name: Optional[StrictStr] = None @@ -33,56 +34,78 @@ class UserLite(BaseModel): avatar: Optional[StrictStr] = None avatar_url: Optional[StrictStr] = Field(default=None, description="Avatar URL") display_name: Optional[StrictStr] = None - __properties = ["id", "first_name", "last_name", "email", "avatar", "avatar_url", "display_name"] + __properties: ClassVar[List[str]] = ["id", "first_name", "last_name", "email", "avatar", "avatar_url", "display_name"] + + model_config = ConfigDict( + populate_by_name=True, + validate_assignment=True, + protected_namespaces=(), + ) - class Config: - """Pydantic configuration""" - allow_population_by_field_name = True - validate_assignment = True def to_str(self) -> str: """Returns the string representation of the model using alias""" - return pprint.pformat(self.dict(by_alias=True)) + return pprint.pformat(self.model_dump(by_alias=True)) def to_json(self) -> str: """Returns the JSON representation of the model using alias""" + # TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead return json.dumps(self.to_dict()) @classmethod - def from_json(cls, json_str: str) -> UserLite: + def from_json(cls, json_str: str) -> Optional[Self]: """Create an instance of UserLite from a JSON string""" return cls.from_dict(json.loads(json_str)) - def to_dict(self): - """Returns the dictionary representation of the model using alias""" - _dict = self.dict(by_alias=True, - exclude={ - "id", - "first_name", - "last_name", - "email", - "avatar", - "avatar_url", - "display_name", - }, - exclude_none=True) + def to_dict(self) -> Dict[str, Any]: + """Return the dictionary representation of the model using alias. + + This has the following differences from calling pydantic's + `self.model_dump(by_alias=True)`: + + * `None` is only added to the output dict for nullable fields that + were set at model initialization. Other fields with value `None` + are ignored. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + * OpenAPI `readOnly` fields are excluded. + """ + excluded_fields: Set[str] = set([ + "id", + "first_name", + "last_name", + "email", + "avatar", + "avatar_url", + "display_name", + ]) + + _dict = self.model_dump( + by_alias=True, + exclude=excluded_fields, + exclude_none=True, + ) # set to None if email (nullable) is None - # and __fields_set__ contains the field - if self.email is None and "email" in self.__fields_set__: + # and model_fields_set contains the field + if self.email is None and "email" in self.model_fields_set: _dict['email'] = None return _dict @classmethod - def from_dict(cls, obj: dict) -> UserLite: + def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]: """Create an instance of UserLite from a dict""" if obj is None: return None if not isinstance(obj, dict): - return UserLite.parse_obj(obj) + return cls.model_validate(obj) - _obj = UserLite.parse_obj({ + _obj = cls.model_validate({ "id": obj.get("id"), "first_name": obj.get("first_name"), "last_name": obj.get("last_name"), diff --git a/plane/oauth/api.py b/plane/oauth/api.py index 2715730..ee4f5f5 100644 --- a/plane/oauth/api.py +++ b/plane/oauth/api.py @@ -12,7 +12,7 @@ from plane.configuration import Configuration from plane.exceptions import ApiException -from plane.rest import RESTClientObject +from plane.api_client import ApiClient from .models import OAuthConfig, PlaneOAuthAppInstallation, PlaneOAuthTokenResponse @@ -42,7 +42,7 @@ def __init__( configuration = Configuration(host=base_url) self.configuration = configuration - self.rest_client = RESTClientObject(configuration) + self.api_client = ApiClient(configuration) def get_authorization_url( self, @@ -79,12 +79,16 @@ def exchange_code_for_token( } try: - response = self.rest_client.post_request( - url=f"{self.base_url}/auth/o/token/", headers=headers, post_params=data + response = self.api_client.call_api( + "POST", + "/auth/o/token/", + header_params=headers, + body=data, ) + response.read() + json_response = json.loads(response.data) - response_data = json.loads(response.data.decode("utf-8")) - return PlaneOAuthTokenResponse.validate(response_data) + return PlaneOAuthTokenResponse.model_validate(json_response) except ApiException as e: logger.error(f"Failed to exchange code for token: {e}") @@ -112,8 +116,16 @@ def get_refresh_token(self, refresh_token: str) -> PlaneOAuthTokenResponse: url=f"{self.base_url}/auth/o/token/", headers=headers, post_params=data ) - response_data = json.loads(response.data.decode("utf-8")) - return PlaneOAuthTokenResponse.validate(response_data) + response = self.api_client.call_api( + "POST", + "/auth/o/token/", + header_params=headers, + body=data, + ) + response.read() + json_response = json.loads(response.data) + + return PlaneOAuthTokenResponse.model_validate(json_response) except ApiException as e: logger.error(f"Failed to refresh token: {e}") @@ -140,8 +152,16 @@ def get_bot_token(self, app_installation_id: str) -> PlaneOAuthTokenResponse: url=f"{self.base_url}/auth/o/token/", headers=headers, post_params=data ) - response_data = json.loads(response.data.decode("utf-8")) - return PlaneOAuthTokenResponse.validate(response_data) + response = self.api_client.call_api( + "POST", + "/auth/o/token/", + header_params=headers, + body=data, + ) + response.read() + json_response = json.loads(response.data) + + return PlaneOAuthTokenResponse.model_validate(json_response) except ApiException as e: logger.error(f"Failed to get bot token: {e}") @@ -160,19 +180,21 @@ def get_app_installations( headers = { "Authorization": f"Bearer {token}", } - path = "/auth/o/app-installation/" + path = f"{self.base_url}/auth/o/app-installation/" if app_installation_id: path += f"?id={app_installation_id}" - response = self.rest_client.get_request( - url=f"{self.base_url}{path}", - headers=headers, + response = self.api_client.call_api( + "GET", + path, + header_params=headers, ) - if not response.data: - raise ApiException(status=404, reason="App installation not found") + response.read() + json_response = json.loads(response.data) return [ - PlaneOAuthAppInstallation.validate(item) - for item in json.loads(response.data) + PlaneOAuthAppInstallation.model_validate(item) + for item in json_response ] + except ApiException as e: logger.error(f"Failed to get app installation: {e}") raise diff --git a/plane/rest.py b/plane/rest.py index ba0b638..903f490 100644 --- a/plane/rest.py +++ b/plane/rest.py @@ -15,18 +15,15 @@ import io import json -import logging import re import ssl import urllib3 -from plane.exceptions import ApiException, UnauthorizedException, ForbiddenException, NotFoundException, ServiceException, ApiValueError, BadRequestException - - -logger = logging.getLogger(__name__) +from plane.exceptions import ApiException, ApiValueError SUPPORTED_SOCKS_PROXIES = {"socks5", "socks5h", "socks4", "socks4a"} +RESTResponseType = urllib3.HTTPResponse def is_socks_proxy_url(url): @@ -42,27 +39,31 @@ def is_socks_proxy_url(url): class RESTResponse(io.IOBase): def __init__(self, resp) -> None: - self.urllib3_response = resp + self.response = resp self.status = resp.status self.reason = resp.reason - self.data = resp.data + self.data = None + + def read(self): + if self.data is None: + self.data = self.response.data + return self.data def getheaders(self): """Returns a dictionary of the response headers.""" - return self.urllib3_response.headers + return self.response.headers def getheader(self, name, default=None): """Returns a given response header.""" - return self.urllib3_response.headers.get(name, default) + return self.response.headers.get(name, default) class RESTClientObject: - def __init__(self, configuration, pools_size=4, maxsize=None) -> None: + def __init__(self, configuration) -> None: # urllib3.PoolManager will pass all kw parameters to connectionpool # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/poolmanager.py#L75 # noqa: E501 # https://github.com/shazow/urllib3/blob/f9409436f83aeb79fbaf090181cd81b784f1b8ce/urllib3/connectionpool.py#L680 # noqa: E501 - # maxsize is the number of requests to host that are allowed in parallel # noqa: E501 # Custom SSL certificates and client certificates: http://urllib3.readthedocs.io/en/latest/advanced-usage.html # noqa: E501 # cert_reqs @@ -71,86 +72,80 @@ def __init__(self, configuration, pools_size=4, maxsize=None) -> None: else: cert_reqs = ssl.CERT_NONE - addition_pool_args = {} + pool_args = { + "cert_reqs": cert_reqs, + "ca_certs": configuration.ssl_ca_cert, + "cert_file": configuration.cert_file, + "key_file": configuration.key_file, + "ca_cert_data": configuration.ca_cert_data, + } if configuration.assert_hostname is not None: - addition_pool_args['assert_hostname'] = configuration.assert_hostname # noqa: E501 + pool_args['assert_hostname'] = ( + configuration.assert_hostname + ) if configuration.retries is not None: - addition_pool_args['retries'] = configuration.retries + pool_args['retries'] = configuration.retries if configuration.tls_server_name: - addition_pool_args['server_hostname'] = configuration.tls_server_name + pool_args['server_hostname'] = configuration.tls_server_name if configuration.socket_options is not None: - addition_pool_args['socket_options'] = configuration.socket_options + pool_args['socket_options'] = configuration.socket_options - if maxsize is None: - if configuration.connection_pool_maxsize is not None: - maxsize = configuration.connection_pool_maxsize - else: - maxsize = 4 + if configuration.connection_pool_maxsize is not None: + pool_args['maxsize'] = configuration.connection_pool_maxsize # https pool manager + self.pool_manager: urllib3.PoolManager + if configuration.proxy: if is_socks_proxy_url(configuration.proxy): from urllib3.contrib.socks import SOCKSProxyManager - self.pool_manager = SOCKSProxyManager( - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - headers=configuration.proxy_headers, - **addition_pool_args - ) + pool_args["proxy_url"] = configuration.proxy + pool_args["headers"] = configuration.proxy_headers + self.pool_manager = SOCKSProxyManager(**pool_args) else: - self.pool_manager = urllib3.ProxyManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - proxy_url=configuration.proxy, - proxy_headers=configuration.proxy_headers, - **addition_pool_args - ) + pool_args["proxy_url"] = configuration.proxy + pool_args["proxy_headers"] = configuration.proxy_headers + self.pool_manager = urllib3.ProxyManager(**pool_args) else: - self.pool_manager = urllib3.PoolManager( - num_pools=pools_size, - maxsize=maxsize, - cert_reqs=cert_reqs, - ca_certs=configuration.ssl_ca_cert, - cert_file=configuration.cert_file, - key_file=configuration.key_file, - **addition_pool_args - ) - - def request(self, method, url, query_params=None, headers=None, - body=None, post_params=None, _preload_content=True, - _request_timeout=None): + self.pool_manager = urllib3.PoolManager(**pool_args) + + def request( + self, + method, + url, + headers=None, + body=None, + post_params=None, + _request_timeout=None + ): """Perform requests. :param method: http request method :param url: http request url - :param query_params: query parameters in the url :param headers: http request headers :param body: request json body, for `application/json` :param post_params: request post parameters, `application/x-www-form-urlencoded` and `multipart/form-data` - :param _preload_content: if False, the urllib3.HTTPResponse object will - be returned without reading/decoding response - data. Default is True. :param _request_timeout: timeout setting for this request. If one number provided, it will be total request timeout. It can also be a pair (tuple) of (connection, read) timeouts. """ method = method.upper() - assert method in ['GET', 'HEAD', 'DELETE', 'POST', 'PUT', - 'PATCH', 'OPTIONS'] + assert method in [ + 'GET', + 'HEAD', + 'DELETE', + 'POST', + 'PUT', + 'PATCH', + 'OPTIONS' + ] if post_params and body: raise ApiValueError( @@ -159,43 +154,52 @@ def request(self, method, url, query_params=None, headers=None, post_params = post_params or {} headers = headers or {} - # url already contains the URL query string - # so reset query_params to empty dict - query_params = {} timeout = None if _request_timeout: - if isinstance(_request_timeout, (int,float)): # noqa: E501,F821 + if isinstance(_request_timeout, (int, float)): timeout = urllib3.Timeout(total=_request_timeout) - elif (isinstance(_request_timeout, tuple) and - len(_request_timeout) == 2): + elif ( + isinstance(_request_timeout, tuple) + and len(_request_timeout) == 2 + ): timeout = urllib3.Timeout( - connect=_request_timeout[0], read=_request_timeout[1]) + connect=_request_timeout[0], + read=_request_timeout[1] + ) try: # For `POST`, `PUT`, `PATCH`, `OPTIONS`, `DELETE` if method in ['POST', 'PUT', 'PATCH', 'OPTIONS', 'DELETE']: # no content type provided or payload is json - if not headers.get('Content-Type') or re.search('json', headers['Content-Type'], re.IGNORECASE): + content_type = headers.get('Content-Type') + if ( + not content_type + or re.search('json', content_type, re.IGNORECASE) + ): request_body = None if body is not None: request_body = json.dumps(body) r = self.pool_manager.request( - method, url, + method, + url, body=request_body, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'application/x-www-form-urlencoded': # noqa: E501 + headers=headers, + preload_content=False + ) + elif content_type == 'application/x-www-form-urlencoded': r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=False, - preload_content=_preload_content, timeout=timeout, - headers=headers) - elif headers['Content-Type'] == 'multipart/form-data': + headers=headers, + preload_content=False + ) + elif content_type == 'multipart/form-data': # must del headers['Content-Type'], or the correct # Content-Type which generated by urllib3 will be # overwritten. @@ -203,21 +207,33 @@ def request(self, method, url, query_params=None, headers=None, # Ensures that dict objects are serialized post_params = [(a, json.dumps(b)) if isinstance(b, dict) else (a,b) for a, b in post_params] r = self.pool_manager.request( - method, url, + method, + url, fields=post_params, encode_multipart=True, - preload_content=_preload_content, timeout=timeout, - headers=headers) + headers=headers, + preload_content=False + ) # Pass a `string` parameter directly in the body to support - # other content types than Json when `body` argument is - # provided in serialized form + # other content types than JSON when `body` argument is + # provided in serialized form. elif isinstance(body, str) or isinstance(body, bytes): - request_body = body r = self.pool_manager.request( - method, url, + method, + url, + body=body, + timeout=timeout, + headers=headers, + preload_content=False + ) + elif headers['Content-Type'].startswith('text/') and isinstance(body, bool): + request_body = "true" if body else "false" + r = self.pool_manager.request( + method, + url, body=request_body, - preload_content=_preload_content, + preload_content=False, timeout=timeout, headers=headers) else: @@ -228,102 +244,16 @@ def request(self, method, url, query_params=None, headers=None, raise ApiException(status=0, reason=msg) # For `GET`, `HEAD` else: - r = self.pool_manager.request(method, url, - fields={}, - preload_content=_preload_content, - timeout=timeout, - headers=headers) + r = self.pool_manager.request( + method, + url, + fields={}, + timeout=timeout, + headers=headers, + preload_content=False + ) except urllib3.exceptions.SSLError as e: - msg = "{0}\n{1}".format(type(e).__name__, str(e)) + msg = "\n".join([type(e).__name__, str(e)]) raise ApiException(status=0, reason=msg) - if _preload_content: - r = RESTResponse(r) - - # log response body - logger.debug("response body: %s", r.data) - - if not 200 <= r.status <= 299: - if r.status == 400: - raise BadRequestException(http_resp=r) - - if r.status == 401: - raise UnauthorizedException(http_resp=r) - - if r.status == 403: - raise ForbiddenException(http_resp=r) - - if r.status == 404: - raise NotFoundException(http_resp=r) - - if 500 <= r.status <= 599: - raise ServiceException(http_resp=r) - - raise ApiException(http_resp=r) - - return r - - def get_request(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("GET", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def head_request(self, url, headers=None, query_params=None, _preload_content=True, - _request_timeout=None): - return self.request("HEAD", url, - headers=headers, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - query_params=query_params) - - def options_request(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("OPTIONS", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def delete_request(self, url, headers=None, query_params=None, body=None, - _preload_content=True, _request_timeout=None): - return self.request("DELETE", url, - headers=headers, - query_params=query_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def post_request(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("POST", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def put_request(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PUT", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) - - def patch_request(self, url, headers=None, query_params=None, post_params=None, - body=None, _preload_content=True, _request_timeout=None): - return self.request("PATCH", url, - headers=headers, - query_params=query_params, - post_params=post_params, - _preload_content=_preload_content, - _request_timeout=_request_timeout, - body=body) + return RESTResponse(r) diff --git a/pyproject.toml b/pyproject.toml index fa78c3a..13ab354 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "plane" -version = "0.1.6" +version = "0.1.7" description = "The Plane REST API" authors = ["Plane "] license = "GNU AGPLv3" @@ -10,17 +10,21 @@ keywords = ["OpenAPI", "OpenAPI-Generator", "The Plane REST API"] include = ["plane/py.typed"] [tool.poetry.dependencies] -python = "^3.8" +python = "^3.9" -urllib3 = ">= 1.25.3" -python-dateutil = ">=2.8.2" -pydantic = "^1.10.5, <2" -aenum = ">=3.1.11" +urllib3 = ">= 2.1.0, < 3.0.0" +python-dateutil = ">= 2.8.2" +pydantic = ">= 2" +typing-extensions = ">= 4.7.1" [tool.poetry.dev-dependencies] -pytest = ">=7.2.1" -tox = ">=3.9.0" -flake8 = ">=4.0.0" +pytest = ">= 7.2.1" +pytest-cov = ">= 2.8.1" +tox = ">= 3.9.0" +flake8 = ">= 4.0.0" +types-python-dateutil = ">= 2.8.19.14" +mypy = ">= 1.5" + [build-system] requires = ["setuptools"] @@ -28,3 +32,58 @@ build-backend = "setuptools.build_meta" [tool.pylint.'MESSAGES CONTROL'] extension-pkg-whitelist = "pydantic" + +[tool.mypy] +files = [ + "plane", + #"test", # auto-generated tests + "tests", # hand-written tests +] +# TODO: enable "strict" once all these individual checks are passing +# strict = true + +# List from: https://mypy.readthedocs.io/en/stable/existing_code.html#introduce-stricter-options +warn_unused_configs = true +warn_redundant_casts = true +warn_unused_ignores = true + +## Getting these passing should be easy +strict_equality = true +extra_checks = true + +## Strongly recommend enabling this one as soon as you can +check_untyped_defs = true + +## These shouldn't be too much additional work, but may be tricky to +## get passing if you use a lot of untyped libraries +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true + +### These next few are various gradations of forcing use of type annotations +#disallow_untyped_calls = true +#disallow_incomplete_defs = true +#disallow_untyped_defs = true +# +### This one isn't too hard to get passing, but return on investment is lower +#no_implicit_reexport = true +# +### This one can be tricky to get passing if you use a lot of untyped libraries +#warn_return_any = true + +[[tool.mypy.overrides]] +module = [ + "plane.configuration", +] +warn_unused_ignores = true +strict_equality = true +extra_checks = true +check_untyped_defs = true +disallow_subclassing_any = true +disallow_untyped_decorators = true +disallow_any_generics = true +disallow_untyped_calls = true +disallow_incomplete_defs = true +disallow_untyped_defs = true +no_implicit_reexport = true +warn_return_any = true diff --git a/requirements.txt b/requirements.txt index 0a8bf96..6cbb2b9 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,5 +1,4 @@ -python_dateutil >= 2.5.3 -setuptools >= 21.0.0 -urllib3 >= 1.25.3, < 3.0.0 -pydantic >= 1.10.5, < 2 -aenum >= 3.1.11 +urllib3 >= 2.1.0, < 3.0.0 +python_dateutil >= 2.8.2 +pydantic >= 2 +typing-extensions >= 4.7.1 diff --git a/setup.py b/setup.py index a88592e..66d4efe 100644 --- a/setup.py +++ b/setup.py @@ -22,19 +22,15 @@ # prerequisite: setuptools # http://pypi.python.org/pypi/setuptools NAME = "plane-sdk" -VERSION = "0.1.6" -PYTHON_REQUIRES = ">=3.7" +VERSION = "0.1.7" +PYTHON_REQUIRES = ">= 3.9" REQUIRES = [ - "urllib3 >= 1.25.3, < 3.0.0", - "python-dateutil", - "pydantic >= 1.10.5, < 2", - "aenum" + "urllib3 >= 2.1.0, < 3.0.0", + "python-dateutil >= 2.8.2", + "pydantic >= 2", + "typing-extensions >= 4.7.1", ] -# Read README.md for long description -with open("README.md", "r", encoding="utf-8") as fh: - long_description = fh.read() - setup( name=NAME, version=VERSION, @@ -42,12 +38,14 @@ author="Plane", author_email="support@plane.so", url="", - keywords=["The Plane REST API"], + keywords=["OpenAPI", "OpenAPI-Generator", "The Plane REST API"], install_requires=REQUIRES, packages=find_packages(exclude=["test", "tests"]), include_package_data=True, license="GNU AGPLv3", long_description_content_type='text/markdown', - long_description=long_description, + long_description="""\ + The Plane REST API Visit our quick start guide and full API documentation at [developers.plane.so](https://developers.plane.so/api-reference/introduction). + """, # noqa: E501 package_data={"plane": ["py.typed"]}, -) +) \ No newline at end of file diff --git a/test-requirements.txt b/test-requirements.txt index 3a0d0b9..e98555c 100644 --- a/test-requirements.txt +++ b/test-requirements.txt @@ -1,3 +1,6 @@ -pytest~=7.1.3 -pytest-cov>=2.8.1 -pytest-randomly>=3.12.0 +pytest >= 7.2.1 +pytest-cov >= 2.8.1 +tox >= 3.9.0 +flake8 >= 4.0.0 +types-python-dateutil >= 2.8.19.14 +mypy >= 1.5