Skip to content

Commit 6281066

Browse files
feat(api): aggregated API specs update
1 parent 0a2f63b commit 6281066

File tree

9 files changed

+112
-113
lines changed

9 files changed

+112
-113
lines changed

.stats.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 612
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-751a4484d0fe654e54b278167d65ece7cc03a254ded11d7910878acc1c54d13f.yml
3-
openapi_spec_hash: b70c3cc1433a3ff2665b95afd8a4df81
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/gcore%2Fgcore-dafe18d92c83ef5bf5454ccc0c0d242b753f42c37f62542bfd7b614f5ad5d6f4.yml
3+
openapi_spec_hash: fbe9b7c24144bd442b1294bf2e3ee79a
44
config_hash: 11eb703eee66609eba76695b18f8cb4a

src/gcore/resources/iam/api_tokens.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from __future__ import annotations
44

5+
from typing import Optional
6+
57
import httpx
68

79
from ..._types import Body, Omit, Query, Headers, NoneType, NotGiven, omit, not_given
@@ -48,7 +50,7 @@ def create(
4850
client_id: int,
4951
*,
5052
client_user: api_token_create_params.ClientUser,
51-
exp_date: str,
53+
exp_date: Optional[str],
5254
name: str,
5355
description: str | Omit = omit,
5456
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.
@@ -269,7 +271,7 @@ async def create(
269271
client_id: int,
270272
*,
271273
client_user: api_token_create_params.ClientUser,
272-
exp_date: str,
274+
exp_date: Optional[str],
273275
name: str,
274276
description: str | Omit = omit,
275277
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs.

src/gcore/types/iam/account_overview.py

Lines changed: 24 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -410,50 +410,44 @@ class User(BaseModel):
410410

411411

412412
class AccountOverview(BaseModel):
413-
id: Optional[int] = None
413+
id: int
414414
"""The account ID."""
415415

416-
bill_type: Optional[str] = None
416+
bill_type: str
417417
"""System field. Billing type of the account."""
418418

419-
capabilities: Optional[List[Literal["CDN", "STORAGE", "STREAMING", "DNS", "DDOS", "CLOUD"]]] = None
419+
capabilities: List[Literal["CDN", "STORAGE", "STREAMING", "DNS", "DDOS", "CLOUD"]]
420420
"""System field. List of services available for the account."""
421421

422-
company_name: Optional[str] = FieldInfo(alias="companyName", default=None)
422+
company_name: str = FieldInfo(alias="companyName")
423423
"""The company name."""
424424

425-
country_code: Optional[str] = None
426-
"""System field. The company country (ISO 3166-1 alpha-2 format)."""
427-
428-
current_user: Optional[int] = FieldInfo(alias="currentUser", default=None)
425+
current_user: int = FieldInfo(alias="currentUser")
429426
"""ID of the current user."""
430427

431-
custom_id: Optional[str] = None
432-
"""The account custom ID."""
433-
434-
deleted: Optional[bool] = None
428+
deleted: bool
435429
"""The field shows the status of the account:
436430
437431
- `true` – the account has been deleted
438432
- `false` – the account is not deleted
439433
"""
440434

441-
email: Optional[str] = None
435+
email: str
442436
"""The account email."""
443437

444438
entry_base_domain: Optional[str] = FieldInfo(alias="entryBaseDomain", default=None)
445439
"""System field. Control panel domain."""
446440

447-
free_features: Optional[FreeFeatures] = FieldInfo(alias="freeFeatures", default=None)
441+
free_features: FreeFeatures = FieldInfo(alias="freeFeatures")
448442
"""
449443
An object of arrays which contains information about free features available for
450444
the requested account.
451445
"""
452446

453-
has_active_admin: Optional[bool] = None
447+
has_active_admin: bool
454448
"""System field."""
455449

456-
is_test: Optional[bool] = None
450+
is_test: bool
457451
"""System field:
458452
459453
- `true` — a test account;
@@ -463,29 +457,33 @@ class AccountOverview(BaseModel):
463457
name: Optional[str] = None
464458
"""Name of a user who registered the requested account."""
465459

466-
paid_features: Optional[PaidFeatures] = FieldInfo(alias="paidFeatures", default=None)
460+
paid_features: PaidFeatures = FieldInfo(alias="paidFeatures")
467461
"""
468462
An object of arrays which contains information about paid features available for
469463
the requested account.
470464
"""
471465

472-
phone: Optional[str] = None
473-
"""Phone of a user who registered the requested account."""
474-
475-
service_statuses: Optional[ServiceStatuses] = FieldInfo(alias="serviceStatuses", default=None)
466+
service_statuses: ServiceStatuses = FieldInfo(alias="serviceStatuses")
476467
"""
477468
An object of arrays which contains information about all services available for
478469
the requested account.
479470
"""
480471

472+
status: Literal["new", "trial", "trialend", "active", "integration", "paused", "preparation", "ready"]
473+
"""Status of the account."""
474+
475+
country_code: Optional[str] = None
476+
"""System field. The company country (ISO 3166-1 alpha-2 format)."""
477+
478+
custom_id: Optional[str] = None
479+
"""The account custom ID."""
480+
481+
phone: Optional[str] = None
482+
"""Phone of a user who registered the requested account."""
483+
481484
signup_process: Optional[Literal["sign_up_full", "sign_up_simple"]] = None
482485
"""System field. Type of the account registration process."""
483486

484-
status: Optional[Literal["new", "trial", "trialend", "active", "integration", "paused", "preparation", "ready"]] = (
485-
None
486-
)
487-
"""Status of the account."""
488-
489487
users: Optional[List[User]] = None
490488
"""List of account users."""
491489

src/gcore/types/iam/api_token.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,54 +25,54 @@ class ClientUserRole(BaseModel):
2525

2626

2727
class ClientUser(BaseModel):
28-
client_id: Optional[int] = None
28+
client_id: int
2929
"""Account's ID."""
3030

31-
deleted: Optional[bool] = None
31+
deleted: bool
3232
"""Deletion flag. If true, then the API token was deleted."""
3333

34-
role: Optional[ClientUserRole] = None
34+
role: ClientUserRole
3535

36-
user_email: Optional[str] = None
36+
user_email: str
3737
"""User's email who issued the API token."""
3838

39-
user_id: Optional[int] = None
39+
user_id: int
4040
"""User's ID who issued the API token."""
4141

42-
user_name: Optional[str] = None
42+
user_name: str
4343
"""User's name who issued the API token."""
4444

4545

4646
class APIToken(BaseModel):
47-
client_user: ClientUser
48-
49-
exp_date: str
50-
"""
51-
Date when the API token becomes expired (ISO 8086/RFC 3339 format), UTC. If
52-
null, then the API token will never expire.
53-
"""
54-
55-
name: str
56-
"""API token name."""
57-
58-
id: Optional[int] = None
47+
id: int
5948
"""API token ID."""
6049

61-
created: Optional[str] = None
50+
client_user: ClientUser
51+
52+
created: str
6253
"""Date when the API token was issued (ISO 8086/RFC 3339 format), UTC."""
6354

64-
deleted: Optional[bool] = None
55+
deleted: bool
6556
"""Deletion flag. If true, then the API token was deleted."""
6657

67-
description: Optional[str] = None
68-
"""API token description."""
58+
exp_date: Optional[str] = None
59+
"""
60+
Date when the API token becomes expired (ISO 8086/RFC 3339 format), UTC. If
61+
null, then the API token will never expire.
62+
"""
6963

70-
expired: Optional[bool] = None
64+
expired: bool
7165
"""Expiration flag.
7266
7367
If true, then the API token has expired. When an API token expires it will be
7468
automatically deleted.
7569
"""
7670

77-
last_usage: Optional[str] = None
71+
last_usage: str
7872
"""Date when the API token was last used (ISO 8086/RFC 3339 format), UTC."""
73+
74+
name: str
75+
"""API token name."""
76+
77+
description: Optional[str] = None
78+
"""API token description."""

src/gcore/types/iam/api_token_create_params.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
from __future__ import annotations
44

5+
from typing import Optional
56
from typing_extensions import Literal, Required, TypedDict
67

78
__all__ = ["APITokenCreateParams", "ClientUser", "ClientUserRole"]
@@ -11,7 +12,7 @@ class APITokenCreateParams(TypedDict, total=False):
1112
client_user: Required[ClientUser]
1213
"""API token role."""
1314

14-
exp_date: Required[str]
15+
exp_date: Required[Optional[str]]
1516
"""
1617
Date when the API token becomes expired (ISO 8086/RFC 3339 format), UTC. If
1718
null, then the API token will never expire.

src/gcore/types/iam/api_token_list.py

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -25,57 +25,57 @@ class APITokenListItemClientUserRole(BaseModel):
2525

2626

2727
class APITokenListItemClientUser(BaseModel):
28-
client_id: Optional[int] = None
28+
client_id: int
2929
"""Account's ID."""
3030

31-
deleted: Optional[bool] = None
31+
deleted: bool
3232
"""Deletion flag. If true, then the API token was deleted."""
3333

34-
role: Optional[APITokenListItemClientUserRole] = None
34+
role: APITokenListItemClientUserRole
3535

36-
user_email: Optional[str] = None
36+
user_email: str
3737
"""User's email who issued the API token."""
3838

39-
user_id: Optional[int] = None
39+
user_id: int
4040
"""User's ID who issued the API token."""
4141

42-
user_name: Optional[str] = None
42+
user_name: str
4343
"""User's name who issued the API token."""
4444

4545

4646
class APITokenListItem(BaseModel):
47-
client_user: APITokenListItemClientUser
48-
49-
exp_date: str
50-
"""
51-
Date when the API token becomes expired (ISO 8086/RFC 3339 format), UTC. If
52-
null, then the API token will never expire.
53-
"""
54-
55-
name: str
56-
"""API token name."""
57-
58-
id: Optional[int] = None
47+
id: int
5948
"""API token ID."""
6049

61-
created: Optional[str] = None
50+
client_user: APITokenListItemClientUser
51+
52+
created: str
6253
"""Date when the API token was issued (ISO 8086/RFC 3339 format), UTC."""
6354

64-
deleted: Optional[bool] = None
55+
deleted: bool
6556
"""Deletion flag. If true, then the API token was deleted."""
6657

67-
description: Optional[str] = None
68-
"""API token description."""
58+
exp_date: Optional[str] = None
59+
"""
60+
Date when the API token becomes expired (ISO 8086/RFC 3339 format), UTC. If
61+
null, then the API token will never expire.
62+
"""
6963

70-
expired: Optional[bool] = None
64+
expired: bool
7165
"""Expiration flag.
7266
7367
If true, then the API token has expired. When an API token expires it will be
7468
automatically deleted.
7569
"""
7670

77-
last_usage: Optional[str] = None
71+
last_usage: str
7872
"""Date when the API token was last used (ISO 8086/RFC 3339 format), UTC."""
7973

74+
name: str
75+
"""API token name."""
76+
77+
description: Optional[str] = None
78+
"""API token description."""
79+
8080

8181
APITokenList: TypeAlias = List[APITokenListItem]

src/gcore/types/iam/user_detailed.py

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -37,35 +37,35 @@ class Group(BaseModel):
3737

3838

3939
class UserDetailed(BaseModel):
40-
id: Optional[int] = None
40+
id: int
4141
"""User's ID."""
4242

43-
activated: Optional[bool] = None
43+
activated: bool
4444
"""Email confirmation:
4545
4646
- `true` – user confirmed the email;
4747
- `false` – user did not confirm the email.
4848
"""
4949

50-
auth_types: Optional[List[Literal["password", "sso", "github", "google-oauth2"]]] = None
50+
auth_types: List[Literal["password", "sso", "github", "google-oauth2"]]
5151
"""System field. List of auth types available for the account."""
5252

53-
client: Optional[float] = None
53+
client: float
5454
"""User's account ID."""
5555

56-
client_and_roles: Optional[List[ClientAndRole]] = None
56+
client_and_roles: List[ClientAndRole]
5757
"""List of user's clients. User can access to one or more clients."""
5858

59-
company: Optional[str] = None
59+
company: str
6060
"""User's company."""
6161

62-
deleted: Optional[bool] = None
62+
deleted: bool
6363
"""Deletion flag. If `true` then user was deleted."""
6464

65-
email: Optional[str] = None
65+
email: str
6666
"""User's email address."""
6767

68-
groups: Optional[List[Group]] = None
68+
groups: List[Group]
6969
"""User's group in the current account.
7070
7171
IAM supports 5 groups:
@@ -77,10 +77,10 @@ class UserDetailed(BaseModel):
7777
- Purge and Prefetch only (API+Web)
7878
"""
7979

80-
is_active: Optional[bool] = None
80+
is_active: bool
8181
"""User activity flag."""
8282

83-
lang: Optional[Literal["de", "en", "ru", "zh", "az"]] = None
83+
lang: Literal["de", "en", "ru", "zh", "az"]
8484
"""User's language.
8585
8686
Defines language of the control panel and email messages.
@@ -92,18 +92,18 @@ class UserDetailed(BaseModel):
9292
phone: Optional[str] = None
9393
"""User's phone."""
9494

95-
reseller: Optional[int] = None
95+
reseller: int
9696
"""Services provider ID."""
9797

98-
sso_auth: Optional[bool] = None
98+
sso_auth: bool
9999
"""SSO authentication flag. If `true` then user can login via SAML SSO."""
100100

101-
two_fa: Optional[bool] = None
101+
two_fa: bool
102102
"""Two-step verification:
103103
104104
- `true` – user enabled two-step verification;
105105
- `false` – user disabled two-step verification.
106106
"""
107107

108-
user_type: Optional[Literal["common", "reseller", "seller"]] = None
108+
user_type: Literal["common", "reseller", "seller"]
109109
"""User's type."""

0 commit comments

Comments
 (0)