Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add region to estimated cost and historical cost response #1855

Merged
Merged
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
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.4",
"regenerated": "2023-02-06 19:15:22.999757",
"spec_repo_commit": "7d2f8965"
"regenerated": "2023-02-06 19:26:33.416623",
"spec_repo_commit": "61fed166"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2023-02-06 19:15:23.014132",
"spec_repo_commit": "7d2f8965"
"regenerated": "2023-02-06 19:26:33.428392",
"spec_repo_commit": "61fed166"
}
}
}
4 changes: 4 additions & 0 deletions .generator/schemas/v2/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2626,6 +2626,10 @@ components:
public_id:
description: The organization public ID.
type: string
region:
description: The region of the Datadog instance that the organization belongs
to.
type: string
total_cost:
description: The total cost of products for the month.
format: double
Expand Down
35 changes: 35 additions & 0 deletions api/datadogV2/model_cost_by_org_attributes.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ type CostByOrgAttributes struct {
OrgName *string `json:"org_name,omitempty"`
// The organization public ID.
PublicId *string `json:"public_id,omitempty"`
// The region of the Datadog instance that the organization belongs to.
Region *string `json:"region,omitempty"`
// The total cost of products for the month.
TotalCost *float64 `json:"total_cost,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
Expand Down Expand Up @@ -155,6 +157,34 @@ func (o *CostByOrgAttributes) SetPublicId(v string) {
o.PublicId = &v
}

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

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

// HasRegion returns a boolean if a field has been set.
func (o *CostByOrgAttributes) HasRegion() bool {
return o != nil && o.Region != nil
}

// SetRegion gets a reference to the given string and assigns it to the Region field.
func (o *CostByOrgAttributes) SetRegion(v string) {
o.Region = &v
}

// GetTotalCost returns the TotalCost field value if set, zero value otherwise.
func (o *CostByOrgAttributes) GetTotalCost() float64 {
if o == nil || o.TotalCost == nil {
Expand Down Expand Up @@ -205,6 +235,9 @@ func (o CostByOrgAttributes) MarshalJSON() ([]byte, error) {
if o.PublicId != nil {
toSerialize["public_id"] = o.PublicId
}
if o.Region != nil {
toSerialize["region"] = o.Region
}
if o.TotalCost != nil {
toSerialize["total_cost"] = o.TotalCost
}
Expand All @@ -223,6 +256,7 @@ func (o *CostByOrgAttributes) UnmarshalJSON(bytes []byte) (err error) {
Date *time.Time `json:"date,omitempty"`
OrgName *string `json:"org_name,omitempty"`
PublicId *string `json:"public_id,omitempty"`
Region *string `json:"region,omitempty"`
TotalCost *float64 `json:"total_cost,omitempty"`
}{}
err = json.Unmarshal(bytes, &all)
Expand All @@ -238,6 +272,7 @@ func (o *CostByOrgAttributes) UnmarshalJSON(bytes []byte) (err error) {
o.Date = all.Date
o.OrgName = all.OrgName
o.PublicId = all.PublicId
o.Region = all.Region
o.TotalCost = all.TotalCost
return nil
}