| 1 |
from __future__ import annotations |
| 2 |
|
| 3 |
from typing import Dict, List, Union, Optional |
| 4 |
from datetime import datetime |
| 5 |
from itertools import chain |
| 6 |
from typing_extensions import Literal |
| 7 |
|
| 8 |
import httpx2 |
| 9 |
|
| 10 |
from ..._types import Body, Omit, Query, Headers, NotGiven, omit, not_given |
| 11 |
from ..._utils import is_given, path_template, strip_not_given |
| 12 |
from ..._compat import cached_property |
| 13 |
from ..._resource import SyncAPIResource, AsyncAPIResource |
| 14 |
from ..._response import ( |
| 15 |
to_raw_response_wrapper, |
| 16 |
to_streamed_response_wrapper, |
| 17 |
async_to_raw_response_wrapper, |
| 18 |
async_to_streamed_response_wrapper, |
| 19 |
) |
| 20 |
from ...pagination import SyncPageCursor, AsyncPageCursor |
| 21 |
from ...types.beta import ( |
| 22 |
BetaUserProfileExternalUserDetailsParams, |
| 23 |
) |
| 24 |
from ..._base_client import AsyncPaginator, make_request_options |
| 25 |
from ...types.anthropic_beta_param import AnthropicBetaParam |
| 26 |
from ...types.beta.beta_user_profile import BetaUserProfile |
| 27 |
from ...types.beta.beta_user_profile_enrollment_url import BetaUserProfileEnrollmentURL |
| 28 |
from ...types.beta.beta_user_profile_external_user_details_params import BetaUserProfileExternalUserDetailsParams |
| 29 |
|
| 30 |
__all__ = ["UserProfiles", "AsyncUserProfiles"] |
| 31 |
|
| 32 |
|
| 33 |
class UserProfiles(SyncAPIResource): |
| 34 |
@cached_property |
| 35 |
def with_raw_response(self) -> UserProfilesWithRawResponse: |
| 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 UserProfilesWithRawResponse(self) |
| 43 |
|
| 44 |
@cached_property |
| 45 |
def with_streaming_response(self) -> UserProfilesWithStreamingResponse: |
| 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 UserProfilesWithStreamingResponse(self) |
| 52 |
|
| 53 |
def create( |
| 54 |
self, |
| 55 |
*, |
| 56 |
access_type: Literal["application", "passthrough"] | Omit = omit, |
| 57 |
external_id: Optional[str] | Omit = omit, |
| 58 |
external_user_details: BetaUserProfileExternalUserDetailsParams | Omit = omit, |
| 59 |
external_user_onboarded_at: Union[str, datetime] | Omit = omit, |
| 60 |
metadata: Dict[str, str] | Omit = omit, |
| 61 |
name: Optional[str] | Omit = omit, |
| 62 |
betas: List[AnthropicBetaParam] | Omit = omit, |
| 63 |
workspace_id: str | Omit = omit, |
| 64 |
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 65 |
# The extra values given here take precedence over values defined on the client or passed to this method. |
| 66 |
extra_headers: Headers | None = None, |
| 67 |
extra_query: Query | None = None, |
| 68 |
extra_body: Body | None = None, |
| 69 |
timeout: float | httpx2.Timeout | None | NotGiven = not_given, |
| 70 |
) -> BetaUserProfile: |
| 71 |
""" |
| 72 |
Create User Profile |
| 73 |
|
| 74 |
Args: |
| 75 |
access_type: How the platform uses the API for this entity. `application` (default): the |
| 76 |
profile represents an individual end-user of the platform's product. |
| 77 |
`passthrough`: the profile identifies a company the platform resells Claude |
| 78 |
access to. |
| 79 |
|
| 80 |
- `application` - The user profile represents an individual end-user of a |
| 81 |
product that the platform builds on the API. New profiles get this value by |
| 82 |
default. |
| 83 |
- `passthrough` - The user profile represents a company that the platform |
| 84 |
resells Claude access to. |
| 85 |
|
| 86 |
external_id: Platform's own identifier for this user. Not enforced unique. Maximum 255 |
| 87 |
characters. Accepted under the `user-profiles-2026-03-24` and |
| 88 |
`user-profiles-2026-08-18` beta headers; under `user-profiles-2026-09-04` send |
| 89 |
`external_user_details.reference_id` instead. |
| 90 |
|
| 91 |
external_user_details: Details about the entity this profile represents, as the platform states them. |
| 92 |
Every field is optional. Accepted under the `user-profiles-2026-09-04` beta |
| 93 |
header only. |
| 94 |
|
| 95 |
external_user_onboarded_at: When the entity this profile represents opened its account with the platform, in |
| 96 |
RFC 3339 format: for an `application` profile, when the end-user signed up; for |
| 97 |
a `passthrough` profile, when the company became the platform's customer. Must |
| 98 |
be a complete timestamp no more than 1 minute in the future. Optional. Accepted |
| 99 |
under the `user-profiles-2026-08-18` beta header; under |
| 100 |
`user-profiles-2026-09-04` send `external_user_details.onboarded_at` instead. |
| 101 |
|
| 102 |
metadata: Free-form key-value data to attach to this user profile. Maximum 16 keys, with |
| 103 |
keys up to 64 characters and values up to 512 characters. Values must be |
| 104 |
non-empty strings. |
| 105 |
|
| 106 |
name: Optional for all profiles. Real-world name of the entity this profile represents |
| 107 |
(company or individual); for a company the platform resells Claude access to |
| 108 |
(`access_type` `passthrough`), that company's name where known. Maximum 255 |
| 109 |
characters. |
| 110 |
|
| 111 |
betas: Optional header to specify the beta version(s) you want to use. |
| 112 |
|
| 113 |
workspace_id: Optional header to select the Workspace for this request. The value is a |
| 114 |
Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). |
| 115 |
|
| 116 |
Only needed for credentials that can act on more than one Workspace. A |
| 117 |
credential that belongs to a specific Workspace may omit it; if sent, it must |
| 118 |
match that Workspace. |
| 119 |
|
| 120 |
extra_headers: Send extra headers |
| 121 |
|
| 122 |
extra_query: Add additional query parameters to the request |
| 123 |
|
| 124 |
extra_body: Add additional JSON properties to the request |
| 125 |
|
| 126 |
timeout: Override the client-level default timeout for this request, in seconds |
| 127 |
""" |
| 128 |
extra_headers = { |
| 129 |
**strip_not_given( |
| 130 |
{ |
| 131 |
"anthropic-beta": ",".join(chain((str(e) for e in betas), ["user-profiles-2026-08-18"])) |
| 132 |
if is_given(betas) |
| 133 |
else not_given, |
| 134 |
"anthropic-workspace-id": workspace_id, |
| 135 |
} |
| 136 |
), |
| 137 |
**(extra_headers or {}), |
| 138 |
} |
| 139 |
extra_headers = {"anthropic-beta": "user-profiles-2026-08-18", **(extra_headers or {})} |
| 140 |
return self._post( |
| 141 |
"/v1/user_profiles?beta=true", |
| 142 |
body={ |
| 143 |
"access_type": access_type, |
| 144 |
"external_id": external_id, |
| 145 |
"external_user_details": external_user_details, |
| 146 |
"external_user_onboarded_at": external_user_onboarded_at, |
| 147 |
"metadata": metadata, |
| 148 |
"name": name, |
| 149 |
}, |
| 150 |
options=make_request_options( |
| 151 |
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 152 |
), |
| 153 |
cast_to=BetaUserProfile, |
| 154 |
) |
| 155 |
|
| 156 |
def retrieve( |
| 157 |
self, |
| 158 |
user_profile_id: str, |
| 159 |
*, |
| 160 |
betas: List[AnthropicBetaParam] | Omit = omit, |
| 161 |
workspace_id: str | Omit = omit, |
| 162 |
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 163 |
# The extra values given here take precedence over values defined on the client or passed to this method. |
| 164 |
extra_headers: Headers | None = None, |
| 165 |
extra_query: Query | None = None, |
| 166 |
extra_body: Body | None = None, |
| 167 |
timeout: float | httpx2.Timeout | None | NotGiven = not_given, |
| 168 |
) -> BetaUserProfile: |
| 169 |
""" |
| 170 |
Get User Profile |
| 171 |
|
| 172 |
Args: |
| 173 |
user_profile_id: The ID of the user profile to get (`uprof_...`). |
| 174 |
|
| 175 |
betas: Optional header to specify the beta version(s) you want to use. |
| 176 |
|
| 177 |
workspace_id: Optional header to select the Workspace for this request. The value is a |
| 178 |
Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). |
| 179 |
|
| 180 |
Only needed for credentials that can act on more than one Workspace. A |
| 181 |
credential that belongs to a specific Workspace may omit it; if sent, it must |
| 182 |
match that Workspace. |
| 183 |
|
| 184 |
extra_headers: Send extra headers |
| 185 |
|
| 186 |
extra_query: Add additional query parameters to the request |
| 187 |
|
| 188 |
extra_body: Add additional JSON properties to the request |
| 189 |
|
| 190 |
timeout: Override the client-level default timeout for this request, in seconds |
| 191 |
""" |
| 192 |
if not user_profile_id: |
| 193 |
raise ValueError(f"Expected a non-empty value for `user_profile_id` but received {user_profile_id!r}") |
| 194 |
extra_headers = { |
| 195 |
**strip_not_given( |
| 196 |
{ |
| 197 |
"anthropic-beta": ",".join(chain((str(e) for e in betas), ["user-profiles-2026-08-18"])) |
| 198 |
if is_given(betas) |
| 199 |
else not_given, |
| 200 |
"anthropic-workspace-id": workspace_id, |
| 201 |
} |
| 202 |
), |
| 203 |
**(extra_headers or {}), |
| 204 |
} |
| 205 |
extra_headers = {"anthropic-beta": "user-profiles-2026-08-18", **(extra_headers or {})} |
| 206 |
return self._get( |
| 207 |
path_template("/v1/user_profiles/{user_profile_id}?beta=true", user_profile_id=user_profile_id), |
| 208 |
options=make_request_options( |
| 209 |
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 210 |
), |
| 211 |
cast_to=BetaUserProfile, |
| 212 |
) |
| 213 |
|
| 214 |
def update( |
| 215 |
self, |
| 216 |
user_profile_id: str, |
| 217 |
*, |
| 218 |
access_type: Optional[Literal["application", "passthrough"]] | Omit = omit, |
| 219 |
external_id: Optional[str] | Omit = omit, |
| 220 |
external_user_details: BetaUserProfileExternalUserDetailsParams | Omit = omit, |
| 221 |
external_user_onboarded_at: Union[str, datetime] | Omit = omit, |
| 222 |
metadata: Dict[str, str] | Omit = omit, |
| 223 |
name: Optional[str] | Omit = omit, |
| 224 |
betas: List[AnthropicBetaParam] | Omit = omit, |
| 225 |
workspace_id: str | Omit = omit, |
| 226 |
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 227 |
# The extra values given here take precedence over values defined on the client or passed to this method. |
| 228 |
extra_headers: Headers | None = None, |
| 229 |
extra_query: Query | None = None, |
| 230 |
extra_body: Body | None = None, |
| 231 |
timeout: float | httpx2.Timeout | None | NotGiven = not_given, |
| 232 |
) -> BetaUserProfile: |
| 233 |
""" |
| 234 |
Update User Profile |
| 235 |
|
| 236 |
Args: |
| 237 |
user_profile_id: The ID of the user profile to update (`uprof_...`). |
| 238 |
|
| 239 |
access_type: If present, replaces the stored access type. Omit to leave unchanged. |
| 240 |
|
| 241 |
- `application` - The user profile represents an individual end-user of a |
| 242 |
product that the platform builds on the API. New profiles get this value by |
| 243 |
default. |
| 244 |
- `passthrough` - The user profile represents a company that the platform |
| 245 |
resells Claude access to. |
| 246 |
|
| 247 |
external_id: If present, replaces the stored external_id. Omit to leave unchanged. Maximum |
| 248 |
255 characters. Accepted under the `user-profiles-2026-03-24` and |
| 249 |
`user-profiles-2026-08-18` beta headers; under `user-profiles-2026-09-04` send |
| 250 |
`external_user_details.reference_id` instead. |
| 251 |
|
| 252 |
external_user_details: Details about the entity this profile represents, as the platform states them. |
| 253 |
Each field sent replaces the stored value; omit a field to leave it unchanged. |
| 254 |
Once set, a value cannot be cleared and `null` is rejected. Accepted under the |
| 255 |
`user-profiles-2026-09-04` beta header only. |
| 256 |
|
| 257 |
external_user_onboarded_at: If present, replaces the stored account creation time. Omit to leave unchanged; |
| 258 |
once set, the value cannot be cleared and `null` is rejected. Must be a complete |
| 259 |
RFC 3339 timestamp no more than 1 minute in the future. Accepted under the |
| 260 |
`user-profiles-2026-08-18` beta header; under `user-profiles-2026-09-04` send |
| 261 |
`external_user_details.onboarded_at` instead. |
| 262 |
|
| 263 |
metadata: Key-value pairs to merge into the stored metadata. Keys provided overwrite |
| 264 |
existing values. To remove a key, set its value to an empty string. Keys not |
| 265 |
provided are left unchanged. Maximum 16 keys, with keys up to 64 characters and |
| 266 |
values up to 512 characters. |
| 267 |
|
| 268 |
name: If present, replaces the stored name. Omit to leave unchanged. Maximum 255 |
| 269 |
characters. |
| 270 |
|
| 271 |
betas: Optional header to specify the beta version(s) you want to use. |
| 272 |
|
| 273 |
workspace_id: Optional header to select the Workspace for this request. The value is a |
| 274 |
Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). |
| 275 |
|
| 276 |
Only needed for credentials that can act on more than one Workspace. A |
| 277 |
credential that belongs to a specific Workspace may omit it; if sent, it must |
| 278 |
match that Workspace. |
| 279 |
|
| 280 |
extra_headers: Send extra headers |
| 281 |
|
| 282 |
extra_query: Add additional query parameters to the request |
| 283 |
|
| 284 |
extra_body: Add additional JSON properties to the request |
| 285 |
|
| 286 |
timeout: Override the client-level default timeout for this request, in seconds |
| 287 |
""" |
| 288 |
if not user_profile_id: |
| 289 |
raise ValueError(f"Expected a non-empty value for `user_profile_id` but received {user_profile_id!r}") |
| 290 |
extra_headers = { |
| 291 |
**strip_not_given( |
| 292 |
{ |
| 293 |
"anthropic-beta": ",".join(chain((str(e) for e in betas), ["user-profiles-2026-08-18"])) |
| 294 |
if is_given(betas) |
| 295 |
else not_given, |
| 296 |
"anthropic-workspace-id": workspace_id, |
| 297 |
} |
| 298 |
), |
| 299 |
**(extra_headers or {}), |
| 300 |
} |
| 301 |
extra_headers = {"anthropic-beta": "user-profiles-2026-08-18", **(extra_headers or {})} |
| 302 |
return self._post( |
| 303 |
path_template("/v1/user_profiles/{user_profile_id}?beta=true", user_profile_id=user_profile_id), |
| 304 |
body={ |
| 305 |
"access_type": access_type, |
| 306 |
"external_id": external_id, |
| 307 |
"external_user_details": external_user_details, |
| 308 |
"external_user_onboarded_at": external_user_onboarded_at, |
| 309 |
"metadata": metadata, |
| 310 |
"name": name, |
| 311 |
}, |
| 312 |
options=make_request_options( |
| 313 |
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 314 |
), |
| 315 |
cast_to=BetaUserProfile, |
| 316 |
) |
| 317 |
|
| 318 |
def list( |
| 319 |
self, |
| 320 |
*, |
| 321 |
limit: int | Omit = omit, |
| 322 |
order: Literal["asc", "desc"] | Omit = omit, |
| 323 |
order_by: Literal["created_at", "name"] | Omit = omit, |
| 324 |
page: str | Omit = omit, |
| 325 |
betas: List[AnthropicBetaParam] | Omit = omit, |
| 326 |
workspace_id: str | Omit = omit, |
| 327 |
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 328 |
# The extra values given here take precedence over values defined on the client or passed to this method. |
| 329 |
extra_headers: Headers | None = None, |
| 330 |
extra_query: Query | None = None, |
| 331 |
extra_body: Body | None = None, |
| 332 |
timeout: float | httpx2.Timeout | None | NotGiven = not_given, |
| 333 |
) -> SyncPageCursor[BetaUserProfile]: |
| 334 |
""" |
| 335 |
List User Profiles |
| 336 |
|
| 337 |
Args: |
| 338 |
limit: The maximum number of user profiles to return, from 1 to 100. Defaults to 20. |
| 339 |
|
| 340 |
order: The sort direction, applied to the field that `order_by` selects. Defaults to |
| 341 |
`desc`. |
| 342 |
|
| 343 |
- `asc` - Oldest first when `order_by` is `created_at`, or names in ascending |
| 344 |
order when `order_by` is `name`. |
| 345 |
- `desc` - Newest first when `order_by` is `created_at`, or names in descending |
| 346 |
order when `order_by` is `name`. This is the default. |
| 347 |
|
| 348 |
order_by: The field to sort user profiles by, in the direction that `order` sets. Defaults |
| 349 |
to `created_at`. |
| 350 |
|
| 351 |
- `created_at` - Sort by when each user profile was created. This is the |
| 352 |
default. |
| 353 |
- `name` - Sort by `name`, ignoring the case of ASCII letters. Profiles without |
| 354 |
a name come last in either direction. |
| 355 |
|
| 356 |
page: The cursor for the page to return, taken from `next_page` in a previous |
| 357 |
response. |
| 358 |
|
| 359 |
Leave it out to get the first page. |
| 360 |
|
| 361 |
betas: Optional header to specify the beta version(s) you want to use. |
| 362 |
|
| 363 |
workspace_id: Optional header to select the Workspace for this request. The value is a |
| 364 |
Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). |
| 365 |
|
| 366 |
Only needed for credentials that can act on more than one Workspace. A |
| 367 |
credential that belongs to a specific Workspace may omit it; if sent, it must |
| 368 |
match that Workspace. |
| 369 |
|
| 370 |
extra_headers: Send extra headers |
| 371 |
|
| 372 |
extra_query: Add additional query parameters to the request |
| 373 |
|
| 374 |
extra_body: Add additional JSON properties to the request |
| 375 |
|
| 376 |
timeout: Override the client-level default timeout for this request, in seconds |
| 377 |
""" |
| 378 |
extra_headers = { |
| 379 |
**strip_not_given( |
| 380 |
{ |
| 381 |
"anthropic-beta": ",".join(chain((str(e) for e in betas), ["user-profiles-2026-08-18"])) |
| 382 |
if is_given(betas) |
| 383 |
else not_given, |
| 384 |
"anthropic-workspace-id": workspace_id, |
| 385 |
} |
| 386 |
), |
| 387 |
**(extra_headers or {}), |
| 388 |
} |
| 389 |
extra_headers = {"anthropic-beta": "user-profiles-2026-08-18", **(extra_headers or {})} |
| 390 |
return self._get_api_list( |
| 391 |
"/v1/user_profiles?beta=true", |
| 392 |
page=SyncPageCursor[BetaUserProfile], |
| 393 |
options=make_request_options( |
| 394 |
extra_headers=extra_headers, |
| 395 |
extra_query=extra_query, |
| 396 |
extra_body=extra_body, |
| 397 |
timeout=timeout, |
| 398 |
query={ |
| 399 |
"limit": limit, |
| 400 |
"order": order, |
| 401 |
"order_by": order_by, |
| 402 |
"page": page, |
| 403 |
}, |
| 404 |
), |
| 405 |
model=BetaUserProfile, |
| 406 |
) |
| 407 |
|
| 408 |
def create_enrollment_url( |
| 409 |
self, |
| 410 |
user_profile_id: str, |
| 411 |
*, |
| 412 |
betas: List[AnthropicBetaParam] | Omit = omit, |
| 413 |
workspace_id: str | Omit = omit, |
| 414 |
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 415 |
# The extra values given here take precedence over values defined on the client or passed to this method. |
| 416 |
extra_headers: Headers | None = None, |
| 417 |
extra_query: Query | None = None, |
| 418 |
extra_body: Body | None = None, |
| 419 |
timeout: float | httpx2.Timeout | None | NotGiven = not_given, |
| 420 |
) -> BetaUserProfileEnrollmentURL: |
| 421 |
""" |
| 422 |
Create Enrollment URL |
| 423 |
|
| 424 |
Args: |
| 425 |
user_profile_id: The ID of the user profile to create an enrollment URL for (`uprof_...`). |
| 426 |
|
| 427 |
betas: Optional header to specify the beta version(s) you want to use. |
| 428 |
|
| 429 |
workspace_id: Optional header to select the Workspace for this request. The value is a |
| 430 |
Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). |
| 431 |
|
| 432 |
Only needed for credentials that can act on more than one Workspace. A |
| 433 |
credential that belongs to a specific Workspace may omit it; if sent, it must |
| 434 |
match that Workspace. |
| 435 |
|
| 436 |
extra_headers: Send extra headers |
| 437 |
|
| 438 |
extra_query: Add additional query parameters to the request |
| 439 |
|
| 440 |
extra_body: Add additional JSON properties to the request |
| 441 |
|
| 442 |
timeout: Override the client-level default timeout for this request, in seconds |
| 443 |
""" |
| 444 |
if not user_profile_id: |
| 445 |
raise ValueError(f"Expected a non-empty value for `user_profile_id` but received {user_profile_id!r}") |
| 446 |
extra_headers = { |
| 447 |
**strip_not_given( |
| 448 |
{ |
| 449 |
"anthropic-beta": ",".join(chain((str(e) for e in betas), ["user-profiles-2026-08-18"])) |
| 450 |
if is_given(betas) |
| 451 |
else not_given, |
| 452 |
"anthropic-workspace-id": workspace_id, |
| 453 |
} |
| 454 |
), |
| 455 |
**(extra_headers or {}), |
| 456 |
} |
| 457 |
extra_headers = {"anthropic-beta": "user-profiles-2026-08-18", **(extra_headers or {})} |
| 458 |
return self._post( |
| 459 |
path_template( |
| 460 |
"/v1/user_profiles/{user_profile_id}/enrollment_url?beta=true", user_profile_id=user_profile_id |
| 461 |
), |
| 462 |
options=make_request_options( |
| 463 |
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 464 |
), |
| 465 |
cast_to=BetaUserProfileEnrollmentURL, |
| 466 |
) |
| 467 |
|
| 468 |
|
| 469 |
class AsyncUserProfiles(AsyncAPIResource): |
| 470 |
@cached_property |
| 471 |
def with_raw_response(self) -> AsyncUserProfilesWithRawResponse: |
| 472 |
""" |
| 473 |
This property can be used as a prefix for any HTTP method call to return |
| 474 |
the raw response object instead of the parsed content. |
| 475 |
|
| 476 |
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#accessing-raw-response-data-eg-headers |
| 477 |
""" |
| 478 |
return AsyncUserProfilesWithRawResponse(self) |
| 479 |
|
| 480 |
@cached_property |
| 481 |
def with_streaming_response(self) -> AsyncUserProfilesWithStreamingResponse: |
| 482 |
""" |
| 483 |
An alternative to `.with_raw_response` that doesn't eagerly read the response body. |
| 484 |
|
| 485 |
For more information, see https://www.github.com/anthropics/anthropic-sdk-python#with_streaming_response |
| 486 |
""" |
| 487 |
return AsyncUserProfilesWithStreamingResponse(self) |
| 488 |
|
| 489 |
async def create( |
| 490 |
self, |
| 491 |
*, |
| 492 |
access_type: Literal["application", "passthrough"] | Omit = omit, |
| 493 |
external_id: Optional[str] | Omit = omit, |
| 494 |
external_user_details: BetaUserProfileExternalUserDetailsParams | Omit = omit, |
| 495 |
external_user_onboarded_at: Union[str, datetime] | Omit = omit, |
| 496 |
metadata: Dict[str, str] | Omit = omit, |
| 497 |
name: Optional[str] | Omit = omit, |
| 498 |
betas: List[AnthropicBetaParam] | Omit = omit, |
| 499 |
workspace_id: str | Omit = omit, |
| 500 |
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 501 |
# The extra values given here take precedence over values defined on the client or passed to this method. |
| 502 |
extra_headers: Headers | None = None, |
| 503 |
extra_query: Query | None = None, |
| 504 |
extra_body: Body | None = None, |
| 505 |
timeout: float | httpx2.Timeout | None | NotGiven = not_given, |
| 506 |
) -> BetaUserProfile: |
| 507 |
""" |
| 508 |
Create User Profile |
| 509 |
|
| 510 |
Args: |
| 511 |
access_type: How the platform uses the API for this entity. `application` (default): the |
| 512 |
profile represents an individual end-user of the platform's product. |
| 513 |
`passthrough`: the profile identifies a company the platform resells Claude |
| 514 |
access to. |
| 515 |
|
| 516 |
- `application` - The user profile represents an individual end-user of a |
| 517 |
product that the platform builds on the API. New profiles get this value by |
| 518 |
default. |
| 519 |
- `passthrough` - The user profile represents a company that the platform |
| 520 |
resells Claude access to. |
| 521 |
|
| 522 |
external_id: Platform's own identifier for this user. Not enforced unique. Maximum 255 |
| 523 |
characters. Accepted under the `user-profiles-2026-03-24` and |
| 524 |
`user-profiles-2026-08-18` beta headers; under `user-profiles-2026-09-04` send |
| 525 |
`external_user_details.reference_id` instead. |
| 526 |
|
| 527 |
external_user_details: Details about the entity this profile represents, as the platform states them. |
| 528 |
Every field is optional. Accepted under the `user-profiles-2026-09-04` beta |
| 529 |
header only. |
| 530 |
|
| 531 |
external_user_onboarded_at: When the entity this profile represents opened its account with the platform, in |
| 532 |
RFC 3339 format: for an `application` profile, when the end-user signed up; for |
| 533 |
a `passthrough` profile, when the company became the platform's customer. Must |
| 534 |
be a complete timestamp no more than 1 minute in the future. Optional. Accepted |
| 535 |
under the `user-profiles-2026-08-18` beta header; under |
| 536 |
`user-profiles-2026-09-04` send `external_user_details.onboarded_at` instead. |
| 537 |
|
| 538 |
metadata: Free-form key-value data to attach to this user profile. Maximum 16 keys, with |
| 539 |
keys up to 64 characters and values up to 512 characters. Values must be |
| 540 |
non-empty strings. |
| 541 |
|
| 542 |
name: Optional for all profiles. Real-world name of the entity this profile represents |
| 543 |
(company or individual); for a company the platform resells Claude access to |
| 544 |
(`access_type` `passthrough`), that company's name where known. Maximum 255 |
| 545 |
characters. |
| 546 |
|
| 547 |
betas: Optional header to specify the beta version(s) you want to use. |
| 548 |
|
| 549 |
workspace_id: Optional header to select the Workspace for this request. The value is a |
| 550 |
Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). |
| 551 |
|
| 552 |
Only needed for credentials that can act on more than one Workspace. A |
| 553 |
credential that belongs to a specific Workspace may omit it; if sent, it must |
| 554 |
match that Workspace. |
| 555 |
|
| 556 |
extra_headers: Send extra headers |
| 557 |
|
| 558 |
extra_query: Add additional query parameters to the request |
| 559 |
|
| 560 |
extra_body: Add additional JSON properties to the request |
| 561 |
|
| 562 |
timeout: Override the client-level default timeout for this request, in seconds |
| 563 |
""" |
| 564 |
extra_headers = { |
| 565 |
**strip_not_given( |
| 566 |
{ |
| 567 |
"anthropic-beta": ",".join(chain((str(e) for e in betas), ["user-profiles-2026-08-18"])) |
| 568 |
if is_given(betas) |
| 569 |
else not_given, |
| 570 |
"anthropic-workspace-id": workspace_id, |
| 571 |
} |
| 572 |
), |
| 573 |
**(extra_headers or {}), |
| 574 |
} |
| 575 |
extra_headers = {"anthropic-beta": "user-profiles-2026-08-18", **(extra_headers or {})} |
| 576 |
return await self._post( |
| 577 |
"/v1/user_profiles?beta=true", |
| 578 |
body={ |
| 579 |
"access_type": access_type, |
| 580 |
"external_id": external_id, |
| 581 |
"external_user_details": external_user_details, |
| 582 |
"external_user_onboarded_at": external_user_onboarded_at, |
| 583 |
"metadata": metadata, |
| 584 |
"name": name, |
| 585 |
}, |
| 586 |
options=make_request_options( |
| 587 |
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 588 |
), |
| 589 |
cast_to=BetaUserProfile, |
| 590 |
) |
| 591 |
|
| 592 |
async def retrieve( |
| 593 |
self, |
| 594 |
user_profile_id: str, |
| 595 |
*, |
| 596 |
betas: List[AnthropicBetaParam] | Omit = omit, |
| 597 |
workspace_id: str | Omit = omit, |
| 598 |
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 599 |
# The extra values given here take precedence over values defined on the client or passed to this method. |
| 600 |
extra_headers: Headers | None = None, |
| 601 |
extra_query: Query | None = None, |
| 602 |
extra_body: Body | None = None, |
| 603 |
timeout: float | httpx2.Timeout | None | NotGiven = not_given, |
| 604 |
) -> BetaUserProfile: |
| 605 |
""" |
| 606 |
Get User Profile |
| 607 |
|
| 608 |
Args: |
| 609 |
user_profile_id: The ID of the user profile to get (`uprof_...`). |
| 610 |
|
| 611 |
betas: Optional header to specify the beta version(s) you want to use. |
| 612 |
|
| 613 |
workspace_id: Optional header to select the Workspace for this request. The value is a |
| 614 |
Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). |
| 615 |
|
| 616 |
Only needed for credentials that can act on more than one Workspace. A |
| 617 |
credential that belongs to a specific Workspace may omit it; if sent, it must |
| 618 |
match that Workspace. |
| 619 |
|
| 620 |
extra_headers: Send extra headers |
| 621 |
|
| 622 |
extra_query: Add additional query parameters to the request |
| 623 |
|
| 624 |
extra_body: Add additional JSON properties to the request |
| 625 |
|
| 626 |
timeout: Override the client-level default timeout for this request, in seconds |
| 627 |
""" |
| 628 |
if not user_profile_id: |
| 629 |
raise ValueError(f"Expected a non-empty value for `user_profile_id` but received {user_profile_id!r}") |
| 630 |
extra_headers = { |
| 631 |
**strip_not_given( |
| 632 |
{ |
| 633 |
"anthropic-beta": ",".join(chain((str(e) for e in betas), ["user-profiles-2026-08-18"])) |
| 634 |
if is_given(betas) |
| 635 |
else not_given, |
| 636 |
"anthropic-workspace-id": workspace_id, |
| 637 |
} |
| 638 |
), |
| 639 |
**(extra_headers or {}), |
| 640 |
} |
| 641 |
extra_headers = {"anthropic-beta": "user-profiles-2026-08-18", **(extra_headers or {})} |
| 642 |
return await self._get( |
| 643 |
path_template("/v1/user_profiles/{user_profile_id}?beta=true", user_profile_id=user_profile_id), |
| 644 |
options=make_request_options( |
| 645 |
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 646 |
), |
| 647 |
cast_to=BetaUserProfile, |
| 648 |
) |
| 649 |
|
| 650 |
async def update( |
| 651 |
self, |
| 652 |
user_profile_id: str, |
| 653 |
*, |
| 654 |
access_type: Optional[Literal["application", "passthrough"]] | Omit = omit, |
| 655 |
external_id: Optional[str] | Omit = omit, |
| 656 |
external_user_details: BetaUserProfileExternalUserDetailsParams | Omit = omit, |
| 657 |
external_user_onboarded_at: Union[str, datetime] | Omit = omit, |
| 658 |
metadata: Dict[str, str] | Omit = omit, |
| 659 |
name: Optional[str] | Omit = omit, |
| 660 |
betas: List[AnthropicBetaParam] | Omit = omit, |
| 661 |
workspace_id: str | Omit = omit, |
| 662 |
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 663 |
# The extra values given here take precedence over values defined on the client or passed to this method. |
| 664 |
extra_headers: Headers | None = None, |
| 665 |
extra_query: Query | None = None, |
| 666 |
extra_body: Body | None = None, |
| 667 |
timeout: float | httpx2.Timeout | None | NotGiven = not_given, |
| 668 |
) -> BetaUserProfile: |
| 669 |
""" |
| 670 |
Update User Profile |
| 671 |
|
| 672 |
Args: |
| 673 |
user_profile_id: The ID of the user profile to update (`uprof_...`). |
| 674 |
|
| 675 |
access_type: If present, replaces the stored access type. Omit to leave unchanged. |
| 676 |
|
| 677 |
- `application` - The user profile represents an individual end-user of a |
| 678 |
product that the platform builds on the API. New profiles get this value by |
| 679 |
default. |
| 680 |
- `passthrough` - The user profile represents a company that the platform |
| 681 |
resells Claude access to. |
| 682 |
|
| 683 |
external_id: If present, replaces the stored external_id. Omit to leave unchanged. Maximum |
| 684 |
255 characters. Accepted under the `user-profiles-2026-03-24` and |
| 685 |
`user-profiles-2026-08-18` beta headers; under `user-profiles-2026-09-04` send |
| 686 |
`external_user_details.reference_id` instead. |
| 687 |
|
| 688 |
external_user_details: Details about the entity this profile represents, as the platform states them. |
| 689 |
Each field sent replaces the stored value; omit a field to leave it unchanged. |
| 690 |
Once set, a value cannot be cleared and `null` is rejected. Accepted under the |
| 691 |
`user-profiles-2026-09-04` beta header only. |
| 692 |
|
| 693 |
external_user_onboarded_at: If present, replaces the stored account creation time. Omit to leave unchanged; |
| 694 |
once set, the value cannot be cleared and `null` is rejected. Must be a complete |
| 695 |
RFC 3339 timestamp no more than 1 minute in the future. Accepted under the |
| 696 |
`user-profiles-2026-08-18` beta header; under `user-profiles-2026-09-04` send |
| 697 |
`external_user_details.onboarded_at` instead. |
| 698 |
|
| 699 |
metadata: Key-value pairs to merge into the stored metadata. Keys provided overwrite |
| 700 |
existing values. To remove a key, set its value to an empty string. Keys not |
| 701 |
provided are left unchanged. Maximum 16 keys, with keys up to 64 characters and |
| 702 |
values up to 512 characters. |
| 703 |
|
| 704 |
name: If present, replaces the stored name. Omit to leave unchanged. Maximum 255 |
| 705 |
characters. |
| 706 |
|
| 707 |
betas: Optional header to specify the beta version(s) you want to use. |
| 708 |
|
| 709 |
workspace_id: Optional header to select the Workspace for this request. The value is a |
| 710 |
Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). |
| 711 |
|
| 712 |
Only needed for credentials that can act on more than one Workspace. A |
| 713 |
credential that belongs to a specific Workspace may omit it; if sent, it must |
| 714 |
match that Workspace. |
| 715 |
|
| 716 |
extra_headers: Send extra headers |
| 717 |
|
| 718 |
extra_query: Add additional query parameters to the request |
| 719 |
|
| 720 |
extra_body: Add additional JSON properties to the request |
| 721 |
|
| 722 |
timeout: Override the client-level default timeout for this request, in seconds |
| 723 |
""" |
| 724 |
if not user_profile_id: |
| 725 |
raise ValueError(f"Expected a non-empty value for `user_profile_id` but received {user_profile_id!r}") |
| 726 |
extra_headers = { |
| 727 |
**strip_not_given( |
| 728 |
{ |
| 729 |
"anthropic-beta": ",".join(chain((str(e) for e in betas), ["user-profiles-2026-08-18"])) |
| 730 |
if is_given(betas) |
| 731 |
else not_given, |
| 732 |
"anthropic-workspace-id": workspace_id, |
| 733 |
} |
| 734 |
), |
| 735 |
**(extra_headers or {}), |
| 736 |
} |
| 737 |
extra_headers = {"anthropic-beta": "user-profiles-2026-08-18", **(extra_headers or {})} |
| 738 |
return await self._post( |
| 739 |
path_template("/v1/user_profiles/{user_profile_id}?beta=true", user_profile_id=user_profile_id), |
| 740 |
body={ |
| 741 |
"access_type": access_type, |
| 742 |
"external_id": external_id, |
| 743 |
"external_user_details": external_user_details, |
| 744 |
"external_user_onboarded_at": external_user_onboarded_at, |
| 745 |
"metadata": metadata, |
| 746 |
"name": name, |
| 747 |
}, |
| 748 |
options=make_request_options( |
| 749 |
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 750 |
), |
| 751 |
cast_to=BetaUserProfile, |
| 752 |
) |
| 753 |
|
| 754 |
def list( |
| 755 |
self, |
| 756 |
*, |
| 757 |
limit: int | Omit = omit, |
| 758 |
order: Literal["asc", "desc"] | Omit = omit, |
| 759 |
order_by: Literal["created_at", "name"] | Omit = omit, |
| 760 |
page: str | Omit = omit, |
| 761 |
betas: List[AnthropicBetaParam] | Omit = omit, |
| 762 |
workspace_id: str | Omit = omit, |
| 763 |
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 764 |
# The extra values given here take precedence over values defined on the client or passed to this method. |
| 765 |
extra_headers: Headers | None = None, |
| 766 |
extra_query: Query | None = None, |
| 767 |
extra_body: Body | None = None, |
| 768 |
timeout: float | httpx2.Timeout | None | NotGiven = not_given, |
| 769 |
) -> AsyncPaginator[BetaUserProfile, AsyncPageCursor[BetaUserProfile]]: |
| 770 |
""" |
| 771 |
List User Profiles |
| 772 |
|
| 773 |
Args: |
| 774 |
limit: The maximum number of user profiles to return, from 1 to 100. Defaults to 20. |
| 775 |
|
| 776 |
order: The sort direction, applied to the field that `order_by` selects. Defaults to |
| 777 |
`desc`. |
| 778 |
|
| 779 |
- `asc` - Oldest first when `order_by` is `created_at`, or names in ascending |
| 780 |
order when `order_by` is `name`. |
| 781 |
- `desc` - Newest first when `order_by` is `created_at`, or names in descending |
| 782 |
order when `order_by` is `name`. This is the default. |
| 783 |
|
| 784 |
order_by: The field to sort user profiles by, in the direction that `order` sets. Defaults |
| 785 |
to `created_at`. |
| 786 |
|
| 787 |
- `created_at` - Sort by when each user profile was created. This is the |
| 788 |
default. |
| 789 |
- `name` - Sort by `name`, ignoring the case of ASCII letters. Profiles without |
| 790 |
a name come last in either direction. |
| 791 |
|
| 792 |
page: The cursor for the page to return, taken from `next_page` in a previous |
| 793 |
response. |
| 794 |
|
| 795 |
Leave it out to get the first page. |
| 796 |
|
| 797 |
betas: Optional header to specify the beta version(s) you want to use. |
| 798 |
|
| 799 |
workspace_id: Optional header to select the Workspace for this request. The value is a |
| 800 |
Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). |
| 801 |
|
| 802 |
Only needed for credentials that can act on more than one Workspace. A |
| 803 |
credential that belongs to a specific Workspace may omit it; if sent, it must |
| 804 |
match that Workspace. |
| 805 |
|
| 806 |
extra_headers: Send extra headers |
| 807 |
|
| 808 |
extra_query: Add additional query parameters to the request |
| 809 |
|
| 810 |
extra_body: Add additional JSON properties to the request |
| 811 |
|
| 812 |
timeout: Override the client-level default timeout for this request, in seconds |
| 813 |
""" |
| 814 |
extra_headers = { |
| 815 |
**strip_not_given( |
| 816 |
{ |
| 817 |
"anthropic-beta": ",".join(chain((str(e) for e in betas), ["user-profiles-2026-08-18"])) |
| 818 |
if is_given(betas) |
| 819 |
else not_given, |
| 820 |
"anthropic-workspace-id": workspace_id, |
| 821 |
} |
| 822 |
), |
| 823 |
**(extra_headers or {}), |
| 824 |
} |
| 825 |
extra_headers = {"anthropic-beta": "user-profiles-2026-08-18", **(extra_headers or {})} |
| 826 |
return self._get_api_list( |
| 827 |
"/v1/user_profiles?beta=true", |
| 828 |
page=AsyncPageCursor[BetaUserProfile], |
| 829 |
options=make_request_options( |
| 830 |
extra_headers=extra_headers, |
| 831 |
extra_query=extra_query, |
| 832 |
extra_body=extra_body, |
| 833 |
timeout=timeout, |
| 834 |
query={ |
| 835 |
"limit": limit, |
| 836 |
"order": order, |
| 837 |
"order_by": order_by, |
| 838 |
"page": page, |
| 839 |
}, |
| 840 |
), |
| 841 |
model=BetaUserProfile, |
| 842 |
) |
| 843 |
|
| 844 |
async def create_enrollment_url( |
| 845 |
self, |
| 846 |
user_profile_id: str, |
| 847 |
*, |
| 848 |
betas: List[AnthropicBetaParam] | Omit = omit, |
| 849 |
workspace_id: str | Omit = omit, |
| 850 |
# Use the following arguments if you need to pass additional parameters to the API that aren't available via kwargs. |
| 851 |
# The extra values given here take precedence over values defined on the client or passed to this method. |
| 852 |
extra_headers: Headers | None = None, |
| 853 |
extra_query: Query | None = None, |
| 854 |
extra_body: Body | None = None, |
| 855 |
timeout: float | httpx2.Timeout | None | NotGiven = not_given, |
| 856 |
) -> BetaUserProfileEnrollmentURL: |
| 857 |
""" |
| 858 |
Create Enrollment URL |
| 859 |
|
| 860 |
Args: |
| 861 |
user_profile_id: The ID of the user profile to create an enrollment URL for (`uprof_...`). |
| 862 |
|
| 863 |
betas: Optional header to specify the beta version(s) you want to use. |
| 864 |
|
| 865 |
workspace_id: Optional header to select the Workspace for this request. The value is a |
| 866 |
Workspace ID (for example, `wrkspc_011CZkZaBF1tNoB5wlCeusgy`). |
| 867 |
|
| 868 |
Only needed for credentials that can act on more than one Workspace. A |
| 869 |
credential that belongs to a specific Workspace may omit it; if sent, it must |
| 870 |
match that Workspace. |
| 871 |
|
| 872 |
extra_headers: Send extra headers |
| 873 |
|
| 874 |
extra_query: Add additional query parameters to the request |
| 875 |
|
| 876 |
extra_body: Add additional JSON properties to the request |
| 877 |
|
| 878 |
timeout: Override the client-level default timeout for this request, in seconds |
| 879 |
""" |
| 880 |
if not user_profile_id: |
| 881 |
raise ValueError(f"Expected a non-empty value for `user_profile_id` but received {user_profile_id!r}") |
| 882 |
extra_headers = { |
| 883 |
**strip_not_given( |
| 884 |
{ |
| 885 |
"anthropic-beta": ",".join(chain((str(e) for e in betas), ["user-profiles-2026-08-18"])) |
| 886 |
if is_given(betas) |
| 887 |
else not_given, |
| 888 |
"anthropic-workspace-id": workspace_id, |
| 889 |
} |
| 890 |
), |
| 891 |
**(extra_headers or {}), |
| 892 |
} |
| 893 |
extra_headers = {"anthropic-beta": "user-profiles-2026-08-18", **(extra_headers or {})} |
| 894 |
return await self._post( |
| 895 |
path_template( |
| 896 |
"/v1/user_profiles/{user_profile_id}/enrollment_url?beta=true", user_profile_id=user_profile_id |
| 897 |
), |
| 898 |
options=make_request_options( |
| 899 |
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout |
| 900 |
), |
| 901 |
cast_to=BetaUserProfileEnrollmentURL, |
| 902 |
) |
| 903 |
|
| 904 |
|
| 905 |
class UserProfilesWithRawResponse: |
| 906 |
def __init__(self, user_profiles: UserProfiles) -> None: |
| 907 |
self._user_profiles = user_profiles |
| 908 |
|
| 909 |
self.create = to_raw_response_wrapper( |
| 910 |
user_profiles.create, |
| 911 |
) |
| 912 |
self.retrieve = to_raw_response_wrapper( |
| 913 |
user_profiles.retrieve, |
| 914 |
) |
| 915 |
self.update = to_raw_response_wrapper( |
| 916 |
user_profiles.update, |
| 917 |
) |
| 918 |
self.list = to_raw_response_wrapper( |
| 919 |
user_profiles.list, |
| 920 |
) |
| 921 |
self.create_enrollment_url = to_raw_response_wrapper( |
| 922 |
user_profiles.create_enrollment_url, |
| 923 |
) |
| 924 |
|
| 925 |
|
| 926 |
class AsyncUserProfilesWithRawResponse: |
| 927 |
def __init__(self, user_profiles: AsyncUserProfiles) -> None: |
| 928 |
self._user_profiles = user_profiles |
| 929 |
|
| 930 |
self.create = async_to_raw_response_wrapper( |
| 931 |
user_profiles.create, |
| 932 |
) |
| 933 |
self.retrieve = async_to_raw_response_wrapper( |
| 934 |
user_profiles.retrieve, |
| 935 |
) |
| 936 |
self.update = async_to_raw_response_wrapper( |
| 937 |
user_profiles.update, |
| 938 |
) |
| 939 |
self.list = async_to_raw_response_wrapper( |
| 940 |
user_profiles.list, |
| 941 |
) |
| 942 |
self.create_enrollment_url = async_to_raw_response_wrapper( |
| 943 |
user_profiles.create_enrollment_url, |
| 944 |
) |
| 945 |
|
| 946 |
|
| 947 |
class UserProfilesWithStreamingResponse: |
| 948 |
def __init__(self, user_profiles: UserProfiles) -> None: |
| 949 |
self._user_profiles = user_profiles |
| 950 |
|
| 951 |
self.create = to_streamed_response_wrapper( |
| 952 |
user_profiles.create, |
| 953 |
) |
| 954 |
self.retrieve = to_streamed_response_wrapper( |
| 955 |
user_profiles.retrieve, |
| 956 |
) |
| 957 |
self.update = to_streamed_response_wrapper( |
| 958 |
user_profiles.update, |
| 959 |
) |
| 960 |
self.list = to_streamed_response_wrapper( |
| 961 |
user_profiles.list, |
| 962 |
) |
| 963 |
self.create_enrollment_url = to_streamed_response_wrapper( |
| 964 |
user_profiles.create_enrollment_url, |
| 965 |
) |
| 966 |
|
| 967 |
|
| 968 |
class AsyncUserProfilesWithStreamingResponse: |
| 969 |
def __init__(self, user_profiles: AsyncUserProfiles) -> None: |
| 970 |
self._user_profiles = user_profiles |
| 971 |
|
| 972 |
self.create = async_to_streamed_response_wrapper( |
| 973 |
user_profiles.create, |
| 974 |
) |
| 975 |
self.retrieve = async_to_streamed_response_wrapper( |
| 976 |
user_profiles.retrieve, |
| 977 |
) |
| 978 |
self.update = async_to_streamed_response_wrapper( |
| 979 |
user_profiles.update, |
| 980 |
) |
| 981 |
self.list = async_to_streamed_response_wrapper( |
| 982 |
user_profiles.list, |
| 983 |
) |
| 984 |
self.create_enrollment_url = async_to_streamed_response_wrapper( |
| 985 |
user_profiles.create_enrollment_url, |
| 986 |
) |