Skip to content
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
2,702 changes: 2,506 additions & 196 deletions .generator/schemas/v2/openapi.yaml

Large diffs are not rendered by default.

1,673 changes: 1,463 additions & 210 deletions api/datadogV2/api_cloud_cost_management.go

Large diffs are not rendered by default.

16 changes: 16 additions & 0 deletions api/datadogV2/doc.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,26 +116,42 @@
// - [CaseManagementApi.UpdateAttributes]
// - [CaseManagementApi.UpdatePriority]
// - [CaseManagementApi.UpdateStatus]
// - [CloudCostManagementApi.CreateArbitraryCostRule]
// - [CloudCostManagementApi.CreateCostAWSCURConfig]
// - [CloudCostManagementApi.CreateCostAzureUCConfigs]
// - [CloudCostManagementApi.CreateCostGCPUsageCostConfig]
// - [CloudCostManagementApi.CreateRuleset]
// - [CloudCostManagementApi.DeleteArbitraryCostRule]
// - [CloudCostManagementApi.DeleteBudget]
// - [CloudCostManagementApi.DeleteCostAWSCURConfig]
// - [CloudCostManagementApi.DeleteCostAzureUCConfig]
// - [CloudCostManagementApi.DeleteCostGCPUsageCostConfig]
// - [CloudCostManagementApi.DeleteCustomCostsFile]
// - [CloudCostManagementApi.DeleteRuleset]
// - [CloudCostManagementApi.GetArbitraryCostRule]
// - [CloudCostManagementApi.GetBudget]
// - [CloudCostManagementApi.GetCostAWSCURConfig]
// - [CloudCostManagementApi.GetCostAzureUCConfig]
// - [CloudCostManagementApi.GetCostGCPUsageCostConfig]
// - [CloudCostManagementApi.GetCustomCostsFile]
// - [CloudCostManagementApi.GetRuleset]
// - [CloudCostManagementApi.ListArbitraryCostRules]
// - [CloudCostManagementApi.ListBudgets]
// - [CloudCostManagementApi.ListCostAWSCURConfigs]
// - [CloudCostManagementApi.ListCostAzureUCConfigs]
// - [CloudCostManagementApi.ListCostGCPUsageCostConfigs]
// - [CloudCostManagementApi.ListCustomCostsFiles]
// - [CloudCostManagementApi.ListRulesets]
// - [CloudCostManagementApi.ReorderArbitraryCostRules]
// - [CloudCostManagementApi.ReorderRulesets]
// - [CloudCostManagementApi.UpdateArbitraryCostRule]
// - [CloudCostManagementApi.UpdateCostAWSCURConfig]
// - [CloudCostManagementApi.UpdateCostAzureUCConfigs]
// - [CloudCostManagementApi.UpdateCostGCPUsageCostConfig]
// - [CloudCostManagementApi.UpdateRuleset]
// - [CloudCostManagementApi.UploadCustomCostsFile]
// - [CloudCostManagementApi.UpsertBudget]
// - [CloudCostManagementApi.ValidateQuery]
// - [CloudNetworkMonitoringApi.GetAggregatedConnections]
// - [CloudNetworkMonitoringApi.GetAggregatedDns]
// - [CloudflareIntegrationApi.CreateCloudflareAccount]
Expand Down
39 changes: 25 additions & 14 deletions api/datadogV2/model_account_filtering_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ type AccountFilteringConfig struct {
// The AWS account IDs to be excluded from your billing dataset. This field is used when `include_new_accounts` is `true`.
ExcludedAccounts []string `json:"excluded_accounts,omitempty"`
// Whether or not to automatically include new member accounts by default in your billing dataset.
IncludeNewAccounts *bool `json:"include_new_accounts,omitempty"`
IncludeNewAccounts datadog.NullableBool `json:"include_new_accounts,omitempty"`
// The AWS account IDs to be included in your billing dataset. This field is used when `include_new_accounts` is `false`.
IncludedAccounts []string `json:"included_accounts,omitempty"`
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
Expand Down Expand Up @@ -66,32 +66,43 @@ func (o *AccountFilteringConfig) SetExcludedAccounts(v []string) {
o.ExcludedAccounts = v
}

// GetIncludeNewAccounts returns the IncludeNewAccounts field value if set, zero value otherwise.
// GetIncludeNewAccounts returns the IncludeNewAccounts field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *AccountFilteringConfig) GetIncludeNewAccounts() bool {
if o == nil || o.IncludeNewAccounts == nil {
if o == nil || o.IncludeNewAccounts.Get() == nil {
var ret bool
return ret
}
return *o.IncludeNewAccounts
return *o.IncludeNewAccounts.Get()
}

// GetIncludeNewAccountsOk returns a tuple with the IncludeNewAccounts 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 *AccountFilteringConfig) GetIncludeNewAccountsOk() (*bool, bool) {
if o == nil || o.IncludeNewAccounts == nil {
if o == nil {
return nil, false
}
return o.IncludeNewAccounts, true
return o.IncludeNewAccounts.Get(), o.IncludeNewAccounts.IsSet()
}

// HasIncludeNewAccounts returns a boolean if a field has been set.
func (o *AccountFilteringConfig) HasIncludeNewAccounts() bool {
return o != nil && o.IncludeNewAccounts != nil
return o != nil && o.IncludeNewAccounts.IsSet()
}

// SetIncludeNewAccounts gets a reference to the given bool and assigns it to the IncludeNewAccounts field.
// SetIncludeNewAccounts gets a reference to the given datadog.NullableBool and assigns it to the IncludeNewAccounts field.
func (o *AccountFilteringConfig) SetIncludeNewAccounts(v bool) {
o.IncludeNewAccounts = &v
o.IncludeNewAccounts.Set(&v)
}

// SetIncludeNewAccountsNil sets the value for IncludeNewAccounts to be an explicit nil.
func (o *AccountFilteringConfig) SetIncludeNewAccountsNil() {
o.IncludeNewAccounts.Set(nil)
}

// UnsetIncludeNewAccounts ensures that no value is present for IncludeNewAccounts, not even an explicit nil.
func (o *AccountFilteringConfig) UnsetIncludeNewAccounts() {
o.IncludeNewAccounts.Unset()
}

// GetIncludedAccounts returns the IncludedAccounts field value if set, zero value otherwise.
Expand Down Expand Up @@ -131,8 +142,8 @@ func (o AccountFilteringConfig) MarshalJSON() ([]byte, error) {
if o.ExcludedAccounts != nil {
toSerialize["excluded_accounts"] = o.ExcludedAccounts
}
if o.IncludeNewAccounts != nil {
toSerialize["include_new_accounts"] = o.IncludeNewAccounts
if o.IncludeNewAccounts.IsSet() {
toSerialize["include_new_accounts"] = o.IncludeNewAccounts.Get()
}
if o.IncludedAccounts != nil {
toSerialize["included_accounts"] = o.IncludedAccounts
Expand All @@ -147,9 +158,9 @@ func (o AccountFilteringConfig) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *AccountFilteringConfig) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
ExcludedAccounts []string `json:"excluded_accounts,omitempty"`
IncludeNewAccounts *bool `json:"include_new_accounts,omitempty"`
IncludedAccounts []string `json:"included_accounts,omitempty"`
ExcludedAccounts []string `json:"excluded_accounts,omitempty"`
IncludeNewAccounts datadog.NullableBool `json:"include_new_accounts,omitempty"`
IncludedAccounts []string `json:"included_accounts,omitempty"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
Expand Down
111 changes: 111 additions & 0 deletions api/datadogV2/model_arbitrary_cost_upsert_request.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
// This product includes software developed at Datadog (https://www.datadoghq.com/).
// Copyright 2019-Present Datadog, Inc.

package datadogV2

import (
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
)

// ArbitraryCostUpsertRequest The definition of `ArbitraryCostUpsertRequest` object.
type ArbitraryCostUpsertRequest struct {
// The definition of `ArbitraryCostUpsertRequestData` object.
Data *ArbitraryCostUpsertRequestData `json:"data,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{} `json:"-"`
}

// NewArbitraryCostUpsertRequest instantiates a new ArbitraryCostUpsertRequest object.
// This constructor will assign default values to properties that have it defined,
// and makes sure properties required by API are set, but the set of arguments
// will change when the set of required properties is changed.
func NewArbitraryCostUpsertRequest() *ArbitraryCostUpsertRequest {
this := ArbitraryCostUpsertRequest{}
return &this
}

// NewArbitraryCostUpsertRequestWithDefaults instantiates a new ArbitraryCostUpsertRequest object.
// This constructor will only assign default values to properties that have it defined,
// but it doesn't guarantee that properties required by API are set.
func NewArbitraryCostUpsertRequestWithDefaults() *ArbitraryCostUpsertRequest {
this := ArbitraryCostUpsertRequest{}
return &this
}

// GetData returns the Data field value if set, zero value otherwise.
func (o *ArbitraryCostUpsertRequest) GetData() ArbitraryCostUpsertRequestData {
if o == nil || o.Data == nil {
var ret ArbitraryCostUpsertRequestData
return ret
}
return *o.Data
}

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

// HasData returns a boolean if a field has been set.
func (o *ArbitraryCostUpsertRequest) HasData() bool {
return o != nil && o.Data != nil
}

// SetData gets a reference to the given ArbitraryCostUpsertRequestData and assigns it to the Data field.
func (o *ArbitraryCostUpsertRequest) SetData(v ArbitraryCostUpsertRequestData) {
o.Data = &v
}

// MarshalJSON serializes the struct using spec logic.
func (o ArbitraryCostUpsertRequest) MarshalJSON() ([]byte, error) {
toSerialize := map[string]interface{}{}
if o.UnparsedObject != nil {
return datadog.Marshal(o.UnparsedObject)
}
if o.Data != nil {
toSerialize["data"] = o.Data
}

for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return datadog.Marshal(toSerialize)
}

// UnmarshalJSON deserializes the given payload.
func (o *ArbitraryCostUpsertRequest) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
Data *ArbitraryCostUpsertRequestData `json:"data,omitempty"`
}{}
if err = datadog.Unmarshal(bytes, &all); err != nil {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}
additionalProperties := make(map[string]interface{})
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
datadog.DeleteKeys(additionalProperties, &[]string{"data"})
} else {
return err
}

hasInvalidField := false
if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.Data = all.Data

if len(additionalProperties) > 0 {
o.AdditionalProperties = additionalProperties
}

if hasInvalidField {
return datadog.Unmarshal(bytes, &o.UnparsedObject)
}

return nil
}
Loading
Loading