mirror of
https://github.com/hanzoai/python-sdk.git
synced 2026-10-23 20:23:00 +00:00
client: regenerate from hanzo-inc/cloud@e71c02bf66 (8.5.754)
Co-authored-by: Hanzo Dev <[email protected]>
This commit is contained in:
@@ -278,7 +278,6 @@ pkg/hanzoai/cloud/models/ai_model_providers.py
|
||||
pkg/hanzoai/cloud/models/ai_models.py
|
||||
pkg/hanzoai/cloud/models/ai_panel_judge.py
|
||||
pkg/hanzoai/cloud/models/ai_paused.py
|
||||
pkg/hanzoai/cloud/models/ai_per_million.py
|
||||
pkg/hanzoai/cloud/models/ai_price.py
|
||||
pkg/hanzoai/cloud/models/ai_provider_usage.py
|
||||
pkg/hanzoai/cloud/models/ai_provider_usage_model_spend.py
|
||||
@@ -2477,8 +2476,6 @@ pkg/hanzoai/cloud/models/pref_prefs_view.py
|
||||
pkg/hanzoai/cloud/models/pricing_card.py
|
||||
pkg/hanzoai/cloud/models/pricing_component.py
|
||||
pkg/hanzoai/cloud/models/pricing_enablement_board.py
|
||||
pkg/hanzoai/cloud/models/pricing_enso_out.py
|
||||
pkg/hanzoai/cloud/models/pricing_price.py
|
||||
pkg/hanzoai/cloud/models/pricing_pricing_health.py
|
||||
pkg/hanzoai/cloud/models/pricing_pricing_model_list.py
|
||||
pkg/hanzoai/cloud/models/pricing_pricing_plan_list.py
|
||||
@@ -2487,10 +2484,7 @@ pkg/hanzoai/cloud/models/pricing_pricing_provider_list.py
|
||||
pkg/hanzoai/cloud/models/pricing_pricing_region_list.py
|
||||
pkg/hanzoai/cloud/models/pricing_pricing_tier_list.py
|
||||
pkg/hanzoai/cloud/models/pricing_pricing_tool_list.py
|
||||
pkg/hanzoai/cloud/models/pricing_quote.py
|
||||
pkg/hanzoai/cloud/models/pricing_rate.py
|
||||
pkg/hanzoai/cloud/models/pricing_rate_arm.py
|
||||
pkg/hanzoai/cloud/models/pricing_rate_window.py
|
||||
pkg/hanzoai/cloud/models/pricing_speed.py
|
||||
pkg/hanzoai/cloud/models/pricing_user_enablement_item.py
|
||||
pkg/hanzoai/cloud/models/principal_agent_brief.py
|
||||
|
||||
+2
-2
@@ -1,4 +1,4 @@
|
||||
ref=86dcaea8092b3597a6325b7abd6df0b820978160
|
||||
sha256=8886c3c7b7f8e5feee00b09a36241a3a283fc43a24ccdb1264dc44606115f901
|
||||
ref=e71c02bf66be10a72a72c64f95e47e69be9d859b
|
||||
sha256=63404c2aaddc0ecbbc659e9be7b08c807cb728671a1cb394bb020f9470a6d2fa
|
||||
repo=hanzo-inc/cloud
|
||||
path=openapi.yaml
|
||||
|
||||
@@ -300,7 +300,6 @@ __all__ = [
|
||||
"AiModels",
|
||||
"AiPanelJudge",
|
||||
"AiPaused",
|
||||
"AiPerMillion",
|
||||
"AiPrice",
|
||||
"AiProviderUsage",
|
||||
"AiProviderUsageModelSpend",
|
||||
@@ -2499,8 +2498,6 @@ __all__ = [
|
||||
"PricingCard",
|
||||
"PricingComponent",
|
||||
"PricingEnablementBoard",
|
||||
"PricingEnsoOut",
|
||||
"PricingPrice",
|
||||
"PricingPricingHealth",
|
||||
"PricingPricingModelList",
|
||||
"PricingPricingPlanList",
|
||||
@@ -2509,10 +2506,7 @@ __all__ = [
|
||||
"PricingPricingRegionList",
|
||||
"PricingPricingTierList",
|
||||
"PricingPricingToolList",
|
||||
"PricingQuote",
|
||||
"PricingRate",
|
||||
"PricingRateArm",
|
||||
"PricingRateWindow",
|
||||
"PricingSpeed",
|
||||
"PricingUserEnablementItem",
|
||||
"PrincipalAgentBrief",
|
||||
@@ -3471,7 +3465,6 @@ from hanzoai.cloud.models.ai_model_providers import AiModelProviders as AiModelP
|
||||
from hanzoai.cloud.models.ai_models import AiModels as AiModels
|
||||
from hanzoai.cloud.models.ai_panel_judge import AiPanelJudge as AiPanelJudge
|
||||
from hanzoai.cloud.models.ai_paused import AiPaused as AiPaused
|
||||
from hanzoai.cloud.models.ai_per_million import AiPerMillion as AiPerMillion
|
||||
from hanzoai.cloud.models.ai_price import AiPrice as AiPrice
|
||||
from hanzoai.cloud.models.ai_provider_usage import AiProviderUsage as AiProviderUsage
|
||||
from hanzoai.cloud.models.ai_provider_usage_model_spend import AiProviderUsageModelSpend as AiProviderUsageModelSpend
|
||||
@@ -5670,8 +5663,6 @@ from hanzoai.cloud.models.pref_prefs_view import PrefPrefsView as PrefPrefsView
|
||||
from hanzoai.cloud.models.pricing_card import PricingCard as PricingCard
|
||||
from hanzoai.cloud.models.pricing_component import PricingComponent as PricingComponent
|
||||
from hanzoai.cloud.models.pricing_enablement_board import PricingEnablementBoard as PricingEnablementBoard
|
||||
from hanzoai.cloud.models.pricing_enso_out import PricingEnsoOut as PricingEnsoOut
|
||||
from hanzoai.cloud.models.pricing_price import PricingPrice as PricingPrice
|
||||
from hanzoai.cloud.models.pricing_pricing_health import PricingPricingHealth as PricingPricingHealth
|
||||
from hanzoai.cloud.models.pricing_pricing_model_list import PricingPricingModelList as PricingPricingModelList
|
||||
from hanzoai.cloud.models.pricing_pricing_plan_list import PricingPricingPlanList as PricingPricingPlanList
|
||||
@@ -5680,10 +5671,7 @@ from hanzoai.cloud.models.pricing_pricing_provider_list import PricingPricingPro
|
||||
from hanzoai.cloud.models.pricing_pricing_region_list import PricingPricingRegionList as PricingPricingRegionList
|
||||
from hanzoai.cloud.models.pricing_pricing_tier_list import PricingPricingTierList as PricingPricingTierList
|
||||
from hanzoai.cloud.models.pricing_pricing_tool_list import PricingPricingToolList as PricingPricingToolList
|
||||
from hanzoai.cloud.models.pricing_quote import PricingQuote as PricingQuote
|
||||
from hanzoai.cloud.models.pricing_rate import PricingRate as PricingRate
|
||||
from hanzoai.cloud.models.pricing_rate_arm import PricingRateArm as PricingRateArm
|
||||
from hanzoai.cloud.models.pricing_rate_window import PricingRateWindow as PricingRateWindow
|
||||
from hanzoai.cloud.models.pricing_speed import PricingSpeed as PricingSpeed
|
||||
from hanzoai.cloud.models.pricing_user_enablement_item import PricingUserEnablementItem as PricingUserEnablementItem
|
||||
from hanzoai.cloud.models.principal_agent_brief import PrincipalAgentBrief as PrincipalAgentBrief
|
||||
|
||||
@@ -48,6 +48,7 @@ from hanzoai.cloud.models.marketing_summary import MarketingSummary
|
||||
from hanzoai.cloud.models.marketing_suppression import MarketingSuppression
|
||||
from hanzoai.cloud.models.marketing_suppression_list import MarketingSuppressionList
|
||||
from hanzoai.cloud.models.marketing_unsubscribed import MarketingUnsubscribed
|
||||
from hanzoai.cloud.models.problem_details import ProblemDetails
|
||||
|
||||
from hanzoai.cloud.api_client import ApiClient, RequestSerialized
|
||||
from hanzoai.cloud.api_response import ApiResponse
|
||||
@@ -86,7 +87,7 @@ class MarketingApi:
|
||||
) -> None:
|
||||
"""Removes one of the caller org's audiences and answers 204.
|
||||
|
||||
Removes one of the caller org's audiences and answers 204. It deletes the saved filter only — no customer, event or enrollment is touched.
|
||||
Removes one of the caller org's audiences and answers 204. It deletes the saved filter only — no customer, event or enrollment is touched. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param id: ID is the audience id from the path, as returned by create. (required)
|
||||
:type id: str
|
||||
@@ -153,7 +154,7 @@ class MarketingApi:
|
||||
) -> ApiResponse[None]:
|
||||
"""Removes one of the caller org's audiences and answers 204.
|
||||
|
||||
Removes one of the caller org's audiences and answers 204. It deletes the saved filter only — no customer, event or enrollment is touched.
|
||||
Removes one of the caller org's audiences and answers 204. It deletes the saved filter only — no customer, event or enrollment is touched. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param id: ID is the audience id from the path, as returned by create. (required)
|
||||
:type id: str
|
||||
@@ -220,7 +221,7 @@ class MarketingApi:
|
||||
) -> RESTResponseType:
|
||||
"""Removes one of the caller org's audiences and answers 204.
|
||||
|
||||
Removes one of the caller org's audiences and answers 204. It deletes the saved filter only — no customer, event or enrollment is touched.
|
||||
Removes one of the caller org's audiences and answers 204. It deletes the saved filter only — no customer, event or enrollment is touched. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param id: ID is the audience id from the path, as returned by create. (required)
|
||||
:type id: str
|
||||
@@ -872,7 +873,7 @@ class MarketingApi:
|
||||
) -> None:
|
||||
"""Re-subscribes an address on one channel and answers 204.
|
||||
|
||||
Re-subscribes an address on one channel and answers 204. An address that is not on the list reads as not found.
|
||||
Re-subscribes an address on one channel and answers 204. An address that is not on the list reads as not found. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param channel: Channel is the surface opted out of: email, sms, social, meta, google or tiktok. Empty means email. Opting out of one leaves the others reachable.
|
||||
:type channel: str
|
||||
@@ -951,7 +952,7 @@ class MarketingApi:
|
||||
) -> ApiResponse[None]:
|
||||
"""Re-subscribes an address on one channel and answers 204.
|
||||
|
||||
Re-subscribes an address on one channel and answers 204. An address that is not on the list reads as not found.
|
||||
Re-subscribes an address on one channel and answers 204. An address that is not on the list reads as not found. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param channel: Channel is the surface opted out of: email, sms, social, meta, google or tiktok. Empty means email. Opting out of one leaves the others reachable.
|
||||
:type channel: str
|
||||
@@ -1030,7 +1031,7 @@ class MarketingApi:
|
||||
) -> RESTResponseType:
|
||||
"""Re-subscribes an address on one channel and answers 204.
|
||||
|
||||
Re-subscribes an address on one channel and answers 204. An address that is not on the list reads as not found.
|
||||
Re-subscribes an address on one channel and answers 204. An address that is not on the list reads as not found. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param channel: Channel is the surface opted out of: email, sms, social, meta, google or tiktok. Empty means email. Opting out of one leaves the others reachable.
|
||||
:type channel: str
|
||||
@@ -3038,6 +3039,283 @@ class MarketingApi:
|
||||
|
||||
|
||||
|
||||
@validate_call
|
||||
def get_marketing_click(
|
||||
self,
|
||||
user_agent: Annotated[Optional[StrictStr], Field(description="Agent is the clicker's User-Agent header. Only its family (chrome, safari, automated, …) is kept.")] = None,
|
||||
t: Annotated[Optional[StrictStr], Field(description="T is the click token the send minted for this link and this recipient: base64url, signed under the deployment's KMS key marketing/click-hmac. It is the request's only authority.")] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> ProblemDetails:
|
||||
"""Follows a tracked email link.
|
||||
|
||||
Follows a tracked email link. It is public — the person clicking has no session — and the token is its only authority: a token that verifies, for a sequence of one of Hanzo's own orgs that still exists, answers 302 to the destination it signs and records one click (time and user-agent family; no IP address), off the request path so the redirect never waits on storage. A token that is missing, altered, signed under another key, older than a year, or for any other org or a deleted sequence answers 302 to the brand's home page (https://hanzo.ai/ on Hanzo's deployment). The location is only ever a destination a token signs or that page, never a URL the request names.
|
||||
|
||||
:param user_agent: Agent is the clicker's User-Agent header. Only its family (chrome, safari, automated, …) is kept.
|
||||
:type user_agent: str
|
||||
:param t: T is the click token the send minted for this link and this recipient: base64url, signed under the deployment's KMS key marketing/click-hmac. It is the request's only authority.
|
||||
:type t: str
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._get_marketing_click_serialize(
|
||||
user_agent=user_agent,
|
||||
t=t,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'302': None,
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
def get_marketing_click_with_http_info(
|
||||
self,
|
||||
user_agent: Annotated[Optional[StrictStr], Field(description="Agent is the clicker's User-Agent header. Only its family (chrome, safari, automated, …) is kept.")] = None,
|
||||
t: Annotated[Optional[StrictStr], Field(description="T is the click token the send minted for this link and this recipient: base64url, signed under the deployment's KMS key marketing/click-hmac. It is the request's only authority.")] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> ApiResponse[ProblemDetails]:
|
||||
"""Follows a tracked email link.
|
||||
|
||||
Follows a tracked email link. It is public — the person clicking has no session — and the token is its only authority: a token that verifies, for a sequence of one of Hanzo's own orgs that still exists, answers 302 to the destination it signs and records one click (time and user-agent family; no IP address), off the request path so the redirect never waits on storage. A token that is missing, altered, signed under another key, older than a year, or for any other org or a deleted sequence answers 302 to the brand's home page (https://hanzo.ai/ on Hanzo's deployment). The location is only ever a destination a token signs or that page, never a URL the request names.
|
||||
|
||||
:param user_agent: Agent is the clicker's User-Agent header. Only its family (chrome, safari, automated, …) is kept.
|
||||
:type user_agent: str
|
||||
:param t: T is the click token the send minted for this link and this recipient: base64url, signed under the deployment's KMS key marketing/click-hmac. It is the request's only authority.
|
||||
:type t: str
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._get_marketing_click_serialize(
|
||||
user_agent=user_agent,
|
||||
t=t,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'302': None,
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
def get_marketing_click_without_preload_content(
|
||||
self,
|
||||
user_agent: Annotated[Optional[StrictStr], Field(description="Agent is the clicker's User-Agent header. Only its family (chrome, safari, automated, …) is kept.")] = None,
|
||||
t: Annotated[Optional[StrictStr], Field(description="T is the click token the send minted for this link and this recipient: base64url, signed under the deployment's KMS key marketing/click-hmac. It is the request's only authority.")] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> RESTResponseType:
|
||||
"""Follows a tracked email link.
|
||||
|
||||
Follows a tracked email link. It is public — the person clicking has no session — and the token is its only authority: a token that verifies, for a sequence of one of Hanzo's own orgs that still exists, answers 302 to the destination it signs and records one click (time and user-agent family; no IP address), off the request path so the redirect never waits on storage. A token that is missing, altered, signed under another key, older than a year, or for any other org or a deleted sequence answers 302 to the brand's home page (https://hanzo.ai/ on Hanzo's deployment). The location is only ever a destination a token signs or that page, never a URL the request names.
|
||||
|
||||
:param user_agent: Agent is the clicker's User-Agent header. Only its family (chrome, safari, automated, …) is kept.
|
||||
:type user_agent: str
|
||||
:param t: T is the click token the send minted for this link and this recipient: base64url, signed under the deployment's KMS key marketing/click-hmac. It is the request's only authority.
|
||||
:type t: str
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._get_marketing_click_serialize(
|
||||
user_agent=user_agent,
|
||||
t=t,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'302': None,
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _get_marketing_click_serialize(
|
||||
self,
|
||||
user_agent,
|
||||
t,
|
||||
_request_auth,
|
||||
_content_type,
|
||||
_headers,
|
||||
_host_index,
|
||||
) -> RequestSerialized:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
# process the query parameters
|
||||
if t is not None:
|
||||
|
||||
_query_params.append(('t', t))
|
||||
|
||||
# process the header parameters
|
||||
if user_agent is not None:
|
||||
_header_params['User-Agent'] = user_agent
|
||||
# process the form parameters
|
||||
# process the body parameter
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
if 'Accept' not in _header_params:
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
[
|
||||
'application/problem+json'
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = [
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method='GET',
|
||||
resource_path='/v1/marketing/click',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
body=_body_params,
|
||||
post_params=_form_params,
|
||||
files=_files,
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@validate_call
|
||||
def get_marketing_promos(
|
||||
self,
|
||||
@@ -5715,7 +5993,6 @@ class MarketingApi:
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = [
|
||||
'bearer'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
@@ -5755,7 +6032,7 @@ class MarketingApi:
|
||||
) -> MarketingAudience:
|
||||
"""Saves a cohort filter for the caller's org.
|
||||
|
||||
Saves a cohort filter for the caller's org. Name is required. Omitting event saves the WHOLE-ORG audience — every mailable customer — which needs no analytics warehouse; naming one narrows that roster to the customers who fired it within windowDays.
|
||||
Saves a cohort filter for the caller's org. Name is required. Omitting event saves the WHOLE-ORG audience — every mailable customer — which needs no analytics warehouse; naming one narrows that roster to the customers who fired it within windowDays. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param marketing_audience: (required)
|
||||
:type marketing_audience: MarketingAudience
|
||||
@@ -5822,7 +6099,7 @@ class MarketingApi:
|
||||
) -> ApiResponse[MarketingAudience]:
|
||||
"""Saves a cohort filter for the caller's org.
|
||||
|
||||
Saves a cohort filter for the caller's org. Name is required. Omitting event saves the WHOLE-ORG audience — every mailable customer — which needs no analytics warehouse; naming one narrows that roster to the customers who fired it within windowDays.
|
||||
Saves a cohort filter for the caller's org. Name is required. Omitting event saves the WHOLE-ORG audience — every mailable customer — which needs no analytics warehouse; naming one narrows that roster to the customers who fired it within windowDays. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param marketing_audience: (required)
|
||||
:type marketing_audience: MarketingAudience
|
||||
@@ -5889,7 +6166,7 @@ class MarketingApi:
|
||||
) -> RESTResponseType:
|
||||
"""Saves a cohort filter for the caller's org.
|
||||
|
||||
Saves a cohort filter for the caller's org. Name is required. Omitting event saves the WHOLE-ORG audience — every mailable customer — which needs no analytics warehouse; naming one narrows that roster to the customers who fired it within windowDays.
|
||||
Saves a cohort filter for the caller's org. Name is required. Omitting event saves the WHOLE-ORG audience — every mailable customer — which needs no analytics warehouse; naming one narrows that roster to the customers who fired it within windowDays. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param marketing_audience: (required)
|
||||
:type marketing_audience: MarketingAudience
|
||||
@@ -7435,7 +7712,7 @@ class MarketingApi:
|
||||
) -> MarketingSequence:
|
||||
"""Registers a drip sequence in the caller's org.
|
||||
|
||||
Registers a drip sequence in the caller's org. Name is required; status defaults to draft, and a sequence must be ACTIVE before it will accept enrollments. The id, createdAt and updatedAt of the input are ignored — the server assigns them.
|
||||
Registers a drip sequence in the caller's org. Name is required; status defaults to draft, and a sequence must be ACTIVE before it will accept enrollments. The id, createdAt and updatedAt of the input are ignored — the server assigns them. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param marketing_sequence: (required)
|
||||
:type marketing_sequence: MarketingSequence
|
||||
@@ -7502,7 +7779,7 @@ class MarketingApi:
|
||||
) -> ApiResponse[MarketingSequence]:
|
||||
"""Registers a drip sequence in the caller's org.
|
||||
|
||||
Registers a drip sequence in the caller's org. Name is required; status defaults to draft, and a sequence must be ACTIVE before it will accept enrollments. The id, createdAt and updatedAt of the input are ignored — the server assigns them.
|
||||
Registers a drip sequence in the caller's org. Name is required; status defaults to draft, and a sequence must be ACTIVE before it will accept enrollments. The id, createdAt and updatedAt of the input are ignored — the server assigns them. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param marketing_sequence: (required)
|
||||
:type marketing_sequence: MarketingSequence
|
||||
@@ -7569,7 +7846,7 @@ class MarketingApi:
|
||||
) -> RESTResponseType:
|
||||
"""Registers a drip sequence in the caller's org.
|
||||
|
||||
Registers a drip sequence in the caller's org. Name is required; status defaults to draft, and a sequence must be ACTIVE before it will accept enrollments. The id, createdAt and updatedAt of the input are ignored — the server assigns them.
|
||||
Registers a drip sequence in the caller's org. Name is required; status defaults to draft, and a sequence must be ACTIVE before it will accept enrollments. The id, createdAt and updatedAt of the input are ignored — the server assigns them. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param marketing_sequence: (required)
|
||||
:type marketing_sequence: MarketingSequence
|
||||
@@ -7711,7 +7988,7 @@ class MarketingApi:
|
||||
) -> MarketingEnrollResult:
|
||||
"""Adds one contact or a whole audience to a sequence and schedules the first step for each.
|
||||
|
||||
Adds one contact or a whole audience to a sequence and schedules the first step for each. The sequence must be ACTIVE (a draft sends nothing), and the request must name exactly one of address or audienceId. Enrolling is ALL this does: the message itself is sent later by the drip engine, through the suppression gate, so an opted-out customer can be enrolled here and still never be mailed. Re-posting is safe — an address this sequence already took is counted in alreadyEnrolled and never double-dripped — which is what makes retrying a partially-applied announcement a resume rather than a second send.
|
||||
Adds one contact or a whole audience to a sequence and schedules the first step for each. The sequence must be ACTIVE (a draft sends nothing), and the request must name exactly one of address or audienceId. Enrolling is ALL this does: the message itself is sent later by the drip engine, through the suppression gate, so an opted-out customer can be enrolled here and still never be mailed. Re-posting is safe — an address this sequence already took is counted in alreadyEnrolled and never double-dripped — which is what makes retrying a partially-applied announcement a resume rather than a second send. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param id: ID is the sequence id from the path. (required)
|
||||
:type id: str
|
||||
@@ -7782,7 +8059,7 @@ class MarketingApi:
|
||||
) -> ApiResponse[MarketingEnrollResult]:
|
||||
"""Adds one contact or a whole audience to a sequence and schedules the first step for each.
|
||||
|
||||
Adds one contact or a whole audience to a sequence and schedules the first step for each. The sequence must be ACTIVE (a draft sends nothing), and the request must name exactly one of address or audienceId. Enrolling is ALL this does: the message itself is sent later by the drip engine, through the suppression gate, so an opted-out customer can be enrolled here and still never be mailed. Re-posting is safe — an address this sequence already took is counted in alreadyEnrolled and never double-dripped — which is what makes retrying a partially-applied announcement a resume rather than a second send.
|
||||
Adds one contact or a whole audience to a sequence and schedules the first step for each. The sequence must be ACTIVE (a draft sends nothing), and the request must name exactly one of address or audienceId. Enrolling is ALL this does: the message itself is sent later by the drip engine, through the suppression gate, so an opted-out customer can be enrolled here and still never be mailed. Re-posting is safe — an address this sequence already took is counted in alreadyEnrolled and never double-dripped — which is what makes retrying a partially-applied announcement a resume rather than a second send. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param id: ID is the sequence id from the path. (required)
|
||||
:type id: str
|
||||
@@ -7853,7 +8130,7 @@ class MarketingApi:
|
||||
) -> RESTResponseType:
|
||||
"""Adds one contact or a whole audience to a sequence and schedules the first step for each.
|
||||
|
||||
Adds one contact or a whole audience to a sequence and schedules the first step for each. The sequence must be ACTIVE (a draft sends nothing), and the request must name exactly one of address or audienceId. Enrolling is ALL this does: the message itself is sent later by the drip engine, through the suppression gate, so an opted-out customer can be enrolled here and still never be mailed. Re-posting is safe — an address this sequence already took is counted in alreadyEnrolled and never double-dripped — which is what makes retrying a partially-applied announcement a resume rather than a second send.
|
||||
Adds one contact or a whole audience to a sequence and schedules the first step for each. The sequence must be ACTIVE (a draft sends nothing), and the request must name exactly one of address or audienceId. Enrolling is ALL this does: the message itself is sent later by the drip engine, through the suppression gate, so an opted-out customer can be enrolled here and still never be mailed. Re-posting is safe — an address this sequence already took is counted in alreadyEnrolled and never double-dripped — which is what makes retrying a partially-applied announcement a resume rather than a second send. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param id: ID is the sequence id from the path. (required)
|
||||
:type id: str
|
||||
@@ -8001,7 +8278,7 @@ class MarketingApi:
|
||||
) -> None:
|
||||
"""Stops one walk mid-sequence and answers 204: no further step is sent, and steps already delivered are not recalled.
|
||||
|
||||
Stops one walk mid-sequence and answers 204: no further step is sent, and steps already delivered are not recalled. Only an ACTIVE enrollment can be canceled — one already completed or canceled reads as not found.
|
||||
Stops one walk mid-sequence and answers 204: no further step is sent, and steps already delivered are not recalled. Only an ACTIVE enrollment can be canceled — one already completed or canceled reads as not found. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param id: ID is the sequence id from the path. (required)
|
||||
:type id: str
|
||||
@@ -8072,7 +8349,7 @@ class MarketingApi:
|
||||
) -> ApiResponse[None]:
|
||||
"""Stops one walk mid-sequence and answers 204: no further step is sent, and steps already delivered are not recalled.
|
||||
|
||||
Stops one walk mid-sequence and answers 204: no further step is sent, and steps already delivered are not recalled. Only an ACTIVE enrollment can be canceled — one already completed or canceled reads as not found.
|
||||
Stops one walk mid-sequence and answers 204: no further step is sent, and steps already delivered are not recalled. Only an ACTIVE enrollment can be canceled — one already completed or canceled reads as not found. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param id: ID is the sequence id from the path. (required)
|
||||
:type id: str
|
||||
@@ -8143,7 +8420,7 @@ class MarketingApi:
|
||||
) -> RESTResponseType:
|
||||
"""Stops one walk mid-sequence and answers 204: no further step is sent, and steps already delivered are not recalled.
|
||||
|
||||
Stops one walk mid-sequence and answers 204: no further step is sent, and steps already delivered are not recalled. Only an ACTIVE enrollment can be canceled — one already completed or canceled reads as not found.
|
||||
Stops one walk mid-sequence and answers 204: no further step is sent, and steps already delivered are not recalled. Only an ACTIVE enrollment can be canceled — one already completed or canceled reads as not found. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param id: ID is the sequence id from the path. (required)
|
||||
:type id: str
|
||||
@@ -8277,7 +8554,7 @@ class MarketingApi:
|
||||
) -> MarketingSequenceStatus:
|
||||
"""Flips draft/active/archived — the activation gate for sending, since only an active sequence accepts enrollments.
|
||||
|
||||
Flips draft/active/archived — the activation gate for sending, since only an active sequence accepts enrollments. It does not touch enrollments already walking: archiving stops new ones, not in-flight ones.
|
||||
Flips draft/active/archived — the activation gate for sending, since only an active sequence accepts enrollments. It does not touch enrollments already walking: archiving stops new ones, not in-flight ones. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param id: ID is the sequence id from the path. (required)
|
||||
:type id: str
|
||||
@@ -8348,7 +8625,7 @@ class MarketingApi:
|
||||
) -> ApiResponse[MarketingSequenceStatus]:
|
||||
"""Flips draft/active/archived — the activation gate for sending, since only an active sequence accepts enrollments.
|
||||
|
||||
Flips draft/active/archived — the activation gate for sending, since only an active sequence accepts enrollments. It does not touch enrollments already walking: archiving stops new ones, not in-flight ones.
|
||||
Flips draft/active/archived — the activation gate for sending, since only an active sequence accepts enrollments. It does not touch enrollments already walking: archiving stops new ones, not in-flight ones. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param id: ID is the sequence id from the path. (required)
|
||||
:type id: str
|
||||
@@ -8419,7 +8696,7 @@ class MarketingApi:
|
||||
) -> RESTResponseType:
|
||||
"""Flips draft/active/archived — the activation gate for sending, since only an active sequence accepts enrollments.
|
||||
|
||||
Flips draft/active/archived — the activation gate for sending, since only an active sequence accepts enrollments. It does not touch enrollments already walking: archiving stops new ones, not in-flight ones.
|
||||
Flips draft/active/archived — the activation gate for sending, since only an active sequence accepts enrollments. It does not touch enrollments already walking: archiving stops new ones, not in-flight ones. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param id: ID is the sequence id from the path. (required)
|
||||
:type id: str
|
||||
@@ -8567,7 +8844,7 @@ class MarketingApi:
|
||||
) -> MarketingStep:
|
||||
"""Appends a message to the END of a sequence: the new step's idx is one past the last, so steps arrive in the order they are added.
|
||||
|
||||
Appends a message to the END of a sequence: the new step's idx is one past the last, so steps arrive in the order they are added. Body is required and delaySeconds must be >= 0. Adding a step does not disturb enrollments already walking — one that has passed this index simply never sees it.
|
||||
Appends a message to the END of a sequence: the new step's idx is one past the last, so steps arrive in the order they are added. Body is required and delaySeconds must be >= 0. Adding a step does not disturb enrollments already walking — one that has passed this index simply never sees it. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param id: SequenceID is the sequence id from the path (the route's :id). (required)
|
||||
:type id: str
|
||||
@@ -8638,7 +8915,7 @@ class MarketingApi:
|
||||
) -> ApiResponse[MarketingStep]:
|
||||
"""Appends a message to the END of a sequence: the new step's idx is one past the last, so steps arrive in the order they are added.
|
||||
|
||||
Appends a message to the END of a sequence: the new step's idx is one past the last, so steps arrive in the order they are added. Body is required and delaySeconds must be >= 0. Adding a step does not disturb enrollments already walking — one that has passed this index simply never sees it.
|
||||
Appends a message to the END of a sequence: the new step's idx is one past the last, so steps arrive in the order they are added. Body is required and delaySeconds must be >= 0. Adding a step does not disturb enrollments already walking — one that has passed this index simply never sees it. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param id: SequenceID is the sequence id from the path (the route's :id). (required)
|
||||
:type id: str
|
||||
@@ -8709,7 +8986,7 @@ class MarketingApi:
|
||||
) -> RESTResponseType:
|
||||
"""Appends a message to the END of a sequence: the new step's idx is one past the last, so steps arrive in the order they are added.
|
||||
|
||||
Appends a message to the END of a sequence: the new step's idx is one past the last, so steps arrive in the order they are added. Body is required and delaySeconds must be >= 0. Adding a step does not disturb enrollments already walking — one that has passed this index simply never sees it.
|
||||
Appends a message to the END of a sequence: the new step's idx is one past the last, so steps arrive in the order they are added. Body is required and delaySeconds must be >= 0. Adding a step does not disturb enrollments already walking — one that has passed this index simply never sees it. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param id: SequenceID is the sequence id from the path (the route's :id). (required)
|
||||
:type id: str
|
||||
@@ -8856,7 +9133,7 @@ class MarketingApi:
|
||||
) -> MarketingSuppression:
|
||||
"""Records an opt-out for the org (admin / self-service management).
|
||||
|
||||
Records an opt-out for the org (admin / self-service management). Address is required; channel defaults to email. It is idempotent: re-suppressing the same tuple keeps the original record rather than erroring. From here on the ONE send gate refuses that recipient on that channel.
|
||||
Records an opt-out for the org (admin / self-service management). Address is required; channel defaults to email. It is idempotent: re-suppressing the same tuple keeps the original record rather than erroring. From here on the ONE send gate refuses that recipient on that channel. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param marketing_suppression: (required)
|
||||
:type marketing_suppression: MarketingSuppression
|
||||
@@ -8923,7 +9200,7 @@ class MarketingApi:
|
||||
) -> ApiResponse[MarketingSuppression]:
|
||||
"""Records an opt-out for the org (admin / self-service management).
|
||||
|
||||
Records an opt-out for the org (admin / self-service management). Address is required; channel defaults to email. It is idempotent: re-suppressing the same tuple keeps the original record rather than erroring. From here on the ONE send gate refuses that recipient on that channel.
|
||||
Records an opt-out for the org (admin / self-service management). Address is required; channel defaults to email. It is idempotent: re-suppressing the same tuple keeps the original record rather than erroring. From here on the ONE send gate refuses that recipient on that channel. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param marketing_suppression: (required)
|
||||
:type marketing_suppression: MarketingSuppression
|
||||
@@ -8990,7 +9267,7 @@ class MarketingApi:
|
||||
) -> RESTResponseType:
|
||||
"""Records an opt-out for the org (admin / self-service management).
|
||||
|
||||
Records an opt-out for the org (admin / self-service management). Address is required; channel defaults to email. It is idempotent: re-suppressing the same tuple keeps the original record rather than erroring. From here on the ONE send gate refuses that recipient on that channel.
|
||||
Records an opt-out for the org (admin / self-service management). Address is required; channel defaults to email. It is idempotent: re-suppressing the same tuple keeps the original record rather than erroring. From here on the ONE send gate refuses that recipient on that channel. Org admin or SuperAdmin only; a member of the org is refused.
|
||||
|
||||
:param marketing_suppression: (required)
|
||||
:type marketing_suppression: MarketingSuppression
|
||||
@@ -9112,6 +9389,350 @@ class MarketingApi:
|
||||
|
||||
|
||||
|
||||
@validate_call
|
||||
def post_marketing_unsubscribe(
|
||||
self,
|
||||
org: Annotated[Optional[StrictStr], Field(description="Org is the org the link was minted for.")] = None,
|
||||
channel: Annotated[Optional[StrictStr], Field(description="Channel is the surface to opt out of.")] = None,
|
||||
address: Annotated[Optional[StrictStr], Field(description="Address is the recipient to opt out.")] = None,
|
||||
token: Annotated[Optional[StrictStr], Field(description="Token is the HMAC over (org, channel, address), the only authority here.")] = None,
|
||||
list_unsubscribe: Annotated[Optional[StrictStr], Field(description="OneClick is the form's List-Unsubscribe field, \\\"One-Click\\\" from a mail client. The token decides; this field only names the form.")] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> MarketingUnsubscribed:
|
||||
"""Is the one-click unsubscribe a mail client sends from the List-Unsubscribe header (RFC 8058): the same signed link the footer carries, POSTed with the form body List-Unsubscribe=One-Click.
|
||||
|
||||
Is the one-click unsubscribe a mail client sends from the List-Unsubscribe header (RFC 8058): the same signed link the footer carries, POSTed with the form body List-Unsubscribe=One-Click. It opts out exactly what a click on the link does, under the same token check, and is as public.
|
||||
|
||||
:param org: Org is the org the link was minted for.
|
||||
:type org: str
|
||||
:param channel: Channel is the surface to opt out of.
|
||||
:type channel: str
|
||||
:param address: Address is the recipient to opt out.
|
||||
:type address: str
|
||||
:param token: Token is the HMAC over (org, channel, address), the only authority here.
|
||||
:type token: str
|
||||
:param list_unsubscribe: OneClick is the form's List-Unsubscribe field, \\\"One-Click\\\" from a mail client. The token decides; this field only names the form.
|
||||
:type list_unsubscribe: str
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._post_marketing_unsubscribe_serialize(
|
||||
org=org,
|
||||
channel=channel,
|
||||
address=address,
|
||||
token=token,
|
||||
list_unsubscribe=list_unsubscribe,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "MarketingUnsubscribed",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
def post_marketing_unsubscribe_with_http_info(
|
||||
self,
|
||||
org: Annotated[Optional[StrictStr], Field(description="Org is the org the link was minted for.")] = None,
|
||||
channel: Annotated[Optional[StrictStr], Field(description="Channel is the surface to opt out of.")] = None,
|
||||
address: Annotated[Optional[StrictStr], Field(description="Address is the recipient to opt out.")] = None,
|
||||
token: Annotated[Optional[StrictStr], Field(description="Token is the HMAC over (org, channel, address), the only authority here.")] = None,
|
||||
list_unsubscribe: Annotated[Optional[StrictStr], Field(description="OneClick is the form's List-Unsubscribe field, \\\"One-Click\\\" from a mail client. The token decides; this field only names the form.")] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> ApiResponse[MarketingUnsubscribed]:
|
||||
"""Is the one-click unsubscribe a mail client sends from the List-Unsubscribe header (RFC 8058): the same signed link the footer carries, POSTed with the form body List-Unsubscribe=One-Click.
|
||||
|
||||
Is the one-click unsubscribe a mail client sends from the List-Unsubscribe header (RFC 8058): the same signed link the footer carries, POSTed with the form body List-Unsubscribe=One-Click. It opts out exactly what a click on the link does, under the same token check, and is as public.
|
||||
|
||||
:param org: Org is the org the link was minted for.
|
||||
:type org: str
|
||||
:param channel: Channel is the surface to opt out of.
|
||||
:type channel: str
|
||||
:param address: Address is the recipient to opt out.
|
||||
:type address: str
|
||||
:param token: Token is the HMAC over (org, channel, address), the only authority here.
|
||||
:type token: str
|
||||
:param list_unsubscribe: OneClick is the form's List-Unsubscribe field, \\\"One-Click\\\" from a mail client. The token decides; this field only names the form.
|
||||
:type list_unsubscribe: str
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._post_marketing_unsubscribe_serialize(
|
||||
org=org,
|
||||
channel=channel,
|
||||
address=address,
|
||||
token=token,
|
||||
list_unsubscribe=list_unsubscribe,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "MarketingUnsubscribed",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
def post_marketing_unsubscribe_without_preload_content(
|
||||
self,
|
||||
org: Annotated[Optional[StrictStr], Field(description="Org is the org the link was minted for.")] = None,
|
||||
channel: Annotated[Optional[StrictStr], Field(description="Channel is the surface to opt out of.")] = None,
|
||||
address: Annotated[Optional[StrictStr], Field(description="Address is the recipient to opt out.")] = None,
|
||||
token: Annotated[Optional[StrictStr], Field(description="Token is the HMAC over (org, channel, address), the only authority here.")] = None,
|
||||
list_unsubscribe: Annotated[Optional[StrictStr], Field(description="OneClick is the form's List-Unsubscribe field, \\\"One-Click\\\" from a mail client. The token decides; this field only names the form.")] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> RESTResponseType:
|
||||
"""Is the one-click unsubscribe a mail client sends from the List-Unsubscribe header (RFC 8058): the same signed link the footer carries, POSTed with the form body List-Unsubscribe=One-Click.
|
||||
|
||||
Is the one-click unsubscribe a mail client sends from the List-Unsubscribe header (RFC 8058): the same signed link the footer carries, POSTed with the form body List-Unsubscribe=One-Click. It opts out exactly what a click on the link does, under the same token check, and is as public.
|
||||
|
||||
:param org: Org is the org the link was minted for.
|
||||
:type org: str
|
||||
:param channel: Channel is the surface to opt out of.
|
||||
:type channel: str
|
||||
:param address: Address is the recipient to opt out.
|
||||
:type address: str
|
||||
:param token: Token is the HMAC over (org, channel, address), the only authority here.
|
||||
:type token: str
|
||||
:param list_unsubscribe: OneClick is the form's List-Unsubscribe field, \\\"One-Click\\\" from a mail client. The token decides; this field only names the form.
|
||||
:type list_unsubscribe: str
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._post_marketing_unsubscribe_serialize(
|
||||
org=org,
|
||||
channel=channel,
|
||||
address=address,
|
||||
token=token,
|
||||
list_unsubscribe=list_unsubscribe,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "MarketingUnsubscribed",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _post_marketing_unsubscribe_serialize(
|
||||
self,
|
||||
org,
|
||||
channel,
|
||||
address,
|
||||
token,
|
||||
list_unsubscribe,
|
||||
_request_auth,
|
||||
_content_type,
|
||||
_headers,
|
||||
_host_index,
|
||||
) -> RequestSerialized:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
# process the query parameters
|
||||
if org is not None:
|
||||
|
||||
_query_params.append(('org', org))
|
||||
|
||||
if channel is not None:
|
||||
|
||||
_query_params.append(('channel', channel))
|
||||
|
||||
if address is not None:
|
||||
|
||||
_query_params.append(('address', address))
|
||||
|
||||
if token is not None:
|
||||
|
||||
_query_params.append(('token', token))
|
||||
|
||||
# process the header parameters
|
||||
# process the form parameters
|
||||
if list_unsubscribe is not None:
|
||||
_form_params.append(('List-Unsubscribe', list_unsubscribe))
|
||||
# process the body parameter
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
if 'Accept' not in _header_params:
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
[
|
||||
'application/json',
|
||||
'application/problem+json'
|
||||
]
|
||||
)
|
||||
|
||||
# set the HTTP header `Content-Type`
|
||||
if _content_type:
|
||||
_header_params['Content-Type'] = _content_type
|
||||
else:
|
||||
_default_content_type = (
|
||||
self.api_client.select_header_content_type(
|
||||
[
|
||||
'application/x-www-form-urlencoded',
|
||||
'multipart/form-data'
|
||||
]
|
||||
)
|
||||
)
|
||||
if _default_content_type is not None:
|
||||
_header_params['Content-Type'] = _default_content_type
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = [
|
||||
'bearer'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method='POST',
|
||||
resource_path='/v1/marketing/unsubscribe',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
body=_body_params,
|
||||
post_params=_form_params,
|
||||
files=_files,
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@validate_call
|
||||
def put_marketing_calendar_by_id(
|
||||
self,
|
||||
|
||||
@@ -16,12 +16,11 @@ from pydantic import validate_call, Field, StrictFloat, StrictStr, StrictInt
|
||||
from typing import Any, Dict, List, Optional, Tuple, Union
|
||||
from typing_extensions import Annotated
|
||||
|
||||
from pydantic import Field, StrictBool, StrictStr
|
||||
from typing import Any, Dict, Optional
|
||||
from pydantic import Field, StrictStr
|
||||
from typing import Any, Dict
|
||||
from typing_extensions import Annotated
|
||||
from hanzoai.cloud.models.pricing_card import PricingCard
|
||||
from hanzoai.cloud.models.pricing_enablement_board import PricingEnablementBoard
|
||||
from hanzoai.cloud.models.pricing_enso_out import PricingEnsoOut
|
||||
from hanzoai.cloud.models.pricing_pricing_health import PricingPricingHealth
|
||||
from hanzoai.cloud.models.pricing_pricing_model_list import PricingPricingModelList
|
||||
from hanzoai.cloud.models.pricing_pricing_plan_list import PricingPricingPlanList
|
||||
@@ -2766,321 +2765,6 @@ class PricingApi:
|
||||
|
||||
|
||||
|
||||
@validate_call
|
||||
def get_pricing_enso(
|
||||
self,
|
||||
preset: Annotated[Optional[StrictStr], Field(description="Preset is the Enso model to quote (\"enso-flash\"); empty quotes every one.")] = None,
|
||||
reasoning: Annotated[Optional[StrictStr], Field(description="Reasoning is the depth to quote it at: none, low, medium, high, max, or default (what a request that names none gets). Empty quotes every depth together.")] = None,
|
||||
arms: Annotated[Optional[StrictStr], Field(description="Arms quotes a set of models composed into a blend instead, comma-separated ids (the arms of a /v1/benchmark/presets blend): from its cheapest, up to its dearest, nothing typical.")] = None,
|
||||
byok: Annotated[Optional[StrictBool], Field(description="BYOK quotes the platform's fee on a call the org's own provider key pays for.")] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> PricingEnsoOut:
|
||||
"""Quotes what Enso costs.
|
||||
|
||||
Quotes what Enso costs. A call bills what its arms cost us — each provider's price, and OpenRouter's fee where OpenRouter's credit bought it — and the platform's fee on top, so a model has three prices: from (its cheapest arm), typical (what its calls cost over the last day, or its last calls when the day held few) and upTo (its dearest arm, a long prompt's price included), in dollars a million tokens. Preset and reasoning narrow the answer to one model at one depth; arms quotes a blend of models instead. A SuperAdmin's answer names each model's arms.
|
||||
|
||||
:param preset: Preset is the Enso model to quote (\"enso-flash\"); empty quotes every one.
|
||||
:type preset: str
|
||||
:param reasoning: Reasoning is the depth to quote it at: none, low, medium, high, max, or default (what a request that names none gets). Empty quotes every depth together.
|
||||
:type reasoning: str
|
||||
:param arms: Arms quotes a set of models composed into a blend instead, comma-separated ids (the arms of a /v1/benchmark/presets blend): from its cheapest, up to its dearest, nothing typical.
|
||||
:type arms: str
|
||||
:param byok: BYOK quotes the platform's fee on a call the org's own provider key pays for.
|
||||
:type byok: bool
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._get_pricing_enso_serialize(
|
||||
preset=preset,
|
||||
reasoning=reasoning,
|
||||
arms=arms,
|
||||
byok=byok,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "PricingEnsoOut",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
).data
|
||||
|
||||
|
||||
@validate_call
|
||||
def get_pricing_enso_with_http_info(
|
||||
self,
|
||||
preset: Annotated[Optional[StrictStr], Field(description="Preset is the Enso model to quote (\"enso-flash\"); empty quotes every one.")] = None,
|
||||
reasoning: Annotated[Optional[StrictStr], Field(description="Reasoning is the depth to quote it at: none, low, medium, high, max, or default (what a request that names none gets). Empty quotes every depth together.")] = None,
|
||||
arms: Annotated[Optional[StrictStr], Field(description="Arms quotes a set of models composed into a blend instead, comma-separated ids (the arms of a /v1/benchmark/presets blend): from its cheapest, up to its dearest, nothing typical.")] = None,
|
||||
byok: Annotated[Optional[StrictBool], Field(description="BYOK quotes the platform's fee on a call the org's own provider key pays for.")] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> ApiResponse[PricingEnsoOut]:
|
||||
"""Quotes what Enso costs.
|
||||
|
||||
Quotes what Enso costs. A call bills what its arms cost us — each provider's price, and OpenRouter's fee where OpenRouter's credit bought it — and the platform's fee on top, so a model has three prices: from (its cheapest arm), typical (what its calls cost over the last day, or its last calls when the day held few) and upTo (its dearest arm, a long prompt's price included), in dollars a million tokens. Preset and reasoning narrow the answer to one model at one depth; arms quotes a blend of models instead. A SuperAdmin's answer names each model's arms.
|
||||
|
||||
:param preset: Preset is the Enso model to quote (\"enso-flash\"); empty quotes every one.
|
||||
:type preset: str
|
||||
:param reasoning: Reasoning is the depth to quote it at: none, low, medium, high, max, or default (what a request that names none gets). Empty quotes every depth together.
|
||||
:type reasoning: str
|
||||
:param arms: Arms quotes a set of models composed into a blend instead, comma-separated ids (the arms of a /v1/benchmark/presets blend): from its cheapest, up to its dearest, nothing typical.
|
||||
:type arms: str
|
||||
:param byok: BYOK quotes the platform's fee on a call the org's own provider key pays for.
|
||||
:type byok: bool
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._get_pricing_enso_serialize(
|
||||
preset=preset,
|
||||
reasoning=reasoning,
|
||||
arms=arms,
|
||||
byok=byok,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "PricingEnsoOut",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
response_data.read()
|
||||
return self.api_client.response_deserialize(
|
||||
response_data=response_data,
|
||||
response_types_map=_response_types_map,
|
||||
)
|
||||
|
||||
|
||||
@validate_call
|
||||
def get_pricing_enso_without_preload_content(
|
||||
self,
|
||||
preset: Annotated[Optional[StrictStr], Field(description="Preset is the Enso model to quote (\"enso-flash\"); empty quotes every one.")] = None,
|
||||
reasoning: Annotated[Optional[StrictStr], Field(description="Reasoning is the depth to quote it at: none, low, medium, high, max, or default (what a request that names none gets). Empty quotes every depth together.")] = None,
|
||||
arms: Annotated[Optional[StrictStr], Field(description="Arms quotes a set of models composed into a blend instead, comma-separated ids (the arms of a /v1/benchmark/presets blend): from its cheapest, up to its dearest, nothing typical.")] = None,
|
||||
byok: Annotated[Optional[StrictBool], Field(description="BYOK quotes the platform's fee on a call the org's own provider key pays for.")] = None,
|
||||
_request_timeout: Union[
|
||||
None,
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Tuple[
|
||||
Annotated[StrictFloat, Field(gt=0)],
|
||||
Annotated[StrictFloat, Field(gt=0)]
|
||||
]
|
||||
] = None,
|
||||
_request_auth: Optional[Dict[StrictStr, Any]] = None,
|
||||
_content_type: Optional[StrictStr] = None,
|
||||
_headers: Optional[Dict[StrictStr, Any]] = None,
|
||||
_host_index: Annotated[StrictInt, Field(ge=0, le=0)] = 0,
|
||||
) -> RESTResponseType:
|
||||
"""Quotes what Enso costs.
|
||||
|
||||
Quotes what Enso costs. A call bills what its arms cost us — each provider's price, and OpenRouter's fee where OpenRouter's credit bought it — and the platform's fee on top, so a model has three prices: from (its cheapest arm), typical (what its calls cost over the last day, or its last calls when the day held few) and upTo (its dearest arm, a long prompt's price included), in dollars a million tokens. Preset and reasoning narrow the answer to one model at one depth; arms quotes a blend of models instead. A SuperAdmin's answer names each model's arms.
|
||||
|
||||
:param preset: Preset is the Enso model to quote (\"enso-flash\"); empty quotes every one.
|
||||
:type preset: str
|
||||
:param reasoning: Reasoning is the depth to quote it at: none, low, medium, high, max, or default (what a request that names none gets). Empty quotes every depth together.
|
||||
:type reasoning: str
|
||||
:param arms: Arms quotes a set of models composed into a blend instead, comma-separated ids (the arms of a /v1/benchmark/presets blend): from its cheapest, up to its dearest, nothing typical.
|
||||
:type arms: str
|
||||
:param byok: BYOK quotes the platform's fee on a call the org's own provider key pays for.
|
||||
:type byok: bool
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
timeout. It can also be a pair (tuple) of
|
||||
(connection, read) timeouts.
|
||||
:type _request_timeout: int, tuple(int, int), optional
|
||||
:param _request_auth: set to override the auth_settings for an a single
|
||||
request; this effectively ignores the
|
||||
authentication in the spec for a single request.
|
||||
:type _request_auth: dict, optional
|
||||
:param _content_type: force content-type for the request.
|
||||
:type _content_type: str, Optional
|
||||
:param _headers: set to override the headers for a single
|
||||
request; this effectively ignores the headers
|
||||
in the spec for a single request.
|
||||
:type _headers: dict, optional
|
||||
:param _host_index: set to override the host_index for a single
|
||||
request; this effectively ignores the host_index
|
||||
in the spec for a single request.
|
||||
:type _host_index: int, optional
|
||||
:return: Returns the result object.
|
||||
""" # noqa: E501
|
||||
|
||||
_param = self._get_pricing_enso_serialize(
|
||||
preset=preset,
|
||||
reasoning=reasoning,
|
||||
arms=arms,
|
||||
byok=byok,
|
||||
_request_auth=_request_auth,
|
||||
_content_type=_content_type,
|
||||
_headers=_headers,
|
||||
_host_index=_host_index
|
||||
)
|
||||
|
||||
_response_types_map: Dict[str, Optional[str]] = {
|
||||
'200': "PricingEnsoOut",
|
||||
}
|
||||
response_data = self.api_client.call_api(
|
||||
*_param,
|
||||
_request_timeout=_request_timeout
|
||||
)
|
||||
return response_data.response
|
||||
|
||||
|
||||
def _get_pricing_enso_serialize(
|
||||
self,
|
||||
preset,
|
||||
reasoning,
|
||||
arms,
|
||||
byok,
|
||||
_request_auth,
|
||||
_content_type,
|
||||
_headers,
|
||||
_host_index,
|
||||
) -> RequestSerialized:
|
||||
|
||||
_host = None
|
||||
|
||||
_collection_formats: Dict[str, str] = {
|
||||
}
|
||||
|
||||
_path_params: Dict[str, str] = {}
|
||||
_query_params: List[Tuple[str, str]] = []
|
||||
_header_params: Dict[str, Optional[str]] = _headers or {}
|
||||
_form_params: List[Tuple[str, str]] = []
|
||||
_files: Dict[
|
||||
str, Union[str, bytes, List[str], List[bytes], List[Tuple[str, bytes]]]
|
||||
] = {}
|
||||
_body_params: Optional[bytes] = None
|
||||
|
||||
# process the path parameters
|
||||
# process the query parameters
|
||||
if preset is not None:
|
||||
|
||||
_query_params.append(('preset', preset))
|
||||
|
||||
if reasoning is not None:
|
||||
|
||||
_query_params.append(('reasoning', reasoning))
|
||||
|
||||
if arms is not None:
|
||||
|
||||
_query_params.append(('arms', arms))
|
||||
|
||||
if byok is not None:
|
||||
|
||||
_query_params.append(('byok', byok))
|
||||
|
||||
# process the header parameters
|
||||
# process the form parameters
|
||||
# process the body parameter
|
||||
|
||||
|
||||
# set the HTTP header `Accept`
|
||||
if 'Accept' not in _header_params:
|
||||
_header_params['Accept'] = self.api_client.select_header_accept(
|
||||
[
|
||||
'application/json',
|
||||
'application/problem+json'
|
||||
]
|
||||
)
|
||||
|
||||
|
||||
# authentication setting
|
||||
_auth_settings: List[str] = [
|
||||
'bearer'
|
||||
]
|
||||
|
||||
return self.api_client.param_serialize(
|
||||
method='GET',
|
||||
resource_path='/v1/pricing/enso',
|
||||
path_params=_path_params,
|
||||
query_params=_query_params,
|
||||
header_params=_header_params,
|
||||
body=_body_params,
|
||||
post_params=_form_params,
|
||||
files=_files,
|
||||
auth_settings=_auth_settings,
|
||||
collection_formats=_collection_formats,
|
||||
_host=_host,
|
||||
_request_auth=_request_auth
|
||||
)
|
||||
|
||||
|
||||
|
||||
|
||||
@validate_call
|
||||
def get_pricing_featured(
|
||||
self,
|
||||
@@ -6078,7 +5762,7 @@ class PricingApi:
|
||||
) -> Dict[str, object]:
|
||||
"""Returns the catalog's headline statistics — model counts by family and the provider directory.
|
||||
|
||||
Returns the catalog's headline statistics — model counts by family and the provider directory. The provider sub-object is filtered to what the caller's org may see, so a disabled provider's name never leaks; the aggregate counts are the catalog's own, over everything it holds. A SuperAdmin's summary adds `enso`: the day's Enso answers, the arms that failed first, the share OpenRouter's credit bought (fallbacks), the fee collected and every loss, by route.
|
||||
Returns the catalog's headline statistics — model counts by family and the provider directory. The provider sub-object is filtered to what the caller's org may see, so a disabled provider's name never leaks; the aggregate counts are the catalog's own, over everything it holds. A SuperAdmin's summary adds `enso`: the day's Enso answers, the arms that failed first, the share OpenRouter's credit bought (fallbacks), the margin the fixed prices made, the answers that stated no cost and every loss, by model, arm and vendor.
|
||||
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
@@ -6141,7 +5825,7 @@ class PricingApi:
|
||||
) -> ApiResponse[Dict[str, object]]:
|
||||
"""Returns the catalog's headline statistics — model counts by family and the provider directory.
|
||||
|
||||
Returns the catalog's headline statistics — model counts by family and the provider directory. The provider sub-object is filtered to what the caller's org may see, so a disabled provider's name never leaks; the aggregate counts are the catalog's own, over everything it holds. A SuperAdmin's summary adds `enso`: the day's Enso answers, the arms that failed first, the share OpenRouter's credit bought (fallbacks), the fee collected and every loss, by route.
|
||||
Returns the catalog's headline statistics — model counts by family and the provider directory. The provider sub-object is filtered to what the caller's org may see, so a disabled provider's name never leaks; the aggregate counts are the catalog's own, over everything it holds. A SuperAdmin's summary adds `enso`: the day's Enso answers, the arms that failed first, the share OpenRouter's credit bought (fallbacks), the margin the fixed prices made, the answers that stated no cost and every loss, by model, arm and vendor.
|
||||
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
@@ -6204,7 +5888,7 @@ class PricingApi:
|
||||
) -> RESTResponseType:
|
||||
"""Returns the catalog's headline statistics — model counts by family and the provider directory.
|
||||
|
||||
Returns the catalog's headline statistics — model counts by family and the provider directory. The provider sub-object is filtered to what the caller's org may see, so a disabled provider's name never leaks; the aggregate counts are the catalog's own, over everything it holds. A SuperAdmin's summary adds `enso`: the day's Enso answers, the arms that failed first, the share OpenRouter's credit bought (fallbacks), the fee collected and every loss, by route.
|
||||
Returns the catalog's headline statistics — model counts by family and the provider directory. The provider sub-object is filtered to what the caller's org may see, so a disabled provider's name never leaks; the aggregate counts are the catalog's own, over everything it holds. A SuperAdmin's summary adds `enso`: the day's Enso answers, the arms that failed first, the share OpenRouter's credit bought (fallbacks), the margin the fixed prices made, the answers that stated no cost and every loss, by model, arm and vendor.
|
||||
|
||||
:param _request_timeout: timeout setting for this request. If one
|
||||
number provided, it will be total request
|
||||
|
||||
@@ -162,7 +162,6 @@ from hanzoai.cloud.models.ai_model_providers import AiModelProviders
|
||||
from hanzoai.cloud.models.ai_models import AiModels
|
||||
from hanzoai.cloud.models.ai_panel_judge import AiPanelJudge
|
||||
from hanzoai.cloud.models.ai_paused import AiPaused
|
||||
from hanzoai.cloud.models.ai_per_million import AiPerMillion
|
||||
from hanzoai.cloud.models.ai_price import AiPrice
|
||||
from hanzoai.cloud.models.ai_provider_usage import AiProviderUsage
|
||||
from hanzoai.cloud.models.ai_provider_usage_model_spend import AiProviderUsageModelSpend
|
||||
@@ -2361,8 +2360,6 @@ from hanzoai.cloud.models.pref_prefs_view import PrefPrefsView
|
||||
from hanzoai.cloud.models.pricing_card import PricingCard
|
||||
from hanzoai.cloud.models.pricing_component import PricingComponent
|
||||
from hanzoai.cloud.models.pricing_enablement_board import PricingEnablementBoard
|
||||
from hanzoai.cloud.models.pricing_enso_out import PricingEnsoOut
|
||||
from hanzoai.cloud.models.pricing_price import PricingPrice
|
||||
from hanzoai.cloud.models.pricing_pricing_health import PricingPricingHealth
|
||||
from hanzoai.cloud.models.pricing_pricing_model_list import PricingPricingModelList
|
||||
from hanzoai.cloud.models.pricing_pricing_plan_list import PricingPricingPlanList
|
||||
@@ -2371,10 +2368,7 @@ from hanzoai.cloud.models.pricing_pricing_provider_list import PricingPricingPro
|
||||
from hanzoai.cloud.models.pricing_pricing_region_list import PricingPricingRegionList
|
||||
from hanzoai.cloud.models.pricing_pricing_tier_list import PricingPricingTierList
|
||||
from hanzoai.cloud.models.pricing_pricing_tool_list import PricingPricingToolList
|
||||
from hanzoai.cloud.models.pricing_quote import PricingQuote
|
||||
from hanzoai.cloud.models.pricing_rate import PricingRate
|
||||
from hanzoai.cloud.models.pricing_rate_arm import PricingRateArm
|
||||
from hanzoai.cloud.models.pricing_rate_window import PricingRateWindow
|
||||
from hanzoai.cloud.models.pricing_speed import PricingSpeed
|
||||
from hanzoai.cloud.models.pricing_user_enablement_item import PricingUserEnablementItem
|
||||
from hanzoai.cloud.models.principal_agent_brief import PrincipalAgentBrief
|
||||
|
||||
@@ -17,10 +17,8 @@ import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictFloat, StrictInt, StrictStr
|
||||
from pydantic import BaseModel, ConfigDict, StrictBool, StrictFloat, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional, Union
|
||||
from hanzoai.cloud.models.ai_per_million import AiPerMillion
|
||||
from hanzoai.cloud.models.ai_window import AiWindow
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
@@ -29,17 +27,13 @@ class AiModelPricingInfo(BaseModel):
|
||||
AiModelPricingInfo
|
||||
""" # noqa: E501
|
||||
completion: Optional[StrictStr] = None
|
||||
fee: Optional[StrictStr] = None
|
||||
var_from: Optional[AiPerMillion] = Field(default=None, alias="from")
|
||||
input_per_million: Optional[Union[StrictFloat, StrictInt]] = None
|
||||
output_per_million: Optional[Union[StrictFloat, StrictInt]] = None
|
||||
overrides: Optional[List[Dict[str, Any]]] = None
|
||||
prompt: Optional[StrictStr] = None
|
||||
rates: Optional[Dict[str, StrictStr]] = None
|
||||
up_to: Optional[AiPerMillion] = None
|
||||
variable: Optional[StrictBool] = None
|
||||
window: Optional[AiWindow] = None
|
||||
__properties: ClassVar[List[str]] = ["completion", "fee", "from", "input_per_million", "output_per_million", "overrides", "prompt", "rates", "up_to", "variable", "window"]
|
||||
__properties: ClassVar[List[str]] = ["completion", "input_per_million", "output_per_million", "overrides", "prompt", "rates", "variable"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -80,15 +74,6 @@ class AiModelPricingInfo(BaseModel):
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of var_from
|
||||
if self.var_from:
|
||||
_dict['from'] = self.var_from.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of up_to
|
||||
if self.up_to:
|
||||
_dict['up_to'] = self.up_to.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of window
|
||||
if self.window:
|
||||
_dict['window'] = self.window.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
@@ -102,16 +87,12 @@ class AiModelPricingInfo(BaseModel):
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"completion": obj.get("completion"),
|
||||
"fee": obj.get("fee"),
|
||||
"from": AiPerMillion.from_dict(obj["from"]) if obj.get("from") is not None else None,
|
||||
"input_per_million": obj.get("input_per_million"),
|
||||
"output_per_million": obj.get("output_per_million"),
|
||||
"overrides": obj.get("overrides"),
|
||||
"prompt": obj.get("prompt"),
|
||||
"rates": obj.get("rates"),
|
||||
"up_to": AiPerMillion.from_dict(obj["up_to"]) if obj.get("up_to") is not None else None,
|
||||
"variable": obj.get("variable"),
|
||||
"window": AiWindow.from_dict(obj["window"]) if obj.get("window") is not None else None
|
||||
"variable": obj.get("variable")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Hanzo Cloud API
|
||||
|
||||
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
||||
|
||||
The version of the OpenAPI document: v1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, StrictFloat, StrictInt
|
||||
from typing import Any, ClassVar, Dict, List, Optional, Union
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class AiPerMillion(BaseModel):
|
||||
"""
|
||||
AiPerMillion
|
||||
""" # noqa: E501
|
||||
cache_read_per_million: Optional[Union[StrictFloat, StrictInt]] = None
|
||||
cache_write_per_million: Optional[Union[StrictFloat, StrictInt]] = None
|
||||
input_per_million: Optional[Union[StrictFloat, StrictInt]] = None
|
||||
output_per_million: Optional[Union[StrictFloat, StrictInt]] = None
|
||||
__properties: ClassVar[List[str]] = ["cache_read_per_million", "cache_write_per_million", "input_per_million", "output_per_million"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of AiPerMillion from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of AiPerMillion from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"cache_read_per_million": obj.get("cache_read_per_million"),
|
||||
"cache_write_per_million": obj.get("cache_write_per_million"),
|
||||
"input_per_million": obj.get("input_per_million"),
|
||||
"output_per_million": obj.get("output_per_million")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ class BillingSubscription(BaseModel):
|
||||
cancel_at_period_end: Optional[StrictBool] = Field(default=None, description="CancelAtPeriodEnd reports that the plan ends at CurrentPeriodEnd.", alias="cancelAtPeriodEnd")
|
||||
canceled_at: Optional[StrictStr] = Field(default=None, description="CanceledAt is when it was canceled; absent when it was not.", alias="canceledAt")
|
||||
charged_cents: Optional[StrictInt] = Field(default=None, description="ChargedCents is what the period in hand was actually paid, after any discount and net of refunds. 0 when the period is unpaid.", alias="chargedCents")
|
||||
coupon: Optional[StrictStr] = Field(default=None, description="Coupon is the plan coupon code the first period was bought with, as commerce stores it (upper case); absent when none was.")
|
||||
created_at: Optional[StrictStr] = Field(default=None, description="CreatedAt is when the row was written, RFC 3339.", alias="createdAt")
|
||||
current_period_end: Optional[StrictStr] = Field(default=None, description="CurrentPeriodEnd is when it ends, RFC 3339. The plan is paid through it.", alias="currentPeriodEnd")
|
||||
current_period_start: Optional[StrictStr] = Field(default=None, description="CurrentPeriodStart is when the period in hand began, RFC 3339.", alias="currentPeriodStart")
|
||||
@@ -49,7 +50,7 @@ class BillingSubscription(BaseModel):
|
||||
trial_start: Optional[StrictStr] = Field(default=None, description="TrialStart is when a trial began; absent when there was none.", alias="trialStart")
|
||||
updated_at: Optional[StrictStr] = Field(default=None, description="UpdatedAt is when the row last changed, RFC 3339.", alias="updatedAt")
|
||||
user_id: Optional[StrictStr] = Field(default=None, description="UserID is the billing account that holds it: the org slug for an org's own plan, \"<org>/<name>\" for a member's.", alias="userId")
|
||||
__properties: ClassVar[List[str]] = ["cancelAtPeriodEnd", "canceledAt", "chargedCents", "createdAt", "currentPeriodEnd", "currentPeriodStart", "defaultPaymentMethod", "endedAt", "id", "mrrCents", "plan", "planId", "providerType", "quantity", "seats", "settled", "status", "test", "trialEnd", "trialStart", "updatedAt", "userId"]
|
||||
__properties: ClassVar[List[str]] = ["cancelAtPeriodEnd", "canceledAt", "chargedCents", "coupon", "createdAt", "currentPeriodEnd", "currentPeriodStart", "defaultPaymentMethod", "endedAt", "id", "mrrCents", "plan", "planId", "providerType", "quantity", "seats", "settled", "status", "test", "trialEnd", "trialStart", "updatedAt", "userId"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
@@ -108,6 +109,7 @@ class BillingSubscription(BaseModel):
|
||||
"cancelAtPeriodEnd": obj.get("cancelAtPeriodEnd"),
|
||||
"canceledAt": obj.get("canceledAt"),
|
||||
"chargedCents": obj.get("chargedCents"),
|
||||
"coupon": obj.get("coupon"),
|
||||
"createdAt": obj.get("createdAt"),
|
||||
"currentPeriodEnd": obj.get("currentPeriodEnd"),
|
||||
"currentPeriodStart": obj.get("currentPeriodStart"),
|
||||
|
||||
@@ -26,7 +26,7 @@ class MarketingStep(BaseModel):
|
||||
"""
|
||||
MarketingStep
|
||||
""" # noqa: E501
|
||||
body: Optional[StrictStr] = Field(default=None, description="Body is the message text. Required. The signed one-click unsubscribe link is appended to it at send time.")
|
||||
body: Optional[StrictStr] = Field(default=None, description="Body is the message text. Required. The signed one-click unsubscribe link is appended to it at send time, and in an HTML body each <a> to an http(s) URL is sent pointing at GET /v1/marketing/click, which counts the click and redirects to the URL written here.")
|
||||
created_at: Optional[StrictInt] = Field(default=None, description="CreatedAt is unix seconds, server-assigned.", alias="createdAt")
|
||||
delay_seconds: Optional[StrictInt] = Field(default=None, description="DelaySeconds is how long after the previous step this one sends (after enrollment, for step 0).", alias="delaySeconds")
|
||||
id: Optional[StrictStr] = Field(default=None, description="ID is the server-assigned step id (\"step_\" + 128 random bits).")
|
||||
|
||||
@@ -1,103 +0,0 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Hanzo Cloud API
|
||||
|
||||
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
||||
|
||||
The version of the OpenAPI document: v1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from hanzoai.cloud.models.pricing_quote import PricingQuote
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class PricingEnsoOut(BaseModel):
|
||||
"""
|
||||
PricingEnsoOut
|
||||
""" # noqa: E501
|
||||
computed: Optional[StrictStr] = Field(default=None, description="Computed is when the prices were computed, RFC 3339.")
|
||||
fee: Optional[StrictStr] = Field(default=None, description="Fee is the platform's fee every price carries, percent: the margin, and the only one.")
|
||||
free: Optional[List[StrictStr]] = Field(default=None, description="Free names the Enso models served at no charge.")
|
||||
measured: Optional[StrictStr] = Field(default=None, description="Measured is when the calls typical was measured over were read, RFC 3339.")
|
||||
quotes: Optional[List[PricingQuote]] = Field(default=None, description="Quotes is each model at each depth asked: from, typical and upTo in dollars a million tokens, and the window typical was measured over.")
|
||||
__properties: ClassVar[List[str]] = ["computed", "fee", "free", "measured", "quotes"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of PricingEnsoOut from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in quotes (list)
|
||||
_items = []
|
||||
if self.quotes:
|
||||
for _item_quotes in self.quotes:
|
||||
if _item_quotes:
|
||||
_items.append(_item_quotes.to_dict())
|
||||
_dict['quotes'] = _items
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of PricingEnsoOut from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"computed": obj.get("computed"),
|
||||
"fee": obj.get("fee"),
|
||||
"free": obj.get("free"),
|
||||
"measured": obj.get("measured"),
|
||||
"quotes": [PricingQuote.from_dict(_item) for _item in obj["quotes"]] if obj.get("quotes") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Hanzo Cloud API
|
||||
|
||||
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
||||
|
||||
The version of the OpenAPI document: v1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class PricingPrice(BaseModel):
|
||||
"""
|
||||
PricingPrice
|
||||
""" # noqa: E501
|
||||
cache_read: Optional[StrictStr] = Field(default=None, description="CacheRead is a prompt token read from the provider's cache, dollars a million; \"\" where the price states none.", alias="cacheRead")
|
||||
cache_write: Optional[StrictStr] = Field(default=None, description="CacheWrite is a prompt token written to the provider's cache, dollars a million; \"\" where the price states none.", alias="cacheWrite")
|
||||
input: Optional[StrictStr] = Field(default=None, description="Input is a fresh prompt token's price, dollars a million.")
|
||||
output: Optional[StrictStr] = Field(default=None, description="Output is a completion token's price, dollars a million.")
|
||||
__properties: ClassVar[List[str]] = ["cacheRead", "cacheWrite", "input", "output"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of PricingPrice from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of PricingPrice from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"cacheRead": obj.get("cacheRead"),
|
||||
"cacheWrite": obj.get("cacheWrite"),
|
||||
"input": obj.get("input"),
|
||||
"output": obj.get("output")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -1,125 +0,0 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Hanzo Cloud API
|
||||
|
||||
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
||||
|
||||
The version of the OpenAPI document: v1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictBool, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from hanzoai.cloud.models.pricing_price import PricingPrice
|
||||
from hanzoai.cloud.models.pricing_rate_arm import PricingRateArm
|
||||
from hanzoai.cloud.models.pricing_rate_window import PricingRateWindow
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class PricingQuote(BaseModel):
|
||||
"""
|
||||
PricingQuote
|
||||
""" # noqa: E501
|
||||
arms: Optional[List[PricingRateArm]] = Field(default=None, description="Arms are the model's routes, set for a SuperAdmin alone.")
|
||||
byok: Optional[StrictBool] = Field(default=None, description="BYOK says the prices carry the fee of a call on the org's own key.")
|
||||
fee: Optional[StrictStr] = Field(default=None, description="Fee is the platform's fee each price carries, percent.")
|
||||
var_from: Optional[PricingPrice] = Field(default=None, description="From is the least a token bills: the model's cheapest arm, class by class.", alias="from")
|
||||
model: Optional[StrictStr] = Field(default=None, description="Model is the model quoted, or a blend's models joined by commas.")
|
||||
reasoning: Optional[StrictStr] = Field(default=None, description="Reasoning is the depth quoted: none, low, medium, high, max or default; \"\" for every depth together.")
|
||||
typical: Optional[PricingPrice] = Field(default=None, description="Typical is what a token of the model's calls billed, measured over Window; nil when no call was measured.")
|
||||
up_to: Optional[PricingPrice] = Field(default=None, description="UpTo is the most a token bills: the model's dearest arm, a long prompt's price included.", alias="upTo")
|
||||
window: Optional[PricingRateWindow] = Field(default=None, description="Window is the calls Typical was measured over.")
|
||||
__properties: ClassVar[List[str]] = ["arms", "byok", "fee", "from", "model", "reasoning", "typical", "upTo", "window"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of PricingQuote from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of each item in arms (list)
|
||||
_items = []
|
||||
if self.arms:
|
||||
for _item_arms in self.arms:
|
||||
if _item_arms:
|
||||
_items.append(_item_arms.to_dict())
|
||||
_dict['arms'] = _items
|
||||
# override the default output from pydantic by calling `to_dict()` of var_from
|
||||
if self.var_from:
|
||||
_dict['from'] = self.var_from.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of typical
|
||||
if self.typical:
|
||||
_dict['typical'] = self.typical.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of up_to
|
||||
if self.up_to:
|
||||
_dict['upTo'] = self.up_to.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of window
|
||||
if self.window:
|
||||
_dict['window'] = self.window.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of PricingQuote from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"arms": [PricingRateArm.from_dict(_item) for _item in obj["arms"]] if obj.get("arms") is not None else None,
|
||||
"byok": obj.get("byok"),
|
||||
"fee": obj.get("fee"),
|
||||
"from": PricingPrice.from_dict(obj["from"]) if obj.get("from") is not None else None,
|
||||
"model": obj.get("model"),
|
||||
"reasoning": obj.get("reasoning"),
|
||||
"typical": PricingPrice.from_dict(obj["typical"]) if obj.get("typical") is not None else None,
|
||||
"upTo": PricingPrice.from_dict(obj["upTo"]) if obj.get("upTo") is not None else None,
|
||||
"window": PricingRateWindow.from_dict(obj["window"]) if obj.get("window") is not None else None
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -1,106 +0,0 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Hanzo Cloud API
|
||||
|
||||
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
||||
|
||||
The version of the OpenAPI document: v1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from hanzoai.cloud.models.pricing_price import PricingPrice
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class PricingRateArm(BaseModel):
|
||||
"""
|
||||
PricingRateArm
|
||||
""" # noqa: E501
|
||||
above: Optional[StrictInt] = Field(default=None, description="Above is the prompt length Long applies past, tokens.")
|
||||
fee: Optional[StrictStr] = Field(default=None, description="Fee is a reseller's fee on the provider's price, percent: part of the cost.")
|
||||
kind: Optional[StrictStr] = Field(default=None, description="Kind is how the provider is reached: direct (its own API, on a key Hanzo or the org holds), family (a Hanzo family service), do (DigitalOcean's inference) or openrouter (the fallback), asked in that order.")
|
||||
list: Optional[PricingPrice] = Field(default=None, description="List is the provider's own price.")
|
||||
long: Optional[PricingPrice] = Field(default=None, description="Long is the provider's price for a prompt past Above tokens, where it charges one.")
|
||||
provider: Optional[StrictStr] = Field(default=None, description="Provider is the account the arm runs on, as the family's catalog names it.")
|
||||
upstream: Optional[StrictStr] = Field(default=None, description="Upstream is the model the arm runs.")
|
||||
__properties: ClassVar[List[str]] = ["above", "fee", "kind", "list", "long", "provider", "upstream"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of PricingRateArm from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
# override the default output from pydantic by calling `to_dict()` of list
|
||||
if self.list:
|
||||
_dict['list'] = self.list.to_dict()
|
||||
# override the default output from pydantic by calling `to_dict()` of long
|
||||
if self.long:
|
||||
_dict['long'] = self.long.to_dict()
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of PricingRateArm from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"above": obj.get("above"),
|
||||
"fee": obj.get("fee"),
|
||||
"kind": obj.get("kind"),
|
||||
"list": PricingPrice.from_dict(obj["list"]) if obj.get("list") is not None else None,
|
||||
"long": PricingPrice.from_dict(obj["long"]) if obj.get("long") is not None else None,
|
||||
"provider": obj.get("provider"),
|
||||
"upstream": obj.get("upstream")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
@@ -1,93 +0,0 @@
|
||||
# coding: utf-8
|
||||
|
||||
"""
|
||||
Hanzo Cloud API
|
||||
|
||||
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
|
||||
|
||||
The version of the OpenAPI document: v1
|
||||
Generated by OpenAPI Generator (https://openapi-generator.tech)
|
||||
|
||||
Do not edit the class manually.
|
||||
""" # noqa: E501
|
||||
|
||||
|
||||
from __future__ import annotations
|
||||
import pprint
|
||||
import re # noqa: F401
|
||||
import json
|
||||
|
||||
from pydantic import BaseModel, ConfigDict, Field, StrictInt, StrictStr
|
||||
from typing import Any, ClassVar, Dict, List, Optional
|
||||
from typing import Optional, Set
|
||||
from typing_extensions import Self
|
||||
|
||||
class PricingRateWindow(BaseModel):
|
||||
"""
|
||||
PricingRateWindow
|
||||
""" # noqa: E501
|
||||
basis: Optional[StrictStr] = Field(default=None, description="Basis is \"24h\" (every call of the last day), \"last\" (the model's last calls, the day having held too few) or \"\" (none measured).")
|
||||
requests: Optional[StrictInt] = Field(default=None, description="Requests is how many calls were measured.")
|
||||
since: Optional[StrictInt] = Field(default=None, description="Since is when the first call measured was made, unix seconds.")
|
||||
until: Optional[StrictInt] = Field(default=None, description="Until is when the last was, unix seconds.")
|
||||
__properties: ClassVar[List[str]] = ["basis", "requests", "since", "until"]
|
||||
|
||||
model_config = ConfigDict(
|
||||
populate_by_name=True,
|
||||
validate_assignment=True,
|
||||
protected_namespaces=(),
|
||||
)
|
||||
|
||||
|
||||
def to_str(self) -> str:
|
||||
"""Returns the string representation of the model using alias"""
|
||||
return pprint.pformat(self.model_dump(by_alias=True))
|
||||
|
||||
def to_json(self) -> str:
|
||||
"""Returns the JSON representation of the model using alias"""
|
||||
# TODO: pydantic v2: use .model_dump_json(by_alias=True, exclude_unset=True) instead
|
||||
return json.dumps(self.to_dict())
|
||||
|
||||
@classmethod
|
||||
def from_json(cls, json_str: str) -> Optional[Self]:
|
||||
"""Create an instance of PricingRateWindow from a JSON string"""
|
||||
return cls.from_dict(json.loads(json_str))
|
||||
|
||||
def to_dict(self) -> Dict[str, Any]:
|
||||
"""Return the dictionary representation of the model using alias.
|
||||
|
||||
This has the following differences from calling pydantic's
|
||||
`self.model_dump(by_alias=True)`:
|
||||
|
||||
* `None` is only added to the output dict for nullable fields that
|
||||
were set at model initialization. Other fields with value `None`
|
||||
are ignored.
|
||||
"""
|
||||
excluded_fields: Set[str] = set([
|
||||
])
|
||||
|
||||
_dict = self.model_dump(
|
||||
by_alias=True,
|
||||
exclude=excluded_fields,
|
||||
exclude_none=True,
|
||||
)
|
||||
return _dict
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, obj: Optional[Dict[str, Any]]) -> Optional[Self]:
|
||||
"""Create an instance of PricingRateWindow from a dict"""
|
||||
if obj is None:
|
||||
return None
|
||||
|
||||
if not isinstance(obj, dict):
|
||||
return cls.model_validate(obj)
|
||||
|
||||
_obj = cls.model_validate({
|
||||
"basis": obj.get("basis"),
|
||||
"requests": obj.get("requests"),
|
||||
"since": obj.get("since"),
|
||||
"until": obj.get("until")
|
||||
})
|
||||
return _obj
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
[project]
|
||||
name = "hanzoai"
|
||||
version = "8.5.749"
|
||||
version = "8.5.754"
|
||||
description = "The official Python library for the Hanzo API"
|
||||
dynamic = ["readme"]
|
||||
license = "Apache-2.0"
|
||||
|
||||
Reference in New Issue
Block a user