From 897ff56fcc0a67629b94af2d5cfc51922d59c7d0 Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Thu, 12 Oct 2023 17:30:58 +0000 Subject: [PATCH] Regenerate client from commit 201be608 of spec repo --- .apigentools-info | 8 +- .generator/schemas/v1/openapi.yaml | 18 +++ api/datadogV1/model_ip_prefixes_global.go | 139 ++++++++++++++++++++++ api/datadogV1/model_ip_ranges.go | 40 ++++++- 4 files changed, 200 insertions(+), 5 deletions(-) create mode 100644 api/datadogV1/model_ip_prefixes_global.go diff --git a/.apigentools-info b/.apigentools-info index e2562b8c5a8..fec3bf654e6 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.6", - "regenerated": "2023-10-12 16:54:30.986438", - "spec_repo_commit": "a04c27c5" + "regenerated": "2023-10-12 17:29:32.714151", + "spec_repo_commit": "201be608" }, "v2": { "apigentools_version": "1.6.6", - "regenerated": "2023-10-12 16:54:31.006071", - "spec_repo_commit": "a04c27c5" + "regenerated": "2023-10-12 17:29:32.729493", + "spec_repo_commit": "201be608" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index c4526d0aebe..a6c770382c4 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -4045,6 +4045,22 @@ components: type: string type: array type: object + IPPrefixesGlobal: + description: Available prefix information for all Datadog endpoints. + properties: + prefixes_ipv4: + description: List of IPv4 prefixes. + items: + description: IPv4 prefix + type: string + type: array + prefixes_ipv6: + description: List of IPv6 prefixes. + items: + description: IPv6 prefix + type: string + type: array + type: object IPPrefixesLogs: description: Available prefix information for the Logs endpoints. properties: @@ -4185,6 +4201,8 @@ components: $ref: '#/components/schemas/IPPrefixesAPI' apm: $ref: '#/components/schemas/IPPrefixesAPM' + global: + $ref: '#/components/schemas/IPPrefixesGlobal' logs: $ref: '#/components/schemas/IPPrefixesLogs' modified: diff --git a/api/datadogV1/model_ip_prefixes_global.go b/api/datadogV1/model_ip_prefixes_global.go new file mode 100644 index 00000000000..53cece57fa4 --- /dev/null +++ b/api/datadogV1/model_ip_prefixes_global.go @@ -0,0 +1,139 @@ +// 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/goccy/go-json" + + "github.com/DataDog/datadog-api-client-go/v2/api/datadog" +) + +// IPPrefixesGlobal Available prefix information for all Datadog endpoints. +type IPPrefixesGlobal struct { + // List of IPv4 prefixes. + PrefixesIpv4 []string `json:"prefixes_ipv4,omitempty"` + // List of IPv6 prefixes. + PrefixesIpv6 []string `json:"prefixes_ipv6,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{} +} + +// NewIPPrefixesGlobal instantiates a new IPPrefixesGlobal 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 NewIPPrefixesGlobal() *IPPrefixesGlobal { + this := IPPrefixesGlobal{} + return &this +} + +// NewIPPrefixesGlobalWithDefaults instantiates a new IPPrefixesGlobal 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 NewIPPrefixesGlobalWithDefaults() *IPPrefixesGlobal { + this := IPPrefixesGlobal{} + return &this +} + +// GetPrefixesIpv4 returns the PrefixesIpv4 field value if set, zero value otherwise. +func (o *IPPrefixesGlobal) GetPrefixesIpv4() []string { + if o == nil || o.PrefixesIpv4 == nil { + var ret []string + return ret + } + return o.PrefixesIpv4 +} + +// GetPrefixesIpv4Ok returns a tuple with the PrefixesIpv4 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPPrefixesGlobal) GetPrefixesIpv4Ok() (*[]string, bool) { + if o == nil || o.PrefixesIpv4 == nil { + return nil, false + } + return &o.PrefixesIpv4, true +} + +// HasPrefixesIpv4 returns a boolean if a field has been set. +func (o *IPPrefixesGlobal) HasPrefixesIpv4() bool { + return o != nil && o.PrefixesIpv4 != nil +} + +// SetPrefixesIpv4 gets a reference to the given []string and assigns it to the PrefixesIpv4 field. +func (o *IPPrefixesGlobal) SetPrefixesIpv4(v []string) { + o.PrefixesIpv4 = v +} + +// GetPrefixesIpv6 returns the PrefixesIpv6 field value if set, zero value otherwise. +func (o *IPPrefixesGlobal) GetPrefixesIpv6() []string { + if o == nil || o.PrefixesIpv6 == nil { + var ret []string + return ret + } + return o.PrefixesIpv6 +} + +// GetPrefixesIpv6Ok returns a tuple with the PrefixesIpv6 field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPPrefixesGlobal) GetPrefixesIpv6Ok() (*[]string, bool) { + if o == nil || o.PrefixesIpv6 == nil { + return nil, false + } + return &o.PrefixesIpv6, true +} + +// HasPrefixesIpv6 returns a boolean if a field has been set. +func (o *IPPrefixesGlobal) HasPrefixesIpv6() bool { + return o != nil && o.PrefixesIpv6 != nil +} + +// SetPrefixesIpv6 gets a reference to the given []string and assigns it to the PrefixesIpv6 field. +func (o *IPPrefixesGlobal) SetPrefixesIpv6(v []string) { + o.PrefixesIpv6 = v +} + +// MarshalJSON serializes the struct using spec logic. +func (o IPPrefixesGlobal) MarshalJSON() ([]byte, error) { + toSerialize := map[string]interface{}{} + if o.UnparsedObject != nil { + return json.Marshal(o.UnparsedObject) + } + if o.PrefixesIpv4 != nil { + toSerialize["prefixes_ipv4"] = o.PrefixesIpv4 + } + if o.PrefixesIpv6 != nil { + toSerialize["prefixes_ipv6"] = o.PrefixesIpv6 + } + + for key, value := range o.AdditionalProperties { + toSerialize[key] = value + } + return json.Marshal(toSerialize) +} + +// UnmarshalJSON deserializes the given payload. +func (o *IPPrefixesGlobal) UnmarshalJSON(bytes []byte) (err error) { + all := struct { + PrefixesIpv4 []string `json:"prefixes_ipv4,omitempty"` + PrefixesIpv6 []string `json:"prefixes_ipv6,omitempty"` + }{} + if err = json.Unmarshal(bytes, &all); err != nil { + return json.Unmarshal(bytes, &o.UnparsedObject) + } + additionalProperties := make(map[string]interface{}) + if err = json.Unmarshal(bytes, &additionalProperties); err == nil { + datadog.DeleteKeys(additionalProperties, &[]string{"prefixes_ipv4", "prefixes_ipv6"}) + } else { + return err + } + o.PrefixesIpv4 = all.PrefixesIpv4 + o.PrefixesIpv6 = all.PrefixesIpv6 + + if len(additionalProperties) > 0 { + o.AdditionalProperties = additionalProperties + } + + return nil +} diff --git a/api/datadogV1/model_ip_ranges.go b/api/datadogV1/model_ip_ranges.go index 6dbc2d088cc..f8ddd805bda 100644 --- a/api/datadogV1/model_ip_ranges.go +++ b/api/datadogV1/model_ip_ranges.go @@ -18,6 +18,8 @@ type IPRanges struct { Api *IPPrefixesAPI `json:"api,omitempty"` // Available prefix information for the APM endpoints. Apm *IPPrefixesAPM `json:"apm,omitempty"` + // Available prefix information for all Datadog endpoints. + Global *IPPrefixesGlobal `json:"global,omitempty"` // Available prefix information for the Logs endpoints. Logs *IPPrefixesLogs `json:"logs,omitempty"` // Date when last updated, in the form `YYYY-MM-DD-hh-mm-ss`. @@ -142,6 +144,34 @@ func (o *IPRanges) SetApm(v IPPrefixesAPM) { o.Apm = &v } +// GetGlobal returns the Global field value if set, zero value otherwise. +func (o *IPRanges) GetGlobal() IPPrefixesGlobal { + if o == nil || o.Global == nil { + var ret IPPrefixesGlobal + return ret + } + return *o.Global +} + +// GetGlobalOk returns a tuple with the Global field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *IPRanges) GetGlobalOk() (*IPPrefixesGlobal, bool) { + if o == nil || o.Global == nil { + return nil, false + } + return o.Global, true +} + +// HasGlobal returns a boolean if a field has been set. +func (o *IPRanges) HasGlobal() bool { + return o != nil && o.Global != nil +} + +// SetGlobal gets a reference to the given IPPrefixesGlobal and assigns it to the Global field. +func (o *IPRanges) SetGlobal(v IPPrefixesGlobal) { + o.Global = &v +} + // GetLogs returns the Logs field value if set, zero value otherwise. func (o *IPRanges) GetLogs() IPPrefixesLogs { if o == nil || o.Logs == nil { @@ -409,6 +439,9 @@ func (o IPRanges) MarshalJSON() ([]byte, error) { if o.Apm != nil { toSerialize["apm"] = o.Apm } + if o.Global != nil { + toSerialize["global"] = o.Global + } if o.Logs != nil { toSerialize["logs"] = o.Logs } @@ -449,6 +482,7 @@ func (o *IPRanges) UnmarshalJSON(bytes []byte) (err error) { Agents *IPPrefixesAgents `json:"agents,omitempty"` Api *IPPrefixesAPI `json:"api,omitempty"` Apm *IPPrefixesAPM `json:"apm,omitempty"` + Global *IPPrefixesGlobal `json:"global,omitempty"` Logs *IPPrefixesLogs `json:"logs,omitempty"` Modified *string `json:"modified,omitempty"` Orchestrator *IPPrefixesOrchestrator `json:"orchestrator,omitempty"` @@ -464,7 +498,7 @@ func (o *IPRanges) UnmarshalJSON(bytes []byte) (err error) { } additionalProperties := make(map[string]interface{}) if err = json.Unmarshal(bytes, &additionalProperties); err == nil { - datadog.DeleteKeys(additionalProperties, &[]string{"agents", "api", "apm", "logs", "modified", "orchestrator", "process", "remote-configuration", "synthetics", "synthetics-private-locations", "version", "webhooks"}) + datadog.DeleteKeys(additionalProperties, &[]string{"agents", "api", "apm", "global", "logs", "modified", "orchestrator", "process", "remote-configuration", "synthetics", "synthetics-private-locations", "version", "webhooks"}) } else { return err } @@ -482,6 +516,10 @@ func (o *IPRanges) UnmarshalJSON(bytes []byte) (err error) { hasInvalidField = true } o.Apm = all.Apm + if all.Global != nil && all.Global.UnparsedObject != nil && o.UnparsedObject == nil { + hasInvalidField = true + } + o.Global = all.Global if all.Logs != nil && all.Logs.UnparsedObject != nil && o.UnparsedObject == nil { hasInvalidField = true }