From 14db34ca9eff6e341a25488a27957dce69ade79f Mon Sep 17 00:00:00 2001 From: SDK Generator Bot Date: Mon, 7 Jul 2025 07:15:50 +0000 Subject: [PATCH] Generate iaas --- services/iaas/model_create_network_payload.go | 50 +++++++++++++++++++ services/iaas/model_network.go | 48 ++++++++++++++++++ .../model_partial_update_network_payload.go | 48 ++++++++++++++++++ 3 files changed, 146 insertions(+) diff --git a/services/iaas/model_create_network_payload.go b/services/iaas/model_create_network_payload.go index dac5af860..8f56c0a94 100644 --- a/services/iaas/model_create_network_payload.go +++ b/services/iaas/model_create_network_payload.go @@ -37,6 +37,26 @@ func setCreateNetworkPayloadGetAddressFamilyAttributeType(arg *CreateNetworkPayl *arg = &val } +/* + types and functions for dhcp +*/ + +// isBoolean +type CreateNetworkPayloadgetDhcpAttributeType = *bool +type CreateNetworkPayloadgetDhcpArgType = bool +type CreateNetworkPayloadgetDhcpRetType = bool + +func getCreateNetworkPayloadgetDhcpAttributeTypeOk(arg CreateNetworkPayloadgetDhcpAttributeType) (ret CreateNetworkPayloadgetDhcpRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setCreateNetworkPayloadgetDhcpAttributeType(arg *CreateNetworkPayloadgetDhcpAttributeType, val CreateNetworkPayloadgetDhcpRetType) { + *arg = &val +} + /* types and functions for labels */ @@ -101,6 +121,8 @@ func setCreateNetworkPayloadgetRoutedAttributeType(arg *CreateNetworkPayloadgetR // CreateNetworkPayload Object that represents the request body for a network create. type CreateNetworkPayload struct { AddressFamily CreateNetworkPayloadGetAddressFamilyAttributeType `json:"addressFamily,omitempty"` + // Enable or disable DHCP for a network. + Dhcp CreateNetworkPayloadgetDhcpAttributeType `json:"dhcp,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Labels CreateNetworkPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. @@ -127,6 +149,8 @@ func NewCreateNetworkPayload(name CreateNetworkPayloadGetNameArgType) *CreateNet // but it doesn't guarantee that properties required by API are set func NewCreateNetworkPayloadWithDefaults() *CreateNetworkPayload { this := CreateNetworkPayload{} + var dhcp bool = true + this.Dhcp = &dhcp return &this } @@ -153,6 +177,29 @@ func (o *CreateNetworkPayload) SetAddressFamily(v CreateNetworkPayloadGetAddress setCreateNetworkPayloadGetAddressFamilyAttributeType(&o.AddressFamily, v) } +// GetDhcp returns the Dhcp field value if set, zero value otherwise. +func (o *CreateNetworkPayload) GetDhcp() (res CreateNetworkPayloadgetDhcpRetType) { + res, _ = o.GetDhcpOk() + return +} + +// GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *CreateNetworkPayload) GetDhcpOk() (ret CreateNetworkPayloadgetDhcpRetType, ok bool) { + return getCreateNetworkPayloadgetDhcpAttributeTypeOk(o.Dhcp) +} + +// HasDhcp returns a boolean if a field has been set. +func (o *CreateNetworkPayload) HasDhcp() bool { + _, ok := o.GetDhcpOk() + return ok +} + +// SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. +func (o *CreateNetworkPayload) SetDhcp(v CreateNetworkPayloadgetDhcpRetType) { + setCreateNetworkPayloadgetDhcpAttributeType(&o.Dhcp, v) +} + // GetLabels returns the Labels field value if set, zero value otherwise. func (o *CreateNetworkPayload) GetLabels() (res CreateNetworkPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() @@ -221,6 +268,9 @@ func (o CreateNetworkPayload) ToMap() (map[string]interface{}, error) { if val, ok := getCreateNetworkPayloadGetAddressFamilyAttributeTypeOk(o.AddressFamily); ok { toSerialize["AddressFamily"] = val } + if val, ok := getCreateNetworkPayloadgetDhcpAttributeTypeOk(o.Dhcp); ok { + toSerialize["Dhcp"] = val + } if val, ok := getCreateNetworkPayloadGetLabelsAttributeTypeOk(o.Labels); ok { toSerialize["Labels"] = val } diff --git a/services/iaas/model_network.go b/services/iaas/model_network.go index 961fb9c9d..c8324e067 100644 --- a/services/iaas/model_network.go +++ b/services/iaas/model_network.go @@ -38,6 +38,26 @@ func setNetworkGetCreatedAtAttributeType(arg *NetworkGetCreatedAtAttributeType, *arg = &val } +/* + types and functions for dhcp +*/ + +// isBoolean +type NetworkgetDhcpAttributeType = *bool +type NetworkgetDhcpArgType = bool +type NetworkgetDhcpRetType = bool + +func getNetworkgetDhcpAttributeTypeOk(arg NetworkgetDhcpAttributeType) (ret NetworkgetDhcpRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setNetworkgetDhcpAttributeType(arg *NetworkgetDhcpAttributeType, val NetworkgetDhcpRetType) { + *arg = &val +} + /* types and functions for gateway */ @@ -316,6 +336,8 @@ func setNetworkGetUpdatedAtAttributeType(arg *NetworkGetUpdatedAtAttributeType, type Network struct { // Date-time when resource was created. CreatedAt NetworkGetCreatedAtAttributeType `json:"createdAt,omitempty"` + // Enable or disable DHCP for a network. + Dhcp NetworkgetDhcpAttributeType `json:"dhcp,omitempty"` // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. Gateway NetworkGetGatewayAttributeType `json:"gateway,omitempty"` // The gateway of a network. If not specified the first IP of the network will be assigned as the gateway. If 'null' is sent, then the network doesn't have a gateway. @@ -389,6 +411,29 @@ func (o *Network) SetCreatedAt(v NetworkGetCreatedAtRetType) { setNetworkGetCreatedAtAttributeType(&o.CreatedAt, v) } +// GetDhcp returns the Dhcp field value if set, zero value otherwise. +func (o *Network) GetDhcp() (res NetworkgetDhcpRetType) { + res, _ = o.GetDhcpOk() + return +} + +// GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *Network) GetDhcpOk() (ret NetworkgetDhcpRetType, ok bool) { + return getNetworkgetDhcpAttributeTypeOk(o.Dhcp) +} + +// HasDhcp returns a boolean if a field has been set. +func (o *Network) HasDhcp() bool { + _, ok := o.GetDhcpOk() + return ok +} + +// SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. +func (o *Network) SetDhcp(v NetworkgetDhcpRetType) { + setNetworkgetDhcpAttributeType(&o.Dhcp, v) +} + // GetGateway returns the Gateway field value if set, zero value otherwise (both if not set or set to explicit null). func (o *Network) GetGateway() (res NetworkGetGatewayRetType) { res, _ = o.GetGatewayOk() @@ -697,6 +742,9 @@ func (o Network) ToMap() (map[string]interface{}, error) { if val, ok := getNetworkGetCreatedAtAttributeTypeOk(o.CreatedAt); ok { toSerialize["CreatedAt"] = val } + if val, ok := getNetworkgetDhcpAttributeTypeOk(o.Dhcp); ok { + toSerialize["Dhcp"] = val + } if val, ok := getNetworkGetGatewayAttributeTypeOk(o.Gateway); ok { toSerialize["Gateway"] = val } diff --git a/services/iaas/model_partial_update_network_payload.go b/services/iaas/model_partial_update_network_payload.go index 7e81264fc..7b4480c14 100644 --- a/services/iaas/model_partial_update_network_payload.go +++ b/services/iaas/model_partial_update_network_payload.go @@ -37,6 +37,26 @@ func setPartialUpdateNetworkPayloadGetAddressFamilyAttributeType(arg *PartialUpd *arg = &val } +/* + types and functions for dhcp +*/ + +// isBoolean +type PartialUpdateNetworkPayloadgetDhcpAttributeType = *bool +type PartialUpdateNetworkPayloadgetDhcpArgType = bool +type PartialUpdateNetworkPayloadgetDhcpRetType = bool + +func getPartialUpdateNetworkPayloadgetDhcpAttributeTypeOk(arg PartialUpdateNetworkPayloadgetDhcpAttributeType) (ret PartialUpdateNetworkPayloadgetDhcpRetType, ok bool) { + if arg == nil { + return ret, false + } + return *arg, true +} + +func setPartialUpdateNetworkPayloadgetDhcpAttributeType(arg *PartialUpdateNetworkPayloadgetDhcpAttributeType, val PartialUpdateNetworkPayloadgetDhcpRetType) { + *arg = &val +} + /* types and functions for labels */ @@ -101,6 +121,8 @@ func setPartialUpdateNetworkPayloadgetRoutedAttributeType(arg *PartialUpdateNetw // PartialUpdateNetworkPayload Object that represents the request body for a network update. type PartialUpdateNetworkPayload struct { AddressFamily PartialUpdateNetworkPayloadGetAddressFamilyAttributeType `json:"addressFamily,omitempty"` + // Enable or disable DHCP for a network. + Dhcp PartialUpdateNetworkPayloadgetDhcpAttributeType `json:"dhcp,omitempty"` // Object that represents the labels of an object. Regex for keys: `^[a-z]((-|_|[a-z0-9])){0,62}$`. Regex for values: `^(-|_|[a-z0-9]){0,63}$`. Labels PartialUpdateNetworkPayloadGetLabelsAttributeType `json:"labels,omitempty"` // The name for a General Object. Matches Names and also UUIDs. @@ -149,6 +171,29 @@ func (o *PartialUpdateNetworkPayload) SetAddressFamily(v PartialUpdateNetworkPay setPartialUpdateNetworkPayloadGetAddressFamilyAttributeType(&o.AddressFamily, v) } +// GetDhcp returns the Dhcp field value if set, zero value otherwise. +func (o *PartialUpdateNetworkPayload) GetDhcp() (res PartialUpdateNetworkPayloadgetDhcpRetType) { + res, _ = o.GetDhcpOk() + return +} + +// GetDhcpOk returns a tuple with the Dhcp field value if set, nil otherwise +// and a boolean to check if the value has been set. +func (o *PartialUpdateNetworkPayload) GetDhcpOk() (ret PartialUpdateNetworkPayloadgetDhcpRetType, ok bool) { + return getPartialUpdateNetworkPayloadgetDhcpAttributeTypeOk(o.Dhcp) +} + +// HasDhcp returns a boolean if a field has been set. +func (o *PartialUpdateNetworkPayload) HasDhcp() bool { + _, ok := o.GetDhcpOk() + return ok +} + +// SetDhcp gets a reference to the given bool and assigns it to the Dhcp field. +func (o *PartialUpdateNetworkPayload) SetDhcp(v PartialUpdateNetworkPayloadgetDhcpRetType) { + setPartialUpdateNetworkPayloadgetDhcpAttributeType(&o.Dhcp, v) +} + // GetLabels returns the Labels field value if set, zero value otherwise. func (o *PartialUpdateNetworkPayload) GetLabels() (res PartialUpdateNetworkPayloadGetLabelsRetType) { res, _ = o.GetLabelsOk() @@ -223,6 +268,9 @@ func (o PartialUpdateNetworkPayload) ToMap() (map[string]interface{}, error) { if val, ok := getPartialUpdateNetworkPayloadGetAddressFamilyAttributeTypeOk(o.AddressFamily); ok { toSerialize["AddressFamily"] = val } + if val, ok := getPartialUpdateNetworkPayloadgetDhcpAttributeTypeOk(o.Dhcp); ok { + toSerialize["Dhcp"] = val + } if val, ok := getPartialUpdateNetworkPayloadGetLabelsAttributeTypeOk(o.Labels); ok { toSerialize["Labels"] = val }