From e4b69b3b4e37a0bb9aea1c6ab5bf22161a5accda Mon Sep 17 00:00:00 2001 From: "ci.datadog-api-spec" Date: Mon, 1 May 2023 20:55:43 +0000 Subject: [PATCH] Regenerate client from commit 7415799d of spec repo --- .apigentools-info | 8 +- .generator/schemas/v1/openapi.yaml | 18 +++ api/datadogV1/model_ip_prefixes_global.go | 145 ++++++++++++++++++++++ api/datadogV1/model_ip_ranges.go | 44 ++++++- 4 files changed, 210 insertions(+), 5 deletions(-) create mode 100644 api/datadogV1/model_ip_prefixes_global.go diff --git a/.apigentools-info b/.apigentools-info index 6bc695a57ae..c1951501df4 100644 --- a/.apigentools-info +++ b/.apigentools-info @@ -4,13 +4,13 @@ "spec_versions": { "v1": { "apigentools_version": "1.6.4", - "regenerated": "2023-05-01 18:21:26.168034", - "spec_repo_commit": "dcb4806e" + "regenerated": "2023-05-01 20:54:29.336592", + "spec_repo_commit": "7415799d" }, "v2": { "apigentools_version": "1.6.4", - "regenerated": "2023-05-01 18:21:26.180207", - "spec_repo_commit": "dcb4806e" + "regenerated": "2023-05-01 20:54:29.350252", + "spec_repo_commit": "7415799d" } } } \ No newline at end of file diff --git a/.generator/schemas/v1/openapi.yaml b/.generator/schemas/v1/openapi.yaml index cf1a971769b..0255f2d9b8a 100644 --- a/.generator/schemas/v1/openapi.yaml +++ b/.generator/schemas/v1/openapi.yaml @@ -3860,6 +3860,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: @@ -3984,6 +4000,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..7075934dbb9 --- /dev/null +++ b/api/datadogV1/model_ip_prefixes_global.go @@ -0,0 +1,145 @@ +// 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 ( + "encoding/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) { + raw := map[string]interface{}{} + all := struct { + PrefixesIpv4 []string `json:"prefixes_ipv4,omitempty"` + PrefixesIpv6 []string `json:"prefixes_ipv6,omitempty"` + }{} + err = json.Unmarshal(bytes, &all) + if err != nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + return nil + } + 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 bd812bf0cda..c992a9817db 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`. @@ -140,6 +142,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 { @@ -379,6 +409,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 } @@ -417,6 +450,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"` @@ -437,7 +471,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", "synthetics", "synthetics-private-locations", "version", "webhooks"}) + datadog.DeleteKeys(additionalProperties, &[]string{"agents", "api", "apm", "global", "logs", "modified", "orchestrator", "process", "synthetics", "synthetics-private-locations", "version", "webhooks"}) } else { return err } @@ -465,6 +499,14 @@ func (o *IPRanges) UnmarshalJSON(bytes []byte) (err error) { o.UnparsedObject = raw } o.Apm = all.Apm + if all.Global != nil && all.Global.UnparsedObject != nil && o.UnparsedObject == nil { + err = json.Unmarshal(bytes, &raw) + if err != nil { + return err + } + o.UnparsedObject = raw + } + o.Global = all.Global if all.Logs != nil && all.Logs.UnparsedObject != nil && o.UnparsedObject == nil { err = json.Unmarshal(bytes, &raw) if err != nil {