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 field and note about multiregion start #1918

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-04-10 11:13:47.531585",
"spec_repo_commit": "04eeb6ee"
"regenerated": "2023-04-10 15:00:23.757906",
"spec_repo_commit": "615bff17"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2023-04-10 11:13:47.543572",
"spec_repo_commit": "04eeb6ee"
"regenerated": "2023-04-10 15:00:23.779721",
"spec_repo_commit": "615bff17"
}
}
}
26 changes: 18 additions & 8 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3606,6 +3606,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
tag_config_source:
description: The source of the usage attribution tag configuration and the
selected tags in the format of `<source_org_name>:::<selected tag 1>///<selected
Expand Down Expand Up @@ -7068,6 +7072,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
tag_config_source:
description: The source of the usage attribution tag configuration and the
selected tags in the format `<source_org_name>:::<selected tag 1>///<selected
Expand Down Expand Up @@ -28591,10 +28599,11 @@ paths:
- Usage Metering
/api/v1/usage/hourly-attribution:
get:
description: "Get hourly usage attribution.\n\nThis API endpoint is paginated.
To make sure you receive all records, check if the value of `next_record_id`
is\nset in the response. If it is, make another request and pass `next_record_id`
as a parameter.\nPseudo code example:\n\n```\nresponse := GetHourlyUsageAttribution(start_month)\ncursor
description: "Get hourly usage attribution. Multi-region data is available starting
March 1, 2023.\n\nThis API endpoint is paginated. To make sure you receive
all records, check if the value of `next_record_id` is\nset in the response.
If it is, make another request and pass `next_record_id` as a parameter.\nPseudo
code example:\n\n```\nresponse := GetHourlyUsageAttribution(start_month)\ncursor
:= response.metadata.pagination.next_record_id\nWHILE cursor != null BEGIN\n
\ sleep(5 seconds) # Avoid running into rate limit\n response := GetHourlyUsageAttribution(start_month,
next_record_id=cursor)\n cursor := response.metadata.pagination.next_record_id\nEND\n```"
Expand Down Expand Up @@ -29102,10 +29111,11 @@ paths:
- Usage Metering
/api/v1/usage/monthly-attribution:
get:
description: "Get monthly usage attribution.\n\nThis API endpoint is paginated.
To make sure you receive all records, check if the value of `next_record_id`
is\nset in the response. If it is, make another request and pass `next_record_id`
as a parameter.\nPseudo code example:\n\n```\nresponse := GetMonthlyUsageAttribution(start_month)\ncursor
description: "Get monthly usage attribution. Multi-region data is available
starting March 1, 2023.\n\nThis API endpoint is paginated. To make sure you
receive all records, check if the value of `next_record_id` is\nset in the
response. If it is, make another request and pass `next_record_id` as a parameter.\nPseudo
code example:\n\n```\nresponse := GetMonthlyUsageAttribution(start_month)\ncursor
:= response.metadata.pagination.next_record_id\nWHILE cursor != null BEGIN\n
\ sleep(5 seconds) # Avoid running into rate limit\n response := GetMonthlyUsageAttribution(start_month,
next_record_id=cursor)\n cursor := response.metadata.pagination.next_record_id\nEND\n```"
Expand Down
4 changes: 2 additions & 2 deletions api/datadogV1/api_usage_metering.go
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ func (r *GetHourlyUsageAttributionOptionalParameters) WithIncludeDescendants(inc
}

// GetHourlyUsageAttribution Get hourly usage attribution.
// Get hourly usage attribution.
// Get hourly usage attribution. Multi-region data is available starting March 1, 2023.
//
// This API endpoint is paginated. To make sure you receive all records, check if the value of `next_record_id` is
// set in the response. If it is, make another request and pass `next_record_id` as a parameter.
Expand Down Expand Up @@ -679,7 +679,7 @@ func (r *GetMonthlyUsageAttributionOptionalParameters) WithIncludeDescendants(in
}

// GetMonthlyUsageAttribution Get monthly usage attribution.
// Get monthly usage attribution.
// Get monthly usage attribution. Multi-region data is available starting March 1, 2023.
//
// This API endpoint is paginated. To make sure you receive all records, check if the value of `next_record_id` is
// set in the response. If it is, make another request and pass `next_record_id` as a parameter.
Expand Down
35 changes: 35 additions & 0 deletions api/datadogV1/model_hourly_usage_attribution_body.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ type HourlyUsageAttributionBody 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 source of the usage attribution tag configuration and the selected tags in the format of `<source_org_name>:::<selected tag 1>///<selected tag 2>///<selected tag 3>`.
TagConfigSource *string `json:"tag_config_source,omitempty"`
// Tag keys and values.
Expand Down Expand Up @@ -137,6 +139,34 @@ func (o *HourlyUsageAttributionBody) SetPublicId(v string) {
o.PublicId = &v
}

// GetRegion returns the Region field value if set, zero value otherwise.
func (o *HourlyUsageAttributionBody) 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 *HourlyUsageAttributionBody) 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 *HourlyUsageAttributionBody) 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 *HourlyUsageAttributionBody) SetRegion(v string) {
o.Region = &v
}

// GetTagConfigSource returns the TagConfigSource field value if set, zero value otherwise.
func (o *HourlyUsageAttributionBody) GetTagConfigSource() string {
if o == nil || o.TagConfigSource == nil {
Expand Down Expand Up @@ -296,6 +326,9 @@ func (o HourlyUsageAttributionBody) MarshalJSON() ([]byte, error) {
if o.PublicId != nil {
toSerialize["public_id"] = o.PublicId
}
if o.Region != nil {
toSerialize["region"] = o.Region
}
if o.TagConfigSource != nil {
toSerialize["tag_config_source"] = o.TagConfigSource
}
Expand Down Expand Up @@ -325,6 +358,7 @@ func (o *HourlyUsageAttributionBody) UnmarshalJSON(bytes []byte) (err error) {
Hour *time.Time `json:"hour,omitempty"`
OrgName *string `json:"org_name,omitempty"`
PublicId *string `json:"public_id,omitempty"`
Region *string `json:"region,omitempty"`
TagConfigSource *string `json:"tag_config_source,omitempty"`
Tags map[string][]string `json:"tags,omitempty"`
TotalUsageSum *float64 `json:"total_usage_sum,omitempty"`
Expand All @@ -351,6 +385,7 @@ func (o *HourlyUsageAttributionBody) UnmarshalJSON(bytes []byte) (err error) {
o.Hour = all.Hour
o.OrgName = all.OrgName
o.PublicId = all.PublicId
o.Region = all.Region
o.TagConfigSource = all.TagConfigSource
o.Tags = all.Tags
o.TotalUsageSum = all.TotalUsageSum
Expand Down
35 changes: 35 additions & 0 deletions api/datadogV1/model_monthly_usage_attribution_body.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ type MonthlyUsageAttributionBody 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 source of the usage attribution tag configuration and the selected tags in the format `<source_org_name>:::<selected tag 1>///<selected tag 2>///<selected tag 3>`.
TagConfigSource *string `json:"tag_config_source,omitempty"`
// Tag keys and values.
Expand Down Expand Up @@ -135,6 +137,34 @@ func (o *MonthlyUsageAttributionBody) SetPublicId(v string) {
o.PublicId = &v
}

// GetRegion returns the Region field value if set, zero value otherwise.
func (o *MonthlyUsageAttributionBody) 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 *MonthlyUsageAttributionBody) 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 *MonthlyUsageAttributionBody) 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 *MonthlyUsageAttributionBody) SetRegion(v string) {
o.Region = &v
}

// GetTagConfigSource returns the TagConfigSource field value if set, zero value otherwise.
func (o *MonthlyUsageAttributionBody) GetTagConfigSource() string {
if o == nil || o.TagConfigSource == nil {
Expand Down Expand Up @@ -266,6 +296,9 @@ func (o MonthlyUsageAttributionBody) MarshalJSON() ([]byte, error) {
if o.PublicId != nil {
toSerialize["public_id"] = o.PublicId
}
if o.Region != nil {
toSerialize["region"] = o.Region
}
if o.TagConfigSource != nil {
toSerialize["tag_config_source"] = o.TagConfigSource
}
Expand Down Expand Up @@ -296,6 +329,7 @@ func (o *MonthlyUsageAttributionBody) UnmarshalJSON(bytes []byte) (err error) {
Month *time.Time `json:"month,omitempty"`
OrgName *string `json:"org_name,omitempty"`
PublicId *string `json:"public_id,omitempty"`
Region *string `json:"region,omitempty"`
TagConfigSource *string `json:"tag_config_source,omitempty"`
Tags map[string][]string `json:"tags,omitempty"`
UpdatedAt *time.Time `json:"updated_at,omitempty"`
Expand All @@ -313,6 +347,7 @@ func (o *MonthlyUsageAttributionBody) UnmarshalJSON(bytes []byte) (err error) {
o.Month = all.Month
o.OrgName = all.OrgName
o.PublicId = all.PublicId
o.Region = all.Region
o.TagConfigSource = all.TagConfigSource
o.Tags = all.Tags
o.UpdatedAt = all.UpdatedAt
Expand Down