Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): update via SDK Studio #256

Merged
merged 1 commit into from
Apr 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 8 additions & 5 deletions api.md
Original file line number Diff line number Diff line change
Expand Up @@ -4771,21 +4771,24 @@ Types:
from cloudflare.types.zero_trust.devices import (
DeviceInput,
DeviceMatch,
DevicePostureRule,
UnnamedSchemaRef34ef0ad73a63c3f76ed170adca181930,
UnnamedSchemaRef41885dd46b9e0294254c49305a273681,
UnnamedSchemaRef9e35ef84511131488ae286ce78ac4b27,
PostureCreateResponse,
PostureUpdateResponse,
PostureListResponse,
PostureDeleteResponse,
PostureGetResponse,
)
```

Methods:

- <code title="post /accounts/{account_id}/devices/posture">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/devices/posture_create_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/devices/device_posture_rule.py">Optional</a></code>
- <code title="put /accounts/{account_id}/devices/posture/{rule_id}">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">update</a>(rule_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/devices/posture_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/devices/device_posture_rule.py">Optional</a></code>
- <code title="get /accounts/{account_id}/devices/posture">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/zero_trust/devices/device_posture_rule.py">SyncSinglePage[DevicePostureRule]</a></code>
- <code title="post /accounts/{account_id}/devices/posture">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">create</a>(\*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/devices/posture_create_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/devices/posture_create_response.py">Optional</a></code>
- <code title="put /accounts/{account_id}/devices/posture/{rule_id}">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">update</a>(rule_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/devices/posture_update_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/devices/posture_update_response.py">Optional</a></code>
- <code title="get /accounts/{account_id}/devices/posture">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">list</a>(\*, account_id) -> <a href="./src/cloudflare/types/zero_trust/devices/posture_list_response.py">SyncSinglePage[PostureListResponse]</a></code>
- <code title="delete /accounts/{account_id}/devices/posture/{rule_id}">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">delete</a>(rule_id, \*, account_id, \*\*<a href="src/cloudflare/types/zero_trust/devices/posture_delete_params.py">params</a>) -> <a href="./src/cloudflare/types/zero_trust/devices/posture_delete_response.py">Optional</a></code>
- <code title="get /accounts/{account_id}/devices/posture/{rule_id}">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">get</a>(rule_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/devices/device_posture_rule.py">Optional</a></code>
- <code title="get /accounts/{account_id}/devices/posture/{rule_id}">client.zero_trust.devices.posture.<a href="./src/cloudflare/resources/zero_trust/devices/posture/posture.py">get</a>(rule_id, \*, account_id) -> <a href="./src/cloudflare/types/zero_trust/devices/posture_get_response.py">Optional</a></code>

#### Integrations

Expand Down
41 changes: 22 additions & 19 deletions src/cloudflare/resources/zero_trust/devices/posture/posture.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,11 @@
from .....types.zero_trust.devices import (
DeviceInputParam,
DeviceMatchParam,
DevicePostureRule,
PostureGetResponse,
PostureListResponse,
PostureCreateResponse,
PostureDeleteResponse,
PostureUpdateResponse,
posture_create_params,
posture_delete_params,
posture_update_params,
Expand Down Expand Up @@ -97,7 +100,7 @@ def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[DevicePostureRule]:
) -> Optional[PostureCreateResponse]:
"""
Creates a new device posture rule.

Expand Down Expand Up @@ -149,7 +152,7 @@ def create(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
cast_to=cast(Type[Optional[PostureCreateResponse]], ResultWrapper[PostureCreateResponse]),
)

def update(
Expand Down Expand Up @@ -190,7 +193,7 @@ def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[DevicePostureRule]:
) -> Optional[PostureUpdateResponse]:
"""
Updates a device posture rule.

Expand Down Expand Up @@ -246,7 +249,7 @@ def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
cast_to=cast(Type[Optional[PostureUpdateResponse]], ResultWrapper[PostureUpdateResponse]),
)

def list(
Expand All @@ -259,7 +262,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> SyncSinglePage[DevicePostureRule]:
) -> SyncSinglePage[PostureListResponse]:
"""
Fetches device posture rules for a Zero Trust account.

Expand All @@ -276,11 +279,11 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
f"/accounts/{account_id}/devices/posture",
page=SyncSinglePage[DevicePostureRule],
page=SyncSinglePage[PostureListResponse],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=DevicePostureRule,
model=PostureListResponse,
)

def delete(
Expand Down Expand Up @@ -338,7 +341,7 @@ def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[DevicePostureRule]:
) -> Optional[PostureGetResponse]:
"""
Fetches a single device posture rule.

Expand Down Expand Up @@ -366,7 +369,7 @@ def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
cast_to=cast(Type[Optional[PostureGetResponse]], ResultWrapper[PostureGetResponse]),
)


Expand Down Expand Up @@ -420,7 +423,7 @@ async def create(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[DevicePostureRule]:
) -> Optional[PostureCreateResponse]:
"""
Creates a new device posture rule.

Expand Down Expand Up @@ -472,7 +475,7 @@ async def create(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
cast_to=cast(Type[Optional[PostureCreateResponse]], ResultWrapper[PostureCreateResponse]),
)

async def update(
Expand Down Expand Up @@ -513,7 +516,7 @@ async def update(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[DevicePostureRule]:
) -> Optional[PostureUpdateResponse]:
"""
Updates a device posture rule.

Expand Down Expand Up @@ -569,7 +572,7 @@ async def update(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
cast_to=cast(Type[Optional[PostureUpdateResponse]], ResultWrapper[PostureUpdateResponse]),
)

def list(
Expand All @@ -582,7 +585,7 @@ def list(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> AsyncPaginator[DevicePostureRule, AsyncSinglePage[DevicePostureRule]]:
) -> AsyncPaginator[PostureListResponse, AsyncSinglePage[PostureListResponse]]:
"""
Fetches device posture rules for a Zero Trust account.

Expand All @@ -599,11 +602,11 @@ def list(
raise ValueError(f"Expected a non-empty value for `account_id` but received {account_id!r}")
return self._get_api_list(
f"/accounts/{account_id}/devices/posture",
page=AsyncSinglePage[DevicePostureRule],
page=AsyncSinglePage[PostureListResponse],
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
model=DevicePostureRule,
model=PostureListResponse,
)

async def delete(
Expand Down Expand Up @@ -661,7 +664,7 @@ async def get(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> Optional[DevicePostureRule]:
) -> Optional[PostureGetResponse]:
"""
Fetches a single device posture rule.

Expand Down Expand Up @@ -689,7 +692,7 @@ async def get(
timeout=timeout,
post_parser=ResultWrapper._unwrapper,
),
cast_to=cast(Type[Optional[DevicePostureRule]], ResultWrapper[DevicePostureRule]),
cast_to=cast(Type[Optional[PostureGetResponse]], ResultWrapper[PostureGetResponse]),
)


Expand Down
5 changes: 4 additions & 1 deletion src/cloudflare/types/zero_trust/devices/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,23 +13,26 @@
from .device_input_param import DeviceInputParam as DeviceInputParam
from .device_match_param import DeviceMatchParam as DeviceMatchParam
from .policy_edit_params import PolicyEditParams as PolicyEditParams
from .device_posture_rule import DevicePostureRule as DevicePostureRule
from .policy_create_params import PolicyCreateParams as PolicyCreateParams
from .policy_delete_params import PolicyDeleteParams as PolicyDeleteParams
from .posture_get_response import PostureGetResponse as PostureGetResponse
from .revoke_create_params import RevokeCreateParams as RevokeCreateParams
from .network_create_params import NetworkCreateParams as NetworkCreateParams
from .network_delete_params import NetworkDeleteParams as NetworkDeleteParams
from .network_update_params import NetworkUpdateParams as NetworkUpdateParams
from .posture_create_params import PostureCreateParams as PostureCreateParams
from .posture_delete_params import PostureDeleteParams as PostureDeleteParams
from .posture_list_response import PostureListResponse as PostureListResponse
from .posture_update_params import PostureUpdateParams as PostureUpdateParams
from .setting_update_params import SettingUpdateParams as SettingUpdateParams
from .dex_test_create_params import DEXTestCreateParams as DEXTestCreateParams
from .dex_test_update_params import DEXTestUpdateParams as DEXTestUpdateParams
from .policy_delete_response import PolicyDeleteResponse as PolicyDeleteResponse
from .unrevoke_create_params import UnrevokeCreateParams as UnrevokeCreateParams
from .network_delete_response import NetworkDeleteResponse as NetworkDeleteResponse
from .posture_create_response import PostureCreateResponse as PostureCreateResponse
from .posture_delete_response import PostureDeleteResponse as PostureDeleteResponse
from .posture_update_response import PostureUpdateResponse as PostureUpdateResponse
from .dex_test_delete_response import DEXTestDeleteResponse as DEXTestDeleteResponse
from .override_code_list_response import OverrideCodeListResponse as OverrideCodeListResponse
from .unnamed_schema_ref_34ef0ad73a63c3f76ed170adca181930 import (
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List, Optional
from typing_extensions import Literal

from ...._models import BaseModel
from .device_input import DeviceInput
from .device_match import DeviceMatch

__all__ = ["PostureCreateResponse"]


class PostureCreateResponse(BaseModel):
id: Optional[str] = None
"""API UUID."""

description: Optional[str] = None
"""The description of the device posture rule."""

expiration: Optional[str] = None
"""Sets the expiration time for a posture check result.

If empty, the result remains valid until it is overwritten by new data from the
WARP client.
"""

input: Optional[DeviceInput] = None
"""The value to be checked against."""

match: Optional[List[DeviceMatch]] = None
"""The conditions that the client must match to run the rule."""

name: Optional[str] = None
"""The name of the device posture rule."""

schedule: Optional[str] = None
"""Polling frequency for the WARP client posture check.

Default: `5m` (poll every five minutes). Minimum: `1m`.
"""

type: Optional[
Literal[
"file",
"application",
"tanium",
"gateway",
"warp",
"disk_encryption",
"sentinelone",
"carbonblack",
"firewall",
"os_version",
"domain_joined",
"client_certificate",
"unique_client_id",
"kolide",
"tanium_s2s",
"crowdstrike_s2s",
"intune",
"workspace_one",
"sentinelone_s2s",
]
] = None
"""The type of device posture rule."""
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
from .device_input import DeviceInput
from .device_match import DeviceMatch

__all__ = ["DevicePostureRule"]
__all__ = ["PostureGetResponse"]


class DevicePostureRule(BaseModel):
class PostureGetResponse(BaseModel):
id: Optional[str] = None
"""API UUID."""

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing import List, Optional
from typing_extensions import Literal

from ...._models import BaseModel
from .device_input import DeviceInput
from .device_match import DeviceMatch

__all__ = ["PostureListResponse"]


class PostureListResponse(BaseModel):
id: Optional[str] = None
"""API UUID."""

description: Optional[str] = None
"""The description of the device posture rule."""

expiration: Optional[str] = None
"""Sets the expiration time for a posture check result.

If empty, the result remains valid until it is overwritten by new data from the
WARP client.
"""

input: Optional[DeviceInput] = None
"""The value to be checked against."""

match: Optional[List[DeviceMatch]] = None
"""The conditions that the client must match to run the rule."""

name: Optional[str] = None
"""The name of the device posture rule."""

schedule: Optional[str] = None
"""Polling frequency for the WARP client posture check.

Default: `5m` (poll every five minutes). Minimum: `1m`.
"""

type: Optional[
Literal[
"file",
"application",
"tanium",
"gateway",
"warp",
"disk_encryption",
"sentinelone",
"carbonblack",
"firewall",
"os_version",
"domain_joined",
"client_certificate",
"unique_client_id",
"kolide",
"tanium_s2s",
"crowdstrike_s2s",
"intune",
"workspace_one",
"sentinelone_s2s",
]
] = None
"""The type of device posture rule."""
Loading