Skip to content

Commit

Permalink
Regenerate client from commit 97635a60 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Jul 22, 2024
1 parent e5355cd commit a66d9e1
Show file tree
Hide file tree
Showing 4 changed files with 122 additions and 8 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-07-19 19:37:58.750999",
"spec_repo_commit": "a3f2b7d2"
"regenerated": "2024-07-22 14:26:49.710552",
"spec_repo_commit": "97635a60"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-07-19 19:37:58.775987",
"spec_repo_commit": "a3f2b7d2"
"regenerated": "2024-07-22 14:26:49.728277",
"spec_repo_commit": "97635a60"
}
}
}
24 changes: 24 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15172,6 +15172,12 @@ components:
ProjectedCostAttributes:
description: Projected Cost attributes data.
properties:
account_name:
description: The account name.
type: string
account_public_id:
description: The account public ID.
type: string
charges:
description: List of charges data reported for the requested month.
items:
Expand Down Expand Up @@ -36702,6 +36708,15 @@ paths:
schema:
format: date-time
type: string
- description: 'Boolean to specify whether to include accounts connected to
the current account as partner customers in the Datadog partner network
program. Defaults to `false`. '
in: query
name: include_connected_accounts
required: false
schema:
default: false
type: boolean
responses:
'200':
content:
Expand Down Expand Up @@ -37008,6 +37023,15 @@ paths:
required: false
schema:
type: string
- description: 'Boolean to specify whether to include accounts connected to
the current account as partner customers in the Datadog partner network
program. Defaults to `false`. '
in: query
name: include_connected_accounts
required: false
schema:
default: false
type: boolean
responses:
'200':
content:
Expand Down
26 changes: 23 additions & 3 deletions api/datadogV2/api_usage_metering.go
Original file line number Diff line number Diff line change
Expand Up @@ -357,8 +357,9 @@ func (a *UsageMeteringApi) GetEstimatedCostByOrg(ctx _context.Context, o ...GetE

// GetHistoricalCostByOrgOptionalParameters holds optional parameters for GetHistoricalCostByOrg.
type GetHistoricalCostByOrgOptionalParameters struct {
View *string
EndMonth *time.Time
View *string
EndMonth *time.Time
IncludeConnectedAccounts *bool
}

// NewGetHistoricalCostByOrgOptionalParameters creates an empty struct for parameters.
Expand All @@ -379,6 +380,12 @@ func (r *GetHistoricalCostByOrgOptionalParameters) WithEndMonth(endMonth time.Ti
return r
}

// WithIncludeConnectedAccounts sets the corresponding parameter name and returns the struct.
func (r *GetHistoricalCostByOrgOptionalParameters) WithIncludeConnectedAccounts(includeConnectedAccounts bool) *GetHistoricalCostByOrgOptionalParameters {
r.IncludeConnectedAccounts = &includeConnectedAccounts
return r
}

// GetHistoricalCostByOrg Get historical cost across your account.
// Get historical cost across multi-org and single root-org accounts.
// Cost data for a given month becomes available no later than the 16th of the following month.
Expand Down Expand Up @@ -416,6 +423,9 @@ func (a *UsageMeteringApi) GetHistoricalCostByOrg(ctx _context.Context, startMon
if optionalParams.EndMonth != nil {
localVarQueryParams.Add("end_month", datadog.ParameterToString(*optionalParams.EndMonth, ""))
}
if optionalParams.IncludeConnectedAccounts != nil {
localVarQueryParams.Add("include_connected_accounts", datadog.ParameterToString(*optionalParams.IncludeConnectedAccounts, ""))
}
localVarHeaderParams["Accept"] = "application/json;datetime-format=rfc3339"

datadog.SetAuthKeys(
Expand Down Expand Up @@ -794,7 +804,8 @@ func (a *UsageMeteringApi) GetMonthlyCostAttribution(ctx _context.Context, start

// GetProjectedCostOptionalParameters holds optional parameters for GetProjectedCost.
type GetProjectedCostOptionalParameters struct {
View *string
View *string
IncludeConnectedAccounts *bool
}

// NewGetProjectedCostOptionalParameters creates an empty struct for parameters.
Expand All @@ -809,6 +820,12 @@ func (r *GetProjectedCostOptionalParameters) WithView(view string) *GetProjected
return r
}

// WithIncludeConnectedAccounts sets the corresponding parameter name and returns the struct.
func (r *GetProjectedCostOptionalParameters) WithIncludeConnectedAccounts(includeConnectedAccounts bool) *GetProjectedCostOptionalParameters {
r.IncludeConnectedAccounts = &includeConnectedAccounts
return r
}

// GetProjectedCost Get projected cost across your account.
// Get projected cost across multi-org and single root-org accounts.
// Projected cost data is only available for the current month and becomes available around the 12th of the month.
Expand Down Expand Up @@ -842,6 +859,9 @@ func (a *UsageMeteringApi) GetProjectedCost(ctx _context.Context, o ...GetProjec
if optionalParams.View != nil {
localVarQueryParams.Add("view", datadog.ParameterToString(*optionalParams.View, ""))
}
if optionalParams.IncludeConnectedAccounts != nil {
localVarQueryParams.Add("include_connected_accounts", datadog.ParameterToString(*optionalParams.IncludeConnectedAccounts, ""))
}
localVarHeaderParams["Accept"] = "application/json;datetime-format=rfc3339"

datadog.SetAuthKeys(
Expand Down
72 changes: 71 additions & 1 deletion api/datadogV2/model_projected_cost_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import (

// ProjectedCostAttributes Projected Cost attributes data.
type ProjectedCostAttributes struct {
// The account name.
AccountName *string `json:"account_name,omitempty"`
// The account public ID.
AccountPublicId *string `json:"account_public_id,omitempty"`
// List of charges data reported for the requested month.
Charges []ChargebackBreakdown `json:"charges,omitempty"`
// The month requested.
Expand Down Expand Up @@ -46,6 +50,62 @@ func NewProjectedCostAttributesWithDefaults() *ProjectedCostAttributes {
return &this
}

// GetAccountName returns the AccountName field value if set, zero value otherwise.
func (o *ProjectedCostAttributes) GetAccountName() string {
if o == nil || o.AccountName == nil {
var ret string
return ret
}
return *o.AccountName
}

// GetAccountNameOk returns a tuple with the AccountName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectedCostAttributes) GetAccountNameOk() (*string, bool) {
if o == nil || o.AccountName == nil {
return nil, false
}
return o.AccountName, true
}

// HasAccountName returns a boolean if a field has been set.
func (o *ProjectedCostAttributes) HasAccountName() bool {
return o != nil && o.AccountName != nil
}

// SetAccountName gets a reference to the given string and assigns it to the AccountName field.
func (o *ProjectedCostAttributes) SetAccountName(v string) {
o.AccountName = &v
}

// GetAccountPublicId returns the AccountPublicId field value if set, zero value otherwise.
func (o *ProjectedCostAttributes) GetAccountPublicId() string {
if o == nil || o.AccountPublicId == nil {
var ret string
return ret
}
return *o.AccountPublicId
}

// GetAccountPublicIdOk returns a tuple with the AccountPublicId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ProjectedCostAttributes) GetAccountPublicIdOk() (*string, bool) {
if o == nil || o.AccountPublicId == nil {
return nil, false
}
return o.AccountPublicId, true
}

// HasAccountPublicId returns a boolean if a field has been set.
func (o *ProjectedCostAttributes) HasAccountPublicId() bool {
return o != nil && o.AccountPublicId != nil
}

// SetAccountPublicId gets a reference to the given string and assigns it to the AccountPublicId field.
func (o *ProjectedCostAttributes) SetAccountPublicId(v string) {
o.AccountPublicId = &v
}

// GetCharges returns the Charges field value if set, zero value otherwise.
func (o *ProjectedCostAttributes) GetCharges() []ChargebackBreakdown {
if o == nil || o.Charges == nil {
Expand Down Expand Up @@ -220,6 +280,12 @@ func (o ProjectedCostAttributes) MarshalJSON() ([]byte, error) {
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.AccountName != nil {
toSerialize["account_name"] = o.AccountName
}
if o.AccountPublicId != nil {
toSerialize["account_public_id"] = o.AccountPublicId
}
if o.Charges != nil {
toSerialize["charges"] = o.Charges
}
Expand Down Expand Up @@ -252,6 +318,8 @@ func (o ProjectedCostAttributes) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *ProjectedCostAttributes) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
AccountName *string `json:"account_name,omitempty"`
AccountPublicId *string `json:"account_public_id,omitempty"`
Charges []ChargebackBreakdown `json:"charges,omitempty"`
Date *time.Time `json:"date,omitempty"`
OrgName *string `json:"org_name,omitempty"`
Expand All @@ -264,10 +332,12 @@ func (o *ProjectedCostAttributes) UnmarshalJSON(bytes []byte) (err error) {
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"charges", "date", "org_name", "projected_total_cost", "public_id", "region"})
datadog.DeleteKeys(additionalProperties, &[]string{"account_name", "account_public_id", "charges", "date", "org_name", "projected_total_cost", "public_id", "region"})
} else {
return err
}
o.AccountName = all.AccountName
o.AccountPublicId = all.AccountPublicId
o.Charges = all.Charges
o.Date = all.Date
o.OrgName = all.OrgName
Expand Down

0 comments on commit a66d9e1

Please sign in to comment.