Skip to content

Commit

Permalink
Regenerate client from commit d7ce271f of spec repo (#1408)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <[email protected]>
Co-authored-by: api-clients-generation-pipeline[bot] <54105614+api-clients-generation-pipeline[bot]@users.noreply.github.com>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Apr 4, 2022
1 parent 96a07df commit 8f80d44
Show file tree
Hide file tree
Showing 11 changed files with 232 additions and 47 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.2",
"regenerated": "2022-04-04 09:25:03.669389",
"spec_repo_commit": "e6337d88"
"regenerated": "2022-04-04 14:19:08.560671",
"spec_repo_commit": "d7ce271f"
},
"v2": {
"apigentools_version": "1.6.2",
"regenerated": "2022-04-04 09:25:03.686826",
"spec_repo_commit": "e6337d88"
"regenerated": "2022-04-04 14:19:08.573539",
"spec_repo_commit": "d7ce271f"
}
}
}
41 changes: 36 additions & 5 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3454,6 +3454,7 @@ components:
next_record_id:
description: The cursor to get the next results (if any). To make the next
request, use the same parameters and add `next_record_id`.
nullable: true
type: string
type: object
HourlyUsageAttributionResponse:
Expand Down Expand Up @@ -6628,6 +6629,7 @@ components:
next_record_id:
description: The cursor to use to get the next results, if any. To make
the next request, use the same parameters with the addition of the `next_record_id`.
nullable: true
type: string
type: object
MonthlyUsageAttributionResponse:
Expand Down Expand Up @@ -15495,6 +15497,7 @@ components:
next_record_id:
description: The cursor to get the next results (if any). To make the next
request, use the same parameters and add `next_record_id`.
nullable: true
type: string
total_number_of_records:
description: Total number of records.
Expand Down Expand Up @@ -26151,7 +26154,13 @@ paths:
type: safe
/api/v1/usage/hourly-attribution:
get:
description: Get Hourly Usage Attribution.
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
:= 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```"
operationId: GetHourlyUsageAttribution
parameters:
- description: 'Datetime in ISO-8601 format, UTC, precise to hour: `[YYYY-MM-DDThh]`
Expand Down Expand Up @@ -26185,8 +26194,12 @@ paths:
required: false
schema:
type: string
- description: Comma separated list of tags used to group usage. If no value
- description: 'Comma separated list of tags used to group usage. If no value
is provided the usage will not be broken down by tags.


To see which tags are available, look for the value of `tag_config_source`
in the API response.'
in: query
name: tag_breakdown_keys
required: false
Expand Down Expand Up @@ -26641,7 +26654,13 @@ paths:
type: safe
/api/v1/usage/monthly-attribution:
get:
description: Get Monthly Usage Attribution.
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
:= 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```"
operationId: GetMonthlyUsageAttribution
parameters:
- description: 'Datetime in ISO-8601 format, UTC, precise to month: `[YYYY-MM]`
Expand Down Expand Up @@ -26681,8 +26700,12 @@ paths:
required: false
schema:
$ref: '#/components/schemas/MonthlyUsageAttributionSupportedMetrics'
- description: Comma separated list of tags used to group usage. If no value
is provided the usage will not be broken down by tags.
- description: 'Comma separated list of tag keys used to group usage. If no
value is provided the usage will not be broken down by tags.


To see which tags are available, look for the value of `tag_config_source`
in the API response.'
in: query
name: tag_breakdown_keys
required: false
Expand Down Expand Up @@ -26722,6 +26745,14 @@ paths:
summary: Get Monthly Usage Attribution
tags:
- Usage Metering
x-given:
monthly_usage_attribution:
parameters:
- name: start_month
value: '"{{ timeISO(''now - 3d'') }}"'
- name: fields
value: '"infra_host_usage"'
step: there is a valid "monthly_usage_attribution" response
x-menu-order: 31
x-undo:
type: safe
Expand Down
28 changes: 28 additions & 0 deletions api/v1/datadog/api_usage_metering.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,20 @@ func (r *GetHourlyUsageAttributionOptionalParameters) WithTagBreakdownKeys(tagBr
/*
* GetHourlyUsageAttribution Get Hourly Usage Attribution
* Get Hourly Usage Attribution.
*
* 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.
* Pseudo code example:
*
* ```
* response := GetHourlyUsageAttribution(start_month)
* cursor := response.metadata.pagination.next_record_id
* WHILE cursor != null BEGIN
* sleep(5 seconds) # Avoid running into rate limit
* response := GetHourlyUsageAttribution(start_month, next_record_id=cursor)
* cursor := response.metadata.pagination.next_record_id
* END
* ```
*/
func (a *UsageMeteringApiService) GetHourlyUsageAttribution(ctx _context.Context, startHr time.Time, usageType HourlyUsageAttributionUsageType, o ...GetHourlyUsageAttributionOptionalParameters) (HourlyUsageAttributionResponse, *_nethttp.Response, error) {
req := apiGetHourlyUsageAttributionRequest{
Expand Down Expand Up @@ -1025,6 +1039,20 @@ func (r *GetMonthlyUsageAttributionOptionalParameters) WithNextRecordId(nextReco
/*
* GetMonthlyUsageAttribution Get Monthly Usage Attribution
* Get Monthly Usage Attribution.
*
* 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.
* Pseudo code example:
*
* ```
* response := GetMonthlyUsageAttribution(start_month)
* cursor := response.metadata.pagination.next_record_id
* WHILE cursor != null BEGIN
* sleep(5 seconds) # Avoid running into rate limit
* response := GetMonthlyUsageAttribution(start_month, next_record_id=cursor)
* cursor := response.metadata.pagination.next_record_id
* END
* ```
*/
func (a *UsageMeteringApiService) GetMonthlyUsageAttribution(ctx _context.Context, startMonth time.Time, fields MonthlyUsageAttributionSupportedMetrics, o ...GetMonthlyUsageAttributionOptionalParameters) (MonthlyUsageAttributionResponse, *_nethttp.Response, error) {
req := apiGetMonthlyUsageAttributionRequest{
Expand Down
35 changes: 23 additions & 12 deletions api/v1/datadog/model_hourly_usage_attribution_pagination.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
// HourlyUsageAttributionPagination The metadata for the current pagination.
type HourlyUsageAttributionPagination struct {
// The cursor to get the next results (if any). To make the next request, use the same parameters and add `next_record_id`.
NextRecordId *string `json:"next_record_id,omitempty"`
NextRecordId NullableString `json:"next_record_id,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
UnparsedObject map[string]interface{} `json:-`
AdditionalProperties map[string]interface{}
Expand All @@ -36,45 +36,56 @@ func NewHourlyUsageAttributionPaginationWithDefaults() *HourlyUsageAttributionPa
return &this
}

// GetNextRecordId returns the NextRecordId field value if set, zero value otherwise.
// GetNextRecordId returns the NextRecordId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *HourlyUsageAttributionPagination) GetNextRecordId() string {
if o == nil || o.NextRecordId == nil {
if o == nil || o.NextRecordId.Get() == nil {
var ret string
return ret
}
return *o.NextRecordId
return *o.NextRecordId.Get()
}

// GetNextRecordIdOk returns a tuple with the NextRecordId field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *HourlyUsageAttributionPagination) GetNextRecordIdOk() (*string, bool) {
if o == nil || o.NextRecordId == nil {
if o == nil {
return nil, false
}
return o.NextRecordId, true
return o.NextRecordId.Get(), o.NextRecordId.IsSet()
}

// HasNextRecordId returns a boolean if a field has been set.
func (o *HourlyUsageAttributionPagination) HasNextRecordId() bool {
if o != nil && o.NextRecordId != nil {
if o != nil && o.NextRecordId.IsSet() {
return true
}

return false
}

// SetNextRecordId gets a reference to the given string and assigns it to the NextRecordId field.
// SetNextRecordId gets a reference to the given NullableString and assigns it to the NextRecordId field.
func (o *HourlyUsageAttributionPagination) SetNextRecordId(v string) {
o.NextRecordId = &v
o.NextRecordId.Set(&v)
}

// SetNextRecordIdNil sets the value for NextRecordId to be an explicit nil
func (o *HourlyUsageAttributionPagination) SetNextRecordIdNil() {
o.NextRecordId.Set(nil)
}

// UnsetNextRecordId ensures that no value is present for NextRecordId, not even an explicit nil
func (o *HourlyUsageAttributionPagination) UnsetNextRecordId() {
o.NextRecordId.Unset()
}

func (o HourlyUsageAttributionPagination) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return json.Marshal(o.UnparsedObject)
}
if o.NextRecordId != nil {
toSerialize["next_record_id"] = o.NextRecordId
if o.NextRecordId.IsSet() {
toSerialize["next_record_id"] = o.NextRecordId.Get()
}

for key, value := range o.AdditionalProperties {
Expand All @@ -86,7 +97,7 @@ func (o HourlyUsageAttributionPagination) MarshalJSON() ([]byte, error) {
func (o *HourlyUsageAttributionPagination) UnmarshalJSON(bytes []byte) (err error) {
raw := map[string]interface{}{}
all := struct {
NextRecordId *string `json:"next_record_id,omitempty"`
NextRecordId NullableString `json:"next_record_id,omitempty"`
}{}
err = json.Unmarshal(bytes, &all)
if err != nil {
Expand Down
35 changes: 23 additions & 12 deletions api/v1/datadog/model_monthly_usage_attribution_pagination.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import (
// MonthlyUsageAttributionPagination The metadata for the current pagination.
type MonthlyUsageAttributionPagination struct {
// The cursor to use to get the next results, if any. To make the next request, use the same parameters with the addition of the `next_record_id`.
NextRecordId *string `json:"next_record_id,omitempty"`
NextRecordId NullableString `json:"next_record_id,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
UnparsedObject map[string]interface{} `json:-`
AdditionalProperties map[string]interface{}
Expand All @@ -36,45 +36,56 @@ func NewMonthlyUsageAttributionPaginationWithDefaults() *MonthlyUsageAttribution
return &this
}

// GetNextRecordId returns the NextRecordId field value if set, zero value otherwise.
// GetNextRecordId returns the NextRecordId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *MonthlyUsageAttributionPagination) GetNextRecordId() string {
if o == nil || o.NextRecordId == nil {
if o == nil || o.NextRecordId.Get() == nil {
var ret string
return ret
}
return *o.NextRecordId
return *o.NextRecordId.Get()
}

// GetNextRecordIdOk returns a tuple with the NextRecordId field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *MonthlyUsageAttributionPagination) GetNextRecordIdOk() (*string, bool) {
if o == nil || o.NextRecordId == nil {
if o == nil {
return nil, false
}
return o.NextRecordId, true
return o.NextRecordId.Get(), o.NextRecordId.IsSet()
}

// HasNextRecordId returns a boolean if a field has been set.
func (o *MonthlyUsageAttributionPagination) HasNextRecordId() bool {
if o != nil && o.NextRecordId != nil {
if o != nil && o.NextRecordId.IsSet() {
return true
}

return false
}

// SetNextRecordId gets a reference to the given string and assigns it to the NextRecordId field.
// SetNextRecordId gets a reference to the given NullableString and assigns it to the NextRecordId field.
func (o *MonthlyUsageAttributionPagination) SetNextRecordId(v string) {
o.NextRecordId = &v
o.NextRecordId.Set(&v)
}

// SetNextRecordIdNil sets the value for NextRecordId to be an explicit nil
func (o *MonthlyUsageAttributionPagination) SetNextRecordIdNil() {
o.NextRecordId.Set(nil)
}

// UnsetNextRecordId ensures that no value is present for NextRecordId, not even an explicit nil
func (o *MonthlyUsageAttributionPagination) UnsetNextRecordId() {
o.NextRecordId.Unset()
}

func (o MonthlyUsageAttributionPagination) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return json.Marshal(o.UnparsedObject)
}
if o.NextRecordId != nil {
toSerialize["next_record_id"] = o.NextRecordId
if o.NextRecordId.IsSet() {
toSerialize["next_record_id"] = o.NextRecordId.Get()
}

for key, value := range o.AdditionalProperties {
Expand All @@ -86,7 +97,7 @@ func (o MonthlyUsageAttributionPagination) MarshalJSON() ([]byte, error) {
func (o *MonthlyUsageAttributionPagination) UnmarshalJSON(bytes []byte) (err error) {
raw := map[string]interface{}{}
all := struct {
NextRecordId *string `json:"next_record_id,omitempty"`
NextRecordId NullableString `json:"next_record_id,omitempty"`
}{}
err = json.Unmarshal(bytes, &all)
if err != nil {
Expand Down
Loading

0 comments on commit 8f80d44

Please sign in to comment.