waldur-api-client 7.6.8__py3-none-any.whl → 7.7.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of waldur-api-client might be problematic. Click here for more details.

Files changed (91) hide show
  1. waldur_api_client/api/broadcast_messages/broadcast_messages_schedule.py +89 -0
  2. waldur_api_client/api/call_proposal_project_role_mappings/call_proposal_project_role_mappings_create.py +152 -0
  3. waldur_api_client/api/call_proposal_project_role_mappings/call_proposal_project_role_mappings_destroy.py +89 -0
  4. waldur_api_client/api/call_proposal_project_role_mappings/call_proposal_project_role_mappings_list.py +194 -0
  5. waldur_api_client/api/call_proposal_project_role_mappings/call_proposal_project_role_mappings_partial_update.py +166 -0
  6. waldur_api_client/api/call_proposal_project_role_mappings/call_proposal_project_role_mappings_retrieve.py +144 -0
  7. waldur_api_client/api/call_proposal_project_role_mappings/call_proposal_project_role_mappings_update.py +166 -0
  8. waldur_api_client/api/invoices/invoices_list.py +0 -30
  9. waldur_api_client/api/invoices/invoices_stats_list.py +0 -30
  10. waldur_api_client/api/marketplace_maintenance_announcement_offerings/__init__.py +1 -0
  11. waldur_api_client/api/marketplace_maintenance_announcement_offerings/marketplace_maintenance_announcement_offerings_create.py +152 -0
  12. waldur_api_client/api/marketplace_maintenance_announcement_offerings/marketplace_maintenance_announcement_offerings_destroy.py +89 -0
  13. waldur_api_client/api/marketplace_maintenance_announcement_offerings/marketplace_maintenance_announcement_offerings_list.py +175 -0
  14. waldur_api_client/api/marketplace_maintenance_announcement_offerings/marketplace_maintenance_announcement_offerings_partial_update.py +166 -0
  15. waldur_api_client/api/marketplace_maintenance_announcement_offerings/marketplace_maintenance_announcement_offerings_retrieve.py +144 -0
  16. waldur_api_client/api/marketplace_maintenance_announcement_offerings/marketplace_maintenance_announcement_offerings_update.py +166 -0
  17. waldur_api_client/api/marketplace_maintenance_announcement_template_offerings/__init__.py +1 -0
  18. waldur_api_client/api/marketplace_maintenance_announcement_template_offerings/marketplace_maintenance_announcement_template_offerings_create.py +152 -0
  19. waldur_api_client/api/marketplace_maintenance_announcement_template_offerings/marketplace_maintenance_announcement_template_offerings_destroy.py +89 -0
  20. waldur_api_client/api/marketplace_maintenance_announcement_template_offerings/marketplace_maintenance_announcement_template_offerings_list.py +175 -0
  21. waldur_api_client/api/marketplace_maintenance_announcement_template_offerings/marketplace_maintenance_announcement_template_offerings_partial_update.py +168 -0
  22. waldur_api_client/api/marketplace_maintenance_announcement_template_offerings/marketplace_maintenance_announcement_template_offerings_retrieve.py +144 -0
  23. waldur_api_client/api/marketplace_maintenance_announcement_template_offerings/marketplace_maintenance_announcement_template_offerings_update.py +166 -0
  24. waldur_api_client/api/marketplace_maintenance_announcements/__init__.py +1 -0
  25. waldur_api_client/api/{autoprovisioning_rule_plans/autoprovisioning_rule_plans_create.py → marketplace_maintenance_announcements/marketplace_maintenance_announcements_create.py} +25 -23
  26. waldur_api_client/api/marketplace_maintenance_announcements/marketplace_maintenance_announcements_destroy.py +89 -0
  27. waldur_api_client/api/{autoprovisioning_rule_plans/autoprovisioning_rule_plans_list.py → marketplace_maintenance_announcements/marketplace_maintenance_announcements_list.py} +15 -13
  28. waldur_api_client/api/{autoprovisioning_rule_plans/autoprovisioning_rule_plans_partial_update.py → marketplace_maintenance_announcements/marketplace_maintenance_announcements_partial_update.py} +25 -23
  29. waldur_api_client/api/{autoprovisioning_rule_plans/autoprovisioning_rule_plans_retrieve.py → marketplace_maintenance_announcements/marketplace_maintenance_announcements_retrieve.py} +15 -13
  30. waldur_api_client/api/{autoprovisioning_rule_plans/autoprovisioning_rule_plans_update.py → marketplace_maintenance_announcements/marketplace_maintenance_announcements_update.py} +25 -23
  31. waldur_api_client/api/marketplace_maintenance_announcements_template/__init__.py +1 -0
  32. waldur_api_client/api/marketplace_maintenance_announcements_template/marketplace_maintenance_announcements_template_create.py +152 -0
  33. waldur_api_client/api/marketplace_maintenance_announcements_template/marketplace_maintenance_announcements_template_destroy.py +89 -0
  34. waldur_api_client/api/marketplace_maintenance_announcements_template/marketplace_maintenance_announcements_template_list.py +175 -0
  35. waldur_api_client/api/marketplace_maintenance_announcements_template/marketplace_maintenance_announcements_template_partial_update.py +166 -0
  36. waldur_api_client/api/marketplace_maintenance_announcements_template/marketplace_maintenance_announcements_template_retrieve.py +144 -0
  37. waldur_api_client/api/marketplace_maintenance_announcements_template/marketplace_maintenance_announcements_template_update.py +166 -0
  38. waldur_api_client/api/{autoprovisioning_rule_plans/autoprovisioning_rule_plans_destroy.py → marketplace_plans/marketplace_plans_destroy.py} +1 -1
  39. waldur_api_client/api/marketplace_provider_offerings/marketplace_provider_offerings_update_offering_component.py +6 -6
  40. waldur_api_client/api/openstack_volume_types/openstack_volume_types_names_retrieve.py +118 -0
  41. waldur_api_client/models/__init__.py +52 -18
  42. waldur_api_client/models/constance_settings.py +22 -0
  43. waldur_api_client/models/constance_settings_request.py +22 -0
  44. waldur_api_client/models/event_types_enum.py +1 -0
  45. waldur_api_client/models/impact_level_enum.py +11 -0
  46. waldur_api_client/models/maintenance_announcement.py +225 -0
  47. waldur_api_client/models/maintenance_announcement_offering.py +112 -0
  48. waldur_api_client/models/maintenance_announcement_offering_request.py +95 -0
  49. waldur_api_client/models/maintenance_announcement_offering_template.py +112 -0
  50. waldur_api_client/models/maintenance_announcement_offering_template_request.py +95 -0
  51. waldur_api_client/models/maintenance_announcement_request.py +113 -0
  52. waldur_api_client/models/maintenance_announcement_state_enum.py +12 -0
  53. waldur_api_client/models/maintenance_announcement_template.py +134 -0
  54. waldur_api_client/models/maintenance_announcement_template_request.py +95 -0
  55. waldur_api_client/models/maintenance_type_enum.py +12 -0
  56. waldur_api_client/models/merged_plugin_options.py +1 -1
  57. waldur_api_client/models/merged_plugin_options_request.py +1 -1
  58. waldur_api_client/models/offering_component.py +15 -4
  59. waldur_api_client/models/patched_maintenance_announcement_offering_request.py +94 -0
  60. waldur_api_client/models/patched_maintenance_announcement_offering_template_request.py +94 -0
  61. waldur_api_client/models/patched_maintenance_announcement_request.py +128 -0
  62. waldur_api_client/models/patched_maintenance_announcement_template_request.py +94 -0
  63. waldur_api_client/models/patched_proposal_project_role_mapping_request.py +88 -0
  64. waldur_api_client/models/patched_protected_call_request.py +0 -17
  65. waldur_api_client/models/patched_rule_request.py +90 -1
  66. waldur_api_client/models/{patched_rule_plans_request_limits.py → patched_rule_request_plan_attributes.py} +5 -5
  67. waldur_api_client/models/patched_rule_request_plan_limits.py +44 -0
  68. waldur_api_client/models/proposal_project_role_mapping.py +122 -0
  69. waldur_api_client/models/proposal_project_role_mapping_request.py +89 -0
  70. waldur_api_client/models/proposal_protected_calls_list_field_item.py +0 -3
  71. waldur_api_client/models/proposal_protected_calls_retrieve_field_item.py +0 -3
  72. waldur_api_client/models/protected_call.py +0 -34
  73. waldur_api_client/models/protected_call_request.py +0 -17
  74. waldur_api_client/models/provider_offering_details.py +1 -1
  75. waldur_api_client/models/public_offering_details.py +1 -1
  76. waldur_api_client/models/rule.py +99 -7
  77. waldur_api_client/models/{rule_plans_attributes.py → rule_plan_attributes.py} +5 -5
  78. waldur_api_client/models/{rule_plans_limits.py → rule_plan_limits.py} +5 -5
  79. waldur_api_client/models/rule_request.py +89 -1
  80. waldur_api_client/models/{rule_plans_request_attributes.py → rule_request_plan_attributes.py} +5 -5
  81. waldur_api_client/models/{rule_plans_request_limits.py → rule_request_plan_limits.py} +5 -5
  82. waldur_api_client/models/update_offering_component_request.py +274 -0
  83. {waldur_api_client-7.6.8.dist-info → waldur_api_client-7.7.0.dist-info}/METADATA +1 -1
  84. {waldur_api_client-7.6.8.dist-info → waldur_api_client-7.7.0.dist-info}/RECORD +87 -40
  85. waldur_api_client/models/patched_rule_plans_request.py +0 -108
  86. waldur_api_client/models/patched_rule_plans_request_attributes.py +0 -44
  87. waldur_api_client/models/rule_plans.py +0 -126
  88. waldur_api_client/models/rule_plans_request.py +0 -109
  89. /waldur_api_client/api/{autoprovisioning_rule_plans → call_proposal_project_role_mappings}/__init__.py +0 -0
  90. {waldur_api_client-7.6.8.dist-info → waldur_api_client-7.7.0.dist-info}/LICENSE +0 -0
  91. {waldur_api_client-7.6.8.dist-info → waldur_api_client-7.7.0.dist-info}/WHEEL +0 -0
@@ -0,0 +1,89 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Union
3
+ from uuid import UUID
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import AuthenticatedClient, Client
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ uuid: UUID,
14
+ ) -> dict[str, Any]:
15
+ _kwargs: dict[str, Any] = {
16
+ "method": "post",
17
+ "url": f"/api/broadcast-messages/{uuid}/schedule/",
18
+ }
19
+
20
+ return _kwargs
21
+
22
+
23
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Any:
24
+ if response.status_code == 200:
25
+ return None
26
+ raise errors.UnexpectedStatus(response.status_code, response.content)
27
+
28
+
29
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
30
+ return Response(
31
+ status_code=HTTPStatus(response.status_code),
32
+ content=response.content,
33
+ headers=response.headers,
34
+ parsed=_parse_response(client=client, response=response),
35
+ )
36
+
37
+
38
+ def sync_detailed(
39
+ uuid: UUID,
40
+ *,
41
+ client: AuthenticatedClient,
42
+ ) -> Response[Any]:
43
+ """
44
+ Args:
45
+ uuid (UUID):
46
+
47
+ Raises:
48
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
49
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
50
+
51
+ Returns:
52
+ Response[Any]
53
+ """
54
+
55
+ kwargs = _get_kwargs(
56
+ uuid=uuid,
57
+ )
58
+
59
+ response = client.get_httpx_client().request(
60
+ **kwargs,
61
+ )
62
+
63
+ return _build_response(client=client, response=response)
64
+
65
+
66
+ async def asyncio_detailed(
67
+ uuid: UUID,
68
+ *,
69
+ client: AuthenticatedClient,
70
+ ) -> Response[Any]:
71
+ """
72
+ Args:
73
+ uuid (UUID):
74
+
75
+ Raises:
76
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
77
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
78
+
79
+ Returns:
80
+ Response[Any]
81
+ """
82
+
83
+ kwargs = _get_kwargs(
84
+ uuid=uuid,
85
+ )
86
+
87
+ response = await client.get_async_httpx_client().request(**kwargs)
88
+
89
+ return _build_response(client=client, response=response)
@@ -0,0 +1,152 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Union
3
+
4
+ import httpx
5
+
6
+ from ... import errors
7
+ from ...client import AuthenticatedClient, Client
8
+ from ...models.proposal_project_role_mapping import ProposalProjectRoleMapping
9
+ from ...models.proposal_project_role_mapping_request import ProposalProjectRoleMappingRequest
10
+ from ...types import Response
11
+
12
+
13
+ def _get_kwargs(
14
+ *,
15
+ body: ProposalProjectRoleMappingRequest,
16
+ ) -> dict[str, Any]:
17
+ headers: dict[str, Any] = {}
18
+
19
+ _kwargs: dict[str, Any] = {
20
+ "method": "post",
21
+ "url": "/api/call-proposal-project-role-mappings/",
22
+ }
23
+
24
+ _kwargs["json"] = body.to_dict()
25
+
26
+ headers["Content-Type"] = "application/json"
27
+
28
+ _kwargs["headers"] = headers
29
+ return _kwargs
30
+
31
+
32
+ def _parse_response(
33
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
34
+ ) -> ProposalProjectRoleMapping:
35
+ if response.status_code == 201:
36
+ response_201 = ProposalProjectRoleMapping.from_dict(response.json())
37
+
38
+ return response_201
39
+ raise errors.UnexpectedStatus(response.status_code, response.content)
40
+
41
+
42
+ def _build_response(
43
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
44
+ ) -> Response[ProposalProjectRoleMapping]:
45
+ return Response(
46
+ status_code=HTTPStatus(response.status_code),
47
+ content=response.content,
48
+ headers=response.headers,
49
+ parsed=_parse_response(client=client, response=response),
50
+ )
51
+
52
+
53
+ def sync_detailed(
54
+ *,
55
+ client: AuthenticatedClient,
56
+ body: ProposalProjectRoleMappingRequest,
57
+ ) -> Response[ProposalProjectRoleMapping]:
58
+ """
59
+ Args:
60
+ body (ProposalProjectRoleMappingRequest):
61
+
62
+ Raises:
63
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
64
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
65
+
66
+ Returns:
67
+ Response[ProposalProjectRoleMapping]
68
+ """
69
+
70
+ kwargs = _get_kwargs(
71
+ body=body,
72
+ )
73
+
74
+ response = client.get_httpx_client().request(
75
+ **kwargs,
76
+ )
77
+
78
+ return _build_response(client=client, response=response)
79
+
80
+
81
+ def sync(
82
+ *,
83
+ client: AuthenticatedClient,
84
+ body: ProposalProjectRoleMappingRequest,
85
+ ) -> ProposalProjectRoleMapping:
86
+ """
87
+ Args:
88
+ body (ProposalProjectRoleMappingRequest):
89
+
90
+ Raises:
91
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
92
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
93
+
94
+ Returns:
95
+ ProposalProjectRoleMapping
96
+ """
97
+
98
+ return sync_detailed(
99
+ client=client,
100
+ body=body,
101
+ ).parsed
102
+
103
+
104
+ async def asyncio_detailed(
105
+ *,
106
+ client: AuthenticatedClient,
107
+ body: ProposalProjectRoleMappingRequest,
108
+ ) -> Response[ProposalProjectRoleMapping]:
109
+ """
110
+ Args:
111
+ body (ProposalProjectRoleMappingRequest):
112
+
113
+ Raises:
114
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
115
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
116
+
117
+ Returns:
118
+ Response[ProposalProjectRoleMapping]
119
+ """
120
+
121
+ kwargs = _get_kwargs(
122
+ body=body,
123
+ )
124
+
125
+ response = await client.get_async_httpx_client().request(**kwargs)
126
+
127
+ return _build_response(client=client, response=response)
128
+
129
+
130
+ async def asyncio(
131
+ *,
132
+ client: AuthenticatedClient,
133
+ body: ProposalProjectRoleMappingRequest,
134
+ ) -> ProposalProjectRoleMapping:
135
+ """
136
+ Args:
137
+ body (ProposalProjectRoleMappingRequest):
138
+
139
+ Raises:
140
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
141
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
142
+
143
+ Returns:
144
+ ProposalProjectRoleMapping
145
+ """
146
+
147
+ return (
148
+ await asyncio_detailed(
149
+ client=client,
150
+ body=body,
151
+ )
152
+ ).parsed
@@ -0,0 +1,89 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Union
3
+ from uuid import UUID
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import AuthenticatedClient, Client
9
+ from ...types import Response
10
+
11
+
12
+ def _get_kwargs(
13
+ uuid: UUID,
14
+ ) -> dict[str, Any]:
15
+ _kwargs: dict[str, Any] = {
16
+ "method": "delete",
17
+ "url": f"/api/call-proposal-project-role-mappings/{uuid}/",
18
+ }
19
+
20
+ return _kwargs
21
+
22
+
23
+ def _parse_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Any:
24
+ if response.status_code == 204:
25
+ return None
26
+ raise errors.UnexpectedStatus(response.status_code, response.content)
27
+
28
+
29
+ def _build_response(*, client: Union[AuthenticatedClient, Client], response: httpx.Response) -> Response[Any]:
30
+ return Response(
31
+ status_code=HTTPStatus(response.status_code),
32
+ content=response.content,
33
+ headers=response.headers,
34
+ parsed=_parse_response(client=client, response=response),
35
+ )
36
+
37
+
38
+ def sync_detailed(
39
+ uuid: UUID,
40
+ *,
41
+ client: AuthenticatedClient,
42
+ ) -> Response[Any]:
43
+ """
44
+ Args:
45
+ uuid (UUID):
46
+
47
+ Raises:
48
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
49
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
50
+
51
+ Returns:
52
+ Response[Any]
53
+ """
54
+
55
+ kwargs = _get_kwargs(
56
+ uuid=uuid,
57
+ )
58
+
59
+ response = client.get_httpx_client().request(
60
+ **kwargs,
61
+ )
62
+
63
+ return _build_response(client=client, response=response)
64
+
65
+
66
+ async def asyncio_detailed(
67
+ uuid: UUID,
68
+ *,
69
+ client: AuthenticatedClient,
70
+ ) -> Response[Any]:
71
+ """
72
+ Args:
73
+ uuid (UUID):
74
+
75
+ Raises:
76
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
77
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
78
+
79
+ Returns:
80
+ Response[Any]
81
+ """
82
+
83
+ kwargs = _get_kwargs(
84
+ uuid=uuid,
85
+ )
86
+
87
+ response = await client.get_async_httpx_client().request(**kwargs)
88
+
89
+ return _build_response(client=client, response=response)
@@ -0,0 +1,194 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Union
3
+ from uuid import UUID
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import AuthenticatedClient, Client
9
+ from ...models.proposal_project_role_mapping import ProposalProjectRoleMapping
10
+ from ...types import UNSET, Response, Unset
11
+
12
+
13
+ def _get_kwargs(
14
+ *,
15
+ call_uuid: Union[Unset, UUID] = UNSET,
16
+ page: Union[Unset, int] = UNSET,
17
+ page_size: Union[Unset, int] = UNSET,
18
+ ) -> dict[str, Any]:
19
+ params: dict[str, Any] = {}
20
+
21
+ json_call_uuid: Union[Unset, str] = UNSET
22
+ if not isinstance(call_uuid, Unset):
23
+ json_call_uuid = str(call_uuid)
24
+ params["call_uuid"] = json_call_uuid
25
+
26
+ params["page"] = page
27
+
28
+ params["page_size"] = page_size
29
+
30
+ params = {k: v for k, v in params.items() if v is not UNSET and v is not None}
31
+
32
+ _kwargs: dict[str, Any] = {
33
+ "method": "get",
34
+ "url": "/api/call-proposal-project-role-mappings/",
35
+ "params": params,
36
+ }
37
+
38
+ return _kwargs
39
+
40
+
41
+ def _parse_response(
42
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
43
+ ) -> list["ProposalProjectRoleMapping"]:
44
+ if response.status_code == 200:
45
+ response_200 = []
46
+ _response_200 = response.json()
47
+ for response_200_item_data in _response_200:
48
+ response_200_item = ProposalProjectRoleMapping.from_dict(response_200_item_data)
49
+
50
+ response_200.append(response_200_item)
51
+
52
+ return response_200
53
+ raise errors.UnexpectedStatus(response.status_code, response.content)
54
+
55
+
56
+ def _build_response(
57
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
58
+ ) -> Response[list["ProposalProjectRoleMapping"]]:
59
+ return Response(
60
+ status_code=HTTPStatus(response.status_code),
61
+ content=response.content,
62
+ headers=response.headers,
63
+ parsed=_parse_response(client=client, response=response),
64
+ )
65
+
66
+
67
+ def sync_detailed(
68
+ *,
69
+ client: AuthenticatedClient,
70
+ call_uuid: Union[Unset, UUID] = UNSET,
71
+ page: Union[Unset, int] = UNSET,
72
+ page_size: Union[Unset, int] = UNSET,
73
+ ) -> Response[list["ProposalProjectRoleMapping"]]:
74
+ """Mixin to optimize HEAD requests for DRF views bypassing serializer processing
75
+
76
+ Args:
77
+ call_uuid (Union[Unset, UUID]):
78
+ page (Union[Unset, int]):
79
+ page_size (Union[Unset, int]):
80
+
81
+ Raises:
82
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
83
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
84
+
85
+ Returns:
86
+ Response[list['ProposalProjectRoleMapping']]
87
+ """
88
+
89
+ kwargs = _get_kwargs(
90
+ call_uuid=call_uuid,
91
+ page=page,
92
+ page_size=page_size,
93
+ )
94
+
95
+ response = client.get_httpx_client().request(
96
+ **kwargs,
97
+ )
98
+
99
+ return _build_response(client=client, response=response)
100
+
101
+
102
+ def sync(
103
+ *,
104
+ client: AuthenticatedClient,
105
+ call_uuid: Union[Unset, UUID] = UNSET,
106
+ page: Union[Unset, int] = UNSET,
107
+ page_size: Union[Unset, int] = UNSET,
108
+ ) -> list["ProposalProjectRoleMapping"]:
109
+ """Mixin to optimize HEAD requests for DRF views bypassing serializer processing
110
+
111
+ Args:
112
+ call_uuid (Union[Unset, UUID]):
113
+ page (Union[Unset, int]):
114
+ page_size (Union[Unset, int]):
115
+
116
+ Raises:
117
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
118
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
119
+
120
+ Returns:
121
+ list['ProposalProjectRoleMapping']
122
+ """
123
+
124
+ return sync_detailed(
125
+ client=client,
126
+ call_uuid=call_uuid,
127
+ page=page,
128
+ page_size=page_size,
129
+ ).parsed
130
+
131
+
132
+ async def asyncio_detailed(
133
+ *,
134
+ client: AuthenticatedClient,
135
+ call_uuid: Union[Unset, UUID] = UNSET,
136
+ page: Union[Unset, int] = UNSET,
137
+ page_size: Union[Unset, int] = UNSET,
138
+ ) -> Response[list["ProposalProjectRoleMapping"]]:
139
+ """Mixin to optimize HEAD requests for DRF views bypassing serializer processing
140
+
141
+ Args:
142
+ call_uuid (Union[Unset, UUID]):
143
+ page (Union[Unset, int]):
144
+ page_size (Union[Unset, int]):
145
+
146
+ Raises:
147
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
148
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
149
+
150
+ Returns:
151
+ Response[list['ProposalProjectRoleMapping']]
152
+ """
153
+
154
+ kwargs = _get_kwargs(
155
+ call_uuid=call_uuid,
156
+ page=page,
157
+ page_size=page_size,
158
+ )
159
+
160
+ response = await client.get_async_httpx_client().request(**kwargs)
161
+
162
+ return _build_response(client=client, response=response)
163
+
164
+
165
+ async def asyncio(
166
+ *,
167
+ client: AuthenticatedClient,
168
+ call_uuid: Union[Unset, UUID] = UNSET,
169
+ page: Union[Unset, int] = UNSET,
170
+ page_size: Union[Unset, int] = UNSET,
171
+ ) -> list["ProposalProjectRoleMapping"]:
172
+ """Mixin to optimize HEAD requests for DRF views bypassing serializer processing
173
+
174
+ Args:
175
+ call_uuid (Union[Unset, UUID]):
176
+ page (Union[Unset, int]):
177
+ page_size (Union[Unset, int]):
178
+
179
+ Raises:
180
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
181
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
182
+
183
+ Returns:
184
+ list['ProposalProjectRoleMapping']
185
+ """
186
+
187
+ return (
188
+ await asyncio_detailed(
189
+ client=client,
190
+ call_uuid=call_uuid,
191
+ page=page,
192
+ page_size=page_size,
193
+ )
194
+ ).parsed
@@ -0,0 +1,166 @@
1
+ from http import HTTPStatus
2
+ from typing import Any, Union
3
+ from uuid import UUID
4
+
5
+ import httpx
6
+
7
+ from ... import errors
8
+ from ...client import AuthenticatedClient, Client
9
+ from ...models.patched_proposal_project_role_mapping_request import PatchedProposalProjectRoleMappingRequest
10
+ from ...models.proposal_project_role_mapping import ProposalProjectRoleMapping
11
+ from ...types import Response
12
+
13
+
14
+ def _get_kwargs(
15
+ uuid: UUID,
16
+ *,
17
+ body: PatchedProposalProjectRoleMappingRequest,
18
+ ) -> dict[str, Any]:
19
+ headers: dict[str, Any] = {}
20
+
21
+ _kwargs: dict[str, Any] = {
22
+ "method": "patch",
23
+ "url": f"/api/call-proposal-project-role-mappings/{uuid}/",
24
+ }
25
+
26
+ _kwargs["json"] = body.to_dict()
27
+
28
+ headers["Content-Type"] = "application/json"
29
+
30
+ _kwargs["headers"] = headers
31
+ return _kwargs
32
+
33
+
34
+ def _parse_response(
35
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
36
+ ) -> ProposalProjectRoleMapping:
37
+ if response.status_code == 200:
38
+ response_200 = ProposalProjectRoleMapping.from_dict(response.json())
39
+
40
+ return response_200
41
+ raise errors.UnexpectedStatus(response.status_code, response.content)
42
+
43
+
44
+ def _build_response(
45
+ *, client: Union[AuthenticatedClient, Client], response: httpx.Response
46
+ ) -> Response[ProposalProjectRoleMapping]:
47
+ return Response(
48
+ status_code=HTTPStatus(response.status_code),
49
+ content=response.content,
50
+ headers=response.headers,
51
+ parsed=_parse_response(client=client, response=response),
52
+ )
53
+
54
+
55
+ def sync_detailed(
56
+ uuid: UUID,
57
+ *,
58
+ client: AuthenticatedClient,
59
+ body: PatchedProposalProjectRoleMappingRequest,
60
+ ) -> Response[ProposalProjectRoleMapping]:
61
+ """
62
+ Args:
63
+ uuid (UUID):
64
+ body (PatchedProposalProjectRoleMappingRequest):
65
+
66
+ Raises:
67
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
68
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
69
+
70
+ Returns:
71
+ Response[ProposalProjectRoleMapping]
72
+ """
73
+
74
+ kwargs = _get_kwargs(
75
+ uuid=uuid,
76
+ body=body,
77
+ )
78
+
79
+ response = client.get_httpx_client().request(
80
+ **kwargs,
81
+ )
82
+
83
+ return _build_response(client=client, response=response)
84
+
85
+
86
+ def sync(
87
+ uuid: UUID,
88
+ *,
89
+ client: AuthenticatedClient,
90
+ body: PatchedProposalProjectRoleMappingRequest,
91
+ ) -> ProposalProjectRoleMapping:
92
+ """
93
+ Args:
94
+ uuid (UUID):
95
+ body (PatchedProposalProjectRoleMappingRequest):
96
+
97
+ Raises:
98
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
99
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
100
+
101
+ Returns:
102
+ ProposalProjectRoleMapping
103
+ """
104
+
105
+ return sync_detailed(
106
+ uuid=uuid,
107
+ client=client,
108
+ body=body,
109
+ ).parsed
110
+
111
+
112
+ async def asyncio_detailed(
113
+ uuid: UUID,
114
+ *,
115
+ client: AuthenticatedClient,
116
+ body: PatchedProposalProjectRoleMappingRequest,
117
+ ) -> Response[ProposalProjectRoleMapping]:
118
+ """
119
+ Args:
120
+ uuid (UUID):
121
+ body (PatchedProposalProjectRoleMappingRequest):
122
+
123
+ Raises:
124
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
125
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
126
+
127
+ Returns:
128
+ Response[ProposalProjectRoleMapping]
129
+ """
130
+
131
+ kwargs = _get_kwargs(
132
+ uuid=uuid,
133
+ body=body,
134
+ )
135
+
136
+ response = await client.get_async_httpx_client().request(**kwargs)
137
+
138
+ return _build_response(client=client, response=response)
139
+
140
+
141
+ async def asyncio(
142
+ uuid: UUID,
143
+ *,
144
+ client: AuthenticatedClient,
145
+ body: PatchedProposalProjectRoleMappingRequest,
146
+ ) -> ProposalProjectRoleMapping:
147
+ """
148
+ Args:
149
+ uuid (UUID):
150
+ body (PatchedProposalProjectRoleMappingRequest):
151
+
152
+ Raises:
153
+ errors.UnexpectedStatus: If the server returns an undocumented status code.
154
+ httpx.TimeoutException: If the request takes longer than Client.timeout.
155
+
156
+ Returns:
157
+ ProposalProjectRoleMapping
158
+ """
159
+
160
+ return (
161
+ await asyncio_detailed(
162
+ uuid=uuid,
163
+ client=client,
164
+ body=body,
165
+ )
166
+ ).parsed