Skip to content

Commit e88e260

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
update hourly usage API docs for partner program (#2577)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com> Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
1 parent 05d36c0 commit e88e260

File tree

4 files changed

+112
-17
lines changed

4 files changed

+112
-17
lines changed

.apigentools-info

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@
44
"spec_versions": {
55
"v1": {
66
"apigentools_version": "1.6.6",
7-
"regenerated": "2024-07-18 17:22:34.134353",
8-
"spec_repo_commit": "9ab8be35"
7+
"regenerated": "2024-07-18 19:17:56.082385",
8+
"spec_repo_commit": "8f19ff48"
99
},
1010
"v2": {
1111
"apigentools_version": "1.6.6",
12-
"regenerated": "2024-07-18 17:22:34.158239",
13-
"spec_repo_commit": "9ab8be35"
12+
"regenerated": "2024-07-18 19:17:56.107292",
13+
"spec_repo_commit": "8f19ff48"
1414
}
1515
}
1616
}

.generator/schemas/v2/openapi.yaml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8741,6 +8741,12 @@ components:
87418741
description: Attributes of hourly usage for a product family for an org for
87428742
a time period.
87438743
properties:
8744+
account_name:
8745+
description: The account name.
8746+
type: string
8747+
account_public_id:
8748+
description: The account public ID.
8749+
type: string
87448750
measurements:
87458751
description: List of the measured usage values for the product family for
87468752
the org for the time period.
@@ -36772,6 +36778,15 @@ paths:
3677236778
schema:
3677336779
default: false
3677436780
type: boolean
36781+
- description: Boolean to specify whether to include accounts connected to the
36782+
current account as partner customers in the Datadog partner network program.
36783+
Defaults to false.
36784+
in: query
36785+
name: filter[include_connected_accounts]
36786+
required: false
36787+
schema:
36788+
default: false
36789+
type: boolean
3677536790
- description: Include breakdown of usage by subcategories where applicable
3677636791
(for product family logs only). Defaults to false.
3677736792
in: query

api/datadogV2/api_usage_metering.go

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -469,12 +469,13 @@ func (a *UsageMeteringApi) GetHistoricalCostByOrg(ctx _context.Context, startMon
469469

470470
// GetHourlyUsageOptionalParameters holds optional parameters for GetHourlyUsage.
471471
type GetHourlyUsageOptionalParameters struct {
472-
FilterTimestampEnd *time.Time
473-
FilterIncludeDescendants *bool
474-
FilterIncludeBreakdown *bool
475-
FilterVersions *string
476-
PageLimit *int32
477-
PageNextRecordId *string
472+
FilterTimestampEnd *time.Time
473+
FilterIncludeDescendants *bool
474+
FilterIncludeConnectedAccounts *bool
475+
FilterIncludeBreakdown *bool
476+
FilterVersions *string
477+
PageLimit *int32
478+
PageNextRecordId *string
478479
}
479480

480481
// NewGetHourlyUsageOptionalParameters creates an empty struct for parameters.
@@ -495,6 +496,12 @@ func (r *GetHourlyUsageOptionalParameters) WithFilterIncludeDescendants(filterIn
495496
return r
496497
}
497498

499+
// WithFilterIncludeConnectedAccounts sets the corresponding parameter name and returns the struct.
500+
func (r *GetHourlyUsageOptionalParameters) WithFilterIncludeConnectedAccounts(filterIncludeConnectedAccounts bool) *GetHourlyUsageOptionalParameters {
501+
r.FilterIncludeConnectedAccounts = &filterIncludeConnectedAccounts
502+
return r
503+
}
504+
498505
// WithFilterIncludeBreakdown sets the corresponding parameter name and returns the struct.
499506
func (r *GetHourlyUsageOptionalParameters) WithFilterIncludeBreakdown(filterIncludeBreakdown bool) *GetHourlyUsageOptionalParameters {
500507
r.FilterIncludeBreakdown = &filterIncludeBreakdown
@@ -554,6 +561,9 @@ func (a *UsageMeteringApi) GetHourlyUsage(ctx _context.Context, filterTimestampS
554561
if optionalParams.FilterIncludeDescendants != nil {
555562
localVarQueryParams.Add("filter[include_descendants]", datadog.ParameterToString(*optionalParams.FilterIncludeDescendants, ""))
556563
}
564+
if optionalParams.FilterIncludeConnectedAccounts != nil {
565+
localVarQueryParams.Add("filter[include_connected_accounts]", datadog.ParameterToString(*optionalParams.FilterIncludeConnectedAccounts, ""))
566+
}
557567
if optionalParams.FilterIncludeBreakdown != nil {
558568
localVarQueryParams.Add("filter[include_breakdown]", datadog.ParameterToString(*optionalParams.FilterIncludeBreakdown, ""))
559569
}

api/datadogV2/model_hourly_usage_attributes.go

Lines changed: 77 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ import (
1212

1313
// HourlyUsageAttributes Attributes of hourly usage for a product family for an org for a time period.
1414
type HourlyUsageAttributes struct {
15+
// The account name.
16+
AccountName *string `json:"account_name,omitempty"`
17+
// The account public ID.
18+
AccountPublicId *string `json:"account_public_id,omitempty"`
1519
// List of the measured usage values for the product family for the org for the time period.
1620
Measurements []HourlyUsageMeasurement `json:"measurements,omitempty"`
1721
// The organization name.
@@ -46,6 +50,62 @@ func NewHourlyUsageAttributesWithDefaults() *HourlyUsageAttributes {
4650
return &this
4751
}
4852

53+
// GetAccountName returns the AccountName field value if set, zero value otherwise.
54+
func (o *HourlyUsageAttributes) GetAccountName() string {
55+
if o == nil || o.AccountName == nil {
56+
var ret string
57+
return ret
58+
}
59+
return *o.AccountName
60+
}
61+
62+
// GetAccountNameOk returns a tuple with the AccountName field value if set, nil otherwise
63+
// and a boolean to check if the value has been set.
64+
func (o *HourlyUsageAttributes) GetAccountNameOk() (*string, bool) {
65+
if o == nil || o.AccountName == nil {
66+
return nil, false
67+
}
68+
return o.AccountName, true
69+
}
70+
71+
// HasAccountName returns a boolean if a field has been set.
72+
func (o *HourlyUsageAttributes) HasAccountName() bool {
73+
return o != nil && o.AccountName != nil
74+
}
75+
76+
// SetAccountName gets a reference to the given string and assigns it to the AccountName field.
77+
func (o *HourlyUsageAttributes) SetAccountName(v string) {
78+
o.AccountName = &v
79+
}
80+
81+
// GetAccountPublicId returns the AccountPublicId field value if set, zero value otherwise.
82+
func (o *HourlyUsageAttributes) GetAccountPublicId() string {
83+
if o == nil || o.AccountPublicId == nil {
84+
var ret string
85+
return ret
86+
}
87+
return *o.AccountPublicId
88+
}
89+
90+
// GetAccountPublicIdOk returns a tuple with the AccountPublicId field value if set, nil otherwise
91+
// and a boolean to check if the value has been set.
92+
func (o *HourlyUsageAttributes) GetAccountPublicIdOk() (*string, bool) {
93+
if o == nil || o.AccountPublicId == nil {
94+
return nil, false
95+
}
96+
return o.AccountPublicId, true
97+
}
98+
99+
// HasAccountPublicId returns a boolean if a field has been set.
100+
func (o *HourlyUsageAttributes) HasAccountPublicId() bool {
101+
return o != nil && o.AccountPublicId != nil
102+
}
103+
104+
// SetAccountPublicId gets a reference to the given string and assigns it to the AccountPublicId field.
105+
func (o *HourlyUsageAttributes) SetAccountPublicId(v string) {
106+
o.AccountPublicId = &v
107+
}
108+
49109
// GetMeasurements returns the Measurements field value if set, zero value otherwise.
50110
func (o *HourlyUsageAttributes) GetMeasurements() []HourlyUsageMeasurement {
51111
if o == nil || o.Measurements == nil {
@@ -220,6 +280,12 @@ func (o HourlyUsageAttributes) MarshalJSON() ([]byte, error) {
220280
if o.UnparsedObject != nil {
221281
return datadog.Marshal(o.UnparsedObject)
222282
}
283+
if o.AccountName != nil {
284+
toSerialize["account_name"] = o.AccountName
285+
}
286+
if o.AccountPublicId != nil {
287+
toSerialize["account_public_id"] = o.AccountPublicId
288+
}
223289
if o.Measurements != nil {
224290
toSerialize["measurements"] = o.Measurements
225291
}
@@ -252,22 +318,26 @@ func (o HourlyUsageAttributes) MarshalJSON() ([]byte, error) {
252318
// UnmarshalJSON deserializes the given payload.
253319
func (o *HourlyUsageAttributes) UnmarshalJSON(bytes []byte) (err error) {
254320
all := struct {
255-
Measurements []HourlyUsageMeasurement `json:"measurements,omitempty"`
256-
OrgName *string `json:"org_name,omitempty"`
257-
ProductFamily *string `json:"product_family,omitempty"`
258-
PublicId *string `json:"public_id,omitempty"`
259-
Region *string `json:"region,omitempty"`
260-
Timestamp *time.Time `json:"timestamp,omitempty"`
321+
AccountName *string `json:"account_name,omitempty"`
322+
AccountPublicId *string `json:"account_public_id,omitempty"`
323+
Measurements []HourlyUsageMeasurement `json:"measurements,omitempty"`
324+
OrgName *string `json:"org_name,omitempty"`
325+
ProductFamily *string `json:"product_family,omitempty"`
326+
PublicId *string `json:"public_id,omitempty"`
327+
Region *string `json:"region,omitempty"`
328+
Timestamp *time.Time `json:"timestamp,omitempty"`
261329
}{}
262330
if err = datadog.Unmarshal(bytes, &all); err != nil {
263331
return datadog.Unmarshal(bytes, &o.UnparsedObject)
264332
}
265333
additionalProperties := make(map[string]interface{})
266334
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
267-
datadog.DeleteKeys(additionalProperties, &[]string{"measurements", "org_name", "product_family", "public_id", "region", "timestamp"})
335+
datadog.DeleteKeys(additionalProperties, &[]string{"account_name", "account_public_id", "measurements", "org_name", "product_family", "public_id", "region", "timestamp"})
268336
} else {
269337
return err
270338
}
339+
o.AccountName = all.AccountName
340+
o.AccountPublicId = all.AccountPublicId
271341
o.Measurements = all.Measurements
272342
o.OrgName = all.OrgName
273343
o.ProductFamily = all.ProductFamily

0 commit comments

Comments
 (0)