# AUTO-GENERATED by scripts/oas-sync emit-resource Profile Auth. Do not edit by hand.
"""Resource wrapper for the OAS ``Profile Auth`` tag (generated)."""
from __future__ import annotations
from typing import Any, Optional
from .._base import BaseResource
from ...models._generated.profile_auth import Profile
class ProfileResource(BaseResource):
"""Resource methods for the OAS `Profile Auth` tag (generated)."""
[docs]
def create_v1(
self,
user_id: str,
) -> Optional[Profile]:
"""profile.create (v1). Premier-only."""
params: dict[str, Any] = {"method": "profile.create"}
params["user_id"] = user_id
payload = self._client._call(params, method="POST")
raw = self._client._unwrap(payload, "profile")
if raw is None:
return None
return Profile.model_validate(raw)
[docs]
def get_auth_v1(
self,
user_id: Optional[str] = None,
) -> Optional[Profile]:
"""profile.get_auth (v1). Premier-only."""
params: dict[str, Any] = {"method": "profile.get_auth"}
self._client._set_optional(
params,
[
("user_id", user_id),
],
)
payload = self._client._call(params)
raw = self._client._unwrap(payload, "profile")
if raw is None:
return None
return Profile.model_validate(raw)
[docs]
def get_v1(
self,
) -> Optional[Profile]:
"""profile.get (v1). Premier-only."""
params: dict[str, Any] = {"method": "profile.get"}
payload = self._client._call(params)
raw = self._client._unwrap(payload, "profile")
if raw is None:
return None
return Profile.model_validate(raw)
__all__ = ["ProfileResource"]