| 1 |
from __future__ import annotations |
| 2 |
|
| 3 |
from .issuers import ( |
| 4 |
Issuers, |
| 5 |
AsyncIssuers, |
| 6 |
IssuersWithRawResponse, |
| 7 |
AsyncIssuersWithRawResponse, |
| 8 |
IssuersWithStreamingResponse, |
| 9 |
AsyncIssuersWithStreamingResponse, |
| 10 |
) |
| 11 |
from ....._compat import cached_property |
| 12 |
from .rules.rules import ( |
| 13 |
Rules, |
| 14 |
AsyncRules, |
| 15 |
RulesWithRawResponse, |
| 16 |
AsyncRulesWithRawResponse, |
| 17 |
RulesWithStreamingResponse, |
| 18 |
AsyncRulesWithStreamingResponse, |
| 19 |
) |
| 20 |
from ....._resource import SyncAPIResource, AsyncAPIResource |
| 21 |
|
| 22 |
__all__ = ["Federation", "AsyncFederation"] |
| 23 |
|
| 24 |
|
| 25 |
class Federation(SyncAPIResource): |
| 26 |
@cached_property |
| 27 |
def issuers(self) -> Issuers: |
| 28 |
return Issuers(self._client) |
| 29 |
|
| 30 |
@cached_property |
| 31 |
def rules(self) -> Rules: |
| 32 |
return Rules(self._client) |
| 33 |
|
| 34 |
@cached_property |
| 35 |
def with_raw_response(self) -> FederationWithRawResponse: |
| 36 |
""" |
| 37 |
This property can be used as a prefix for any HTTP method call to return |
| 38 |
the raw response object instead of the parsed content. |
| 39 |
|
| 40 |
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers |
| 41 |
""" |
| 42 |
return FederationWithRawResponse(self) |
| 43 |
|
| 44 |
@cached_property |
| 45 |
def with_streaming_response(self) -> FederationWithStreamingResponse: |
| 46 |
""" |
| 47 |
An alternative to `.with_raw_response` that doesn't eagerly read the response body. |
| 48 |
|
| 49 |
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#with_streaming_response |
| 50 |
""" |
| 51 |
return FederationWithStreamingResponse(self) |
| 52 |
|
| 53 |
|
| 54 |
class AsyncFederation(AsyncAPIResource): |
| 55 |
@cached_property |
| 56 |
def issuers(self) -> AsyncIssuers: |
| 57 |
return AsyncIssuers(self._client) |
| 58 |
|
| 59 |
@cached_property |
| 60 |
def rules(self) -> AsyncRules: |
| 61 |
return AsyncRules(self._client) |
| 62 |
|
| 63 |
@cached_property |
| 64 |
def with_raw_response(self) -> AsyncFederationWithRawResponse: |
| 65 |
""" |
| 66 |
This property can be used as a prefix for any HTTP method call to return |
| 67 |
the raw response object instead of the parsed content. |
| 68 |
|
| 69 |
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers |
| 70 |
""" |
| 71 |
return AsyncFederationWithRawResponse(self) |
| 72 |
|
| 73 |
@cached_property |
| 74 |
def with_streaming_response(self) -> AsyncFederationWithStreamingResponse: |
| 75 |
""" |
| 76 |
An alternative to `.with_raw_response` that doesn't eagerly read the response body. |
| 77 |
|
| 78 |
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#with_streaming_response |
| 79 |
""" |
| 80 |
return AsyncFederationWithStreamingResponse(self) |
| 81 |
|
| 82 |
|
| 83 |
class FederationWithRawResponse: |
| 84 |
def __init__(self, federation: Federation) -> None: |
| 85 |
self._federation = federation |
| 86 |
|
| 87 |
@cached_property |
| 88 |
def issuers(self) -> IssuersWithRawResponse: |
| 89 |
return IssuersWithRawResponse(self._federation.issuers) |
| 90 |
|
| 91 |
@cached_property |
| 92 |
def rules(self) -> RulesWithRawResponse: |
| 93 |
return RulesWithRawResponse(self._federation.rules) |
| 94 |
|
| 95 |
|
| 96 |
class AsyncFederationWithRawResponse: |
| 97 |
def __init__(self, federation: AsyncFederation) -> None: |
| 98 |
self._federation = federation |
| 99 |
|
| 100 |
@cached_property |
| 101 |
def issuers(self) -> AsyncIssuersWithRawResponse: |
| 102 |
return AsyncIssuersWithRawResponse(self._federation.issuers) |
| 103 |
|
| 104 |
@cached_property |
| 105 |
def rules(self) -> AsyncRulesWithRawResponse: |
| 106 |
return AsyncRulesWithRawResponse(self._federation.rules) |
| 107 |
|
| 108 |
|
| 109 |
class FederationWithStreamingResponse: |
| 110 |
def __init__(self, federation: Federation) -> None: |
| 111 |
self._federation = federation |
| 112 |
|
| 113 |
@cached_property |
| 114 |
def issuers(self) -> IssuersWithStreamingResponse: |
| 115 |
return IssuersWithStreamingResponse(self._federation.issuers) |
| 116 |
|
| 117 |
@cached_property |
| 118 |
def rules(self) -> RulesWithStreamingResponse: |
| 119 |
return RulesWithStreamingResponse(self._federation.rules) |
| 120 |
|
| 121 |
|
| 122 |
class AsyncFederationWithStreamingResponse: |
| 123 |
def __init__(self, federation: AsyncFederation) -> None: |
| 124 |
self._federation = federation |
| 125 |
|
| 126 |
@cached_property |
| 127 |
def issuers(self) -> AsyncIssuersWithStreamingResponse: |
| 128 |
return AsyncIssuersWithStreamingResponse(self._federation.issuers) |
| 129 |
|
| 130 |
@cached_property |
| 131 |
def rules(self) -> AsyncRulesWithStreamingResponse: |
| 132 |
return AsyncRulesWithStreamingResponse(self._federation.rules) |