waldur-api-client 7.8.1__py3-none-any.whl → 7.8.2__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of waldur-api-client might be problematic. Click here for more details.
- waldur_api_client/api/booking_resources/booking_resources_count.py +10 -13
- waldur_api_client/api/booking_resources/booking_resources_list.py +10 -13
- waldur_api_client/api/call_managing_organisations/call_managing_organisations_create.py +44 -7
- waldur_api_client/api/call_managing_organisations/call_managing_organisations_partial_update.py +46 -7
- waldur_api_client/api/call_managing_organisations/call_managing_organisations_update.py +44 -7
- waldur_api_client/api/checklists_admin/checklists_admin_checklist_questions.py +49 -0
- waldur_api_client/api/checklists_admin/checklists_admin_count.py +43 -0
- waldur_api_client/api/checklists_admin/checklists_admin_list.py +43 -0
- waldur_api_client/api/checklists_admin_categories/checklists_admin_categories_create.py +44 -7
- waldur_api_client/api/checklists_admin_categories/checklists_admin_categories_partial_update.py +44 -7
- waldur_api_client/api/checklists_admin_categories/checklists_admin_categories_update.py +44 -7
- waldur_api_client/api/customers/customers_create.py +44 -7
- waldur_api_client/api/customers/customers_partial_update.py +44 -7
- waldur_api_client/api/customers/customers_update.py +44 -7
- waldur_api_client/api/external_links/external_links_create.py +44 -7
- waldur_api_client/api/external_links/external_links_partial_update.py +44 -7
- waldur_api_client/api/external_links/external_links_update.py +44 -7
- waldur_api_client/api/invoices/invoices_paid.py +44 -7
- waldur_api_client/api/marketplace_categories/marketplace_categories_create.py +44 -7
- waldur_api_client/api/marketplace_categories/marketplace_categories_partial_update.py +44 -7
- waldur_api_client/api/marketplace_categories/marketplace_categories_update.py +44 -7
- waldur_api_client/api/marketplace_category_groups/marketplace_category_groups_create.py +44 -7
- waldur_api_client/api/marketplace_category_groups/marketplace_category_groups_partial_update.py +44 -7
- waldur_api_client/api/marketplace_category_groups/marketplace_category_groups_update.py +44 -7
- waldur_api_client/api/marketplace_offering_files/marketplace_offering_files_create.py +44 -7
- waldur_api_client/api/marketplace_orders/marketplace_orders_update_attachment.py +44 -7
- waldur_api_client/api/marketplace_provider_offerings/marketplace_provider_offerings_create.py +44 -7
- waldur_api_client/api/marketplace_provider_offerings/marketplace_provider_offerings_update_image.py +44 -7
- waldur_api_client/api/marketplace_provider_offerings/marketplace_provider_offerings_update_thumbnail.py +30 -5
- waldur_api_client/api/marketplace_provider_resources/marketplace_provider_resources_count.py +10 -13
- waldur_api_client/api/marketplace_provider_resources/marketplace_provider_resources_list.py +10 -13
- waldur_api_client/api/marketplace_resources/marketplace_resources_count.py +10 -13
- waldur_api_client/api/marketplace_resources/marketplace_resources_list.py +10 -13
- waldur_api_client/api/marketplace_screenshots/marketplace_screenshots_create.py +44 -7
- waldur_api_client/api/marketplace_screenshots/marketplace_screenshots_update.py +44 -7
- waldur_api_client/api/marketplace_service_providers/marketplace_service_providers_create.py +44 -7
- waldur_api_client/api/marketplace_service_providers/marketplace_service_providers_partial_update.py +44 -7
- waldur_api_client/api/marketplace_service_providers/marketplace_service_providers_update.py +44 -7
- waldur_api_client/api/override_settings/override_settings.py +30 -5
- waldur_api_client/api/payments/payments_create.py +44 -7
- waldur_api_client/api/payments/payments_partial_update.py +44 -7
- waldur_api_client/api/payments/payments_update.py +44 -7
- waldur_api_client/api/projects/projects_create.py +44 -7
- waldur_api_client/api/projects/projects_partial_update.py +44 -7
- waldur_api_client/api/projects/projects_update.py +44 -7
- waldur_api_client/api/proposal_proposals/proposal_proposals_attach_document.py +30 -5
- waldur_api_client/api/slurm_jobs/slurm_jobs_create.py +44 -7
- waldur_api_client/api/slurm_jobs/slurm_jobs_update.py +44 -7
- waldur_api_client/api/support_attachments/support_attachments_create.py +44 -7
- waldur_api_client/api/user_group_invitations/user_group_invitations_count.py +15 -0
- waldur_api_client/api/user_group_invitations/user_group_invitations_list.py +15 -0
- waldur_api_client/api/users/users_create.py +44 -7
- waldur_api_client/api/users/users_partial_update.py +44 -7
- waldur_api_client/api/users/users_update.py +44 -7
- waldur_api_client/models/__init__.py +146 -2
- waldur_api_client/models/agent_type_enum.py +13 -0
- waldur_api_client/models/attachment_request_form.py +70 -0
- waldur_api_client/models/attachment_request_multipart.py +83 -0
- waldur_api_client/models/booking_offerings_list_field_item.py +1 -0
- waldur_api_client/models/booking_offerings_retrieve_field_item.py +1 -0
- waldur_api_client/models/call_managing_organisation_request_form.py +103 -0
- waldur_api_client/models/call_managing_organisation_request_multipart.py +122 -0
- waldur_api_client/models/call_round.py +11 -1
- waldur_api_client/models/category_group_request_form.py +103 -0
- waldur_api_client/models/category_group_request_multipart.py +122 -0
- waldur_api_client/models/checklist_category_request_form.py +103 -0
- waldur_api_client/models/checklist_category_request_multipart.py +122 -0
- waldur_api_client/models/checklists_admin_checklist_questions_checklist_type.py +11 -0
- waldur_api_client/models/checklists_admin_checklist_questions_checklist_type_in_item.py +11 -0
- waldur_api_client/models/checklists_admin_count_checklist_type.py +11 -0
- waldur_api_client/models/checklists_admin_count_checklist_type_in_item.py +11 -0
- waldur_api_client/models/checklists_admin_list_checklist_type.py +11 -0
- waldur_api_client/models/checklists_admin_list_checklist_type_in_item.py +11 -0
- waldur_api_client/models/constance_settings.py +9 -0
- waldur_api_client/models/constance_settings_request.py +9 -0
- waldur_api_client/models/constance_settings_request_form.py +1547 -0
- waldur_api_client/models/constance_settings_request_multipart.py +2173 -0
- waldur_api_client/models/customer.py +9 -0
- waldur_api_client/models/customer_request.py +9 -0
- waldur_api_client/models/customer_request_form.py +312 -0
- waldur_api_client/models/customer_request_multipart.py +394 -0
- waldur_api_client/models/customers_list_field_item.py +1 -0
- waldur_api_client/models/customers_retrieve_field_item.py +1 -0
- waldur_api_client/models/external_link_request_form.py +111 -0
- waldur_api_client/models/external_link_request_multipart.py +132 -0
- waldur_api_client/models/firecrest_job_request_form.py +104 -0
- waldur_api_client/models/firecrest_job_request_multipart.py +127 -0
- waldur_api_client/models/integration_status.py +21 -4
- waldur_api_client/models/marketplace_category_request_form.py +153 -0
- waldur_api_client/models/marketplace_category_request_multipart.py +187 -0
- waldur_api_client/models/marketplace_provider_offerings_list_course_accounts_retrieve_field_item.py +1 -0
- waldur_api_client/models/marketplace_provider_offerings_list_customer_service_accounts_retrieve_field_item.py +1 -0
- waldur_api_client/models/marketplace_provider_offerings_list_field_item.py +1 -0
- waldur_api_client/models/marketplace_provider_offerings_list_project_service_accounts_retrieve_field_item.py +1 -0
- waldur_api_client/models/marketplace_provider_offerings_retrieve_field_item.py +1 -0
- waldur_api_client/models/marketplace_provider_offerings_stats_retrieve_field_item.py +1 -0
- waldur_api_client/models/marketplace_provider_offerings_user_has_resource_access_retrieve_field_item.py +1 -0
- waldur_api_client/models/marketplace_public_offerings_list_field_item.py +1 -0
- waldur_api_client/models/marketplace_public_offerings_retrieve_field_item.py +1 -0
- waldur_api_client/models/marketplace_service_providers_offerings_list_field_item.py +1 -0
- waldur_api_client/models/nested_round.py +9 -0
- waldur_api_client/models/nested_round_request.py +9 -0
- waldur_api_client/models/offering.py +20 -0
- waldur_api_client/models/offering_create.py +20 -0
- waldur_api_client/models/offering_create_request.py +20 -0
- waldur_api_client/models/offering_create_request_form.py +479 -0
- waldur_api_client/models/offering_create_request_form_limits.py +57 -0
- waldur_api_client/models/offering_create_request_multipart.py +599 -0
- waldur_api_client/models/offering_create_request_multipart_limits.py +57 -0
- waldur_api_client/models/offering_file_request_form.py +78 -0
- waldur_api_client/models/offering_file_request_multipart.py +93 -0
- waldur_api_client/models/offering_image_request_form.py +62 -0
- waldur_api_client/models/offering_image_request_multipart.py +73 -0
- waldur_api_client/models/offering_thumbnail_request_form.py +62 -0
- waldur_api_client/models/offering_thumbnail_request_multipart.py +73 -0
- waldur_api_client/models/offering_user.py +5 -5
- waldur_api_client/models/{offering_user_state_enum.py → offering_user_state.py} +1 -1
- waldur_api_client/models/order_attachment_request_form.py +84 -0
- waldur_api_client/models/order_attachment_request_multipart.py +98 -0
- waldur_api_client/models/paid_request_form.py +81 -0
- waldur_api_client/models/paid_request_multipart.py +94 -0
- waldur_api_client/models/patched_call_managing_organisation_request_form.py +92 -0
- waldur_api_client/models/patched_call_managing_organisation_request_multipart.py +109 -0
- waldur_api_client/models/patched_category_group_request_form.py +101 -0
- waldur_api_client/models/patched_category_group_request_multipart.py +121 -0
- waldur_api_client/models/patched_checklist_category_request_form.py +102 -0
- waldur_api_client/models/patched_checklist_category_request_multipart.py +122 -0
- waldur_api_client/models/patched_customer_request.py +9 -0
- waldur_api_client/models/patched_customer_request_form.py +310 -0
- waldur_api_client/models/patched_customer_request_multipart.py +393 -0
- waldur_api_client/models/patched_external_link_request_form.py +110 -0
- waldur_api_client/models/patched_external_link_request_multipart.py +133 -0
- waldur_api_client/models/patched_marketplace_category_request_form.py +151 -0
- waldur_api_client/models/patched_marketplace_category_request_multipart.py +186 -0
- waldur_api_client/models/patched_payment_request_form.py +119 -0
- waldur_api_client/models/patched_payment_request_multipart.py +142 -0
- waldur_api_client/models/patched_project_request_form.py +279 -0
- waldur_api_client/models/patched_project_request_multipart.py +342 -0
- waldur_api_client/models/patched_service_provider_request_form.py +101 -0
- waldur_api_client/models/patched_service_provider_request_multipart.py +121 -0
- waldur_api_client/models/patched_user_request_form.py +241 -0
- waldur_api_client/models/patched_user_request_multipart.py +306 -0
- waldur_api_client/models/payment_request_form.py +113 -0
- waldur_api_client/models/payment_request_multipart.py +134 -0
- waldur_api_client/models/project_request_form.py +280 -0
- waldur_api_client/models/project_request_multipart.py +341 -0
- waldur_api_client/models/project_user.py +9 -0
- waldur_api_client/models/proposal.py +8 -0
- waldur_api_client/models/proposal_documentation_request_form.py +84 -0
- waldur_api_client/models/proposal_documentation_request_multipart.py +98 -0
- waldur_api_client/models/proposal_proposals_count_o_item.py +3 -1
- waldur_api_client/models/proposal_proposals_list_o_item.py +3 -1
- waldur_api_client/models/proposal_review.py +40 -0
- waldur_api_client/models/protected_proposal_list.py +8 -0
- waldur_api_client/models/protected_proposal_list_request.py +8 -0
- waldur_api_client/models/protected_round.py +8 -0
- waldur_api_client/models/provider_offering.py +21 -1
- waldur_api_client/models/provider_offering_details.py +20 -0
- waldur_api_client/models/public_offering_details.py +20 -0
- waldur_api_client/models/screenshot_request_form.py +87 -0
- waldur_api_client/models/screenshot_request_multipart.py +105 -0
- waldur_api_client/models/service_provider_request_form.py +112 -0
- waldur_api_client/models/service_provider_request_multipart.py +134 -0
- waldur_api_client/models/user_request_form.py +250 -0
- waldur_api_client/models/user_request_multipart.py +316 -0
- {waldur_api_client-7.8.1.dist-info → waldur_api_client-7.8.2.dist-info}/METADATA +1 -1
- {waldur_api_client-7.8.1.dist-info → waldur_api_client-7.8.2.dist-info}/RECORD +169 -98
- {waldur_api_client-7.8.1.dist-info → waldur_api_client-7.8.2.dist-info}/WHEEL +0 -0
- {waldur_api_client-7.8.1.dist-info → waldur_api_client-7.8.2.dist-info}/licenses/LICENSE +0 -0
|
@@ -0,0 +1,279 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from collections.abc import Mapping
|
|
3
|
+
from io import BytesIO
|
|
4
|
+
from typing import Any, TypeVar, Union, cast
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
from dateutil.parser import isoparse
|
|
9
|
+
|
|
10
|
+
from .. import types
|
|
11
|
+
from ..models.blank_enum import BlankEnum
|
|
12
|
+
from ..models.kind_enum import KindEnum
|
|
13
|
+
from ..models.oecd_fos_2007_code_enum import OecdFos2007CodeEnum
|
|
14
|
+
from ..types import UNSET, File, Unset
|
|
15
|
+
|
|
16
|
+
T = TypeVar("T", bound="PatchedProjectRequestForm")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@_attrs_define
|
|
20
|
+
class PatchedProjectRequestForm:
|
|
21
|
+
"""
|
|
22
|
+
Attributes:
|
|
23
|
+
name (Union[Unset, str]):
|
|
24
|
+
slug (Union[Unset, str]):
|
|
25
|
+
customer (Union[Unset, str]):
|
|
26
|
+
description (Union[Unset, str]):
|
|
27
|
+
type_ (Union[None, Unset, str]):
|
|
28
|
+
backend_id (Union[Unset, str]):
|
|
29
|
+
start_date (Union[None, Unset, datetime.date]):
|
|
30
|
+
end_date (Union[None, Unset, datetime.date]): The date is inclusive. Once reached, all project resource will be
|
|
31
|
+
scheduled for termination.
|
|
32
|
+
oecd_fos_2007_code (Union[BlankEnum, None, OecdFos2007CodeEnum, Unset]):
|
|
33
|
+
is_industry (Union[Unset, bool]):
|
|
34
|
+
image (Union[File, None, Unset]):
|
|
35
|
+
kind (Union[Unset, KindEnum]):
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
name: Union[Unset, str] = UNSET
|
|
39
|
+
slug: Union[Unset, str] = UNSET
|
|
40
|
+
customer: Union[Unset, str] = UNSET
|
|
41
|
+
description: Union[Unset, str] = UNSET
|
|
42
|
+
type_: Union[None, Unset, str] = UNSET
|
|
43
|
+
backend_id: Union[Unset, str] = UNSET
|
|
44
|
+
start_date: Union[None, Unset, datetime.date] = UNSET
|
|
45
|
+
end_date: Union[None, Unset, datetime.date] = UNSET
|
|
46
|
+
oecd_fos_2007_code: Union[BlankEnum, None, OecdFos2007CodeEnum, Unset] = UNSET
|
|
47
|
+
is_industry: Union[Unset, bool] = UNSET
|
|
48
|
+
image: Union[File, None, Unset] = UNSET
|
|
49
|
+
kind: Union[Unset, KindEnum] = UNSET
|
|
50
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
51
|
+
|
|
52
|
+
def to_dict(self) -> dict[str, Any]:
|
|
53
|
+
name = self.name
|
|
54
|
+
|
|
55
|
+
slug = self.slug
|
|
56
|
+
|
|
57
|
+
customer = self.customer
|
|
58
|
+
|
|
59
|
+
description = self.description
|
|
60
|
+
|
|
61
|
+
type_: Union[None, Unset, str]
|
|
62
|
+
if isinstance(self.type_, Unset):
|
|
63
|
+
type_ = UNSET
|
|
64
|
+
else:
|
|
65
|
+
type_ = self.type_
|
|
66
|
+
|
|
67
|
+
backend_id = self.backend_id
|
|
68
|
+
|
|
69
|
+
start_date: Union[None, Unset, str]
|
|
70
|
+
if isinstance(self.start_date, Unset):
|
|
71
|
+
start_date = UNSET
|
|
72
|
+
elif isinstance(self.start_date, datetime.date):
|
|
73
|
+
start_date = self.start_date.isoformat()
|
|
74
|
+
else:
|
|
75
|
+
start_date = self.start_date
|
|
76
|
+
|
|
77
|
+
end_date: Union[None, Unset, str]
|
|
78
|
+
if isinstance(self.end_date, Unset):
|
|
79
|
+
end_date = UNSET
|
|
80
|
+
elif isinstance(self.end_date, datetime.date):
|
|
81
|
+
end_date = self.end_date.isoformat()
|
|
82
|
+
else:
|
|
83
|
+
end_date = self.end_date
|
|
84
|
+
|
|
85
|
+
oecd_fos_2007_code: Union[None, Unset, str]
|
|
86
|
+
if isinstance(self.oecd_fos_2007_code, Unset):
|
|
87
|
+
oecd_fos_2007_code = UNSET
|
|
88
|
+
elif isinstance(self.oecd_fos_2007_code, OecdFos2007CodeEnum):
|
|
89
|
+
oecd_fos_2007_code = self.oecd_fos_2007_code.value
|
|
90
|
+
elif isinstance(self.oecd_fos_2007_code, BlankEnum):
|
|
91
|
+
oecd_fos_2007_code = self.oecd_fos_2007_code.value
|
|
92
|
+
else:
|
|
93
|
+
oecd_fos_2007_code = self.oecd_fos_2007_code
|
|
94
|
+
|
|
95
|
+
is_industry = self.is_industry
|
|
96
|
+
|
|
97
|
+
image: Union[None, Unset, types.FileTypes]
|
|
98
|
+
if isinstance(self.image, Unset):
|
|
99
|
+
image = UNSET
|
|
100
|
+
elif isinstance(self.image, File):
|
|
101
|
+
image = self.image.to_tuple()
|
|
102
|
+
|
|
103
|
+
else:
|
|
104
|
+
image = self.image
|
|
105
|
+
|
|
106
|
+
kind: Union[Unset, str] = UNSET
|
|
107
|
+
if not isinstance(self.kind, Unset):
|
|
108
|
+
kind = self.kind.value
|
|
109
|
+
|
|
110
|
+
field_dict: dict[str, Any] = {}
|
|
111
|
+
field_dict.update(self.additional_properties)
|
|
112
|
+
field_dict.update({})
|
|
113
|
+
if name is not UNSET:
|
|
114
|
+
field_dict["name"] = name
|
|
115
|
+
if slug is not UNSET:
|
|
116
|
+
field_dict["slug"] = slug
|
|
117
|
+
if customer is not UNSET:
|
|
118
|
+
field_dict["customer"] = customer
|
|
119
|
+
if description is not UNSET:
|
|
120
|
+
field_dict["description"] = description
|
|
121
|
+
if type_ is not UNSET:
|
|
122
|
+
field_dict["type"] = type_
|
|
123
|
+
if backend_id is not UNSET:
|
|
124
|
+
field_dict["backend_id"] = backend_id
|
|
125
|
+
if start_date is not UNSET:
|
|
126
|
+
field_dict["start_date"] = start_date
|
|
127
|
+
if end_date is not UNSET:
|
|
128
|
+
field_dict["end_date"] = end_date
|
|
129
|
+
if oecd_fos_2007_code is not UNSET:
|
|
130
|
+
field_dict["oecd_fos_2007_code"] = oecd_fos_2007_code
|
|
131
|
+
if is_industry is not UNSET:
|
|
132
|
+
field_dict["is_industry"] = is_industry
|
|
133
|
+
if image is not UNSET:
|
|
134
|
+
field_dict["image"] = image
|
|
135
|
+
if kind is not UNSET:
|
|
136
|
+
field_dict["kind"] = kind
|
|
137
|
+
|
|
138
|
+
return field_dict
|
|
139
|
+
|
|
140
|
+
@classmethod
|
|
141
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
142
|
+
d = dict(src_dict)
|
|
143
|
+
name = d.pop("name", UNSET)
|
|
144
|
+
|
|
145
|
+
slug = d.pop("slug", UNSET)
|
|
146
|
+
|
|
147
|
+
customer = d.pop("customer", UNSET)
|
|
148
|
+
|
|
149
|
+
description = d.pop("description", UNSET)
|
|
150
|
+
|
|
151
|
+
def _parse_type_(data: object) -> Union[None, Unset, str]:
|
|
152
|
+
if data is None:
|
|
153
|
+
return data
|
|
154
|
+
if isinstance(data, Unset):
|
|
155
|
+
return data
|
|
156
|
+
return cast(Union[None, Unset, str], data)
|
|
157
|
+
|
|
158
|
+
type_ = _parse_type_(d.pop("type", UNSET))
|
|
159
|
+
|
|
160
|
+
backend_id = d.pop("backend_id", UNSET)
|
|
161
|
+
|
|
162
|
+
def _parse_start_date(data: object) -> Union[None, Unset, datetime.date]:
|
|
163
|
+
if data is None:
|
|
164
|
+
return data
|
|
165
|
+
if isinstance(data, Unset):
|
|
166
|
+
return data
|
|
167
|
+
try:
|
|
168
|
+
if not isinstance(data, str):
|
|
169
|
+
raise TypeError()
|
|
170
|
+
start_date_type_0 = isoparse(data).date()
|
|
171
|
+
|
|
172
|
+
return start_date_type_0
|
|
173
|
+
except: # noqa: E722
|
|
174
|
+
pass
|
|
175
|
+
return cast(Union[None, Unset, datetime.date], data)
|
|
176
|
+
|
|
177
|
+
start_date = _parse_start_date(d.pop("start_date", UNSET))
|
|
178
|
+
|
|
179
|
+
def _parse_end_date(data: object) -> Union[None, Unset, datetime.date]:
|
|
180
|
+
if data is None:
|
|
181
|
+
return data
|
|
182
|
+
if isinstance(data, Unset):
|
|
183
|
+
return data
|
|
184
|
+
try:
|
|
185
|
+
if not isinstance(data, str):
|
|
186
|
+
raise TypeError()
|
|
187
|
+
end_date_type_0 = isoparse(data).date()
|
|
188
|
+
|
|
189
|
+
return end_date_type_0
|
|
190
|
+
except: # noqa: E722
|
|
191
|
+
pass
|
|
192
|
+
return cast(Union[None, Unset, datetime.date], data)
|
|
193
|
+
|
|
194
|
+
end_date = _parse_end_date(d.pop("end_date", UNSET))
|
|
195
|
+
|
|
196
|
+
def _parse_oecd_fos_2007_code(data: object) -> Union[BlankEnum, None, OecdFos2007CodeEnum, Unset]:
|
|
197
|
+
if data is None:
|
|
198
|
+
return data
|
|
199
|
+
if isinstance(data, Unset):
|
|
200
|
+
return data
|
|
201
|
+
try:
|
|
202
|
+
if not isinstance(data, str):
|
|
203
|
+
raise TypeError()
|
|
204
|
+
oecd_fos_2007_code_type_0 = OecdFos2007CodeEnum(data)
|
|
205
|
+
|
|
206
|
+
return oecd_fos_2007_code_type_0
|
|
207
|
+
except: # noqa: E722
|
|
208
|
+
pass
|
|
209
|
+
try:
|
|
210
|
+
if not isinstance(data, str):
|
|
211
|
+
raise TypeError()
|
|
212
|
+
oecd_fos_2007_code_type_1 = BlankEnum(data)
|
|
213
|
+
|
|
214
|
+
return oecd_fos_2007_code_type_1
|
|
215
|
+
except: # noqa: E722
|
|
216
|
+
pass
|
|
217
|
+
return cast(Union[BlankEnum, None, OecdFos2007CodeEnum, Unset], data)
|
|
218
|
+
|
|
219
|
+
oecd_fos_2007_code = _parse_oecd_fos_2007_code(d.pop("oecd_fos_2007_code", UNSET))
|
|
220
|
+
|
|
221
|
+
is_industry = d.pop("is_industry", UNSET)
|
|
222
|
+
|
|
223
|
+
def _parse_image(data: object) -> Union[File, None, Unset]:
|
|
224
|
+
if data is None:
|
|
225
|
+
return data
|
|
226
|
+
if isinstance(data, Unset):
|
|
227
|
+
return data
|
|
228
|
+
try:
|
|
229
|
+
if not isinstance(data, bytes):
|
|
230
|
+
raise TypeError()
|
|
231
|
+
image_type_0 = File(payload=BytesIO(data))
|
|
232
|
+
|
|
233
|
+
return image_type_0
|
|
234
|
+
except: # noqa: E722
|
|
235
|
+
pass
|
|
236
|
+
return cast(Union[File, None, Unset], data)
|
|
237
|
+
|
|
238
|
+
image = _parse_image(d.pop("image", UNSET))
|
|
239
|
+
|
|
240
|
+
_kind = d.pop("kind", UNSET)
|
|
241
|
+
kind: Union[Unset, KindEnum]
|
|
242
|
+
if isinstance(_kind, Unset):
|
|
243
|
+
kind = UNSET
|
|
244
|
+
else:
|
|
245
|
+
kind = KindEnum(_kind)
|
|
246
|
+
|
|
247
|
+
patched_project_request_form = cls(
|
|
248
|
+
name=name,
|
|
249
|
+
slug=slug,
|
|
250
|
+
customer=customer,
|
|
251
|
+
description=description,
|
|
252
|
+
type_=type_,
|
|
253
|
+
backend_id=backend_id,
|
|
254
|
+
start_date=start_date,
|
|
255
|
+
end_date=end_date,
|
|
256
|
+
oecd_fos_2007_code=oecd_fos_2007_code,
|
|
257
|
+
is_industry=is_industry,
|
|
258
|
+
image=image,
|
|
259
|
+
kind=kind,
|
|
260
|
+
)
|
|
261
|
+
|
|
262
|
+
patched_project_request_form.additional_properties = d
|
|
263
|
+
return patched_project_request_form
|
|
264
|
+
|
|
265
|
+
@property
|
|
266
|
+
def additional_keys(self) -> list[str]:
|
|
267
|
+
return list(self.additional_properties.keys())
|
|
268
|
+
|
|
269
|
+
def __getitem__(self, key: str) -> Any:
|
|
270
|
+
return self.additional_properties[key]
|
|
271
|
+
|
|
272
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
273
|
+
self.additional_properties[key] = value
|
|
274
|
+
|
|
275
|
+
def __delitem__(self, key: str) -> None:
|
|
276
|
+
del self.additional_properties[key]
|
|
277
|
+
|
|
278
|
+
def __contains__(self, key: str) -> bool:
|
|
279
|
+
return key in self.additional_properties
|
|
@@ -0,0 +1,342 @@
|
|
|
1
|
+
import datetime
|
|
2
|
+
from collections.abc import Mapping
|
|
3
|
+
from io import BytesIO
|
|
4
|
+
from typing import Any, TypeVar, Union, cast
|
|
5
|
+
|
|
6
|
+
from attrs import define as _attrs_define
|
|
7
|
+
from attrs import field as _attrs_field
|
|
8
|
+
from dateutil.parser import isoparse
|
|
9
|
+
|
|
10
|
+
from .. import types
|
|
11
|
+
from ..models.blank_enum import BlankEnum
|
|
12
|
+
from ..models.kind_enum import KindEnum
|
|
13
|
+
from ..models.oecd_fos_2007_code_enum import OecdFos2007CodeEnum
|
|
14
|
+
from ..types import UNSET, File, Unset
|
|
15
|
+
|
|
16
|
+
T = TypeVar("T", bound="PatchedProjectRequestMultipart")
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
@_attrs_define
|
|
20
|
+
class PatchedProjectRequestMultipart:
|
|
21
|
+
"""
|
|
22
|
+
Attributes:
|
|
23
|
+
name (Union[Unset, str]):
|
|
24
|
+
slug (Union[Unset, str]):
|
|
25
|
+
customer (Union[Unset, str]):
|
|
26
|
+
description (Union[Unset, str]):
|
|
27
|
+
type_ (Union[None, Unset, str]):
|
|
28
|
+
backend_id (Union[Unset, str]):
|
|
29
|
+
start_date (Union[None, Unset, datetime.date]):
|
|
30
|
+
end_date (Union[None, Unset, datetime.date]): The date is inclusive. Once reached, all project resource will be
|
|
31
|
+
scheduled for termination.
|
|
32
|
+
oecd_fos_2007_code (Union[BlankEnum, None, OecdFos2007CodeEnum, Unset]):
|
|
33
|
+
is_industry (Union[Unset, bool]):
|
|
34
|
+
image (Union[File, None, Unset]):
|
|
35
|
+
kind (Union[Unset, KindEnum]):
|
|
36
|
+
"""
|
|
37
|
+
|
|
38
|
+
name: Union[Unset, str] = UNSET
|
|
39
|
+
slug: Union[Unset, str] = UNSET
|
|
40
|
+
customer: Union[Unset, str] = UNSET
|
|
41
|
+
description: Union[Unset, str] = UNSET
|
|
42
|
+
type_: Union[None, Unset, str] = UNSET
|
|
43
|
+
backend_id: Union[Unset, str] = UNSET
|
|
44
|
+
start_date: Union[None, Unset, datetime.date] = UNSET
|
|
45
|
+
end_date: Union[None, Unset, datetime.date] = UNSET
|
|
46
|
+
oecd_fos_2007_code: Union[BlankEnum, None, OecdFos2007CodeEnum, Unset] = UNSET
|
|
47
|
+
is_industry: Union[Unset, bool] = UNSET
|
|
48
|
+
image: Union[File, None, Unset] = UNSET
|
|
49
|
+
kind: Union[Unset, KindEnum] = UNSET
|
|
50
|
+
additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
|
|
51
|
+
|
|
52
|
+
def to_dict(self) -> dict[str, Any]:
|
|
53
|
+
name = self.name
|
|
54
|
+
|
|
55
|
+
slug = self.slug
|
|
56
|
+
|
|
57
|
+
customer = self.customer
|
|
58
|
+
|
|
59
|
+
description = self.description
|
|
60
|
+
|
|
61
|
+
type_: Union[None, Unset, str]
|
|
62
|
+
if isinstance(self.type_, Unset):
|
|
63
|
+
type_ = UNSET
|
|
64
|
+
else:
|
|
65
|
+
type_ = self.type_
|
|
66
|
+
|
|
67
|
+
backend_id = self.backend_id
|
|
68
|
+
|
|
69
|
+
start_date: Union[None, Unset, str]
|
|
70
|
+
if isinstance(self.start_date, Unset):
|
|
71
|
+
start_date = UNSET
|
|
72
|
+
elif isinstance(self.start_date, datetime.date):
|
|
73
|
+
start_date = self.start_date.isoformat()
|
|
74
|
+
else:
|
|
75
|
+
start_date = self.start_date
|
|
76
|
+
|
|
77
|
+
end_date: Union[None, Unset, str]
|
|
78
|
+
if isinstance(self.end_date, Unset):
|
|
79
|
+
end_date = UNSET
|
|
80
|
+
elif isinstance(self.end_date, datetime.date):
|
|
81
|
+
end_date = self.end_date.isoformat()
|
|
82
|
+
else:
|
|
83
|
+
end_date = self.end_date
|
|
84
|
+
|
|
85
|
+
oecd_fos_2007_code: Union[None, Unset, str]
|
|
86
|
+
if isinstance(self.oecd_fos_2007_code, Unset):
|
|
87
|
+
oecd_fos_2007_code = UNSET
|
|
88
|
+
elif isinstance(self.oecd_fos_2007_code, OecdFos2007CodeEnum):
|
|
89
|
+
oecd_fos_2007_code = self.oecd_fos_2007_code.value
|
|
90
|
+
elif isinstance(self.oecd_fos_2007_code, BlankEnum):
|
|
91
|
+
oecd_fos_2007_code = self.oecd_fos_2007_code.value
|
|
92
|
+
else:
|
|
93
|
+
oecd_fos_2007_code = self.oecd_fos_2007_code
|
|
94
|
+
|
|
95
|
+
is_industry = self.is_industry
|
|
96
|
+
|
|
97
|
+
image: Union[None, Unset, types.FileTypes]
|
|
98
|
+
if isinstance(self.image, Unset):
|
|
99
|
+
image = UNSET
|
|
100
|
+
elif isinstance(self.image, File):
|
|
101
|
+
image = self.image.to_tuple()
|
|
102
|
+
|
|
103
|
+
else:
|
|
104
|
+
image = self.image
|
|
105
|
+
|
|
106
|
+
kind: Union[Unset, str] = UNSET
|
|
107
|
+
if not isinstance(self.kind, Unset):
|
|
108
|
+
kind = self.kind.value
|
|
109
|
+
|
|
110
|
+
field_dict: dict[str, Any] = {}
|
|
111
|
+
field_dict.update(self.additional_properties)
|
|
112
|
+
field_dict.update({})
|
|
113
|
+
if name is not UNSET:
|
|
114
|
+
field_dict["name"] = name
|
|
115
|
+
if slug is not UNSET:
|
|
116
|
+
field_dict["slug"] = slug
|
|
117
|
+
if customer is not UNSET:
|
|
118
|
+
field_dict["customer"] = customer
|
|
119
|
+
if description is not UNSET:
|
|
120
|
+
field_dict["description"] = description
|
|
121
|
+
if type_ is not UNSET:
|
|
122
|
+
field_dict["type"] = type_
|
|
123
|
+
if backend_id is not UNSET:
|
|
124
|
+
field_dict["backend_id"] = backend_id
|
|
125
|
+
if start_date is not UNSET:
|
|
126
|
+
field_dict["start_date"] = start_date
|
|
127
|
+
if end_date is not UNSET:
|
|
128
|
+
field_dict["end_date"] = end_date
|
|
129
|
+
if oecd_fos_2007_code is not UNSET:
|
|
130
|
+
field_dict["oecd_fos_2007_code"] = oecd_fos_2007_code
|
|
131
|
+
if is_industry is not UNSET:
|
|
132
|
+
field_dict["is_industry"] = is_industry
|
|
133
|
+
if image is not UNSET:
|
|
134
|
+
field_dict["image"] = image
|
|
135
|
+
if kind is not UNSET:
|
|
136
|
+
field_dict["kind"] = kind
|
|
137
|
+
|
|
138
|
+
return field_dict
|
|
139
|
+
|
|
140
|
+
def to_multipart(self) -> types.RequestFiles:
|
|
141
|
+
files: types.RequestFiles = []
|
|
142
|
+
|
|
143
|
+
if not isinstance(self.name, Unset):
|
|
144
|
+
files.append(("name", (None, str(self.name).encode(), "text/plain")))
|
|
145
|
+
|
|
146
|
+
if not isinstance(self.slug, Unset):
|
|
147
|
+
files.append(("slug", (None, str(self.slug).encode(), "text/plain")))
|
|
148
|
+
|
|
149
|
+
if not isinstance(self.customer, Unset):
|
|
150
|
+
files.append(("customer", (None, str(self.customer).encode(), "text/plain")))
|
|
151
|
+
|
|
152
|
+
if not isinstance(self.description, Unset):
|
|
153
|
+
files.append(("description", (None, str(self.description).encode(), "text/plain")))
|
|
154
|
+
|
|
155
|
+
if not isinstance(self.type_, Unset):
|
|
156
|
+
if isinstance(self.type_, str):
|
|
157
|
+
files.append(("type", (None, str(self.type_).encode(), "text/plain")))
|
|
158
|
+
else:
|
|
159
|
+
files.append(("type", (None, str(self.type_).encode(), "text/plain")))
|
|
160
|
+
|
|
161
|
+
if not isinstance(self.backend_id, Unset):
|
|
162
|
+
files.append(("backend_id", (None, str(self.backend_id).encode(), "text/plain")))
|
|
163
|
+
|
|
164
|
+
if not isinstance(self.start_date, Unset):
|
|
165
|
+
if isinstance(self.start_date, datetime.date):
|
|
166
|
+
files.append(("start_date", (None, self.start_date.isoformat().encode(), "text/plain")))
|
|
167
|
+
else:
|
|
168
|
+
files.append(("start_date", (None, str(self.start_date).encode(), "text/plain")))
|
|
169
|
+
|
|
170
|
+
if not isinstance(self.end_date, Unset):
|
|
171
|
+
if isinstance(self.end_date, datetime.date):
|
|
172
|
+
files.append(("end_date", (None, self.end_date.isoformat().encode(), "text/plain")))
|
|
173
|
+
else:
|
|
174
|
+
files.append(("end_date", (None, str(self.end_date).encode(), "text/plain")))
|
|
175
|
+
|
|
176
|
+
if not isinstance(self.oecd_fos_2007_code, Unset):
|
|
177
|
+
if isinstance(self.oecd_fos_2007_code, OecdFos2007CodeEnum):
|
|
178
|
+
files.append(("oecd_fos_2007_code", (None, str(self.oecd_fos_2007_code.value).encode(), "text/plain")))
|
|
179
|
+
elif isinstance(self.oecd_fos_2007_code, BlankEnum):
|
|
180
|
+
files.append(("oecd_fos_2007_code", (None, str(self.oecd_fos_2007_code.value).encode(), "text/plain")))
|
|
181
|
+
elif self.oecd_fos_2007_code is None:
|
|
182
|
+
files.append(("oecd_fos_2007_code", (None, str(self.oecd_fos_2007_code).encode(), "text/plain")))
|
|
183
|
+
else:
|
|
184
|
+
files.append(("oecd_fos_2007_code", (None, str(self.oecd_fos_2007_code).encode(), "text/plain")))
|
|
185
|
+
|
|
186
|
+
if not isinstance(self.is_industry, Unset):
|
|
187
|
+
files.append(("is_industry", (None, str(self.is_industry).encode(), "text/plain")))
|
|
188
|
+
|
|
189
|
+
if not isinstance(self.image, Unset):
|
|
190
|
+
if isinstance(self.image, File):
|
|
191
|
+
files.append(("image", self.image.to_tuple()))
|
|
192
|
+
else:
|
|
193
|
+
files.append(("image", (None, str(self.image).encode(), "text/plain")))
|
|
194
|
+
|
|
195
|
+
if not isinstance(self.kind, Unset):
|
|
196
|
+
files.append(("kind", (None, str(self.kind.value).encode(), "text/plain")))
|
|
197
|
+
|
|
198
|
+
for prop_name, prop in self.additional_properties.items():
|
|
199
|
+
files.append((prop_name, (None, str(prop).encode(), "text/plain")))
|
|
200
|
+
|
|
201
|
+
return files
|
|
202
|
+
|
|
203
|
+
@classmethod
|
|
204
|
+
def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
|
|
205
|
+
d = dict(src_dict)
|
|
206
|
+
name = d.pop("name", UNSET)
|
|
207
|
+
|
|
208
|
+
slug = d.pop("slug", UNSET)
|
|
209
|
+
|
|
210
|
+
customer = d.pop("customer", UNSET)
|
|
211
|
+
|
|
212
|
+
description = d.pop("description", UNSET)
|
|
213
|
+
|
|
214
|
+
def _parse_type_(data: object) -> Union[None, Unset, str]:
|
|
215
|
+
if data is None:
|
|
216
|
+
return data
|
|
217
|
+
if isinstance(data, Unset):
|
|
218
|
+
return data
|
|
219
|
+
return cast(Union[None, Unset, str], data)
|
|
220
|
+
|
|
221
|
+
type_ = _parse_type_(d.pop("type", UNSET))
|
|
222
|
+
|
|
223
|
+
backend_id = d.pop("backend_id", UNSET)
|
|
224
|
+
|
|
225
|
+
def _parse_start_date(data: object) -> Union[None, Unset, datetime.date]:
|
|
226
|
+
if data is None:
|
|
227
|
+
return data
|
|
228
|
+
if isinstance(data, Unset):
|
|
229
|
+
return data
|
|
230
|
+
try:
|
|
231
|
+
if not isinstance(data, str):
|
|
232
|
+
raise TypeError()
|
|
233
|
+
start_date_type_0 = isoparse(data).date()
|
|
234
|
+
|
|
235
|
+
return start_date_type_0
|
|
236
|
+
except: # noqa: E722
|
|
237
|
+
pass
|
|
238
|
+
return cast(Union[None, Unset, datetime.date], data)
|
|
239
|
+
|
|
240
|
+
start_date = _parse_start_date(d.pop("start_date", UNSET))
|
|
241
|
+
|
|
242
|
+
def _parse_end_date(data: object) -> Union[None, Unset, datetime.date]:
|
|
243
|
+
if data is None:
|
|
244
|
+
return data
|
|
245
|
+
if isinstance(data, Unset):
|
|
246
|
+
return data
|
|
247
|
+
try:
|
|
248
|
+
if not isinstance(data, str):
|
|
249
|
+
raise TypeError()
|
|
250
|
+
end_date_type_0 = isoparse(data).date()
|
|
251
|
+
|
|
252
|
+
return end_date_type_0
|
|
253
|
+
except: # noqa: E722
|
|
254
|
+
pass
|
|
255
|
+
return cast(Union[None, Unset, datetime.date], data)
|
|
256
|
+
|
|
257
|
+
end_date = _parse_end_date(d.pop("end_date", UNSET))
|
|
258
|
+
|
|
259
|
+
def _parse_oecd_fos_2007_code(data: object) -> Union[BlankEnum, None, OecdFos2007CodeEnum, Unset]:
|
|
260
|
+
if data is None:
|
|
261
|
+
return data
|
|
262
|
+
if isinstance(data, Unset):
|
|
263
|
+
return data
|
|
264
|
+
try:
|
|
265
|
+
if not isinstance(data, str):
|
|
266
|
+
raise TypeError()
|
|
267
|
+
oecd_fos_2007_code_type_0 = OecdFos2007CodeEnum(data)
|
|
268
|
+
|
|
269
|
+
return oecd_fos_2007_code_type_0
|
|
270
|
+
except: # noqa: E722
|
|
271
|
+
pass
|
|
272
|
+
try:
|
|
273
|
+
if not isinstance(data, str):
|
|
274
|
+
raise TypeError()
|
|
275
|
+
oecd_fos_2007_code_type_1 = BlankEnum(data)
|
|
276
|
+
|
|
277
|
+
return oecd_fos_2007_code_type_1
|
|
278
|
+
except: # noqa: E722
|
|
279
|
+
pass
|
|
280
|
+
return cast(Union[BlankEnum, None, OecdFos2007CodeEnum, Unset], data)
|
|
281
|
+
|
|
282
|
+
oecd_fos_2007_code = _parse_oecd_fos_2007_code(d.pop("oecd_fos_2007_code", UNSET))
|
|
283
|
+
|
|
284
|
+
is_industry = d.pop("is_industry", UNSET)
|
|
285
|
+
|
|
286
|
+
def _parse_image(data: object) -> Union[File, None, Unset]:
|
|
287
|
+
if data is None:
|
|
288
|
+
return data
|
|
289
|
+
if isinstance(data, Unset):
|
|
290
|
+
return data
|
|
291
|
+
try:
|
|
292
|
+
if not isinstance(data, bytes):
|
|
293
|
+
raise TypeError()
|
|
294
|
+
image_type_0 = File(payload=BytesIO(data))
|
|
295
|
+
|
|
296
|
+
return image_type_0
|
|
297
|
+
except: # noqa: E722
|
|
298
|
+
pass
|
|
299
|
+
return cast(Union[File, None, Unset], data)
|
|
300
|
+
|
|
301
|
+
image = _parse_image(d.pop("image", UNSET))
|
|
302
|
+
|
|
303
|
+
_kind = d.pop("kind", UNSET)
|
|
304
|
+
kind: Union[Unset, KindEnum]
|
|
305
|
+
if isinstance(_kind, Unset):
|
|
306
|
+
kind = UNSET
|
|
307
|
+
else:
|
|
308
|
+
kind = KindEnum(_kind)
|
|
309
|
+
|
|
310
|
+
patched_project_request_multipart = cls(
|
|
311
|
+
name=name,
|
|
312
|
+
slug=slug,
|
|
313
|
+
customer=customer,
|
|
314
|
+
description=description,
|
|
315
|
+
type_=type_,
|
|
316
|
+
backend_id=backend_id,
|
|
317
|
+
start_date=start_date,
|
|
318
|
+
end_date=end_date,
|
|
319
|
+
oecd_fos_2007_code=oecd_fos_2007_code,
|
|
320
|
+
is_industry=is_industry,
|
|
321
|
+
image=image,
|
|
322
|
+
kind=kind,
|
|
323
|
+
)
|
|
324
|
+
|
|
325
|
+
patched_project_request_multipart.additional_properties = d
|
|
326
|
+
return patched_project_request_multipart
|
|
327
|
+
|
|
328
|
+
@property
|
|
329
|
+
def additional_keys(self) -> list[str]:
|
|
330
|
+
return list(self.additional_properties.keys())
|
|
331
|
+
|
|
332
|
+
def __getitem__(self, key: str) -> Any:
|
|
333
|
+
return self.additional_properties[key]
|
|
334
|
+
|
|
335
|
+
def __setitem__(self, key: str, value: Any) -> None:
|
|
336
|
+
self.additional_properties[key] = value
|
|
337
|
+
|
|
338
|
+
def __delitem__(self, key: str) -> None:
|
|
339
|
+
del self.additional_properties[key]
|
|
340
|
+
|
|
341
|
+
def __contains__(self, key: str) -> bool:
|
|
342
|
+
return key in self.additional_properties
|