Skip to content

Commit

Permalink
Regenerate client from commit bd3fa3c3 of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed Jul 3, 2024
1 parent 5be3103 commit 3bfd669
Show file tree
Hide file tree
Showing 12 changed files with 222 additions and 35 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.6",
"regenerated": "2024-07-02 18:50:24.042736",
"spec_repo_commit": "fae9d797"
"regenerated": "2024-07-03 15:34:12.433276",
"spec_repo_commit": "bd3fa3c3"
},
"v2": {
"apigentools_version": "1.6.6",
"regenerated": "2024-07-02 18:50:24.060302",
"spec_repo_commit": "fae9d797"
"regenerated": "2024-07-03 15:34:12.451066",
"spec_repo_commit": "bd3fa3c3"
}
}
}
23 changes: 23 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -840,6 +840,8 @@ components:
Only hosts that match one of the defined tags are imported into Datadog.'
example: key:value,filter:example
type: string
metrics_config:
$ref: '#/components/schemas/AzureAccountMetricsConfig'
new_client_id:
description: Your New Azure web application ID.
example: new1c7f6-1234-5678-9101-3fcbf464test
Expand All @@ -864,6 +866,27 @@ components:
items:
$ref: '#/components/schemas/AzureAccount'
type: array
AzureAccountMetricsConfig:
description: 'Dictionary containing the key `excluded_resource_providers` which
has to be a list of Microsoft Azure Resource Provider names.

This feature is currently being beta tested.

In order to enable all resource providers for metric collection, pass:

`metrics_config: {"excluded_resource_providers": []}` (i.e., an empty list
for `excluded_resource_providers`).'
properties:
excluded_resource_providers:
description: List of Microsoft Azure Resource Providers to exclude from
metric collection.
example:
- Microsoft.Sql
- Microsoft.Cdn
items:
type: string
type: array
type: object
CancelDowntimesByScopeRequest:
description: Cancel downtimes according to scope.
properties:
Expand Down
75 changes: 61 additions & 14 deletions api/datadogV1/model_azure_account.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,11 @@ type AzureAccount struct {
// Limit the Azure instances that are pulled into Datadog by using tags.
// Only hosts that match one of the defined tags are imported into Datadog.
HostFilters *string `json:"host_filters,omitempty"`
// Dictionary containing the key `excluded_resource_providers` which has to be a list of Microsoft Azure Resource Provider names.
// This feature is currently being beta tested.
// In order to enable all resource providers for metric collection, pass:
// `metrics_config: {"excluded_resource_providers": []}` (i.e., an empty list for `excluded_resource_providers`).
MetricsConfig *AzureAccountMetricsConfig `json:"metrics_config,omitempty"`
// Your New Azure web application ID.
NewClientId *string `json:"new_client_id,omitempty"`
// Your New Azure Active Directory ID.
Expand Down Expand Up @@ -314,6 +319,34 @@ func (o *AzureAccount) SetHostFilters(v string) {
o.HostFilters = &v
}

// GetMetricsConfig returns the MetricsConfig field value if set, zero value otherwise.
func (o *AzureAccount) GetMetricsConfig() AzureAccountMetricsConfig {
if o == nil || o.MetricsConfig == nil {
var ret AzureAccountMetricsConfig
return ret
}
return *o.MetricsConfig
}

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

// HasMetricsConfig returns a boolean if a field has been set.
func (o *AzureAccount) HasMetricsConfig() bool {
return o != nil && o.MetricsConfig != nil
}

// SetMetricsConfig gets a reference to the given AzureAccountMetricsConfig and assigns it to the MetricsConfig field.
func (o *AzureAccount) SetMetricsConfig(v AzureAccountMetricsConfig) {
o.MetricsConfig = &v
}

// GetNewClientId returns the NewClientId field value if set, zero value otherwise.
func (o *AzureAccount) GetNewClientId() string {
if o == nil || o.NewClientId == nil {
Expand Down Expand Up @@ -459,6 +492,9 @@ func (o AzureAccount) MarshalJSON() ([]byte, error) {
if o.HostFilters != nil {
toSerialize["host_filters"] = o.HostFilters
}
if o.MetricsConfig != nil {
toSerialize["metrics_config"] = o.MetricsConfig
}
if o.NewClientId != nil {
toSerialize["new_client_id"] = o.NewClientId
}
Expand All @@ -481,29 +517,32 @@ func (o AzureAccount) MarshalJSON() ([]byte, error) {
// UnmarshalJSON deserializes the given payload.
func (o *AzureAccount) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
AppServicePlanFilters *string `json:"app_service_plan_filters,omitempty"`
Automute *bool `json:"automute,omitempty"`
ClientId *string `json:"client_id,omitempty"`
ClientSecret *string `json:"client_secret,omitempty"`
ContainerAppFilters *string `json:"container_app_filters,omitempty"`
CspmEnabled *bool `json:"cspm_enabled,omitempty"`
CustomMetricsEnabled *bool `json:"custom_metrics_enabled,omitempty"`
Errors []string `json:"errors,omitempty"`
HostFilters *string `json:"host_filters,omitempty"`
NewClientId *string `json:"new_client_id,omitempty"`
NewTenantName *string `json:"new_tenant_name,omitempty"`
ResourceCollectionEnabled *bool `json:"resource_collection_enabled,omitempty"`
TenantName *string `json:"tenant_name,omitempty"`
AppServicePlanFilters *string `json:"app_service_plan_filters,omitempty"`
Automute *bool `json:"automute,omitempty"`
ClientId *string `json:"client_id,omitempty"`
ClientSecret *string `json:"client_secret,omitempty"`
ContainerAppFilters *string `json:"container_app_filters,omitempty"`
CspmEnabled *bool `json:"cspm_enabled,omitempty"`
CustomMetricsEnabled *bool `json:"custom_metrics_enabled,omitempty"`
Errors []string `json:"errors,omitempty"`
HostFilters *string `json:"host_filters,omitempty"`
MetricsConfig *AzureAccountMetricsConfig `json:"metrics_config,omitempty"`
NewClientId *string `json:"new_client_id,omitempty"`
NewTenantName *string `json:"new_tenant_name,omitempty"`
ResourceCollectionEnabled *bool `json:"resource_collection_enabled,omitempty"`
TenantName *string `json:"tenant_name,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{"app_service_plan_filters", "automute", "client_id", "client_secret", "container_app_filters", "cspm_enabled", "custom_metrics_enabled", "errors", "host_filters", "new_client_id", "new_tenant_name", "resource_collection_enabled", "tenant_name"})
datadog.DeleteKeys(additionalProperties, &[]string{"app_service_plan_filters", "automute", "client_id", "client_secret", "container_app_filters", "cspm_enabled", "custom_metrics_enabled", "errors", "host_filters", "metrics_config", "new_client_id", "new_tenant_name", "resource_collection_enabled", "tenant_name"})
} else {
return err
}

hasInvalidField := false
o.AppServicePlanFilters = all.AppServicePlanFilters
o.Automute = all.Automute
o.ClientId = all.ClientId
Expand All @@ -513,6 +552,10 @@ func (o *AzureAccount) UnmarshalJSON(bytes []byte) (err error) {
o.CustomMetricsEnabled = all.CustomMetricsEnabled
o.Errors = all.Errors
o.HostFilters = all.HostFilters
if all.MetricsConfig != nil && all.MetricsConfig.UnparsedObject != nil && o.UnparsedObject == nil {
hasInvalidField = true
}
o.MetricsConfig = all.MetricsConfig
o.NewClientId = all.NewClientId
o.NewTenantName = all.NewTenantName
o.ResourceCollectionEnabled = all.ResourceCollectionEnabled
Expand All @@ -522,5 +565,9 @@ func (o *AzureAccount) UnmarshalJSON(bytes []byte) (err error) {
o.AdditionalProperties = additionalProperties
}

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

return nil
}
105 changes: 105 additions & 0 deletions api/datadogV1/model_azure_account_metrics_config.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
// 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 datadogV1

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

// AzureAccountMetricsConfig Dictionary containing the key `excluded_resource_providers` which has to be a list of Microsoft Azure Resource Provider names.
// This feature is currently being beta tested.
// In order to enable all resource providers for metric collection, pass:
// `metrics_config: {"excluded_resource_providers": []}` (i.e., an empty list for `excluded_resource_providers`).
type AzureAccountMetricsConfig struct {
// List of Microsoft Azure Resource Providers to exclude from metric collection.
ExcludedResourceProviders []string `json:"excluded_resource_providers,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{}
}

// NewAzureAccountMetricsConfig instantiates a new AzureAccountMetricsConfig 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 NewAzureAccountMetricsConfig() *AzureAccountMetricsConfig {
this := AzureAccountMetricsConfig{}
return &this
}

// NewAzureAccountMetricsConfigWithDefaults instantiates a new AzureAccountMetricsConfig 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 NewAzureAccountMetricsConfigWithDefaults() *AzureAccountMetricsConfig {
this := AzureAccountMetricsConfig{}
return &this
}

// GetExcludedResourceProviders returns the ExcludedResourceProviders field value if set, zero value otherwise.
func (o *AzureAccountMetricsConfig) GetExcludedResourceProviders() []string {
if o == nil || o.ExcludedResourceProviders == nil {
var ret []string
return ret
}
return o.ExcludedResourceProviders
}

// GetExcludedResourceProvidersOk returns a tuple with the ExcludedResourceProviders field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AzureAccountMetricsConfig) GetExcludedResourceProvidersOk() (*[]string, bool) {
if o == nil || o.ExcludedResourceProviders == nil {
return nil, false
}
return &o.ExcludedResourceProviders, true
}

// HasExcludedResourceProviders returns a boolean if a field has been set.
func (o *AzureAccountMetricsConfig) HasExcludedResourceProviders() bool {
return o != nil && o.ExcludedResourceProviders != nil
}

// SetExcludedResourceProviders gets a reference to the given []string and assigns it to the ExcludedResourceProviders field.
func (o *AzureAccountMetricsConfig) SetExcludedResourceProviders(v []string) {
o.ExcludedResourceProviders = v
}

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

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

// UnmarshalJSON deserializes the given payload.
func (o *AzureAccountMetricsConfig) UnmarshalJSON(bytes []byte) (err error) {
all := struct {
ExcludedResourceProviders []string `json:"excluded_resource_providers,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{"excluded_resource_providers"})
} else {
return err
}
o.ExcludedResourceProviders = all.ExcludedResourceProviders

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

return nil
}
8 changes: 7 additions & 1 deletion examples/v1/azure-integration/UpdateAzureHostFilters.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,13 @@ func main() {
Errors: []string{
"*",
},
HostFilters: datadog.PtrString("key:value,filter:example"),
HostFilters: datadog.PtrString("key:value,filter:example"),
MetricsConfig: &datadogV1.AzureAccountMetricsConfig{
ExcludedResourceProviders: []string{
"Microsoft.Sql",
"Microsoft.Cdn",
},
},
NewClientId: datadog.PtrString("new1c7f6-1234-5678-9101-3fcbf464test"),
NewTenantName: datadog.PtrString("new1c44-1234-5678-9101-cc00736ftest"),
ResourceCollectionEnabled: datadog.PtrBool(true),
Expand Down
8 changes: 7 additions & 1 deletion examples/v1/azure-integration/UpdateAzureIntegration.go
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,13 @@ func main() {
NewClientId: datadog.PtrString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"),
NewTenantName: datadog.PtrString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"),
ResourceCollectionEnabled: datadog.PtrBool(true),
TenantName: datadog.PtrString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"),
MetricsConfig: &datadogV1.AzureAccountMetricsConfig{
ExcludedResourceProviders: []string{
"Microsoft.Sql",
"Microsoft.Cdn",
},
},
TenantName: datadog.PtrString("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"),
}
ctx := datadog.NewDefaultContext(context.Background())
configuration := datadog.NewConfiguration()
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-02-28T20:25:59.931Z
2024-07-01T18:40:05.567Z
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
interactions:
- request:
body: |
{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17091519-0000-0000-0000-170915195900","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","new_client_id":"17091519-0000-0000-0000-170915195900","new_tenant_name":"17091519-0000-0000-0000-170915195900","resource_collection_enabled":true,"tenant_name":"17091519-0000-0000-0000-170915195900"}
{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17198592-0000-0000-0000-171985920500","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","metrics_config":{"excluded_resource_providers":["Microsoft.Sql","Microsoft.Cdn"]},"new_client_id":"17198592-0000-0000-0000-171985920500","new_tenant_name":"17198592-0000-0000-0000-171985920500","resource_collection_enabled":true,"tenant_name":"17198592-0000-0000-0000-171985920500"}
form: {}
headers:
Accept:
Expand All @@ -23,7 +23,7 @@ interactions:
status: 200 OK
- request:
body: |
{"client_id":"17091519-0000-0000-0000-170915195900","tenant_name":"17091519-0000-0000-0000-170915195900"}
{"client_id":"17198592-0000-0000-0000-171985920500","tenant_name":"17198592-0000-0000-0000-171985920500"}
form: {}
headers:
Accept:
Expand All @@ -45,7 +45,7 @@ interactions:
status: 200 OK
- request:
body: |
{"client_id":"17091519-0000-0000-0000-170915195900","tenant_name":"17091519-0000-0000-0000-170915195900"}
{"client_id":"17198592-0000-0000-0000-171985920500","tenant_name":"17198592-0000-0000-0000-171985920500"}
form: {}
headers:
Accept:
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024-02-28T20:26:00.368Z
2024-07-01T18:40:05.942Z
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
interactions:
- request:
body: |
{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17091519-0000-0000-0000-170915196000","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","new_client_id":"17091519-0000-0000-0000-170915196000","new_tenant_name":"17091519-0000-0000-0000-170915196000","resource_collection_enabled":true,"tenant_name":"17091519-0000-0000-0000-170915196000"}
{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17198592-0000-0000-0000-171985920500","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","metrics_config":{"excluded_resource_providers":["Microsoft.Sql","Microsoft.Cdn"]},"new_client_id":"17198592-0000-0000-0000-171985920500","new_tenant_name":"17198592-0000-0000-0000-171985920500","resource_collection_enabled":true,"tenant_name":"17198592-0000-0000-0000-171985920500"}
form: {}
headers:
Accept:
Expand All @@ -23,7 +23,7 @@ interactions:
status: 200 OK
- request:
body: |
{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17091519-0000-0000-0000-170915196000","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","new_client_id":"17091519-0000-0000-0000-170915196000","new_tenant_name":"17091519-0000-0000-0000-170915196000","resource_collection_enabled":true,"tenant_name":"17091519-0000-0000-0000-170915196000"}
{"app_service_plan_filters":"key:value,filter:example","automute":true,"client_id":"17198592-0000-0000-0000-171985920500","client_secret":"testingx./Sw*g/Y33t..R1cH+hScMDt","container_app_filters":"key:value,filter:example","cspm_enabled":true,"custom_metrics_enabled":true,"errors":["*"],"host_filters":"key:value,filter:example","metrics_config":{"excluded_resource_providers":["Microsoft.Sql","Microsoft.Cdn"]},"new_client_id":"17198592-0000-0000-0000-171985920500","new_tenant_name":"17198592-0000-0000-0000-171985920500","resource_collection_enabled":true,"tenant_name":"17198592-0000-0000-0000-171985920500"}
form: {}
headers:
Accept:
Expand All @@ -45,7 +45,7 @@ interactions:
status: 200 OK
- request:
body: |
{"client_id":"17091519-0000-0000-0000-170915196000","tenant_name":"17091519-0000-0000-0000-170915196000"}
{"client_id":"17198592-0000-0000-0000-171985920500","tenant_name":"17198592-0000-0000-0000-171985920500"}
form: {}
headers:
Accept:
Expand Down
Loading

0 comments on commit 3bfd669

Please sign in to comment.