Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
432 changes: 432 additions & 0 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions examples/v2/ai-gateway/CreateAiGatewayProvider.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
from datadog_api_client.v2.model.ai_gateway_known_provider import AiGatewayKnownProvider
from datadog_api_client.v2.model.ai_gateway_model_input import AiGatewayModelInput
from datadog_api_client.v2.model.ai_gateway_provider_create_attributes import AiGatewayProviderCreateAttributes
from datadog_api_client.v2.model.ai_gateway_provider_create_credential_source import (
AiGatewayProviderCreateCredentialSource,
)
from datadog_api_client.v2.model.ai_gateway_provider_create_data import AiGatewayProviderCreateData
from datadog_api_client.v2.model.ai_gateway_provider_create_request import AiGatewayProviderCreateRequest
from datadog_api_client.v2.model.ai_gateway_provider_initial_binding import AiGatewayProviderInitialBinding
Expand All @@ -25,6 +28,7 @@
data=AiGatewayProviderCreateData(
attributes=AiGatewayProviderCreateAttributes(
cost_multiplier=1.0,
credential_source=AiGatewayProviderCreateCredentialSource.INTEGRATION_ACCOUNT,
initial_bindings=[
AiGatewayProviderInitialBinding(
principals=[
Expand Down Expand Up @@ -56,6 +60,7 @@
],
name="production-us",
slug="prod-us",
zdr_eligible=False,
),
type=AiGatewayProviderType.PROVIDERS,
),
Expand Down
12 changes: 12 additions & 0 deletions examples/v2/ai-gateway/CreateAiGatewayRoutingRule.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@
from datadog_api_client.v2.model.ai_gateway_nullable_routing_rule_tier_ordering import (
AiGatewayNullableRoutingRuleTierOrdering,
)
from datadog_api_client.v2.model.ai_gateway_provider_initial_binding import AiGatewayProviderInitialBinding
from datadog_api_client.v2.model.ai_gateway_provider_initial_binding_relation import (
AiGatewayProviderInitialBindingRelation,
)
from datadog_api_client.v2.model.ai_gateway_routing_classifier_request import AiGatewayRoutingClassifierRequest
from datadog_api_client.v2.model.ai_gateway_routing_reasoning_level import AiGatewayRoutingReasoningLevel
from datadog_api_client.v2.model.ai_gateway_routing_rule_create_attributes import AiGatewayRoutingRuleCreateAttributes
Expand All @@ -21,6 +25,14 @@
body = AiGatewayRoutingRuleCreateRequest(
data=AiGatewayRoutingRuleCreateData(
attributes=AiGatewayRoutingRuleCreateAttributes(
initial_bindings=[
AiGatewayProviderInitialBinding(
principals=[
"org:11111111-1111-1111-1111-111111111111",
],
relation=AiGatewayProviderInitialBindingRelation.VIEWER,
),
],
slug="coding",
tiers=[
AiGatewayRoutingRuleTierRequest(
Expand Down
1 change: 1 addition & 0 deletions examples/v2/ai-gateway/UpdateAiGatewayProvider.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
attributes=AiGatewayProviderUpdateAttributes(
cost_multiplier=1.0,
name="production-us-v2",
zdr_eligible=False,
),
id="42",
type=AiGatewayProviderType.PROVIDERS,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import Union

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
datetime,
unset,
UnsetType,
UUID,
)

Expand All @@ -21,6 +24,7 @@ def openapi_types(_):
"instance_count": (int,),
"over_warning_threshold_count": (int,),
"restricted_details": (bool,),
"total_capacity_microcents": (int,),
"total_spend_microcents": (int,),
"window_start": (datetime,),
}
Expand All @@ -31,6 +35,7 @@ def openapi_types(_):
"instance_count": "instance_count",
"over_warning_threshold_count": "over_warning_threshold_count",
"restricted_details": "restricted_details",
"total_capacity_microcents": "total_capacity_microcents",
"total_spend_microcents": "total_spend_microcents",
"window_start": "window_start",
}
Expand All @@ -44,6 +49,7 @@ def __init__(
restricted_details: bool,
total_spend_microcents: int,
window_start: datetime,
total_capacity_microcents: Union[int, UnsetType] = unset,
**kwargs,
):
"""
Expand All @@ -64,12 +70,17 @@ def __init__(
:param restricted_details: Whether instances were withheld because their provider or model is hidden. Summary counts and totals exclude those instances.
:type restricted_details: bool

:param total_capacity_microcents: Sum of every matching instance's capacity in the window, including per-instance overrides: the combined limit of the instances counted.
:type total_capacity_microcents: int, optional

:param total_spend_microcents: Spend summed across all instances, in microcents.
:type total_spend_microcents: int

:param window_start: Start of the accounting window.
:type window_start: datetime
"""
if total_capacity_microcents is not unset:
kwargs["total_capacity_microcents"] = total_capacity_microcents
super().__init__(kwargs)

self_.budget_id = budget_id
Expand Down
38 changes: 38 additions & 0 deletions src/datadog_api_client/v2/model/ai_gateway_budget_limit_mode.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations


from datadog_api_client.model_utils import (
ModelSimple,
cached_property,
)

from typing import ClassVar


class AiGatewayBudgetLimitMode(ModelSimple):
"""
How the budget limit applies. `shared` is one limit for all matching traffic. `per_instance` is one limit for each counter of a template budget that splits by value.

:param value: Must be one of ["shared", "per_instance"].
:type value: str
"""

allowed_values = {
"shared",
"per_instance",
}
SHARED: ClassVar["AiGatewayBudgetLimitMode"]
PER_INSTANCE: ClassVar["AiGatewayBudgetLimitMode"]

@cached_property
def openapi_types(_):
return {
"value": (str,),
}


AiGatewayBudgetLimitMode.SHARED = AiGatewayBudgetLimitMode("shared")
AiGatewayBudgetLimitMode.PER_INSTANCE = AiGatewayBudgetLimitMode("per_instance")
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

if TYPE_CHECKING:
from datadog_api_client.v2.model.ai_gateway_budget_enforcement import AiGatewayBudgetEnforcement
from datadog_api_client.v2.model.ai_gateway_budget_reporting_summary import AiGatewayBudgetReportingSummary
from datadog_api_client.v2.model.ai_gateway_budget_selector_entry import AiGatewayBudgetSelectorEntry
from datadog_api_client.v2.model.ai_gateway_budget_tags import AiGatewayBudgetTags
from datadog_api_client.v2.model.ai_gateway_budget_window_policy import AiGatewayBudgetWindowPolicy
Expand All @@ -27,6 +28,7 @@ class AiGatewayBudgetListAttributes(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.ai_gateway_budget_enforcement import AiGatewayBudgetEnforcement
from datadog_api_client.v2.model.ai_gateway_budget_reporting_summary import AiGatewayBudgetReportingSummary
from datadog_api_client.v2.model.ai_gateway_budget_selector_entry import AiGatewayBudgetSelectorEntry
from datadog_api_client.v2.model.ai_gateway_budget_tags import AiGatewayBudgetTags
from datadog_api_client.v2.model.ai_gateway_budget_window_policy import AiGatewayBudgetWindowPolicy
Expand All @@ -41,6 +43,7 @@ def openapi_types(_):
"enforcement": (AiGatewayBudgetEnforcement,),
"monitor_id": (int, none_type),
"name": (str,),
"reporting_summary": (AiGatewayBudgetReportingSummary,),
"scope_restricted": (bool,),
"selector": ([AiGatewayBudgetSelectorEntry],),
"tags": (AiGatewayBudgetTags,),
Expand All @@ -63,6 +66,7 @@ def openapi_types(_):
"enforcement": "enforcement",
"monitor_id": "monitor_id",
"name": "name",
"reporting_summary": "reporting_summary",
"scope_restricted": "scope_restricted",
"selector": "selector",
"tags": "tags",
Expand Down Expand Up @@ -93,6 +97,7 @@ def __init__(
window_end: datetime,
window_policy: AiGatewayBudgetWindowPolicy,
window_start: datetime,
reporting_summary: Union[AiGatewayBudgetReportingSummary, UnsetType] = unset,
selector: Union[List[AiGatewayBudgetSelectorEntry], none_type, UnsetType] = unset,
team_id: Union[UUID, UnsetType] = unset,
user_id: Union[UUID, UnsetType] = unset,
Expand Down Expand Up @@ -128,6 +133,9 @@ def __init__(
:param name: Human-readable resource name.
:type name: str

:param reporting_summary: Health across all counters in the active accounting window. Includes hidden counters; contains no scope values or identities.
:type reporting_summary: AiGatewayBudgetReportingSummary, optional

:param scope_restricted: Whether provider or model scope metadata was withheld. Omit unchanged scope fields on an unrelated update to preserve their saved values.
:type scope_restricted: bool

Expand Down Expand Up @@ -158,6 +166,8 @@ def __init__(
:param window_start: Start of the active accounting window.
:type window_start: datetime
"""
if reporting_summary is not unset:
kwargs["reporting_summary"] = reporting_summary
if selector is not unset:
kwargs["selector"] = selector
if team_id is not unset:
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.ai_gateway_budget_limit_mode import AiGatewayBudgetLimitMode


class AiGatewayBudgetReportingSummary(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.ai_gateway_budget_limit_mode import AiGatewayBudgetLimitMode

return {
"exceeded_capacity_count": (int,),
"instance_count": (int,),
"limit_mode": (AiGatewayBudgetLimitMode,),
"over_warning_threshold_count": (int,),
"total_capacity_microcents": (int,),
}

attribute_map = {
"exceeded_capacity_count": "exceeded_capacity_count",
"instance_count": "instance_count",
"limit_mode": "limit_mode",
"over_warning_threshold_count": "over_warning_threshold_count",
"total_capacity_microcents": "total_capacity_microcents",
}

def __init__(
self_,
exceeded_capacity_count: int,
instance_count: int,
limit_mode: AiGatewayBudgetLimitMode,
over_warning_threshold_count: int,
total_capacity_microcents: int,
**kwargs,
):
"""
Health across all counters in the active accounting window. Includes hidden counters; contains no scope values or identities.

:param exceeded_capacity_count: Number of counters at or above capacity.
:type exceeded_capacity_count: int

:param instance_count: Number of counters in the active window. Counters are created on first use.
:type instance_count: int

:param limit_mode: How the budget limit applies. ``shared`` is one limit for all matching traffic. ``per_instance`` is one limit for each counter of a template budget that splits by value.
:type limit_mode: AiGatewayBudgetLimitMode

:param over_warning_threshold_count: Number of counters at or above the warning threshold.
:type over_warning_threshold_count: int

:param total_capacity_microcents: Combined capacity of the counters in the active window, in microcents. A shared budget reports its configured limit before its first counter exists.
:type total_capacity_microcents: int
"""
super().__init__(kwargs)

self_.exceeded_capacity_count = exceeded_capacity_count
self_.instance_count = instance_count
self_.limit_mode = limit_mode
self_.over_warning_threshold_count = over_warning_threshold_count
self_.total_capacity_microcents = total_capacity_microcents
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2019-Present Datadog, Inc.
from __future__ import annotations

from typing import List, Union, TYPE_CHECKING

from datadog_api_client.model_utils import (
ModelNormal,
cached_property,
datetime,
unset,
UnsetType,
)


if TYPE_CHECKING:
from datadog_api_client.v2.model.ai_gateway_model_automatic_pricing_mapping import (
AiGatewayModelAutomaticPricingMapping,
)
from datadog_api_client.v2.model.ai_gateway_model_automatic_pricing_mode_trigger import (
AiGatewayModelAutomaticPricingModeTrigger,
)
from datadog_api_client.v2.model.ai_gateway_model_automatic_pricing_rate import AiGatewayModelAutomaticPricingRate
from datadog_api_client.v2.model.ai_gateway_model_automatic_pricing_source import (
AiGatewayModelAutomaticPricingSource,
)


class AiGatewayModelAutomaticPricing(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.ai_gateway_model_automatic_pricing_mapping import (
AiGatewayModelAutomaticPricingMapping,
)
from datadog_api_client.v2.model.ai_gateway_model_automatic_pricing_mode_trigger import (
AiGatewayModelAutomaticPricingModeTrigger,
)
from datadog_api_client.v2.model.ai_gateway_model_automatic_pricing_rate import (
AiGatewayModelAutomaticPricingRate,
)
from datadog_api_client.v2.model.ai_gateway_model_automatic_pricing_source import (
AiGatewayModelAutomaticPricingSource,
)

return {
"last_validated_at": (datetime,),
"mapping": (AiGatewayModelAutomaticPricingMapping,),
"mode_triggers": ([AiGatewayModelAutomaticPricingModeTrigger],),
"observed_at": (datetime,),
"rates": ([AiGatewayModelAutomaticPricingRate],),
"source": (AiGatewayModelAutomaticPricingSource,),
"stale": (bool,),
}

attribute_map = {
"last_validated_at": "last_validated_at",
"mapping": "mapping",
"mode_triggers": "mode_triggers",
"observed_at": "observed_at",
"rates": "rates",
"source": "source",
"stale": "stale",
}

def __init__(
self_,
last_validated_at: datetime,
observed_at: datetime,
rates: List[AiGatewayModelAutomaticPricingRate],
source: AiGatewayModelAutomaticPricingSource,
stale: bool,
mapping: Union[AiGatewayModelAutomaticPricingMapping, UnsetType] = unset,
mode_triggers: Union[List[AiGatewayModelAutomaticPricingModeTrigger], UnsetType] = unset,
**kwargs,
):
"""
The published models.dev price. Present only when it is the effective price.

:param last_validated_at: Time the price was last revalidated against the source.
:type last_validated_at: datetime

:param mapping: The reviewed endpoint mapping used to identify a custom provider. Omitted when the provider and model identity matched exactly.
:type mapping: AiGatewayModelAutomaticPricingMapping, optional

:param mode_triggers: Request fields that select each priced mode, such as ``speed: fast`` for ``anthropic`` models. Omitted when the model has a single mode.
:type mode_triggers: [AiGatewayModelAutomaticPricingModeTrigger], optional

:param observed_at: Time the price was observed in the source.
:type observed_at: datetime

:param rates: Published rates.
:type rates: [AiGatewayModelAutomaticPricingRate]

:param source: The pricing source entry the price was read from.
:type source: AiGatewayModelAutomaticPricingSource

:param stale: True when the price has not been revalidated recently and is being retained as last-known-good.
:type stale: bool
"""
if mapping is not unset:
kwargs["mapping"] = mapping
if mode_triggers is not unset:
kwargs["mode_triggers"] = mode_triggers
super().__init__(kwargs)

self_.last_validated_at = last_validated_at
self_.observed_at = observed_at
self_.rates = rates
self_.source = source
self_.stale = stale
Loading
Loading