Skip to content

Commit 80bae26

Browse files
committed
Added User.language_iso. See: Mosquito-Alert/mosquito_alert@b7a3d53
1 parent b70cce3 commit 80bae26

15 files changed

+35
-11
lines changed

docs/CreateUser.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
88
**uuid** | **str** | | [readonly]
99
**registration_time** | **datetime** | The date and time when user registered and consented to sharing data. Automatically set by server when user uploads registration. | [readonly]
10+
**language_iso** | **str** | Language setting of app. 2-digit ISO-639-1 language code. | [optional]
1011
**score** | **int** | Global XP Score. This field is updated whenever the user asks for the score, and is only stored here. The content must equal score_v2_adult + score_v2_bite + score_v2_site | [readonly]
1112
**last_score_update** | **datetime** | Last time score was updated | [readonly]
1213

docs/CreateUserRequest.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
88
**device_token** | **str** | Device token, used in messaging. Must be supplied by the client | [optional]
9+
**language_iso** | **str** | Language setting of app. 2-digit ISO-639-1 language code. | [optional]
910
**password** | **str** | |
1011

1112
## Example

docs/PatchedUserRequest.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
88
**device_token** | **str** | Device token, used in messaging. Must be supplied by the client | [optional]
9+
**language_iso** | **str** | Language setting of app. 2-digit ISO-639-1 language code. | [optional]
910

1011
## Example
1112

docs/User.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
88
**uuid** | **str** | | [readonly]
99
**registration_time** | **datetime** | The date and time when user registered and consented to sharing data. Automatically set by server when user uploads registration. | [readonly]
10+
**language_iso** | **str** | Language setting of app. 2-digit ISO-639-1 language code. | [optional]
1011
**score** | **int** | Global XP Score. This field is updated whenever the user asks for the score, and is only stored here. The content must equal score_v2_adult + score_v2_bite + score_v2_site | [readonly]
1112
**last_score_update** | **datetime** | Last time score was updated | [readonly]
1213

docs/UserRequest.md

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
Name | Type | Description | Notes
77
------------ | ------------- | ------------- | -------------
88
**device_token** | **str** | Device token, used in messaging. Must be supplied by the client | [optional]
9+
**language_iso** | **str** | Language setting of app. 2-digit ISO-639-1 language code. | [optional]
910

1011
## Example
1112

mosquito_alert/models/create_user.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020

2121
from datetime import datetime
2222
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
23-
from typing import Any, ClassVar, Dict, List
23+
from typing import Any, ClassVar, Dict, List, Optional
24+
from typing_extensions import Annotated
2425
from typing import Optional, Set
2526
from typing_extensions import Self
2627

@@ -30,9 +31,10 @@ class CreateUser(BaseModel):
3031
""" # noqa: E501
3132
uuid: StrictStr
3233
registration_time: datetime = Field(description="The date and time when user registered and consented to sharing data. Automatically set by server when user uploads registration.")
34+
language_iso: Optional[Annotated[str, Field(strict=True, max_length=2)]] = Field(default=None, description="Language setting of app. 2-digit ISO-639-1 language code.")
3335
score: StrictInt = Field(description="Global XP Score. This field is updated whenever the user asks for the score, and is only stored here. The content must equal score_v2_adult + score_v2_bite + score_v2_site")
3436
last_score_update: datetime = Field(description="Last time score was updated")
35-
__properties: ClassVar[List[str]] = ["uuid", "registration_time", "score", "last_score_update"]
37+
__properties: ClassVar[List[str]] = ["uuid", "registration_time", "language_iso", "score", "last_score_update"]
3638

3739
model_config = ConfigDict(
3840
populate_by_name=True,
@@ -95,6 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
9597
_obj = cls.model_validate({
9698
"uuid": obj.get("uuid"),
9799
"registration_time": obj.get("registration_time"),
100+
"language_iso": obj.get("language_iso"),
98101
"score": obj.get("score"),
99102
"last_score_update": obj.get("last_score_update")
100103
})

mosquito_alert/models/create_user_request.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ class CreateUserRequest(BaseModel):
2929
CreateUserRequest
3030
""" # noqa: E501
3131
device_token: Optional[StrictStr] = Field(default=None, description="Device token, used in messaging. Must be supplied by the client")
32+
language_iso: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2)]] = Field(default=None, description="Language setting of app. 2-digit ISO-639-1 language code.")
3233
password: Annotated[str, Field(min_length=1, strict=True)]
33-
__properties: ClassVar[List[str]] = ["device_token", "password"]
34+
__properties: ClassVar[List[str]] = ["device_token", "language_iso", "password"]
3435

3536
model_config = ConfigDict(
3637
populate_by_name=True,
@@ -89,6 +90,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
8990

9091
_obj = cls.model_validate({
9192
"device_token": obj.get("device_token"),
93+
"language_iso": obj.get("language_iso"),
9294
"password": obj.get("password")
9395
})
9496
return _obj

mosquito_alert/models/patched_user_request.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
from pydantic import BaseModel, ConfigDict, Field, StrictStr
2222
from typing import Any, ClassVar, Dict, List, Optional
23+
from typing_extensions import Annotated
2324
from typing import Optional, Set
2425
from typing_extensions import Self
2526

@@ -28,7 +29,8 @@ class PatchedUserRequest(BaseModel):
2829
PatchedUserRequest
2930
""" # noqa: E501
3031
device_token: Optional[StrictStr] = Field(default=None, description="Device token, used in messaging. Must be supplied by the client")
31-
__properties: ClassVar[List[str]] = ["device_token"]
32+
language_iso: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2)]] = Field(default=None, description="Language setting of app. 2-digit ISO-639-1 language code.")
33+
__properties: ClassVar[List[str]] = ["device_token", "language_iso"]
3234

3335
model_config = ConfigDict(
3436
populate_by_name=True,
@@ -86,7 +88,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
8688
return cls.model_validate(obj)
8789

8890
_obj = cls.model_validate({
89-
"device_token": obj.get("device_token")
91+
"device_token": obj.get("device_token"),
92+
"language_iso": obj.get("language_iso")
9093
})
9194
return _obj
9295

mosquito_alert/models/user.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020

2121
from datetime import datetime
2222
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
23-
from typing import Any, ClassVar, Dict, List
23+
from typing import Any, ClassVar, Dict, List, Optional
24+
from typing_extensions import Annotated
2425
from typing import Optional, Set
2526
from typing_extensions import Self
2627

@@ -30,9 +31,10 @@ class User(BaseModel):
3031
""" # noqa: E501
3132
uuid: StrictStr
3233
registration_time: datetime = Field(description="The date and time when user registered and consented to sharing data. Automatically set by server when user uploads registration.")
34+
language_iso: Optional[Annotated[str, Field(strict=True, max_length=2)]] = Field(default=None, description="Language setting of app. 2-digit ISO-639-1 language code.")
3335
score: StrictInt = Field(description="Global XP Score. This field is updated whenever the user asks for the score, and is only stored here. The content must equal score_v2_adult + score_v2_bite + score_v2_site")
3436
last_score_update: datetime = Field(description="Last time score was updated")
35-
__properties: ClassVar[List[str]] = ["uuid", "registration_time", "score", "last_score_update"]
37+
__properties: ClassVar[List[str]] = ["uuid", "registration_time", "language_iso", "score", "last_score_update"]
3638

3739
model_config = ConfigDict(
3840
populate_by_name=True,
@@ -95,6 +97,7 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
9597
_obj = cls.model_validate({
9698
"uuid": obj.get("uuid"),
9799
"registration_time": obj.get("registration_time"),
100+
"language_iso": obj.get("language_iso"),
98101
"score": obj.get("score"),
99102
"last_score_update": obj.get("last_score_update")
100103
})

mosquito_alert/models/user_request.py

+5-2
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020

2121
from pydantic import BaseModel, ConfigDict, Field, StrictStr
2222
from typing import Any, ClassVar, Dict, List, Optional
23+
from typing_extensions import Annotated
2324
from typing import Optional, Set
2425
from typing_extensions import Self
2526

@@ -28,7 +29,8 @@ class UserRequest(BaseModel):
2829
UserRequest
2930
""" # noqa: E501
3031
device_token: Optional[StrictStr] = Field(default=None, description="Device token, used in messaging. Must be supplied by the client")
31-
__properties: ClassVar[List[str]] = ["device_token"]
32+
language_iso: Optional[Annotated[str, Field(min_length=1, strict=True, max_length=2)]] = Field(default=None, description="Language setting of app. 2-digit ISO-639-1 language code.")
33+
__properties: ClassVar[List[str]] = ["device_token", "language_iso"]
3234

3335
model_config = ConfigDict(
3436
populate_by_name=True,
@@ -86,7 +88,8 @@ def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
8688
return cls.model_validate(obj)
8789

8890
_obj = cls.model_validate({
89-
"device_token": obj.get("device_token")
91+
"device_token": obj.get("device_token"),
92+
"language_iso": obj.get("language_iso")
9093
})
9194
return _obj
9295

test/test_create_user.py

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def make_instance(self, include_optional) -> CreateUser:
3838
return CreateUser(
3939
uuid = '',
4040
registration_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
41+
language_iso = '',
4142
score = 56,
4243
last_score_update = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f')
4344
)

test/test_create_user_request.py

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def make_instance(self, include_optional) -> CreateUserRequest:
3737
if include_optional:
3838
return CreateUserRequest(
3939
device_token = '',
40+
language_iso = '0',
4041
password = '0'
4142
)
4243
else:

test/test_patched_user_request.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ def make_instance(self, include_optional) -> PatchedUserRequest:
3636
model = PatchedUserRequest()
3737
if include_optional:
3838
return PatchedUserRequest(
39-
device_token = ''
39+
device_token = '',
40+
language_iso = '0'
4041
)
4142
else:
4243
return PatchedUserRequest(

test/test_user.py

+1
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def make_instance(self, include_optional) -> User:
3838
return User(
3939
uuid = '',
4040
registration_time = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f'),
41+
language_iso = '',
4142
score = 56,
4243
last_score_update = datetime.datetime.strptime('2013-10-20 19:20:30.00', '%Y-%m-%d %H:%M:%S.%f')
4344
)

test/test_user_request.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ def make_instance(self, include_optional) -> UserRequest:
3636
model = UserRequest()
3737
if include_optional:
3838
return UserRequest(
39-
device_token = ''
39+
device_token = '',
40+
language_iso = '0'
4041
)
4142
else:
4243
return UserRequest(

0 commit comments

Comments
 (0)