Skip to content

Commit dbebda3

Browse files
stainless-app[bot]stainless-bot
authored andcommitted
chore: rebuild project due to codegen change (#2174)
1 parent 9e7ca11 commit dbebda3

File tree

9 files changed

+184
-110
lines changed

9 files changed

+184
-110
lines changed

.stats.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
configured_endpoints: 1411
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-9310ae6fd17ecb7b743b6d9e34cd838d0a626af0f2a786c07c9d17085b7893ed.yml
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/cloudflare%2Fcloudflare-d6dd7ea434d79d52578f28ebdc5ddd1fbf9e68526bf0e32285f1c3725ccacb4d.yml

src/cloudflare/types/zero_trust/access_rule.py

+47-13
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from typing_extensions import TypeAlias
55

66
from .ip_rule import IPRule
7+
from ..._models import BaseModel
78
from .email_rule import EmailRule
89
from .group_rule import GroupRule
910
from .domain_rule import DomainRule
@@ -23,26 +24,59 @@
2324
from .authentication_method_rule import AuthenticationMethodRule
2425
from .any_valid_service_token_rule import AnyValidServiceTokenRule
2526

26-
__all__ = ["AccessRule"]
27+
__all__ = [
28+
"AccessRule",
29+
"AccessAuthContextRule",
30+
"AccessAuthContextRuleAuthContext",
31+
"AccessCommonNameRule",
32+
"AccessCommonNameRuleCommonName",
33+
]
34+
35+
36+
class AccessAuthContextRuleAuthContext(BaseModel):
37+
id: str
38+
"""The ID of an Authentication context."""
39+
40+
ac_id: str
41+
"""The ACID of an Authentication context."""
42+
43+
identity_provider_id: str
44+
"""The ID of your Azure identity provider."""
45+
46+
47+
class AccessAuthContextRule(BaseModel):
48+
auth_context: AccessAuthContextRuleAuthContext
49+
50+
51+
class AccessCommonNameRuleCommonName(BaseModel):
52+
common_name: str
53+
"""The common name to match."""
54+
55+
56+
class AccessCommonNameRule(BaseModel):
57+
common_name: AccessCommonNameRuleCommonName
58+
2759

2860
AccessRule: TypeAlias = Union[
29-
EmailRule,
30-
EmailListRule,
31-
DomainRule,
32-
EveryoneRule,
33-
IPRule,
34-
IPListRule,
35-
CertificateRule,
3661
GroupRule,
62+
AnyValidServiceTokenRule,
63+
AccessAuthContextRule,
64+
AuthenticationMethodRule,
3765
AzureGroupRule,
66+
CertificateRule,
67+
AccessCommonNameRule,
68+
CountryRule,
69+
AccessDevicePostureRule,
70+
DomainRule,
71+
EmailListRule,
72+
EmailRule,
73+
EveryoneRule,
74+
ExternalEvaluationRule,
3875
GitHubOrganizationRule,
3976
GSuiteGroupRule,
77+
IPListRule,
78+
IPRule,
4079
OktaGroupRule,
4180
SAMLGroupRule,
4281
ServiceTokenRule,
43-
AnyValidServiceTokenRule,
44-
ExternalEvaluationRule,
45-
CountryRule,
46-
AuthenticationMethodRule,
47-
AccessDevicePostureRule,
4882
]

src/cloudflare/types/zero_trust/access_rule_param.py

+47-14
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from __future__ import annotations
44

55
from typing import Union
6-
from typing_extensions import TypeAlias
6+
from typing_extensions import Required, TypeAlias, TypedDict
77

88
from .ip_rule_param import IPRuleParam
99
from .email_rule_param import EmailRuleParam
@@ -25,26 +25,59 @@
2525
from .authentication_method_rule_param import AuthenticationMethodRuleParam
2626
from .any_valid_service_token_rule_param import AnyValidServiceTokenRuleParam
2727

28-
__all__ = ["AccessRuleParam"]
28+
__all__ = [
29+
"AccessRuleParam",
30+
"AccessAuthContextRule",
31+
"AccessAuthContextRuleAuthContext",
32+
"AccessCommonNameRule",
33+
"AccessCommonNameRuleCommonName",
34+
]
35+
36+
37+
class AccessAuthContextRuleAuthContext(TypedDict, total=False):
38+
id: Required[str]
39+
"""The ID of an Authentication context."""
40+
41+
ac_id: Required[str]
42+
"""The ACID of an Authentication context."""
43+
44+
identity_provider_id: Required[str]
45+
"""The ID of your Azure identity provider."""
46+
47+
48+
class AccessAuthContextRule(TypedDict, total=False):
49+
auth_context: Required[AccessAuthContextRuleAuthContext]
50+
51+
52+
class AccessCommonNameRuleCommonName(TypedDict, total=False):
53+
common_name: Required[str]
54+
"""The common name to match."""
55+
56+
57+
class AccessCommonNameRule(TypedDict, total=False):
58+
common_name: Required[AccessCommonNameRuleCommonName]
59+
2960

3061
AccessRuleParam: TypeAlias = Union[
31-
EmailRuleParam,
32-
EmailListRuleParam,
33-
DomainRuleParam,
34-
EveryoneRuleParam,
35-
IPRuleParam,
36-
IPListRuleParam,
37-
CertificateRuleParam,
3862
GroupRuleParam,
63+
AnyValidServiceTokenRuleParam,
64+
AccessAuthContextRule,
65+
AuthenticationMethodRuleParam,
3966
AzureGroupRuleParam,
67+
CertificateRuleParam,
68+
AccessCommonNameRule,
69+
CountryRuleParam,
70+
AccessDevicePostureRuleParam,
71+
DomainRuleParam,
72+
EmailListRuleParam,
73+
EmailRuleParam,
74+
EveryoneRuleParam,
75+
ExternalEvaluationRuleParam,
4076
GitHubOrganizationRuleParam,
4177
GSuiteGroupRuleParam,
78+
IPListRuleParam,
79+
IPRuleParam,
4280
OktaGroupRuleParam,
4381
SAMLGroupRuleParam,
4482
ServiceTokenRuleParam,
45-
AnyValidServiceTokenRuleParam,
46-
ExternalEvaluationRuleParam,
47-
CountryRuleParam,
48-
AuthenticationMethodRuleParam,
49-
AccessDevicePostureRuleParam,
5083
]

src/cloudflare/types/zero_trust/github_organization_rule.py

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
22

3+
from typing import Optional
34

45
from pydantic import Field as FieldInfo
56

@@ -15,6 +16,9 @@ class GitHubOrganization(BaseModel):
1516
name: str
1617
"""The name of the organization."""
1718

19+
team: Optional[str] = None
20+
"""The name of the team"""
21+
1822

1923
class GitHubOrganizationRule(BaseModel):
2024
github_organization: GitHubOrganization = FieldInfo(alias="github-organization")

src/cloudflare/types/zero_trust/github_organization_rule_param.py

+3
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ class GitHubOrganization(TypedDict, total=False):
1616
name: Required[str]
1717
"""The name of the organization."""
1818

19+
team: str
20+
"""The name of the team"""
21+
1922

2023
class GitHubOrganizationRuleParam(TypedDict, total=False):
2124
github_organization: Required[Annotated[GitHubOrganization, PropertyInfo(alias="github-organization")]]

tests/api_resources/zero_trust/access/applications/test_policy_tests.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,10 @@ def test_method_create_with_all_params(self, client: Cloudflare) -> None:
3333
account_id="023e105f4ecef8ad9ca31a8372d0c353",
3434
id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
3535
decision="allow",
36-
exclude=[{"email": {"email": "[email protected]"}}],
37-
include=[{"email": {"email": "[email protected]"}}],
36+
exclude=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
37+
include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
3838
name="Allow devs",
39-
require=[{"email": {"email": "[email protected]"}}],
39+
require=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
4040
)
4141
assert_matches_type(PolicyTestCreateResponse, policy_test, path=["response"])
4242

@@ -136,10 +136,10 @@ async def test_method_create_with_all_params(self, async_client: AsyncCloudflare
136136
account_id="023e105f4ecef8ad9ca31a8372d0c353",
137137
id="f174e90a-fafe-4643-bbbc-4a0ed4fc8415",
138138
decision="allow",
139-
exclude=[{"email": {"email": "[email protected]"}}],
140-
include=[{"email": {"email": "[email protected]"}}],
139+
exclude=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
140+
include=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
141141
name="Allow devs",
142-
require=[{"email": {"email": "[email protected]"}}],
142+
require=[{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
143143
)
144144
assert_matches_type(PolicyTestCreateResponse, policy_test, path=["response"])
145145

tests/api_resources/zero_trust/access/test_applications.py

+12-12
Original file line numberDiff line numberDiff line change
@@ -984,10 +984,10 @@ def test_method_create_with_all_params_overload_9(self, client: Cloudflare) -> N
984984
policies=[
985985
{
986986
"decision": "allow",
987-
"include": [{"email": {"email": "[email protected]"}}],
987+
"include": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
988988
"name": "Allow devs",
989-
"exclude": [{"email": {"email": "[email protected]"}}],
990-
"require": [{"email": {"email": "[email protected]"}}],
989+
"exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
990+
"require": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
991991
}
992992
],
993993
)
@@ -2131,10 +2131,10 @@ def test_method_update_with_all_params_overload_9(self, client: Cloudflare) -> N
21312131
policies=[
21322132
{
21332133
"decision": "allow",
2134-
"include": [{"email": {"email": "[email protected]"}}],
2134+
"include": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
21352135
"name": "Allow devs",
2136-
"exclude": [{"email": {"email": "[email protected]"}}],
2137-
"require": [{"email": {"email": "[email protected]"}}],
2136+
"exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
2137+
"require": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
21382138
}
21392139
],
21402140
)
@@ -3453,10 +3453,10 @@ async def test_method_create_with_all_params_overload_9(self, async_client: Asyn
34533453
policies=[
34543454
{
34553455
"decision": "allow",
3456-
"include": [{"email": {"email": "[email protected]"}}],
3456+
"include": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
34573457
"name": "Allow devs",
3458-
"exclude": [{"email": {"email": "[email protected]"}}],
3459-
"require": [{"email": {"email": "[email protected]"}}],
3458+
"exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
3459+
"require": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
34603460
}
34613461
],
34623462
)
@@ -4600,10 +4600,10 @@ async def test_method_update_with_all_params_overload_9(self, async_client: Asyn
46004600
policies=[
46014601
{
46024602
"decision": "allow",
4603-
"include": [{"email": {"email": "[email protected]"}}],
4603+
"include": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
46044604
"name": "Allow devs",
4605-
"exclude": [{"email": {"email": "[email protected]"}}],
4606-
"require": [{"email": {"email": "[email protected]"}}],
4605+
"exclude": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
4606+
"require": [{"group": {"id": "aa0a4aab-672b-4bdb-bc33-a59f1130a11f"}}],
46074607
}
46084608
],
46094609
)

0 commit comments

Comments
 (0)