Skip to content

Commit

Permalink
Mark hosts response version fields as nullable (#1778)
Browse files Browse the repository at this point in the history
Co-authored-by: ci.datadog-api-spec <[email protected]>
  • Loading branch information
api-clients-generation-pipeline[bot] and ci.datadog-api-spec authored Dec 19, 2022
1 parent bb11a9a commit f869133
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 33 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": "2022-12-19 10:28:48.313976",
"spec_repo_commit": "45a3d9c9"
"regenerated": "2022-12-19 15:44:02.177148",
"spec_repo_commit": "37d94b14"
},
"v2": {
"apigentools_version": "1.6.4",
"regenerated": "2022-12-19 10:28:48.325403",
"spec_repo_commit": "45a3d9c9"
"regenerated": "2022-12-19 15:44:02.188913",
"spec_repo_commit": "37d94b14"
}
}
}
4 changes: 4 additions & 0 deletions .generator/schemas/v1/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3419,6 +3419,7 @@ components:
items:
description: The version name.
example: FreeBSD
nullable: true
type: string
type: array
gohai:
Expand All @@ -3434,6 +3435,7 @@ components:
items:
description: Version name.
example: Mac
nullable: true
type: string
type: array
machine:
Expand All @@ -3445,6 +3447,7 @@ components:
items:
description: Version name.
example: Ubuntu
nullable: true
type: string
type: array
platform:
Expand Down Expand Up @@ -3472,6 +3475,7 @@ components:
items:
description: Version name.
example: Windows
nullable: true
type: string
type: array
type: object
Expand Down
56 changes: 28 additions & 28 deletions api/datadogV1/model_host_meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,17 @@ type HostMeta struct {
// The number of cores.
CpuCores *int64 `json:"cpuCores,omitempty"`
// An array of Mac versions.
FbsdV []string `json:"fbsdV,omitempty"`
FbsdV []*string `json:"fbsdV,omitempty"`
// JSON string containing system information.
Gohai *string `json:"gohai,omitempty"`
// Agent install method.
InstallMethod *HostMetaInstallMethod `json:"install_method,omitempty"`
// An array of Mac versions.
MacV []string `json:"macV,omitempty"`
MacV []*string `json:"macV,omitempty"`
// The machine architecture.
Machine *string `json:"machine,omitempty"`
// Array of Unix versions.
NixV []string `json:"nixV,omitempty"`
NixV []*string `json:"nixV,omitempty"`
// The OS platform.
Platform *string `json:"platform,omitempty"`
// The processor.
Expand All @@ -39,7 +39,7 @@ type HostMeta struct {
// The socket hostname.
SocketHostname *string `json:"socket-hostname,omitempty"`
// An array of Windows versions.
WinV []string `json:"winV,omitempty"`
WinV []*string `json:"winV,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{}
Expand Down Expand Up @@ -147,17 +147,17 @@ func (o *HostMeta) SetCpuCores(v int64) {
}

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

// GetFbsdVOk returns a tuple with the FbsdV field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *HostMeta) GetFbsdVOk() (*[]string, bool) {
func (o *HostMeta) GetFbsdVOk() (*[]*string, bool) {
if o == nil || o.FbsdV == nil {
return nil, false
}
Expand All @@ -169,8 +169,8 @@ func (o *HostMeta) HasFbsdV() bool {
return o != nil && o.FbsdV != nil
}

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

Expand Down Expand Up @@ -231,17 +231,17 @@ func (o *HostMeta) SetInstallMethod(v HostMetaInstallMethod) {
}

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

// GetMacVOk returns a tuple with the MacV field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *HostMeta) GetMacVOk() (*[]string, bool) {
func (o *HostMeta) GetMacVOk() (*[]*string, bool) {
if o == nil || o.MacV == nil {
return nil, false
}
Expand All @@ -253,8 +253,8 @@ func (o *HostMeta) HasMacV() bool {
return o != nil && o.MacV != nil
}

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

Expand Down Expand Up @@ -287,17 +287,17 @@ func (o *HostMeta) SetMachine(v string) {
}

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

// GetNixVOk returns a tuple with the NixV field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *HostMeta) GetNixVOk() (*[]string, bool) {
func (o *HostMeta) GetNixVOk() (*[]*string, bool) {
if o == nil || o.NixV == nil {
return nil, false
}
Expand All @@ -309,8 +309,8 @@ func (o *HostMeta) HasNixV() bool {
return o != nil && o.NixV != nil
}

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

Expand Down Expand Up @@ -455,17 +455,17 @@ func (o *HostMeta) SetSocketHostname(v string) {
}

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

// GetWinVOk returns a tuple with the WinV field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *HostMeta) GetWinVOk() (*[]string, bool) {
func (o *HostMeta) GetWinVOk() (*[]*string, bool) {
if o == nil || o.WinV == nil {
return nil, false
}
Expand All @@ -477,8 +477,8 @@ func (o *HostMeta) HasWinV() bool {
return o != nil && o.WinV != nil
}

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

Expand Down Expand Up @@ -547,18 +547,18 @@ func (o *HostMeta) UnmarshalJSON(bytes []byte) (err error) {
AgentChecks [][]interface{} `json:"agent_checks,omitempty"`
AgentVersion *string `json:"agent_version,omitempty"`
CpuCores *int64 `json:"cpuCores,omitempty"`
FbsdV []string `json:"fbsdV,omitempty"`
FbsdV []*string `json:"fbsdV,omitempty"`
Gohai *string `json:"gohai,omitempty"`
InstallMethod *HostMetaInstallMethod `json:"install_method,omitempty"`
MacV []string `json:"macV,omitempty"`
MacV []*string `json:"macV,omitempty"`
Machine *string `json:"machine,omitempty"`
NixV []string `json:"nixV,omitempty"`
NixV []*string `json:"nixV,omitempty"`
Platform *string `json:"platform,omitempty"`
Processor *string `json:"processor,omitempty"`
PythonV *string `json:"pythonV,omitempty"`
SocketFqdn *string `json:"socket-fqdn,omitempty"`
SocketHostname *string `json:"socket-hostname,omitempty"`
WinV []string `json:"winV,omitempty"`
WinV []*string `json:"winV,omitempty"`
}{}
err = json.Unmarshal(bytes, &all)
if err != nil {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ interactions:
method: GET
url: https://api.datadoghq.com/api/v1/hosts?include_hosts_metadata=true
response:
body: '{"exact_total_matching":true,"total_returned":1,"host_list":[{"last_reported_time":1640288946,"name":"vagrant","is_muted":false,"mute_timeout":null,"apps":["ntp","agent"],"tags_by_source":{"Datadog":["host:vagrant"]},"up":true,"metrics":{"load":0.031666666,"iowait":0.0434962,"cpu":0.6632819},"sources":["agent"],"meta":{"socket-hostname":"vagrant","nixV":["ubuntu","18.04",""],"pythonV":"3.8.11","macV":["","",""],"cpuCores":1,"agent_flavor":"agent","platform":"linux","timezones":["UTC"],"winV":["","",""],"machine":"amd64","install_method":{"tool":"install_script","installer_version":"install_script-1.7.1","tool_version":"install_script"},"fbsdV":["","",""],"gohai":"{\"cpu\":{\"cache_size\":\"8192
body: '{"exact_total_matching":true,"total_returned":1,"host_list":[{"last_reported_time":1640288946,"name":"vagrant","is_muted":false,"mute_timeout":null,"apps":["ntp","agent"],"tags_by_source":{"Datadog":["host:vagrant"]},"up":true,"metrics":{"load":0.031666666,"iowait":0.0434962,"cpu":0.6632819},"sources":["agent"],"meta":{"socket-hostname":"vagrant","nixV":["ubuntu","18.04",""],"pythonV":"3.8.11","macV":["","",""],"cpuCores":1,"agent_flavor":"agent","platform":"linux","timezones":["UTC"],"winV":[null,null,null],"machine":"amd64","install_method":{"tool":"install_script","installer_version":"install_script-1.7.1","tool_version":"install_script"},"fbsdV":["","",""],"gohai":"{\"cpu\":{\"cache_size\":\"8192
KB\",\"cpu_cores\":\"1\",\"cpu_logical_processors\":\"1\",\"family\":\"6\",\"mhz\":\"2711.998\",\"model\":\"142\",\"model_name\":\"Intel(R)
Core(TM) i7-8559U CPU @ 2.70GHz\",\"stepping\":\"10\",\"vendor_id\":\"GenuineIntel\"},\"filesystem\":[{\"kb_size\":\"3966892\",\"mounted_on\":\"/dev\",\"name\":\"udev\"},{\"kb_size\":\"797396\",\"mounted_on\":\"/run\",\"name\":\"tmpfs\"},{\"kb_size\":\"64800356\",\"mounted_on\":\"/\",\"name\":\"/dev/mapper/vagrant--vg-root\"},{\"kb_size\":\"3986968\",\"mounted_on\":\"/dev/shm\",\"name\":\"tmpfs\"},{\"kb_size\":\"5120\",\"mounted_on\":\"/run/lock\",\"name\":\"tmpfs\"},{\"kb_size\":\"3986968\",\"mounted_on\":\"/sys/fs/cgroup\",\"name\":\"tmpfs\"},{\"kb_size\":\"488245288\",\"mounted_on\":\"/vagrant\",\"name\":\"/vagrant\"},{\"kb_size\":\"797392\",\"mounted_on\":\"/run/user/1000\",\"name\":\"tmpfs\"}],\"memory\":{\"swap_total\":\"1003516kB\",\"total\":\"7973940kB\"},\"network\":{\"interfaces\":[{\"ipv4\":\"10.0.2.15\",\"ipv4-network\":\"10.0.2.0/24\",\"ipv6\":\"fe80::a00:27ff:fec2:be11\",\"ipv6-network\":\"fe80::/64\",\"macaddress\":\"08:00:27:c2:be:11\",\"name\":\"eth0\"},{\"ipv4\":\"192.168.122.1\",\"ipv4-network\":\"192.168.122.0/24\",\"macaddress\":\"52:54:00:6f:1c:bf\",\"name\":\"virbr0\"}],\"ipaddress\":\"10.0.2.15\",\"ipaddressv6\":\"fe80::a00:27ff:fec2:be11\",\"macaddress\":\"08:00:27:c2:be:11\"},\"platform\":{\"GOOARCH\":\"amd64\",\"GOOS\":\"linux\",\"goV\":\"1.16.7\",\"hardware_platform\":\"x86_64\",\"hostname\":\"vagrant\",\"kernel_name\":\"Linux\",\"kernel_release\":\"4.15.0-29-generic\",\"kernel_version\":\"#31-Ubuntu
SMP Tue Jul 17 15:39:52 UTC 2018\",\"machine\":\"x86_64\",\"os\":\"GNU/Linux\",\"processor\":\"x86_64\",\"pythonV\":\"2.7.15rc1\"}}","network":null,"logs_agent":{"transport":""},"host_id":1036078308,"agent_version":"7.32.3","processor":"Intel(R)
Expand Down

0 comments on commit f869133

Please sign in to comment.