Skip to content

Commit

Permalink
Regenerate client from commit 7415799d of spec repo
Browse files Browse the repository at this point in the history
  • Loading branch information
ci.datadog-api-spec committed May 1, 2023
1 parent 512b697 commit e4b69b3
Show file tree
Hide file tree
Showing 4 changed files with 210 additions and 5 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.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"
}
}
}
18 changes: 18 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
145 changes: 145 additions & 0 deletions api/datadogV1/model_ip_prefixes_global.go
Original file line number Diff line number Diff line change
@@ -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
}
44 changes: 43 additions & 1 deletion api/datadogV1/model_ip_ranges.go
Original file line number Diff line number Diff line change
Expand Up @@ -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`.
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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
}
Expand Down Expand Up @@ -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"`
Expand All @@ -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
}
Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit e4b69b3

Please sign in to comment.