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.

Files changed (169) hide show
  1. waldur_api_client/api/booking_resources/booking_resources_count.py +10 -13
  2. waldur_api_client/api/booking_resources/booking_resources_list.py +10 -13
  3. waldur_api_client/api/call_managing_organisations/call_managing_organisations_create.py +44 -7
  4. waldur_api_client/api/call_managing_organisations/call_managing_organisations_partial_update.py +46 -7
  5. waldur_api_client/api/call_managing_organisations/call_managing_organisations_update.py +44 -7
  6. waldur_api_client/api/checklists_admin/checklists_admin_checklist_questions.py +49 -0
  7. waldur_api_client/api/checklists_admin/checklists_admin_count.py +43 -0
  8. waldur_api_client/api/checklists_admin/checklists_admin_list.py +43 -0
  9. waldur_api_client/api/checklists_admin_categories/checklists_admin_categories_create.py +44 -7
  10. waldur_api_client/api/checklists_admin_categories/checklists_admin_categories_partial_update.py +44 -7
  11. waldur_api_client/api/checklists_admin_categories/checklists_admin_categories_update.py +44 -7
  12. waldur_api_client/api/customers/customers_create.py +44 -7
  13. waldur_api_client/api/customers/customers_partial_update.py +44 -7
  14. waldur_api_client/api/customers/customers_update.py +44 -7
  15. waldur_api_client/api/external_links/external_links_create.py +44 -7
  16. waldur_api_client/api/external_links/external_links_partial_update.py +44 -7
  17. waldur_api_client/api/external_links/external_links_update.py +44 -7
  18. waldur_api_client/api/invoices/invoices_paid.py +44 -7
  19. waldur_api_client/api/marketplace_categories/marketplace_categories_create.py +44 -7
  20. waldur_api_client/api/marketplace_categories/marketplace_categories_partial_update.py +44 -7
  21. waldur_api_client/api/marketplace_categories/marketplace_categories_update.py +44 -7
  22. waldur_api_client/api/marketplace_category_groups/marketplace_category_groups_create.py +44 -7
  23. waldur_api_client/api/marketplace_category_groups/marketplace_category_groups_partial_update.py +44 -7
  24. waldur_api_client/api/marketplace_category_groups/marketplace_category_groups_update.py +44 -7
  25. waldur_api_client/api/marketplace_offering_files/marketplace_offering_files_create.py +44 -7
  26. waldur_api_client/api/marketplace_orders/marketplace_orders_update_attachment.py +44 -7
  27. waldur_api_client/api/marketplace_provider_offerings/marketplace_provider_offerings_create.py +44 -7
  28. waldur_api_client/api/marketplace_provider_offerings/marketplace_provider_offerings_update_image.py +44 -7
  29. waldur_api_client/api/marketplace_provider_offerings/marketplace_provider_offerings_update_thumbnail.py +30 -5
  30. waldur_api_client/api/marketplace_provider_resources/marketplace_provider_resources_count.py +10 -13
  31. waldur_api_client/api/marketplace_provider_resources/marketplace_provider_resources_list.py +10 -13
  32. waldur_api_client/api/marketplace_resources/marketplace_resources_count.py +10 -13
  33. waldur_api_client/api/marketplace_resources/marketplace_resources_list.py +10 -13
  34. waldur_api_client/api/marketplace_screenshots/marketplace_screenshots_create.py +44 -7
  35. waldur_api_client/api/marketplace_screenshots/marketplace_screenshots_update.py +44 -7
  36. waldur_api_client/api/marketplace_service_providers/marketplace_service_providers_create.py +44 -7
  37. waldur_api_client/api/marketplace_service_providers/marketplace_service_providers_partial_update.py +44 -7
  38. waldur_api_client/api/marketplace_service_providers/marketplace_service_providers_update.py +44 -7
  39. waldur_api_client/api/override_settings/override_settings.py +30 -5
  40. waldur_api_client/api/payments/payments_create.py +44 -7
  41. waldur_api_client/api/payments/payments_partial_update.py +44 -7
  42. waldur_api_client/api/payments/payments_update.py +44 -7
  43. waldur_api_client/api/projects/projects_create.py +44 -7
  44. waldur_api_client/api/projects/projects_partial_update.py +44 -7
  45. waldur_api_client/api/projects/projects_update.py +44 -7
  46. waldur_api_client/api/proposal_proposals/proposal_proposals_attach_document.py +30 -5
  47. waldur_api_client/api/slurm_jobs/slurm_jobs_create.py +44 -7
  48. waldur_api_client/api/slurm_jobs/slurm_jobs_update.py +44 -7
  49. waldur_api_client/api/support_attachments/support_attachments_create.py +44 -7
  50. waldur_api_client/api/user_group_invitations/user_group_invitations_count.py +15 -0
  51. waldur_api_client/api/user_group_invitations/user_group_invitations_list.py +15 -0
  52. waldur_api_client/api/users/users_create.py +44 -7
  53. waldur_api_client/api/users/users_partial_update.py +44 -7
  54. waldur_api_client/api/users/users_update.py +44 -7
  55. waldur_api_client/models/__init__.py +146 -2
  56. waldur_api_client/models/agent_type_enum.py +13 -0
  57. waldur_api_client/models/attachment_request_form.py +70 -0
  58. waldur_api_client/models/attachment_request_multipart.py +83 -0
  59. waldur_api_client/models/booking_offerings_list_field_item.py +1 -0
  60. waldur_api_client/models/booking_offerings_retrieve_field_item.py +1 -0
  61. waldur_api_client/models/call_managing_organisation_request_form.py +103 -0
  62. waldur_api_client/models/call_managing_organisation_request_multipart.py +122 -0
  63. waldur_api_client/models/call_round.py +11 -1
  64. waldur_api_client/models/category_group_request_form.py +103 -0
  65. waldur_api_client/models/category_group_request_multipart.py +122 -0
  66. waldur_api_client/models/checklist_category_request_form.py +103 -0
  67. waldur_api_client/models/checklist_category_request_multipart.py +122 -0
  68. waldur_api_client/models/checklists_admin_checklist_questions_checklist_type.py +11 -0
  69. waldur_api_client/models/checklists_admin_checklist_questions_checklist_type_in_item.py +11 -0
  70. waldur_api_client/models/checklists_admin_count_checklist_type.py +11 -0
  71. waldur_api_client/models/checklists_admin_count_checklist_type_in_item.py +11 -0
  72. waldur_api_client/models/checklists_admin_list_checklist_type.py +11 -0
  73. waldur_api_client/models/checklists_admin_list_checklist_type_in_item.py +11 -0
  74. waldur_api_client/models/constance_settings.py +9 -0
  75. waldur_api_client/models/constance_settings_request.py +9 -0
  76. waldur_api_client/models/constance_settings_request_form.py +1547 -0
  77. waldur_api_client/models/constance_settings_request_multipart.py +2173 -0
  78. waldur_api_client/models/customer.py +9 -0
  79. waldur_api_client/models/customer_request.py +9 -0
  80. waldur_api_client/models/customer_request_form.py +312 -0
  81. waldur_api_client/models/customer_request_multipart.py +394 -0
  82. waldur_api_client/models/customers_list_field_item.py +1 -0
  83. waldur_api_client/models/customers_retrieve_field_item.py +1 -0
  84. waldur_api_client/models/external_link_request_form.py +111 -0
  85. waldur_api_client/models/external_link_request_multipart.py +132 -0
  86. waldur_api_client/models/firecrest_job_request_form.py +104 -0
  87. waldur_api_client/models/firecrest_job_request_multipart.py +127 -0
  88. waldur_api_client/models/integration_status.py +21 -4
  89. waldur_api_client/models/marketplace_category_request_form.py +153 -0
  90. waldur_api_client/models/marketplace_category_request_multipart.py +187 -0
  91. waldur_api_client/models/marketplace_provider_offerings_list_course_accounts_retrieve_field_item.py +1 -0
  92. waldur_api_client/models/marketplace_provider_offerings_list_customer_service_accounts_retrieve_field_item.py +1 -0
  93. waldur_api_client/models/marketplace_provider_offerings_list_field_item.py +1 -0
  94. waldur_api_client/models/marketplace_provider_offerings_list_project_service_accounts_retrieve_field_item.py +1 -0
  95. waldur_api_client/models/marketplace_provider_offerings_retrieve_field_item.py +1 -0
  96. waldur_api_client/models/marketplace_provider_offerings_stats_retrieve_field_item.py +1 -0
  97. waldur_api_client/models/marketplace_provider_offerings_user_has_resource_access_retrieve_field_item.py +1 -0
  98. waldur_api_client/models/marketplace_public_offerings_list_field_item.py +1 -0
  99. waldur_api_client/models/marketplace_public_offerings_retrieve_field_item.py +1 -0
  100. waldur_api_client/models/marketplace_service_providers_offerings_list_field_item.py +1 -0
  101. waldur_api_client/models/nested_round.py +9 -0
  102. waldur_api_client/models/nested_round_request.py +9 -0
  103. waldur_api_client/models/offering.py +20 -0
  104. waldur_api_client/models/offering_create.py +20 -0
  105. waldur_api_client/models/offering_create_request.py +20 -0
  106. waldur_api_client/models/offering_create_request_form.py +479 -0
  107. waldur_api_client/models/offering_create_request_form_limits.py +57 -0
  108. waldur_api_client/models/offering_create_request_multipart.py +599 -0
  109. waldur_api_client/models/offering_create_request_multipart_limits.py +57 -0
  110. waldur_api_client/models/offering_file_request_form.py +78 -0
  111. waldur_api_client/models/offering_file_request_multipart.py +93 -0
  112. waldur_api_client/models/offering_image_request_form.py +62 -0
  113. waldur_api_client/models/offering_image_request_multipart.py +73 -0
  114. waldur_api_client/models/offering_thumbnail_request_form.py +62 -0
  115. waldur_api_client/models/offering_thumbnail_request_multipart.py +73 -0
  116. waldur_api_client/models/offering_user.py +5 -5
  117. waldur_api_client/models/{offering_user_state_enum.py → offering_user_state.py} +1 -1
  118. waldur_api_client/models/order_attachment_request_form.py +84 -0
  119. waldur_api_client/models/order_attachment_request_multipart.py +98 -0
  120. waldur_api_client/models/paid_request_form.py +81 -0
  121. waldur_api_client/models/paid_request_multipart.py +94 -0
  122. waldur_api_client/models/patched_call_managing_organisation_request_form.py +92 -0
  123. waldur_api_client/models/patched_call_managing_organisation_request_multipart.py +109 -0
  124. waldur_api_client/models/patched_category_group_request_form.py +101 -0
  125. waldur_api_client/models/patched_category_group_request_multipart.py +121 -0
  126. waldur_api_client/models/patched_checklist_category_request_form.py +102 -0
  127. waldur_api_client/models/patched_checklist_category_request_multipart.py +122 -0
  128. waldur_api_client/models/patched_customer_request.py +9 -0
  129. waldur_api_client/models/patched_customer_request_form.py +310 -0
  130. waldur_api_client/models/patched_customer_request_multipart.py +393 -0
  131. waldur_api_client/models/patched_external_link_request_form.py +110 -0
  132. waldur_api_client/models/patched_external_link_request_multipart.py +133 -0
  133. waldur_api_client/models/patched_marketplace_category_request_form.py +151 -0
  134. waldur_api_client/models/patched_marketplace_category_request_multipart.py +186 -0
  135. waldur_api_client/models/patched_payment_request_form.py +119 -0
  136. waldur_api_client/models/patched_payment_request_multipart.py +142 -0
  137. waldur_api_client/models/patched_project_request_form.py +279 -0
  138. waldur_api_client/models/patched_project_request_multipart.py +342 -0
  139. waldur_api_client/models/patched_service_provider_request_form.py +101 -0
  140. waldur_api_client/models/patched_service_provider_request_multipart.py +121 -0
  141. waldur_api_client/models/patched_user_request_form.py +241 -0
  142. waldur_api_client/models/patched_user_request_multipart.py +306 -0
  143. waldur_api_client/models/payment_request_form.py +113 -0
  144. waldur_api_client/models/payment_request_multipart.py +134 -0
  145. waldur_api_client/models/project_request_form.py +280 -0
  146. waldur_api_client/models/project_request_multipart.py +341 -0
  147. waldur_api_client/models/project_user.py +9 -0
  148. waldur_api_client/models/proposal.py +8 -0
  149. waldur_api_client/models/proposal_documentation_request_form.py +84 -0
  150. waldur_api_client/models/proposal_documentation_request_multipart.py +98 -0
  151. waldur_api_client/models/proposal_proposals_count_o_item.py +3 -1
  152. waldur_api_client/models/proposal_proposals_list_o_item.py +3 -1
  153. waldur_api_client/models/proposal_review.py +40 -0
  154. waldur_api_client/models/protected_proposal_list.py +8 -0
  155. waldur_api_client/models/protected_proposal_list_request.py +8 -0
  156. waldur_api_client/models/protected_round.py +8 -0
  157. waldur_api_client/models/provider_offering.py +21 -1
  158. waldur_api_client/models/provider_offering_details.py +20 -0
  159. waldur_api_client/models/public_offering_details.py +20 -0
  160. waldur_api_client/models/screenshot_request_form.py +87 -0
  161. waldur_api_client/models/screenshot_request_multipart.py +105 -0
  162. waldur_api_client/models/service_provider_request_form.py +112 -0
  163. waldur_api_client/models/service_provider_request_multipart.py +134 -0
  164. waldur_api_client/models/user_request_form.py +250 -0
  165. waldur_api_client/models/user_request_multipart.py +316 -0
  166. {waldur_api_client-7.8.1.dist-info → waldur_api_client-7.8.2.dist-info}/METADATA +1 -1
  167. {waldur_api_client-7.8.1.dist-info → waldur_api_client-7.8.2.dist-info}/RECORD +169 -98
  168. {waldur_api_client-7.8.1.dist-info → waldur_api_client-7.8.2.dist-info}/WHEEL +0 -0
  169. {waldur_api_client-7.8.1.dist-info → waldur_api_client-7.8.2.dist-info}/licenses/LICENSE +0 -0
@@ -95,6 +95,7 @@ class PublicOfferingDetails:
95
95
  parent_name (Union[None, Unset, str]):
96
96
  backend_metadata (Union[Unset, Any]):
97
97
  has_compliance_requirements (Union[Unset, bool]):
98
+ compliance_checklist (Union[None, Unset, str]):
98
99
  user_has_consent (Union[Unset, bool]):
99
100
  google_calendar_is_public (Union[None, Unset, bool]):
100
101
  google_calendar_link (Union[None, Unset, str]): Get the Google Calendar link for an offering.
@@ -161,6 +162,7 @@ class PublicOfferingDetails:
161
162
  parent_name: Union[None, Unset, str] = UNSET
162
163
  backend_metadata: Union[Unset, Any] = UNSET
163
164
  has_compliance_requirements: Union[Unset, bool] = UNSET
165
+ compliance_checklist: Union[None, Unset, str] = UNSET
164
166
  user_has_consent: Union[Unset, bool] = UNSET
165
167
  google_calendar_is_public: Union[None, Unset, bool] = UNSET
166
168
  google_calendar_link: Union[None, Unset, str] = UNSET
@@ -442,6 +444,12 @@ class PublicOfferingDetails:
442
444
 
443
445
  has_compliance_requirements = self.has_compliance_requirements
444
446
 
447
+ compliance_checklist: Union[None, Unset, str]
448
+ if isinstance(self.compliance_checklist, Unset):
449
+ compliance_checklist = UNSET
450
+ else:
451
+ compliance_checklist = self.compliance_checklist
452
+
445
453
  user_has_consent = self.user_has_consent
446
454
 
447
455
  google_calendar_is_public: Union[None, Unset, bool]
@@ -586,6 +594,8 @@ class PublicOfferingDetails:
586
594
  field_dict["backend_metadata"] = backend_metadata
587
595
  if has_compliance_requirements is not UNSET:
588
596
  field_dict["has_compliance_requirements"] = has_compliance_requirements
597
+ if compliance_checklist is not UNSET:
598
+ field_dict["compliance_checklist"] = compliance_checklist
589
599
  if user_has_consent is not UNSET:
590
600
  field_dict["user_has_consent"] = user_has_consent
591
601
  if google_calendar_is_public is not UNSET:
@@ -1018,6 +1028,15 @@ class PublicOfferingDetails:
1018
1028
 
1019
1029
  has_compliance_requirements = d.pop("has_compliance_requirements", UNSET)
1020
1030
 
1031
+ def _parse_compliance_checklist(data: object) -> Union[None, Unset, str]:
1032
+ if data is None:
1033
+ return data
1034
+ if isinstance(data, Unset):
1035
+ return data
1036
+ return cast(Union[None, Unset, str], data)
1037
+
1038
+ compliance_checklist = _parse_compliance_checklist(d.pop("compliance_checklist", UNSET))
1039
+
1021
1040
  user_has_consent = d.pop("user_has_consent", UNSET)
1022
1041
 
1023
1042
  def _parse_google_calendar_is_public(data: object) -> Union[None, Unset, bool]:
@@ -1106,6 +1125,7 @@ class PublicOfferingDetails:
1106
1125
  parent_name=parent_name,
1107
1126
  backend_metadata=backend_metadata,
1108
1127
  has_compliance_requirements=has_compliance_requirements,
1128
+ compliance_checklist=compliance_checklist,
1109
1129
  user_has_consent=user_has_consent,
1110
1130
  google_calendar_is_public=google_calendar_is_public,
1111
1131
  google_calendar_link=google_calendar_link,
@@ -0,0 +1,87 @@
1
+ from collections.abc import Mapping
2
+ from io import BytesIO
3
+ from typing import Any, TypeVar, Union
4
+
5
+ from attrs import define as _attrs_define
6
+ from attrs import field as _attrs_field
7
+
8
+ from ..types import UNSET, File, Unset
9
+
10
+ T = TypeVar("T", bound="ScreenshotRequestForm")
11
+
12
+
13
+ @_attrs_define
14
+ class ScreenshotRequestForm:
15
+ """
16
+ Attributes:
17
+ name (str):
18
+ image (File):
19
+ offering (str):
20
+ description (Union[Unset, str]):
21
+ """
22
+
23
+ name: str
24
+ image: File
25
+ offering: str
26
+ description: Union[Unset, str] = UNSET
27
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
28
+
29
+ def to_dict(self) -> dict[str, Any]:
30
+ name = self.name
31
+
32
+ image = self.image.to_tuple()
33
+
34
+ offering = self.offering
35
+
36
+ description = self.description
37
+
38
+ field_dict: dict[str, Any] = {}
39
+ field_dict.update(self.additional_properties)
40
+ field_dict.update(
41
+ {
42
+ "name": name,
43
+ "image": image,
44
+ "offering": offering,
45
+ }
46
+ )
47
+ if description is not UNSET:
48
+ field_dict["description"] = description
49
+
50
+ return field_dict
51
+
52
+ @classmethod
53
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
54
+ d = dict(src_dict)
55
+ name = d.pop("name")
56
+
57
+ image = File(payload=BytesIO(d.pop("image")))
58
+
59
+ offering = d.pop("offering")
60
+
61
+ description = d.pop("description", UNSET)
62
+
63
+ screenshot_request_form = cls(
64
+ name=name,
65
+ image=image,
66
+ offering=offering,
67
+ description=description,
68
+ )
69
+
70
+ screenshot_request_form.additional_properties = d
71
+ return screenshot_request_form
72
+
73
+ @property
74
+ def additional_keys(self) -> list[str]:
75
+ return list(self.additional_properties.keys())
76
+
77
+ def __getitem__(self, key: str) -> Any:
78
+ return self.additional_properties[key]
79
+
80
+ def __setitem__(self, key: str, value: Any) -> None:
81
+ self.additional_properties[key] = value
82
+
83
+ def __delitem__(self, key: str) -> None:
84
+ del self.additional_properties[key]
85
+
86
+ def __contains__(self, key: str) -> bool:
87
+ return key in self.additional_properties
@@ -0,0 +1,105 @@
1
+ from collections.abc import Mapping
2
+ from io import BytesIO
3
+ from typing import Any, TypeVar, Union
4
+
5
+ from attrs import define as _attrs_define
6
+ from attrs import field as _attrs_field
7
+
8
+ from .. import types
9
+ from ..types import UNSET, File, Unset
10
+
11
+ T = TypeVar("T", bound="ScreenshotRequestMultipart")
12
+
13
+
14
+ @_attrs_define
15
+ class ScreenshotRequestMultipart:
16
+ """
17
+ Attributes:
18
+ name (str):
19
+ image (File):
20
+ offering (str):
21
+ description (Union[Unset, str]):
22
+ """
23
+
24
+ name: str
25
+ image: File
26
+ offering: str
27
+ description: Union[Unset, str] = UNSET
28
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
29
+
30
+ def to_dict(self) -> dict[str, Any]:
31
+ name = self.name
32
+
33
+ image = self.image.to_tuple()
34
+
35
+ offering = self.offering
36
+
37
+ description = self.description
38
+
39
+ field_dict: dict[str, Any] = {}
40
+ field_dict.update(self.additional_properties)
41
+ field_dict.update(
42
+ {
43
+ "name": name,
44
+ "image": image,
45
+ "offering": offering,
46
+ }
47
+ )
48
+ if description is not UNSET:
49
+ field_dict["description"] = description
50
+
51
+ return field_dict
52
+
53
+ def to_multipart(self) -> types.RequestFiles:
54
+ files: types.RequestFiles = []
55
+
56
+ files.append(("name", (None, str(self.name).encode(), "text/plain")))
57
+
58
+ files.append(("image", self.image.to_tuple()))
59
+
60
+ files.append(("offering", (None, str(self.offering).encode(), "text/plain")))
61
+
62
+ if not isinstance(self.description, Unset):
63
+ files.append(("description", (None, str(self.description).encode(), "text/plain")))
64
+
65
+ for prop_name, prop in self.additional_properties.items():
66
+ files.append((prop_name, (None, str(prop).encode(), "text/plain")))
67
+
68
+ return files
69
+
70
+ @classmethod
71
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
72
+ d = dict(src_dict)
73
+ name = d.pop("name")
74
+
75
+ image = File(payload=BytesIO(d.pop("image")))
76
+
77
+ offering = d.pop("offering")
78
+
79
+ description = d.pop("description", UNSET)
80
+
81
+ screenshot_request_multipart = cls(
82
+ name=name,
83
+ image=image,
84
+ offering=offering,
85
+ description=description,
86
+ )
87
+
88
+ screenshot_request_multipart.additional_properties = d
89
+ return screenshot_request_multipart
90
+
91
+ @property
92
+ def additional_keys(self) -> list[str]:
93
+ return list(self.additional_properties.keys())
94
+
95
+ def __getitem__(self, key: str) -> Any:
96
+ return self.additional_properties[key]
97
+
98
+ def __setitem__(self, key: str, value: Any) -> None:
99
+ self.additional_properties[key] = value
100
+
101
+ def __delitem__(self, key: str) -> None:
102
+ del self.additional_properties[key]
103
+
104
+ def __contains__(self, key: str) -> bool:
105
+ return key in self.additional_properties
@@ -0,0 +1,112 @@
1
+ from collections.abc import Mapping
2
+ from io import BytesIO
3
+ from typing import Any, TypeVar, Union, cast
4
+
5
+ from attrs import define as _attrs_define
6
+ from attrs import field as _attrs_field
7
+
8
+ from .. import types
9
+ from ..types import UNSET, File, Unset
10
+
11
+ T = TypeVar("T", bound="ServiceProviderRequestForm")
12
+
13
+
14
+ @_attrs_define
15
+ class ServiceProviderRequestForm:
16
+ """
17
+ Attributes:
18
+ customer (str):
19
+ description (Union[Unset, str]):
20
+ enable_notifications (Union[Unset, bool]):
21
+ image (Union[File, None, Unset]):
22
+ """
23
+
24
+ customer: str
25
+ description: Union[Unset, str] = UNSET
26
+ enable_notifications: Union[Unset, bool] = UNSET
27
+ image: Union[File, None, Unset] = UNSET
28
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
29
+
30
+ def to_dict(self) -> dict[str, Any]:
31
+ customer = self.customer
32
+
33
+ description = self.description
34
+
35
+ enable_notifications = self.enable_notifications
36
+
37
+ image: Union[None, Unset, types.FileTypes]
38
+ if isinstance(self.image, Unset):
39
+ image = UNSET
40
+ elif isinstance(self.image, File):
41
+ image = self.image.to_tuple()
42
+
43
+ else:
44
+ image = self.image
45
+
46
+ field_dict: dict[str, Any] = {}
47
+ field_dict.update(self.additional_properties)
48
+ field_dict.update(
49
+ {
50
+ "customer": customer,
51
+ }
52
+ )
53
+ if description is not UNSET:
54
+ field_dict["description"] = description
55
+ if enable_notifications is not UNSET:
56
+ field_dict["enable_notifications"] = enable_notifications
57
+ if image is not UNSET:
58
+ field_dict["image"] = image
59
+
60
+ return field_dict
61
+
62
+ @classmethod
63
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
64
+ d = dict(src_dict)
65
+ customer = d.pop("customer")
66
+
67
+ description = d.pop("description", UNSET)
68
+
69
+ enable_notifications = d.pop("enable_notifications", UNSET)
70
+
71
+ def _parse_image(data: object) -> Union[File, None, Unset]:
72
+ if data is None:
73
+ return data
74
+ if isinstance(data, Unset):
75
+ return data
76
+ try:
77
+ if not isinstance(data, bytes):
78
+ raise TypeError()
79
+ image_type_0 = File(payload=BytesIO(data))
80
+
81
+ return image_type_0
82
+ except: # noqa: E722
83
+ pass
84
+ return cast(Union[File, None, Unset], data)
85
+
86
+ image = _parse_image(d.pop("image", UNSET))
87
+
88
+ service_provider_request_form = cls(
89
+ customer=customer,
90
+ description=description,
91
+ enable_notifications=enable_notifications,
92
+ image=image,
93
+ )
94
+
95
+ service_provider_request_form.additional_properties = d
96
+ return service_provider_request_form
97
+
98
+ @property
99
+ def additional_keys(self) -> list[str]:
100
+ return list(self.additional_properties.keys())
101
+
102
+ def __getitem__(self, key: str) -> Any:
103
+ return self.additional_properties[key]
104
+
105
+ def __setitem__(self, key: str, value: Any) -> None:
106
+ self.additional_properties[key] = value
107
+
108
+ def __delitem__(self, key: str) -> None:
109
+ del self.additional_properties[key]
110
+
111
+ def __contains__(self, key: str) -> bool:
112
+ return key in self.additional_properties
@@ -0,0 +1,134 @@
1
+ from collections.abc import Mapping
2
+ from io import BytesIO
3
+ from typing import Any, TypeVar, Union, cast
4
+
5
+ from attrs import define as _attrs_define
6
+ from attrs import field as _attrs_field
7
+
8
+ from .. import types
9
+ from ..types import UNSET, File, Unset
10
+
11
+ T = TypeVar("T", bound="ServiceProviderRequestMultipart")
12
+
13
+
14
+ @_attrs_define
15
+ class ServiceProviderRequestMultipart:
16
+ """
17
+ Attributes:
18
+ customer (str):
19
+ description (Union[Unset, str]):
20
+ enable_notifications (Union[Unset, bool]):
21
+ image (Union[File, None, Unset]):
22
+ """
23
+
24
+ customer: str
25
+ description: Union[Unset, str] = UNSET
26
+ enable_notifications: Union[Unset, bool] = UNSET
27
+ image: Union[File, None, Unset] = UNSET
28
+ additional_properties: dict[str, Any] = _attrs_field(init=False, factory=dict)
29
+
30
+ def to_dict(self) -> dict[str, Any]:
31
+ customer = self.customer
32
+
33
+ description = self.description
34
+
35
+ enable_notifications = self.enable_notifications
36
+
37
+ image: Union[None, Unset, types.FileTypes]
38
+ if isinstance(self.image, Unset):
39
+ image = UNSET
40
+ elif isinstance(self.image, File):
41
+ image = self.image.to_tuple()
42
+
43
+ else:
44
+ image = self.image
45
+
46
+ field_dict: dict[str, Any] = {}
47
+ field_dict.update(self.additional_properties)
48
+ field_dict.update(
49
+ {
50
+ "customer": customer,
51
+ }
52
+ )
53
+ if description is not UNSET:
54
+ field_dict["description"] = description
55
+ if enable_notifications is not UNSET:
56
+ field_dict["enable_notifications"] = enable_notifications
57
+ if image is not UNSET:
58
+ field_dict["image"] = image
59
+
60
+ return field_dict
61
+
62
+ def to_multipart(self) -> types.RequestFiles:
63
+ files: types.RequestFiles = []
64
+
65
+ files.append(("customer", (None, str(self.customer).encode(), "text/plain")))
66
+
67
+ if not isinstance(self.description, Unset):
68
+ files.append(("description", (None, str(self.description).encode(), "text/plain")))
69
+
70
+ if not isinstance(self.enable_notifications, Unset):
71
+ files.append(("enable_notifications", (None, str(self.enable_notifications).encode(), "text/plain")))
72
+
73
+ if not isinstance(self.image, Unset):
74
+ if isinstance(self.image, File):
75
+ files.append(("image", self.image.to_tuple()))
76
+ else:
77
+ files.append(("image", (None, str(self.image).encode(), "text/plain")))
78
+
79
+ for prop_name, prop in self.additional_properties.items():
80
+ files.append((prop_name, (None, str(prop).encode(), "text/plain")))
81
+
82
+ return files
83
+
84
+ @classmethod
85
+ def from_dict(cls: type[T], src_dict: Mapping[str, Any]) -> T:
86
+ d = dict(src_dict)
87
+ customer = d.pop("customer")
88
+
89
+ description = d.pop("description", UNSET)
90
+
91
+ enable_notifications = d.pop("enable_notifications", UNSET)
92
+
93
+ def _parse_image(data: object) -> Union[File, None, Unset]:
94
+ if data is None:
95
+ return data
96
+ if isinstance(data, Unset):
97
+ return data
98
+ try:
99
+ if not isinstance(data, bytes):
100
+ raise TypeError()
101
+ image_type_0 = File(payload=BytesIO(data))
102
+
103
+ return image_type_0
104
+ except: # noqa: E722
105
+ pass
106
+ return cast(Union[File, None, Unset], data)
107
+
108
+ image = _parse_image(d.pop("image", UNSET))
109
+
110
+ service_provider_request_multipart = cls(
111
+ customer=customer,
112
+ description=description,
113
+ enable_notifications=enable_notifications,
114
+ image=image,
115
+ )
116
+
117
+ service_provider_request_multipart.additional_properties = d
118
+ return service_provider_request_multipart
119
+
120
+ @property
121
+ def additional_keys(self) -> list[str]:
122
+ return list(self.additional_properties.keys())
123
+
124
+ def __getitem__(self, key: str) -> Any:
125
+ return self.additional_properties[key]
126
+
127
+ def __setitem__(self, key: str, value: Any) -> None:
128
+ self.additional_properties[key] = value
129
+
130
+ def __delitem__(self, key: str) -> None:
131
+ del self.additional_properties[key]
132
+
133
+ def __contains__(self, key: str) -> bool:
134
+ return key in self.additional_properties