Skip to content

Commit 3c24f1a

Browse files
authored
Update generated code (#23)
1 parent 156e511 commit 3c24f1a

File tree

9 files changed

+68
-4
lines changed

9 files changed

+68
-4
lines changed

src/userhub_sdk/_internal/constants.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
import sys
55

66
API_BASE_URL = "https://api.userhub.com"
7-
USER_AGENT = "UserHub-Python/0.6.0"
8-
VERSION = "0.6.0"
7+
USER_AGENT = "UserHub-Python/0.6.1"
8+
VERSION = "0.6.1"
99

1010
AUTH_HEADER = "Authorization"
1111
API_KEY_HEADER = "UserHub-Api-Key"

src/userhub_sdk/adminv1/__init__.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,6 @@
9494
from ._tiered_price_tier import TieredPriceTier
9595
from ._trigger import Trigger
9696
from ._trigger_result import TriggerResult
97-
from ._update_subscription_items_request_item import UpdateSubscriptionItemsRequestItem
9897
from ._user import User
9998
from ._user_input import UserInput
10099
from ._user_result import UserResult
@@ -193,7 +192,6 @@
193192
"TieredPriceTier",
194193
"Trigger",
195194
"TriggerResult",
196-
"UpdateSubscriptionItemsRequestItem",
197195
"User",
198196
"UserInput",
199197
"UserResult",

src/userhub_sdk/adminv1/_organization.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,10 @@ class Organization:
5555
subscription: Optional[AccountSubscription] = None
5656
#: The sign-up time for the organization.
5757
signup_time: Optional[datetime.datetime] = None
58+
#: The number of members in the organization.
59+
#:
60+
#: This includes disabled users, but does not include user's marked for deletion.
61+
member_count: int = 0
5862
#: Whether the organization is disabled.
5963
disabled: Optional[bool] = None
6064
#: The creation time of the organization.
@@ -123,6 +127,9 @@ def __json_encode__(self) -> Dict[str, Any]:
123127
if self.signup_time is not None:
124128
data["signupTime"] = util.encode_datetime(self.signup_time)
125129

130+
if self.member_count is not None:
131+
data["memberCount"] = self.member_count
132+
126133
if self.disabled is not None:
127134
data["disabled"] = self.disabled
128135

@@ -199,6 +206,9 @@ def __json_decode__(data: Dict[str, Any]) -> "Organization":
199206
if data.get("signupTime") is not None:
200207
kwargs["signup_time"] = util.decode_datetime(data["signupTime"])
201208

209+
if data.get("memberCount") is not None:
210+
kwargs["member_count"] = data["memberCount"]
211+
202212
if data.get("disabled") is not None:
203213
kwargs["disabled"] = data["disabled"]
204214

src/userhub_sdk/userv1/_organization.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ class Organization:
2222
email_verified: Optional[bool] = None
2323
#: The photo/avatar URL of the organization.
2424
image_url: Optional[str] = None
25+
#: The number of members in the organization.
26+
#:
27+
#: This includes disabled users, but does not include user's marked for deletion.
28+
member_count: int = 0
2529
#: Whether the organization is disabled.
2630
disabled: Optional[bool] = None
2731

@@ -46,6 +50,9 @@ def __json_encode__(self) -> Dict[str, Any]:
4650
if self.image_url is not None:
4751
data["imageUrl"] = self.image_url
4852

53+
if self.member_count is not None:
54+
data["memberCount"] = self.member_count
55+
4956
if self.disabled is not None:
5057
data["disabled"] = self.disabled
5158

@@ -76,6 +83,9 @@ def __json_decode__(data: Dict[str, Any]) -> "Organization":
7683
if data.get("imageUrl") is not None:
7784
kwargs["image_url"] = data["imageUrl"]
7885

86+
if data.get("memberCount") is not None:
87+
kwargs["member_count"] = data["memberCount"]
88+
7989
if data.get("disabled") is not None:
8090
kwargs["disabled"] = data["disabled"]
8191

tests/adminapi/test_flows.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ def test_create_join_organization():
7171
"anchorTime": "2024-02-05T23:07:46.483Z"
7272
},
7373
"signupTime": "2024-02-05T23:07:46.483Z",
74+
"memberCount": 1,
7475
"disabled": true,
7576
"createTime": "2024-02-05T23:07:46.483Z",
7677
"updateTime": "2024-02-05T23:07:46.483Z"
@@ -216,6 +217,7 @@ def test_create_signup():
216217
"anchorTime": "2024-02-05T23:07:46.483Z"
217218
},
218219
"signupTime": "2024-02-05T23:07:46.483Z",
220+
"memberCount": 1,
219221
"disabled": true,
220222
"createTime": "2024-02-05T23:07:46.483Z",
221223
"updateTime": "2024-02-05T23:07:46.483Z"
@@ -361,6 +363,7 @@ def test_get():
361363
"anchorTime": "2024-02-05T23:07:46.483Z"
362364
},
363365
"signupTime": "2024-02-05T23:07:46.483Z",
366+
"memberCount": 1,
364367
"disabled": true,
365368
"createTime": "2024-02-05T23:07:46.483Z",
366369
"updateTime": "2024-02-05T23:07:46.483Z"
@@ -506,6 +509,7 @@ def test_cancel():
506509
"anchorTime": "2024-02-05T23:07:46.483Z"
507510
},
508511
"signupTime": "2024-02-05T23:07:46.483Z",
512+
"memberCount": 1,
509513
"disabled": true,
510514
"createTime": "2024-02-05T23:07:46.483Z",
511515
"updateTime": "2024-02-05T23:07:46.483Z"
@@ -682,6 +686,7 @@ async def test_async_create_join_organization():
682686
"anchorTime": "2024-02-05T23:07:46.483Z"
683687
},
684688
"signupTime": "2024-02-05T23:07:46.483Z",
689+
"memberCount": 1,
685690
"disabled": true,
686691
"createTime": "2024-02-05T23:07:46.483Z",
687692
"updateTime": "2024-02-05T23:07:46.483Z"
@@ -828,6 +833,7 @@ async def test_async_create_signup():
828833
"anchorTime": "2024-02-05T23:07:46.483Z"
829834
},
830835
"signupTime": "2024-02-05T23:07:46.483Z",
836+
"memberCount": 1,
831837
"disabled": true,
832838
"createTime": "2024-02-05T23:07:46.483Z",
833839
"updateTime": "2024-02-05T23:07:46.483Z"
@@ -974,6 +980,7 @@ async def test_async_get():
974980
"anchorTime": "2024-02-05T23:07:46.483Z"
975981
},
976982
"signupTime": "2024-02-05T23:07:46.483Z",
983+
"memberCount": 1,
977984
"disabled": true,
978985
"createTime": "2024-02-05T23:07:46.483Z",
979986
"updateTime": "2024-02-05T23:07:46.483Z"
@@ -1120,6 +1127,7 @@ async def test_async_cancel():
11201127
"anchorTime": "2024-02-05T23:07:46.483Z"
11211128
},
11221129
"signupTime": "2024-02-05T23:07:46.483Z",
1130+
"memberCount": 1,
11231131
"disabled": true,
11241132
"createTime": "2024-02-05T23:07:46.483Z",
11251133
"updateTime": "2024-02-05T23:07:46.483Z"

tests/adminapi/test_organizations.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ def test_list():
2626
"regionCode": "US",
2727
"timeZone": "America/New_York",
2828
"signupTime": "2024-02-05T23:07:46.483Z",
29+
"memberCount": 1,
2930
"disabled": true,
3031
"createTime": "2024-02-05T23:07:46.483Z",
3132
"updateTime": "2024-02-05T23:07:46.483Z"
@@ -93,6 +94,7 @@ def test_create():
9394
}
9495
},
9596
"signupTime": "2024-02-05T23:07:46.483Z",
97+
"memberCount": 1,
9698
"disabled": true,
9799
"createTime": "2024-02-05T23:07:46.483Z",
98100
"updateTime": "2024-02-05T23:07:46.483Z"
@@ -156,6 +158,7 @@ def test_get():
156158
}
157159
},
158160
"signupTime": "2024-02-05T23:07:46.483Z",
161+
"memberCount": 1,
159162
"disabled": true,
160163
"createTime": "2024-02-05T23:07:46.483Z",
161164
"updateTime": "2024-02-05T23:07:46.483Z"
@@ -219,6 +222,7 @@ def test_update():
219222
}
220223
},
221224
"signupTime": "2024-02-05T23:07:46.483Z",
225+
"memberCount": 1,
222226
"disabled": true,
223227
"createTime": "2024-02-05T23:07:46.483Z",
224228
"updateTime": "2024-02-05T23:07:46.483Z"
@@ -282,6 +286,7 @@ def test_delete():
282286
}
283287
},
284288
"signupTime": "2024-02-05T23:07:46.483Z",
289+
"memberCount": 1,
285290
"disabled": true,
286291
"createTime": "2024-02-05T23:07:46.483Z",
287292
"updateTime": "2024-02-05T23:07:46.483Z"
@@ -345,6 +350,7 @@ def test_undelete():
345350
}
346351
},
347352
"signupTime": "2024-02-05T23:07:46.483Z",
353+
"memberCount": 1,
348354
"disabled": true,
349355
"createTime": "2024-02-05T23:07:46.483Z",
350356
"updateTime": "2024-02-05T23:07:46.483Z"
@@ -408,6 +414,7 @@ def test_connect():
408414
}
409415
},
410416
"signupTime": "2024-02-05T23:07:46.483Z",
417+
"memberCount": 1,
411418
"disabled": true,
412419
"createTime": "2024-02-05T23:07:46.483Z",
413420
"updateTime": "2024-02-05T23:07:46.483Z"
@@ -471,6 +478,7 @@ def test_disconnect():
471478
}
472479
},
473480
"signupTime": "2024-02-05T23:07:46.483Z",
481+
"memberCount": 1,
474482
"disabled": true,
475483
"createTime": "2024-02-05T23:07:46.483Z",
476484
"updateTime": "2024-02-05T23:07:46.483Z"
@@ -752,6 +760,7 @@ async def test_async_list():
752760
"regionCode": "US",
753761
"timeZone": "America/New_York",
754762
"signupTime": "2024-02-05T23:07:46.483Z",
763+
"memberCount": 1,
755764
"disabled": true,
756765
"createTime": "2024-02-05T23:07:46.483Z",
757766
"updateTime": "2024-02-05T23:07:46.483Z"
@@ -820,6 +829,7 @@ async def test_async_create():
820829
}
821830
},
822831
"signupTime": "2024-02-05T23:07:46.483Z",
832+
"memberCount": 1,
823833
"disabled": true,
824834
"createTime": "2024-02-05T23:07:46.483Z",
825835
"updateTime": "2024-02-05T23:07:46.483Z"
@@ -884,6 +894,7 @@ async def test_async_get():
884894
}
885895
},
886896
"signupTime": "2024-02-05T23:07:46.483Z",
897+
"memberCount": 1,
887898
"disabled": true,
888899
"createTime": "2024-02-05T23:07:46.483Z",
889900
"updateTime": "2024-02-05T23:07:46.483Z"
@@ -948,6 +959,7 @@ async def test_async_update():
948959
}
949960
},
950961
"signupTime": "2024-02-05T23:07:46.483Z",
962+
"memberCount": 1,
951963
"disabled": true,
952964
"createTime": "2024-02-05T23:07:46.483Z",
953965
"updateTime": "2024-02-05T23:07:46.483Z"
@@ -1012,6 +1024,7 @@ async def test_async_delete():
10121024
}
10131025
},
10141026
"signupTime": "2024-02-05T23:07:46.483Z",
1027+
"memberCount": 1,
10151028
"disabled": true,
10161029
"createTime": "2024-02-05T23:07:46.483Z",
10171030
"updateTime": "2024-02-05T23:07:46.483Z"
@@ -1076,6 +1089,7 @@ async def test_async_undelete():
10761089
}
10771090
},
10781091
"signupTime": "2024-02-05T23:07:46.483Z",
1092+
"memberCount": 1,
10791093
"disabled": true,
10801094
"createTime": "2024-02-05T23:07:46.483Z",
10811095
"updateTime": "2024-02-05T23:07:46.483Z"
@@ -1140,6 +1154,7 @@ async def test_async_connect():
11401154
}
11411155
},
11421156
"signupTime": "2024-02-05T23:07:46.483Z",
1157+
"memberCount": 1,
11431158
"disabled": true,
11441159
"createTime": "2024-02-05T23:07:46.483Z",
11451160
"updateTime": "2024-02-05T23:07:46.483Z"
@@ -1204,6 +1219,7 @@ async def test_async_disconnect():
12041219
}
12051220
},
12061221
"signupTime": "2024-02-05T23:07:46.483Z",
1222+
"memberCount": 1,
12071223
"disabled": true,
12081224
"createTime": "2024-02-05T23:07:46.483Z",
12091225
"updateTime": "2024-02-05T23:07:46.483Z"

tests/adminapi/test_subscriptions.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ def test_get():
197197
"anchorTime": "2024-02-05T23:07:46.483Z"
198198
},
199199
"signupTime": "2024-02-05T23:07:46.483Z",
200+
"memberCount": 1,
200201
"disabled": true,
201202
"createTime": "2024-02-05T23:07:46.483Z",
202203
"updateTime": "2024-02-05T23:07:46.483Z"
@@ -443,6 +444,7 @@ async def test_async_get():
443444
"anchorTime": "2024-02-05T23:07:46.483Z"
444445
},
445446
"signupTime": "2024-02-05T23:07:46.483Z",
447+
"memberCount": 1,
446448
"disabled": true,
447449
"createTime": "2024-02-05T23:07:46.483Z",
448450
"updateTime": "2024-02-05T23:07:46.483Z"

tests/userapi/test_flows.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ def test_create_join_organization():
4545
"email": "[email protected]",
4646
"emailVerified": true,
4747
"imageUrl": "https://example.com/test.png",
48+
"memberCount": 1,
4849
"disabled": true
4950
},
5051
"user": {
@@ -109,6 +110,7 @@ def test_create_signup():
109110
"email": "[email protected]",
110111
"emailVerified": true,
111112
"imageUrl": "https://example.com/test.png",
113+
"memberCount": 1,
112114
"disabled": true
113115
},
114116
"user": {
@@ -173,6 +175,7 @@ def test_get():
173175
"email": "[email protected]",
174176
"emailVerified": true,
175177
"imageUrl": "https://example.com/test.png",
178+
"memberCount": 1,
176179
"disabled": true
177180
},
178181
"user": {
@@ -237,6 +240,7 @@ def test_approve():
237240
"email": "[email protected]",
238241
"emailVerified": true,
239242
"imageUrl": "https://example.com/test.png",
243+
"memberCount": 1,
240244
"disabled": true
241245
},
242246
"user": {
@@ -301,6 +305,7 @@ def test_consume():
301305
"email": "[email protected]",
302306
"emailVerified": true,
303307
"imageUrl": "https://example.com/test.png",
308+
"memberCount": 1,
304309
"disabled": true
305310
},
306311
"user": {
@@ -365,6 +370,7 @@ def test_cancel():
365370
"email": "[email protected]",
366371
"emailVerified": true,
367372
"imageUrl": "https://example.com/test.png",
373+
"memberCount": 1,
368374
"disabled": true
369375
},
370376
"user": {
@@ -456,6 +462,7 @@ async def test_async_create_join_organization():
456462
"email": "[email protected]",
457463
"emailVerified": true,
458464
"imageUrl": "https://example.com/test.png",
465+
"memberCount": 1,
459466
"disabled": true
460467
},
461468
"user": {
@@ -521,6 +528,7 @@ async def test_async_create_signup():
521528
"email": "[email protected]",
522529
"emailVerified": true,
523530
"imageUrl": "https://example.com/test.png",
531+
"memberCount": 1,
524532
"disabled": true
525533
},
526534
"user": {
@@ -586,6 +594,7 @@ async def test_async_get():
586594
"email": "[email protected]",
587595
"emailVerified": true,
588596
"imageUrl": "https://example.com/test.png",
597+
"memberCount": 1,
589598
"disabled": true
590599
},
591600
"user": {
@@ -651,6 +660,7 @@ async def test_async_approve():
651660
"email": "[email protected]",
652661
"emailVerified": true,
653662
"imageUrl": "https://example.com/test.png",
663+
"memberCount": 1,
654664
"disabled": true
655665
},
656666
"user": {
@@ -716,6 +726,7 @@ async def test_async_consume():
716726
"email": "[email protected]",
717727
"emailVerified": true,
718728
"imageUrl": "https://example.com/test.png",
729+
"memberCount": 1,
719730
"disabled": true
720731
},
721732
"user": {
@@ -781,6 +792,7 @@ async def test_async_cancel():
781792
"email": "[email protected]",
782793
"emailVerified": true,
783794
"imageUrl": "https://example.com/test.png",
795+
"memberCount": 1,
784796
"disabled": true
785797
},
786798
"user": {

0 commit comments

Comments
 (0)