Skip to content

Commit f633971

Browse files
api-clients-generation-pipeline[bot]ci.datadog-api-spec
andauthored
Add tag pipeline, custom allocation rule and get cloud account by id for AWS/Azure/GCP configs APIs (DataDog#3353)
Co-authored-by: ci.datadog-api-spec <packages@datadoghq.com>
1 parent b6726fc commit f633971

181 files changed

Lines changed: 20822 additions & 768 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.generator/schemas/v2/openapi.yaml

Lines changed: 2506 additions & 196 deletions
Large diffs are not rendered by default.

api/datadogV2/api_cloud_cost_management.go

Lines changed: 1463 additions & 210 deletions
Large diffs are not rendered by default.

api/datadogV2/doc.go

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,26 +116,42 @@
116116
// - [CaseManagementApi.UpdateAttributes]
117117
// - [CaseManagementApi.UpdatePriority]
118118
// - [CaseManagementApi.UpdateStatus]
119+
// - [CloudCostManagementApi.CreateArbitraryCostRule]
119120
// - [CloudCostManagementApi.CreateCostAWSCURConfig]
120121
// - [CloudCostManagementApi.CreateCostAzureUCConfigs]
121122
// - [CloudCostManagementApi.CreateCostGCPUsageCostConfig]
123+
// - [CloudCostManagementApi.CreateRuleset]
124+
// - [CloudCostManagementApi.DeleteArbitraryCostRule]
122125
// - [CloudCostManagementApi.DeleteBudget]
123126
// - [CloudCostManagementApi.DeleteCostAWSCURConfig]
124127
// - [CloudCostManagementApi.DeleteCostAzureUCConfig]
125128
// - [CloudCostManagementApi.DeleteCostGCPUsageCostConfig]
126129
// - [CloudCostManagementApi.DeleteCustomCostsFile]
130+
// - [CloudCostManagementApi.DeleteRuleset]
131+
// - [CloudCostManagementApi.GetArbitraryCostRule]
127132
// - [CloudCostManagementApi.GetBudget]
133+
// - [CloudCostManagementApi.GetCostAWSCURConfig]
134+
// - [CloudCostManagementApi.GetCostAzureUCConfig]
135+
// - [CloudCostManagementApi.GetCostGCPUsageCostConfig]
128136
// - [CloudCostManagementApi.GetCustomCostsFile]
137+
// - [CloudCostManagementApi.GetRuleset]
138+
// - [CloudCostManagementApi.ListArbitraryCostRules]
129139
// - [CloudCostManagementApi.ListBudgets]
130140
// - [CloudCostManagementApi.ListCostAWSCURConfigs]
131141
// - [CloudCostManagementApi.ListCostAzureUCConfigs]
132142
// - [CloudCostManagementApi.ListCostGCPUsageCostConfigs]
133143
// - [CloudCostManagementApi.ListCustomCostsFiles]
144+
// - [CloudCostManagementApi.ListRulesets]
145+
// - [CloudCostManagementApi.ReorderArbitraryCostRules]
146+
// - [CloudCostManagementApi.ReorderRulesets]
147+
// - [CloudCostManagementApi.UpdateArbitraryCostRule]
134148
// - [CloudCostManagementApi.UpdateCostAWSCURConfig]
135149
// - [CloudCostManagementApi.UpdateCostAzureUCConfigs]
136150
// - [CloudCostManagementApi.UpdateCostGCPUsageCostConfig]
151+
// - [CloudCostManagementApi.UpdateRuleset]
137152
// - [CloudCostManagementApi.UploadCustomCostsFile]
138153
// - [CloudCostManagementApi.UpsertBudget]
154+
// - [CloudCostManagementApi.ValidateQuery]
139155
// - [CloudNetworkMonitoringApi.GetAggregatedConnections]
140156
// - [CloudNetworkMonitoringApi.GetAggregatedDns]
141157
// - [CloudflareIntegrationApi.CreateCloudflareAccount]

api/datadogV2/model_account_filtering_config.go

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type AccountFilteringConfig struct {
1313
// The AWS account IDs to be excluded from your billing dataset. This field is used when `include_new_accounts` is `true`.
1414
ExcludedAccounts []string `json:"excluded_accounts,omitempty"`
1515
// Whether or not to automatically include new member accounts by default in your billing dataset.
16-
IncludeNewAccounts *bool `json:"include_new_accounts,omitempty"`
16+
IncludeNewAccounts datadog.NullableBool `json:"include_new_accounts,omitempty"`
1717
// The AWS account IDs to be included in your billing dataset. This field is used when `include_new_accounts` is `false`.
1818
IncludedAccounts []string `json:"included_accounts,omitempty"`
1919
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
@@ -66,32 +66,43 @@ func (o *AccountFilteringConfig) SetExcludedAccounts(v []string) {
6666
o.ExcludedAccounts = v
6767
}
6868

69-
// GetIncludeNewAccounts returns the IncludeNewAccounts field value if set, zero value otherwise.
69+
// GetIncludeNewAccounts returns the IncludeNewAccounts field value if set, zero value otherwise (both if not set or set to explicit null).
7070
func (o *AccountFilteringConfig) GetIncludeNewAccounts() bool {
71-
if o == nil || o.IncludeNewAccounts == nil {
71+
if o == nil || o.IncludeNewAccounts.Get() == nil {
7272
var ret bool
7373
return ret
7474
}
75-
return *o.IncludeNewAccounts
75+
return *o.IncludeNewAccounts.Get()
7676
}
7777

7878
// GetIncludeNewAccountsOk returns a tuple with the IncludeNewAccounts field value if set, nil otherwise
7979
// and a boolean to check if the value has been set.
80+
// NOTE: If the value is an explicit nil, `nil, true` will be returned.
8081
func (o *AccountFilteringConfig) GetIncludeNewAccountsOk() (*bool, bool) {
81-
if o == nil || o.IncludeNewAccounts == nil {
82+
if o == nil {
8283
return nil, false
8384
}
84-
return o.IncludeNewAccounts, true
85+
return o.IncludeNewAccounts.Get(), o.IncludeNewAccounts.IsSet()
8586
}
8687

8788
// HasIncludeNewAccounts returns a boolean if a field has been set.
8889
func (o *AccountFilteringConfig) HasIncludeNewAccounts() bool {
89-
return o != nil && o.IncludeNewAccounts != nil
90+
return o != nil && o.IncludeNewAccounts.IsSet()
9091
}
9192

92-
// SetIncludeNewAccounts gets a reference to the given bool and assigns it to the IncludeNewAccounts field.
93+
// SetIncludeNewAccounts gets a reference to the given datadog.NullableBool and assigns it to the IncludeNewAccounts field.
9394
func (o *AccountFilteringConfig) SetIncludeNewAccounts(v bool) {
94-
o.IncludeNewAccounts = &v
95+
o.IncludeNewAccounts.Set(&v)
96+
}
97+
98+
// SetIncludeNewAccountsNil sets the value for IncludeNewAccounts to be an explicit nil.
99+
func (o *AccountFilteringConfig) SetIncludeNewAccountsNil() {
100+
o.IncludeNewAccounts.Set(nil)
101+
}
102+
103+
// UnsetIncludeNewAccounts ensures that no value is present for IncludeNewAccounts, not even an explicit nil.
104+
func (o *AccountFilteringConfig) UnsetIncludeNewAccounts() {
105+
o.IncludeNewAccounts.Unset()
95106
}
96107

97108
// GetIncludedAccounts returns the IncludedAccounts field value if set, zero value otherwise.
@@ -131,8 +142,8 @@ func (o AccountFilteringConfig) MarshalJSON() ([]byte, error) {
131142
if o.ExcludedAccounts != nil {
132143
toSerialize["excluded_accounts"] = o.ExcludedAccounts
133144
}
134-
if o.IncludeNewAccounts != nil {
135-
toSerialize["include_new_accounts"] = o.IncludeNewAccounts
145+
if o.IncludeNewAccounts.IsSet() {
146+
toSerialize["include_new_accounts"] = o.IncludeNewAccounts.Get()
136147
}
137148
if o.IncludedAccounts != nil {
138149
toSerialize["included_accounts"] = o.IncludedAccounts
@@ -147,9 +158,9 @@ func (o AccountFilteringConfig) MarshalJSON() ([]byte, error) {
147158
// UnmarshalJSON deserializes the given payload.
148159
func (o *AccountFilteringConfig) UnmarshalJSON(bytes []byte) (err error) {
149160
all := struct {
150-
ExcludedAccounts []string `json:"excluded_accounts,omitempty"`
151-
IncludeNewAccounts *bool `json:"include_new_accounts,omitempty"`
152-
IncludedAccounts []string `json:"included_accounts,omitempty"`
161+
ExcludedAccounts []string `json:"excluded_accounts,omitempty"`
162+
IncludeNewAccounts datadog.NullableBool `json:"include_new_accounts,omitempty"`
163+
IncludedAccounts []string `json:"included_accounts,omitempty"`
153164
}{}
154165
if err = datadog.Unmarshal(bytes, &all); err != nil {
155166
return datadog.Unmarshal(bytes, &o.UnparsedObject)
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
// Unless explicitly stated otherwise all files in this repository are licensed under the Apache-2.0 License.
2+
// This product includes software developed at Datadog (https://www.datadoghq.com/).
3+
// Copyright 2019-Present Datadog, Inc.
4+
5+
package datadogV2
6+
7+
import (
8+
"github.com/DataDog/datadog-api-client-go/v2/api/datadog"
9+
)
10+
11+
// ArbitraryCostUpsertRequest The definition of `ArbitraryCostUpsertRequest` object.
12+
type ArbitraryCostUpsertRequest struct {
13+
// The definition of `ArbitraryCostUpsertRequestData` object.
14+
Data *ArbitraryCostUpsertRequestData `json:"data,omitempty"`
15+
// UnparsedObject contains the raw value of the object if there was an error when deserializing into the struct
16+
UnparsedObject map[string]interface{} `json:"-"`
17+
AdditionalProperties map[string]interface{} `json:"-"`
18+
}
19+
20+
// NewArbitraryCostUpsertRequest instantiates a new ArbitraryCostUpsertRequest object.
21+
// This constructor will assign default values to properties that have it defined,
22+
// and makes sure properties required by API are set, but the set of arguments
23+
// will change when the set of required properties is changed.
24+
func NewArbitraryCostUpsertRequest() *ArbitraryCostUpsertRequest {
25+
this := ArbitraryCostUpsertRequest{}
26+
return &this
27+
}
28+
29+
// NewArbitraryCostUpsertRequestWithDefaults instantiates a new ArbitraryCostUpsertRequest object.
30+
// This constructor will only assign default values to properties that have it defined,
31+
// but it doesn't guarantee that properties required by API are set.
32+
func NewArbitraryCostUpsertRequestWithDefaults() *ArbitraryCostUpsertRequest {
33+
this := ArbitraryCostUpsertRequest{}
34+
return &this
35+
}
36+
37+
// GetData returns the Data field value if set, zero value otherwise.
38+
func (o *ArbitraryCostUpsertRequest) GetData() ArbitraryCostUpsertRequestData {
39+
if o == nil || o.Data == nil {
40+
var ret ArbitraryCostUpsertRequestData
41+
return ret
42+
}
43+
return *o.Data
44+
}
45+
46+
// GetDataOk returns a tuple with the Data field value if set, nil otherwise
47+
// and a boolean to check if the value has been set.
48+
func (o *ArbitraryCostUpsertRequest) GetDataOk() (*ArbitraryCostUpsertRequestData, bool) {
49+
if o == nil || o.Data == nil {
50+
return nil, false
51+
}
52+
return o.Data, true
53+
}
54+
55+
// HasData returns a boolean if a field has been set.
56+
func (o *ArbitraryCostUpsertRequest) HasData() bool {
57+
return o != nil && o.Data != nil
58+
}
59+
60+
// SetData gets a reference to the given ArbitraryCostUpsertRequestData and assigns it to the Data field.
61+
func (o *ArbitraryCostUpsertRequest) SetData(v ArbitraryCostUpsertRequestData) {
62+
o.Data = &v
63+
}
64+
65+
// MarshalJSON serializes the struct using spec logic.
66+
func (o ArbitraryCostUpsertRequest) MarshalJSON() ([]byte, error) {
67+
toSerialize := map[string]interface{}{}
68+
if o.UnparsedObject != nil {
69+
return datadog.Marshal(o.UnparsedObject)
70+
}
71+
if o.Data != nil {
72+
toSerialize["data"] = o.Data
73+
}
74+
75+
for key, value := range o.AdditionalProperties {
76+
toSerialize[key] = value
77+
}
78+
return datadog.Marshal(toSerialize)
79+
}
80+
81+
// UnmarshalJSON deserializes the given payload.
82+
func (o *ArbitraryCostUpsertRequest) UnmarshalJSON(bytes []byte) (err error) {
83+
all := struct {
84+
Data *ArbitraryCostUpsertRequestData `json:"data,omitempty"`
85+
}{}
86+
if err = datadog.Unmarshal(bytes, &all); err != nil {
87+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
88+
}
89+
additionalProperties := make(map[string]interface{})
90+
if err = datadog.Unmarshal(bytes, &additionalProperties); err == nil {
91+
datadog.DeleteKeys(additionalProperties, &[]string{"data"})
92+
} else {
93+
return err
94+
}
95+
96+
hasInvalidField := false
97+
if all.Data != nil && all.Data.UnparsedObject != nil && o.UnparsedObject == nil {
98+
hasInvalidField = true
99+
}
100+
o.Data = all.Data
101+
102+
if len(additionalProperties) > 0 {
103+
o.AdditionalProperties = additionalProperties
104+
}
105+
106+
if hasInvalidField {
107+
return datadog.Unmarshal(bytes, &o.UnparsedObject)
108+
}
109+
110+
return nil
111+
}

0 commit comments

Comments
 (0)