|
| 1 | +# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details. |
| 2 | + |
| 3 | +from __future__ import annotations |
| 4 | + |
| 5 | +from ..._compat import cached_property |
| 6 | +from ..._resource import SyncAPIResource, AsyncAPIResource |
| 7 | +from .resource_groups import ( |
| 8 | + ResourceGroupsResource, |
| 9 | + AsyncResourceGroupsResource, |
| 10 | + ResourceGroupsResourceWithRawResponse, |
| 11 | + AsyncResourceGroupsResourceWithRawResponse, |
| 12 | + ResourceGroupsResourceWithStreamingResponse, |
| 13 | + AsyncResourceGroupsResourceWithStreamingResponse, |
| 14 | +) |
| 15 | +from .permission_groups import ( |
| 16 | + PermissionGroupsResource, |
| 17 | + AsyncPermissionGroupsResource, |
| 18 | + PermissionGroupsResourceWithRawResponse, |
| 19 | + AsyncPermissionGroupsResourceWithRawResponse, |
| 20 | + PermissionGroupsResourceWithStreamingResponse, |
| 21 | + AsyncPermissionGroupsResourceWithStreamingResponse, |
| 22 | +) |
| 23 | + |
| 24 | +__all__ = ["IamResource", "AsyncIamResource"] |
| 25 | + |
| 26 | + |
| 27 | +class IamResource(SyncAPIResource): |
| 28 | + @cached_property |
| 29 | + def permission_groups(self) -> PermissionGroupsResource: |
| 30 | + return PermissionGroupsResource(self._client) |
| 31 | + |
| 32 | + @cached_property |
| 33 | + def resource_groups(self) -> ResourceGroupsResource: |
| 34 | + return ResourceGroupsResource(self._client) |
| 35 | + |
| 36 | + @cached_property |
| 37 | + def with_raw_response(self) -> IamResourceWithRawResponse: |
| 38 | + return IamResourceWithRawResponse(self) |
| 39 | + |
| 40 | + @cached_property |
| 41 | + def with_streaming_response(self) -> IamResourceWithStreamingResponse: |
| 42 | + return IamResourceWithStreamingResponse(self) |
| 43 | + |
| 44 | + |
| 45 | +class AsyncIamResource(AsyncAPIResource): |
| 46 | + @cached_property |
| 47 | + def permission_groups(self) -> AsyncPermissionGroupsResource: |
| 48 | + return AsyncPermissionGroupsResource(self._client) |
| 49 | + |
| 50 | + @cached_property |
| 51 | + def resource_groups(self) -> AsyncResourceGroupsResource: |
| 52 | + return AsyncResourceGroupsResource(self._client) |
| 53 | + |
| 54 | + @cached_property |
| 55 | + def with_raw_response(self) -> AsyncIamResourceWithRawResponse: |
| 56 | + return AsyncIamResourceWithRawResponse(self) |
| 57 | + |
| 58 | + @cached_property |
| 59 | + def with_streaming_response(self) -> AsyncIamResourceWithStreamingResponse: |
| 60 | + return AsyncIamResourceWithStreamingResponse(self) |
| 61 | + |
| 62 | + |
| 63 | +class IamResourceWithRawResponse: |
| 64 | + def __init__(self, iam: IamResource) -> None: |
| 65 | + self._iam = iam |
| 66 | + |
| 67 | + @cached_property |
| 68 | + def permission_groups(self) -> PermissionGroupsResourceWithRawResponse: |
| 69 | + return PermissionGroupsResourceWithRawResponse(self._iam.permission_groups) |
| 70 | + |
| 71 | + @cached_property |
| 72 | + def resource_groups(self) -> ResourceGroupsResourceWithRawResponse: |
| 73 | + return ResourceGroupsResourceWithRawResponse(self._iam.resource_groups) |
| 74 | + |
| 75 | + |
| 76 | +class AsyncIamResourceWithRawResponse: |
| 77 | + def __init__(self, iam: AsyncIamResource) -> None: |
| 78 | + self._iam = iam |
| 79 | + |
| 80 | + @cached_property |
| 81 | + def permission_groups(self) -> AsyncPermissionGroupsResourceWithRawResponse: |
| 82 | + return AsyncPermissionGroupsResourceWithRawResponse(self._iam.permission_groups) |
| 83 | + |
| 84 | + @cached_property |
| 85 | + def resource_groups(self) -> AsyncResourceGroupsResourceWithRawResponse: |
| 86 | + return AsyncResourceGroupsResourceWithRawResponse(self._iam.resource_groups) |
| 87 | + |
| 88 | + |
| 89 | +class IamResourceWithStreamingResponse: |
| 90 | + def __init__(self, iam: IamResource) -> None: |
| 91 | + self._iam = iam |
| 92 | + |
| 93 | + @cached_property |
| 94 | + def permission_groups(self) -> PermissionGroupsResourceWithStreamingResponse: |
| 95 | + return PermissionGroupsResourceWithStreamingResponse(self._iam.permission_groups) |
| 96 | + |
| 97 | + @cached_property |
| 98 | + def resource_groups(self) -> ResourceGroupsResourceWithStreamingResponse: |
| 99 | + return ResourceGroupsResourceWithStreamingResponse(self._iam.resource_groups) |
| 100 | + |
| 101 | + |
| 102 | +class AsyncIamResourceWithStreamingResponse: |
| 103 | + def __init__(self, iam: AsyncIamResource) -> None: |
| 104 | + self._iam = iam |
| 105 | + |
| 106 | + @cached_property |
| 107 | + def permission_groups(self) -> AsyncPermissionGroupsResourceWithStreamingResponse: |
| 108 | + return AsyncPermissionGroupsResourceWithStreamingResponse(self._iam.permission_groups) |
| 109 | + |
| 110 | + @cached_property |
| 111 | + def resource_groups(self) -> AsyncResourceGroupsResourceWithStreamingResponse: |
| 112 | + return AsyncResourceGroupsResourceWithStreamingResponse(self._iam.resource_groups) |
0 commit comments