Skip to content

Commit

Permalink
Regenerate client from commit c4c9bbbf of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Sep 18, 2024
1 parent c8d3c8e commit d1d2104
Show file tree
Hide file tree
Showing 14 changed files with 559 additions and 4 deletions.
8 changes: 4 additions & 4 deletions .apigentools-info
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@
"spec_versions": {
"v1": {
"apigentools_version": "1.6.6",
"regenerated": "2024-09-18 14:45:15.242991",
"spec_repo_commit": "bae57ce1"
"regenerated": "2024-09-18 15:50:00.894907",
"spec_repo_commit": "c4c9bbbf"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-09-18 14:45:15.259945",
"spec_repo_commit": "bae57ce1"
"regenerated": "2024-09-18 15:50:00.912494",
"spec_repo_commit": "c4c9bbbf"
}
}
}
129 changes: 129 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2175,6 +2175,73 @@ components:
- storage_account
- storage_container
type: object
BillingDimensionsMappingBody:
description: Billing dimensions mapping data.
items:
$ref: '#/components/schemas/BillingDimensionsMappingBodyItem'
type: array
BillingDimensionsMappingBodyItem:
description: The definition of `BillingDimensionsMappingBodyItem` object.
properties:
attributes:
$ref: '#/components/schemas/BillingDimensionsMappingBodyItemAttributes'
id:
description: ID of the billing dimension.
type: string
type:
$ref: '#/components/schemas/ActiveBillingDimensionsType'
type: object
BillingDimensionsMappingBodyItemAttributes:
description: Mapping of billing dimensions to endpoint keys.
properties:
endpoints:
description: List of supported endpoints with their keys mapped to the billing_dimension.
items:
$ref: '#/components/schemas/BillingDimensionsMappingBodyItemAttributesEndpointsItems'
type: array
in_app_label:
description: Label used for the billing dimension in the Plan & Usage charts.
example: APM Hosts
type: string
timestamp:
description: 'Month in ISO-8601 format, UTC, precise to second: `[YYYY-MM-DDThh:mm:ss]`.'
format: date-time
type: string
type: object
BillingDimensionsMappingBodyItemAttributesEndpointsItems:
description: An endpoint's keys mapped to the billing_dimension.
properties:
id:
description: The URL for the endpoint.
example: api/v1/usage/billable-summary
type: string
keys:
description: The billing dimension.
example:
- apm_host_top99p
- apm_host_sum
items:
example: apm_host_top99p
type: string
type: array
status:
$ref: '#/components/schemas/BillingDimensionsMappingBodyItemAttributesEndpointsItemsStatus'
type: object
BillingDimensionsMappingBodyItemAttributesEndpointsItemsStatus:
description: Denotes whether or not mapping keys were available for this endpoint.
enum:
- OK
- NOT_FOUND
type: string
x-enum-varnames:
- OK
- NOT_FOUND
BillingDimensionsMappingResponse:
description: Billing dimensions mapping response.
properties:
data:
$ref: '#/components/schemas/BillingDimensionsMappingBody'
type: object
BulkMuteFindingsRequest:
description: The new bulk mute finding request.
properties:
Expand Down Expand Up @@ -38471,6 +38538,68 @@ paths:
summary: Get hourly usage for application security
tags:
- Usage Metering
/api/v2/usage/billing_dimension_mapping:
get:
description: 'Get a mapping of billing dimensions to the corresponding keys
for the supported usage metering public API endpoints.


This endpoint is only accessible for [parent-level organizations](https://docs.datadoghq.com/account_management/multi_organization/).'
operationId: GetBillingDimensionMapping
parameters:
- description: Datetime in ISO-8601 format, UTC, for mappings beginning this
month. Defaults to the current month.
in: query
name: filter[month]
required: false
schema:
format: date-time
type: string
- description: String to specify whether to retrieve active billing dimension
mappings for the contract or all available mappings. Allowed views are `active`
and `all`. Defaults to `active`.
in: query
name: filter[view]
required: false
schema:
default: active
type: string
responses:
'200':
content:
application/json;datetime-format=rfc3339:
schema:
$ref: '#/components/schemas/BillingDimensionsMappingResponse'
description: OK
'400':
content:
application/json;datetime-format=rfc3339:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Bad Request
'403':
content:
application/json;datetime-format=rfc3339:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Forbidden - User is not authorized
'429':
content:
application/json;datetime-format=rfc3339:
schema:
$ref: '#/components/schemas/APIErrorResponse'
description: Too many requests
security:
- apiKeyAuth: []
appKeyAuth: []
- AuthZ:
- usage_read
summary: Get billing dimension mapping for usage endpoints
tags:
- Usage Metering
x-unstable: '**Note**: This endpoint is in public beta.

If you have any feedback, contact [Datadog support](https://docs.datadoghq.com/help/).'
/api/v2/usage/cost_by_org:
get:
deprecated: true
Expand Down
35 changes: 35 additions & 0 deletions docs/datadog_api_client.v2.model.rst
Original file line number Diff line number Diff line change
Expand Up @@ -725,6 +725,41 @@ datadog\_api\_client.v2.model.bill\_config module
:members:
:show-inheritance:

datadog\_api\_client.v2.model.billing\_dimensions\_mapping\_body\_item module
-----------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.billing_dimensions_mapping_body_item
:members:
:show-inheritance:

datadog\_api\_client.v2.model.billing\_dimensions\_mapping\_body\_item\_attributes module
-----------------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.billing_dimensions_mapping_body_item_attributes
:members:
:show-inheritance:

datadog\_api\_client.v2.model.billing\_dimensions\_mapping\_body\_item\_attributes\_endpoints\_items module
-----------------------------------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.billing_dimensions_mapping_body_item_attributes_endpoints_items
:members:
:show-inheritance:

datadog\_api\_client.v2.model.billing\_dimensions\_mapping\_body\_item\_attributes\_endpoints\_items\_status module
-------------------------------------------------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.billing_dimensions_mapping_body_item_attributes_endpoints_items_status
:members:
:show-inheritance:

datadog\_api\_client.v2.model.billing\_dimensions\_mapping\_response module
---------------------------------------------------------------------------

.. automodule:: datadog_api_client.v2.model.billing_dimensions_mapping_response
:members:
:show-inheritance:

datadog\_api\_client.v2.model.bulk\_mute\_findings\_request module
------------------------------------------------------------------

Expand Down
14 changes: 14 additions & 0 deletions examples/v2/usage-metering/GetBillingDimensionMapping.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
"""
Get billing dimension mapping for usage endpoints returns "OK" response
"""

from datadog_api_client import ApiClient, Configuration
from datadog_api_client.v2.api.usage_metering_api import UsageMeteringApi

configuration = Configuration()
configuration.unstable_operations["get_billing_dimension_mapping"] = True
with ApiClient(configuration) as api_client:
api_instance = UsageMeteringApi(api_client)
response = api_instance.get_billing_dimension_mapping()

print(response)
1 change: 1 addition & 0 deletions src/datadog_api_client/configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,7 @@ def __init__(
"v2.list_apis": False,
"v2.update_open_api": False,
"v2.get_active_billing_dimensions": False,
"v2.get_billing_dimension_mapping": False,
"v2.get_monthly_cost_attribution": False,
"v2.create_dora_deployment": False,
"v2.create_dora_incident": False,
Expand Down
55 changes: 55 additions & 0 deletions src/datadog_api_client/v2/api/usage_metering_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from datadog_api_client.v2.model.usage_application_security_monitoring_response import (
UsageApplicationSecurityMonitoringResponse,
)
from datadog_api_client.v2.model.billing_dimensions_mapping_response import BillingDimensionsMappingResponse
from datadog_api_client.v2.model.cost_by_org_response import CostByOrgResponse
from datadog_api_client.v2.model.hourly_usage_response import HourlyUsageResponse
from datadog_api_client.v2.model.usage_lambda_traced_invocations_response import UsageLambdaTracedInvocationsResponse
Expand Down Expand Up @@ -61,6 +62,33 @@ def __init__(self, api_client=None):
api_client=api_client,
)

self._get_billing_dimension_mapping_endpoint = _Endpoint(
settings={
"response_type": (BillingDimensionsMappingResponse,),
"auth": ["apiKeyAuth", "appKeyAuth", "AuthZ"],
"endpoint_path": "/api/v2/usage/billing_dimension_mapping",
"operation_id": "get_billing_dimension_mapping",
"http_method": "GET",
"version": "v2",
},
params_map={
"filter_month": {
"openapi_types": (datetime,),
"attribute": "filter[month]",
"location": "query",
},
"filter_view": {
"openapi_types": (str,),
"attribute": "filter[view]",
"location": "query",
},
},
headers_map={
"accept": ["application/json;datetime-format=rfc3339"],
},
api_client=api_client,
)

self._get_cost_by_org_endpoint = _Endpoint(
settings={
"response_type": (CostByOrgResponse,),
Expand Down Expand Up @@ -425,6 +453,33 @@ def get_active_billing_dimensions(
kwargs: Dict[str, Any] = {}
return self._get_active_billing_dimensions_endpoint.call_with_http_info(**kwargs)

def get_billing_dimension_mapping(
self,
*,
filter_month: Union[datetime, UnsetType] = unset,
filter_view: Union[str, UnsetType] = unset,
) -> BillingDimensionsMappingResponse:
"""Get billing dimension mapping for usage endpoints.
Get a mapping of billing dimensions to the corresponding keys for the supported usage metering public API endpoints.
This endpoint is only accessible for `parent-level organizations <https://docs.datadoghq.com/account_management/multi_organization/>`_.
:param filter_month: Datetime in ISO-8601 format, UTC, for mappings beginning this month. Defaults to the current month.
:type filter_month: datetime, optional
:param filter_view: String to specify whether to retrieve active billing dimension mappings for the contract or all available mappings. Allowed views are ``active`` and ``all``. Defaults to ``active``.
:type filter_view: str, optional
:rtype: BillingDimensionsMappingResponse
"""
kwargs: Dict[str, Any] = {}
if filter_month is not unset:
kwargs["filter_month"] = filter_month

if filter_view is not unset:
kwargs["filter_view"] = filter_view

return self._get_billing_dimension_mapping_endpoint.call_with_http_info(**kwargs)

def get_cost_by_org(
self,
start_month: datetime,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
# 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 Union, TYPE_CHECKING

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


if TYPE_CHECKING:
from datadog_api_client.v2.model.billing_dimensions_mapping_body_item_attributes import (
BillingDimensionsMappingBodyItemAttributes,
)
from datadog_api_client.v2.model.active_billing_dimensions_type import ActiveBillingDimensionsType


class BillingDimensionsMappingBodyItem(ModelNormal):
@cached_property
def openapi_types(_):
from datadog_api_client.v2.model.billing_dimensions_mapping_body_item_attributes import (
BillingDimensionsMappingBodyItemAttributes,
)
from datadog_api_client.v2.model.active_billing_dimensions_type import ActiveBillingDimensionsType

return {
"attributes": (BillingDimensionsMappingBodyItemAttributes,),
"id": (str,),
"type": (ActiveBillingDimensionsType,),
}

attribute_map = {
"attributes": "attributes",
"id": "id",
"type": "type",
}

def __init__(
self_,
attributes: Union[BillingDimensionsMappingBodyItemAttributes, UnsetType] = unset,
id: Union[str, UnsetType] = unset,
type: Union[ActiveBillingDimensionsType, UnsetType] = unset,
**kwargs,
):
"""
The definition of ``BillingDimensionsMappingBodyItem`` object.
:param attributes: Mapping of billing dimensions to endpoint keys.
:type attributes: BillingDimensionsMappingBodyItemAttributes, optional
:param id: ID of the billing dimension.
:type id: str, optional
:param type: Type of active billing dimensions data.
:type type: ActiveBillingDimensionsType, optional
"""
if attributes is not unset:
kwargs["attributes"] = attributes
if id is not unset:
kwargs["id"] = id
if type is not unset:
kwargs["type"] = type
super().__init__(kwargs)
Loading

0 comments on commit d1d2104

Please sign in to comment.