maleo-identity 0.1.9__py3-none-any.whl → 0.1.10__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 maleo-identity might be problematic. Click here for more details.

@@ -1,6 +1,10 @@
1
1
  from pydantic import BaseModel, Field
2
- from typing import Annotated, Generic
2
+ from typing import Annotated, Generic, Literal, TypeGuard
3
+ from uuid import UUID
4
+ from maleo.schemas.mixins.identity import Identifier
3
5
  from maleo.types.string import OptStrT
6
+ from ..enums.user_profile import IdentifierType
7
+ from ..types.user_profile import IdentifierValueType
4
8
 
5
9
 
6
10
  class LeadingTitle(BaseModel, Generic[OptStrT]):
@@ -39,3 +43,75 @@ class AvatarName(BaseModel, Generic[OptStrT]):
39
43
 
40
44
  class AvatarUrl(BaseModel, Generic[OptStrT]):
41
45
  avatar_url: Annotated[OptStrT, Field(..., description="User's Avatar URL")]
46
+
47
+
48
+ class UserProfileIdentifier(Identifier[IdentifierType, IdentifierValueType]):
49
+ pass
50
+
51
+
52
+ class IdUserProfileIdentifier(Identifier[Literal[IdentifierType.ID], int]):
53
+ type: Annotated[
54
+ Literal[IdentifierType.ID],
55
+ Field(IdentifierType.ID, description="Identifier's type"),
56
+ ] = IdentifierType.ID
57
+ value: Annotated[int, Field(..., description="Identifier's value", ge=1)]
58
+
59
+
60
+ class UserIdUserProfileIdentifier(Identifier[Literal[IdentifierType.USER_ID], int]):
61
+ type: Annotated[
62
+ Literal[IdentifierType.USER_ID],
63
+ Field(IdentifierType.USER_ID, description="Identifier's type"),
64
+ ] = IdentifierType.USER_ID
65
+ value: Annotated[int, Field(..., description="Identifier's value", ge=1)]
66
+
67
+
68
+ class UUIDUserProfileIdentifier(Identifier[Literal[IdentifierType.UUID], UUID]):
69
+ type: Annotated[
70
+ Literal[IdentifierType.UUID],
71
+ Field(IdentifierType.UUID, description="Identifier's type"),
72
+ ] = IdentifierType.UUID
73
+
74
+
75
+ class IdCardUserProfileIdentifier(Identifier[Literal[IdentifierType.ID_CARD], str]):
76
+ type: Annotated[
77
+ Literal[IdentifierType.ID_CARD],
78
+ Field(IdentifierType.ID_CARD, description="Identifier's type"),
79
+ ] = IdentifierType.ID_CARD
80
+ value: Annotated[str, Field(..., description="Identifier's value", max_length=16)]
81
+
82
+
83
+ AnyUserProfileIdentifier = (
84
+ UserProfileIdentifier
85
+ | IdUserProfileIdentifier
86
+ | UserIdUserProfileIdentifier
87
+ | UUIDUserProfileIdentifier
88
+ | IdCardUserProfileIdentifier
89
+ )
90
+
91
+
92
+ def is_id_identifier(
93
+ identifier: AnyUserProfileIdentifier,
94
+ ) -> TypeGuard[IdUserProfileIdentifier]:
95
+ return identifier.type is IdentifierType.ID and isinstance(identifier.value, int)
96
+
97
+
98
+ def is_user_id_identifier(
99
+ identifier: AnyUserProfileIdentifier,
100
+ ) -> TypeGuard[UserIdUserProfileIdentifier]:
101
+ return identifier.type is IdentifierType.USER_ID and isinstance(
102
+ identifier.value, int
103
+ )
104
+
105
+
106
+ def is_uuid_identifier(
107
+ identifier: AnyUserProfileIdentifier,
108
+ ) -> TypeGuard[UUIDUserProfileIdentifier]:
109
+ return identifier.type is IdentifierType.UUID and isinstance(identifier.value, UUID)
110
+
111
+
112
+ def is_id_card_identifier(
113
+ identifier: AnyUserProfileIdentifier,
114
+ ) -> TypeGuard[IdCardUserProfileIdentifier]:
115
+ return identifier.type is IdentifierType.ID_CARD and isinstance(
116
+ identifier.value, str
117
+ )
@@ -0,0 +1,63 @@
1
+ from pydantic import Field
2
+ from typing import Annotated, Literal, TypeGuard
3
+ from uuid import UUID
4
+ from maleo.schemas.mixins.identity import Identifier
5
+ from ..enums.user_system_role import IdentifierType
6
+ from ..types.user_system_role import CompositeIdentifier, IdentifierValueType
7
+
8
+
9
+ class UserSystemRoleIdentifier(Identifier[IdentifierType, IdentifierValueType]):
10
+ pass
11
+
12
+
13
+ class IdUserSystemRoleIdentifier(Identifier[Literal[IdentifierType.ID], int]):
14
+ type: Annotated[
15
+ Literal[IdentifierType.ID],
16
+ Field(IdentifierType.ID, description="Identifier's type"),
17
+ ] = IdentifierType.ID
18
+ value: Annotated[int, Field(..., description="Identifier's value", ge=1)]
19
+
20
+
21
+ class UUIDUserSystemRoleIdentifier(Identifier[Literal[IdentifierType.UUID], UUID]):
22
+ type: Annotated[
23
+ Literal[IdentifierType.UUID],
24
+ Field(IdentifierType.UUID, description="Identifier's type"),
25
+ ] = IdentifierType.UUID
26
+
27
+
28
+ class CompositeUserSystemRoleIdentifier(
29
+ Identifier[Literal[IdentifierType.COMPOSITE], CompositeIdentifier]
30
+ ):
31
+ type: Annotated[
32
+ Literal[IdentifierType.COMPOSITE],
33
+ Field(IdentifierType.COMPOSITE, description="Identifier's type"),
34
+ ] = IdentifierType.COMPOSITE
35
+ value: Annotated[CompositeIdentifier, Field(..., description="Identifier's value")]
36
+
37
+
38
+ AnyUserSystemRoleIdentifier = (
39
+ UserSystemRoleIdentifier
40
+ | IdUserSystemRoleIdentifier
41
+ | UUIDUserSystemRoleIdentifier
42
+ | CompositeUserSystemRoleIdentifier
43
+ )
44
+
45
+
46
+ def is_id_identifier(
47
+ identifier: AnyUserSystemRoleIdentifier,
48
+ ) -> TypeGuard[IdUserSystemRoleIdentifier]:
49
+ return identifier.type is IdentifierType.ID and isinstance(identifier.value, int)
50
+
51
+
52
+ def is_uuid_identifier(
53
+ identifier: AnyUserSystemRoleIdentifier,
54
+ ) -> TypeGuard[UUIDUserSystemRoleIdentifier]:
55
+ return identifier.type is IdentifierType.UUID and isinstance(identifier.value, UUID)
56
+
57
+
58
+ def is_composite_identifier(
59
+ identifier: AnyUserSystemRoleIdentifier,
60
+ ) -> TypeGuard[CompositeUserSystemRoleIdentifier]:
61
+ return identifier.type is IdentifierType.COMPOSITE and isinstance(
62
+ identifier.value, tuple
63
+ )
@@ -1,4 +1,4 @@
1
- from typing import Literal, Tuple, overload
1
+ from typing import Literal, overload
2
2
  from uuid import UUID
3
3
  from maleo.enums.status import (
4
4
  ListOfDataStatuses,
@@ -23,7 +23,8 @@ from maleo.types.dict import StrToAnyDict
23
23
  from maleo.types.integer import OptInt, OptListOfInts
24
24
  from maleo.types.uuid import OptListOfUUIDs
25
25
  from ..enums.api_key import IdentifierType
26
- from ..types.api_key import IdentifierValueType
26
+ from ..mixins.api_key import APIKeyIdentifier
27
+ from ..types.api_key import CompositeIdentifier, IdentifierValueType
27
28
 
28
29
 
29
30
  class CreateParameter(
@@ -64,7 +65,7 @@ class ReadMultipleParameter(
64
65
  return params
65
66
 
66
67
 
67
- class ReadSingleParameter(BaseReadSingleParameter[IdentifierType, IdentifierValueType]):
68
+ class ReadSingleParameter(BaseReadSingleParameter[APIKeyIdentifier]):
68
69
  @overload
69
70
  @classmethod
70
71
  def new(
@@ -88,7 +89,7 @@ class ReadSingleParameter(BaseReadSingleParameter[IdentifierType, IdentifierValu
88
89
  def new(
89
90
  cls,
90
91
  identifier_type: Literal[IdentifierType.COMPOSITE],
91
- identifier_value: Tuple[int, OptInt],
92
+ identifier_value: CompositeIdentifier,
92
93
  statuses: ListOfDataStatuses = list(FULL_DATA_STATUSES),
93
94
  use_cache: bool = True,
94
95
  ) -> "ReadSingleParameter": ...
@@ -110,8 +111,7 @@ class ReadSingleParameter(BaseReadSingleParameter[IdentifierType, IdentifierValu
110
111
  use_cache: bool = True,
111
112
  ) -> "ReadSingleParameter":
112
113
  return cls(
113
- identifier_type=identifier_type,
114
- identifier_value=identifier_value,
114
+ identifier=APIKeyIdentifier(type=identifier_type, value=identifier_value),
115
115
  statuses=statuses,
116
116
  use_cache=use_cache,
117
117
  )
@@ -122,7 +122,33 @@ class ReadSingleParameter(BaseReadSingleParameter[IdentifierType, IdentifierValu
122
122
  )
123
123
 
124
124
 
125
- class DeleteSingleParameter(
126
- BaseDeleteSingleParameter[IdentifierType, IdentifierValueType]
127
- ):
128
- pass
125
+ class DeleteSingleParameter(BaseDeleteSingleParameter[APIKeyIdentifier]):
126
+ @overload
127
+ @classmethod
128
+ def new(
129
+ cls, identifier_type: Literal[IdentifierType.ID], identifier_value: int
130
+ ) -> "DeleteSingleParameter": ...
131
+ @overload
132
+ @classmethod
133
+ def new(
134
+ cls, identifier_type: Literal[IdentifierType.UUID], identifier_value: UUID
135
+ ) -> "DeleteSingleParameter": ...
136
+ @overload
137
+ @classmethod
138
+ def new(
139
+ cls,
140
+ identifier_type: Literal[IdentifierType.COMPOSITE],
141
+ identifier_value: CompositeIdentifier,
142
+ ) -> "DeleteSingleParameter": ...
143
+ @overload
144
+ @classmethod
145
+ def new(
146
+ cls, identifier_type: IdentifierType, identifier_value: IdentifierValueType
147
+ ) -> "DeleteSingleParameter": ...
148
+ @classmethod
149
+ def new(
150
+ cls, identifier_type: IdentifierType, identifier_value: IdentifierValueType
151
+ ) -> "DeleteSingleParameter":
152
+ return cls(
153
+ identifier=APIKeyIdentifier(type=identifier_type, value=identifier_value)
154
+ )
@@ -36,7 +36,7 @@ from ..mixins.api_key import APIKey
36
36
  from ..mixins.organization_registration_code import Code, CurrentUses
37
37
  from ..mixins.organization_relation import IsBidirectional, Meta
38
38
  from ..mixins.organization import Key as OrganizationKey, Name as OrganizationName
39
- from ..mixins.patient import PatientIdentifier
39
+ from ..mixins.patient import PatientIdentity
40
40
  from ..mixins.user_profile import (
41
41
  LeadingTitle,
42
42
  FirstName,
@@ -67,7 +67,7 @@ class PatientSchema(
67
67
  DateOfBirth[date],
68
68
  PlaceOfBirth[OptStr],
69
69
  FullName[str],
70
- PatientIdentifier,
70
+ PatientIdentity,
71
71
  SimpleDataStatusMixin[DataStatusEnum],
72
72
  LifecycleTimestamp,
73
73
  DataIdentifier,
@@ -15,13 +15,14 @@ from maleo.enums.status import (
15
15
  )
16
16
  from maleo.schemas.mixins.filter import convert as convert_filter
17
17
  from maleo.schemas.mixins.identity import (
18
- IdentifierTypeValue,
18
+ IdentifierMixin,
19
19
  Ids,
20
20
  UUIDs,
21
21
  Keys,
22
22
  Names,
23
23
  )
24
24
  from maleo.schemas.mixins.sort import convert as convert_sort
25
+ from maleo.schemas.operation.enums import ResourceOperationStatusUpdateType
25
26
  from maleo.schemas.parameter import (
26
27
  ReadSingleParameter as BaseReadSingleParameter,
27
28
  ReadPaginatedMultipleParameter,
@@ -33,7 +34,7 @@ from maleo.types.integer import OptInt, OptListOfInts
33
34
  from maleo.types.string import OptStr, OptListOfStrs
34
35
  from maleo.types.uuid import OptListOfUUIDs
35
36
  from ..enums.organization import IdentifierType
36
- from ..mixins.organization import Key, Name
37
+ from ..mixins.organization import Key, Name, OrganizationIdentifier
37
38
  from ..types.organization import IdentifierValueType
38
39
 
39
40
 
@@ -81,7 +82,7 @@ class ReadMultipleParameter(
81
82
  return params
82
83
 
83
84
 
84
- class ReadSingleParameter(BaseReadSingleParameter[IdentifierType, IdentifierValueType]):
85
+ class ReadSingleParameter(BaseReadSingleParameter[OrganizationIdentifier]):
85
86
  @overload
86
87
  @classmethod
87
88
  def new(
@@ -118,8 +119,9 @@ class ReadSingleParameter(BaseReadSingleParameter[IdentifierType, IdentifierValu
118
119
  use_cache: bool = True,
119
120
  ) -> "ReadSingleParameter":
120
121
  return cls(
121
- identifier_type=identifier_type,
122
- identifier_value=identifier_value,
122
+ identifier=OrganizationIdentifier(
123
+ type=identifier_type, value=identifier_value
124
+ ),
123
125
  statuses=statuses,
124
126
  use_cache=use_cache,
125
127
  )
@@ -149,22 +151,135 @@ class UpdateDataMixin(BaseModel, Generic[UpdateDataT]):
149
151
 
150
152
  class UpdateParameter(
151
153
  UpdateDataMixin[UpdateDataT],
152
- IdentifierTypeValue[
153
- IdentifierType,
154
- IdentifierValueType,
155
- ],
154
+ IdentifierMixin[OrganizationIdentifier],
156
155
  Generic[UpdateDataT],
157
156
  ):
158
- pass
157
+ @overload
158
+ @classmethod
159
+ def new(
160
+ cls,
161
+ identifier_type: Literal[IdentifierType.ID],
162
+ identifier_value: int,
163
+ data: UpdateDataT,
164
+ ) -> "UpdateParameter": ...
165
+ @overload
166
+ @classmethod
167
+ def new(
168
+ cls,
169
+ identifier_type: Literal[IdentifierType.UUID],
170
+ identifier_value: UUID,
171
+ data: UpdateDataT,
172
+ ) -> "UpdateParameter": ...
173
+ @overload
174
+ @classmethod
175
+ def new(
176
+ cls,
177
+ identifier_type: Literal[IdentifierType.KEY],
178
+ identifier_value: str,
179
+ data: UpdateDataT,
180
+ ) -> "UpdateParameter": ...
181
+ @overload
182
+ @classmethod
183
+ def new(
184
+ cls,
185
+ identifier_type: IdentifierType,
186
+ identifier_value: IdentifierValueType,
187
+ data: UpdateDataT,
188
+ ) -> "UpdateParameter": ...
189
+ @classmethod
190
+ def new(
191
+ cls,
192
+ identifier_type: IdentifierType,
193
+ identifier_value: IdentifierValueType,
194
+ data: UpdateDataT,
195
+ ) -> "UpdateParameter":
196
+ return cls(
197
+ identifier=OrganizationIdentifier(
198
+ type=identifier_type, value=identifier_value
199
+ ),
200
+ data=data,
201
+ )
159
202
 
160
203
 
161
204
  class StatusUpdateParameter(
162
- BaseStatusUpdateParameter[IdentifierType, IdentifierValueType],
205
+ BaseStatusUpdateParameter[OrganizationIdentifier],
163
206
  ):
164
- pass
207
+ @overload
208
+ @classmethod
209
+ def new(
210
+ cls,
211
+ identifier_type: Literal[IdentifierType.ID],
212
+ identifier_value: int,
213
+ type: ResourceOperationStatusUpdateType,
214
+ ) -> "StatusUpdateParameter": ...
215
+ @overload
216
+ @classmethod
217
+ def new(
218
+ cls,
219
+ identifier_type: Literal[IdentifierType.UUID],
220
+ identifier_value: UUID,
221
+ type: ResourceOperationStatusUpdateType,
222
+ ) -> "StatusUpdateParameter": ...
223
+ @overload
224
+ @classmethod
225
+ def new(
226
+ cls,
227
+ identifier_type: Literal[IdentifierType.KEY],
228
+ identifier_value: str,
229
+ type: ResourceOperationStatusUpdateType,
230
+ ) -> "StatusUpdateParameter": ...
231
+ @overload
232
+ @classmethod
233
+ def new(
234
+ cls,
235
+ identifier_type: IdentifierType,
236
+ identifier_value: IdentifierValueType,
237
+ type: ResourceOperationStatusUpdateType,
238
+ ) -> "StatusUpdateParameter": ...
239
+ @classmethod
240
+ def new(
241
+ cls,
242
+ identifier_type: IdentifierType,
243
+ identifier_value: IdentifierValueType,
244
+ type: ResourceOperationStatusUpdateType,
245
+ ) -> "StatusUpdateParameter":
246
+ return cls(
247
+ identifier=OrganizationIdentifier(
248
+ type=identifier_type, value=identifier_value
249
+ ),
250
+ type=type,
251
+ )
165
252
 
166
253
 
167
- class DeleteSingleParameter(
168
- BaseDeleteSingleParameter[IdentifierType, IdentifierValueType]
169
- ):
170
- pass
254
+ class DeleteSingleParameter(BaseDeleteSingleParameter[OrganizationIdentifier]):
255
+ @overload
256
+ @classmethod
257
+ def new(
258
+ cls, identifier_type: Literal[IdentifierType.ID], identifier_value: int
259
+ ) -> "DeleteSingleParameter": ...
260
+ @overload
261
+ @classmethod
262
+ def new(
263
+ cls, identifier_type: Literal[IdentifierType.UUID], identifier_value: UUID
264
+ ) -> "DeleteSingleParameter": ...
265
+ @overload
266
+ @classmethod
267
+ def new(
268
+ cls,
269
+ identifier_type: Literal[IdentifierType.KEY],
270
+ identifier_value: str,
271
+ ) -> "DeleteSingleParameter": ...
272
+ @overload
273
+ @classmethod
274
+ def new(
275
+ cls, identifier_type: IdentifierType, identifier_value: IdentifierValueType
276
+ ) -> "DeleteSingleParameter": ...
277
+ @classmethod
278
+ def new(
279
+ cls, identifier_type: IdentifierType, identifier_value: IdentifierValueType
280
+ ) -> "DeleteSingleParameter":
281
+ return cls(
282
+ identifier=OrganizationIdentifier(
283
+ type=identifier_type, value=identifier_value
284
+ )
285
+ )
@@ -8,13 +8,14 @@ from maleo.enums.status import (
8
8
  from maleo.schemas.mixins.filter import convert as convert_filter
9
9
  from maleo.schemas.mixins.general import Codes
10
10
  from maleo.schemas.mixins.identity import (
11
- IdentifierTypeValue,
11
+ IdentifierMixin,
12
12
  Ids,
13
13
  IntOrganizationId,
14
14
  IntOrganizationIds,
15
15
  UUIDs,
16
16
  )
17
17
  from maleo.schemas.mixins.sort import convert as convert_sort
18
+ from maleo.schemas.operation.enums import ResourceOperationStatusUpdateType
18
19
  from maleo.schemas.parameter import (
19
20
  ReadSingleParameter as BaseReadSingleParameter,
20
21
  ReadPaginatedMultipleParameter,
@@ -26,7 +27,11 @@ from maleo.types.integer import OptInt, OptListOfInts
26
27
  from maleo.types.string import OptStr, OptListOfStrs
27
28
  from maleo.types.uuid import OptListOfUUIDs
28
29
  from ..enums.organization_registration_code import IdentifierType
29
- from ..mixins.organization_registration_code import Code, MaxUses
30
+ from ..mixins.organization_registration_code import (
31
+ Code,
32
+ MaxUses,
33
+ OrganizationRegistrationCodeIdentifier,
34
+ )
30
35
  from ..types.organization_registration_code import IdentifierValueType
31
36
 
32
37
 
@@ -76,7 +81,9 @@ class ReadMultipleParameter(
76
81
  return params
77
82
 
78
83
 
79
- class ReadSingleParameter(BaseReadSingleParameter[IdentifierType, IdentifierValueType]):
84
+ class ReadSingleParameter(
85
+ BaseReadSingleParameter[OrganizationRegistrationCodeIdentifier]
86
+ ):
80
87
  @overload
81
88
  @classmethod
82
89
  def new(
@@ -122,8 +129,9 @@ class ReadSingleParameter(BaseReadSingleParameter[IdentifierType, IdentifierValu
122
129
  use_cache: bool = True,
123
130
  ) -> "ReadSingleParameter":
124
131
  return cls(
125
- identifier_type=identifier_type,
126
- identifier_value=identifier_value,
132
+ identifier=OrganizationRegistrationCodeIdentifier(
133
+ type=identifier_type, value=identifier_value
134
+ ),
127
135
  statuses=statuses,
128
136
  use_cache=use_cache,
129
137
  )
@@ -151,22 +159,139 @@ class UpdateDataMixin(BaseModel, Generic[UpdateDataT]):
151
159
 
152
160
  class UpdateParameter(
153
161
  UpdateDataMixin[UpdateDataT],
154
- IdentifierTypeValue[
155
- IdentifierType,
156
- IdentifierValueType,
157
- ],
162
+ IdentifierMixin[OrganizationRegistrationCodeIdentifier],
158
163
  Generic[UpdateDataT],
159
164
  ):
160
- pass
165
+ @overload
166
+ @classmethod
167
+ def new(
168
+ cls,
169
+ identifier_type: Literal[IdentifierType.ID, IdentifierType.ORGANIZATION_ID],
170
+ identifier_value: int,
171
+ data: UpdateDataT,
172
+ ) -> "UpdateParameter": ...
173
+ @overload
174
+ @classmethod
175
+ def new(
176
+ cls,
177
+ identifier_type: Literal[IdentifierType.UUID],
178
+ identifier_value: UUID,
179
+ data: UpdateDataT,
180
+ ) -> "UpdateParameter": ...
181
+ @overload
182
+ @classmethod
183
+ def new(
184
+ cls,
185
+ identifier_type: Literal[IdentifierType.CODE],
186
+ identifier_value: str,
187
+ data: UpdateDataT,
188
+ ) -> "UpdateParameter": ...
189
+ @overload
190
+ @classmethod
191
+ def new(
192
+ cls,
193
+ identifier_type: IdentifierType,
194
+ identifier_value: IdentifierValueType,
195
+ data: UpdateDataT,
196
+ ) -> "UpdateParameter": ...
197
+ @classmethod
198
+ def new(
199
+ cls,
200
+ identifier_type: IdentifierType,
201
+ identifier_value: IdentifierValueType,
202
+ data: UpdateDataT,
203
+ ) -> "UpdateParameter":
204
+ return cls(
205
+ identifier=OrganizationRegistrationCodeIdentifier(
206
+ type=identifier_type, value=identifier_value
207
+ ),
208
+ data=data,
209
+ )
161
210
 
162
211
 
163
212
  class StatusUpdateParameter(
164
- BaseStatusUpdateParameter[IdentifierType, IdentifierValueType],
213
+ BaseStatusUpdateParameter[OrganizationRegistrationCodeIdentifier],
165
214
  ):
166
- pass
215
+ @overload
216
+ @classmethod
217
+ def new(
218
+ cls,
219
+ identifier_type: Literal[IdentifierType.ID, IdentifierType.ORGANIZATION_ID],
220
+ identifier_value: int,
221
+ type: ResourceOperationStatusUpdateType,
222
+ ) -> "StatusUpdateParameter": ...
223
+ @overload
224
+ @classmethod
225
+ def new(
226
+ cls,
227
+ identifier_type: Literal[IdentifierType.UUID],
228
+ identifier_value: UUID,
229
+ type: ResourceOperationStatusUpdateType,
230
+ ) -> "StatusUpdateParameter": ...
231
+ @overload
232
+ @classmethod
233
+ def new(
234
+ cls,
235
+ identifier_type: Literal[IdentifierType.CODE],
236
+ identifier_value: str,
237
+ type: ResourceOperationStatusUpdateType,
238
+ ) -> "StatusUpdateParameter": ...
239
+ @overload
240
+ @classmethod
241
+ def new(
242
+ cls,
243
+ identifier_type: IdentifierType,
244
+ identifier_value: IdentifierValueType,
245
+ type: ResourceOperationStatusUpdateType,
246
+ ) -> "StatusUpdateParameter": ...
247
+ @classmethod
248
+ def new(
249
+ cls,
250
+ identifier_type: IdentifierType,
251
+ identifier_value: IdentifierValueType,
252
+ type: ResourceOperationStatusUpdateType,
253
+ ) -> "StatusUpdateParameter":
254
+ return cls(
255
+ identifier=OrganizationRegistrationCodeIdentifier(
256
+ type=identifier_type, value=identifier_value
257
+ ),
258
+ type=type,
259
+ )
167
260
 
168
261
 
169
262
  class DeleteSingleParameter(
170
- BaseDeleteSingleParameter[IdentifierType, IdentifierValueType]
263
+ BaseDeleteSingleParameter[OrganizationRegistrationCodeIdentifier]
171
264
  ):
172
- pass
265
+ @overload
266
+ @classmethod
267
+ def new(
268
+ cls,
269
+ identifier_type: Literal[IdentifierType.ID, IdentifierType.ORGANIZATION_ID],
270
+ identifier_value: int,
271
+ ) -> "DeleteSingleParameter": ...
272
+ @overload
273
+ @classmethod
274
+ def new(
275
+ cls, identifier_type: Literal[IdentifierType.UUID], identifier_value: UUID
276
+ ) -> "DeleteSingleParameter": ...
277
+ @overload
278
+ @classmethod
279
+ def new(
280
+ cls,
281
+ identifier_type: Literal[IdentifierType.CODE],
282
+ identifier_value: str,
283
+ ) -> "DeleteSingleParameter": ...
284
+ @overload
285
+ @classmethod
286
+ def new(
287
+ cls, identifier_type: IdentifierType, identifier_value: IdentifierValueType
288
+ ) -> "DeleteSingleParameter": ...
289
+ @classmethod
290
+ def new(
291
+ cls, identifier_type: IdentifierType, identifier_value: IdentifierValueType
292
+ ) -> "DeleteSingleParameter":
293
+ return cls(
294
+ identifier=OrganizationRegistrationCodeIdentifier(
295
+ type=identifier_type, value=identifier_value
296
+ )
297
+ )