Files
sdk/model_network_service_in.go

231 lines
6.0 KiB
Go

/*
Hanzo Cloud API
The Hanzo Cloud API as a customer calls it: every operation under /v1/ except the operator's admin product, relay routes, legacy spellings and capabilities still reached by flag. Tagged by product: the first path segment after /v1/.
API version: v1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package hanzoai
import (
"encoding/json"
)
// checks if the NetworkServiceIn type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &NetworkServiceIn{}
// NetworkServiceIn struct for NetworkServiceIn
type NetworkServiceIn struct {
// Host is where the HOSTING identity forwards a connection — an address the host device itself can reach, \"127.0.0.1\" for a server on the device.
Host *string `json:"host,omitempty"`
// Name is the service's name within the org — a DNS label. The fabric knows the service as \"<name>.<org>\" and answers for it at \"<name>.<org>.zt\".
Name *string `json:"name,omitempty"`
// Port is the port beside Host, and the one the DNS name intercepts.
Port *int64 `json:"port,omitempty"`
AdditionalProperties map[string]interface{}
}
type _NetworkServiceIn NetworkServiceIn
// NewNetworkServiceIn instantiates a new NetworkServiceIn 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 NewNetworkServiceIn() *NetworkServiceIn {
this := NetworkServiceIn{}
return &this
}
// NewNetworkServiceInWithDefaults instantiates a new NetworkServiceIn 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 NewNetworkServiceInWithDefaults() *NetworkServiceIn {
this := NetworkServiceIn{}
return &this
}
// GetHost returns the Host field value if set, zero value otherwise.
func (o *NetworkServiceIn) GetHost() string {
if o == nil || IsNil(o.Host) {
var ret string
return ret
}
return *o.Host
}
// GetHostOk returns a tuple with the Host field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NetworkServiceIn) GetHostOk() (*string, bool) {
if o == nil || IsNil(o.Host) {
return nil, false
}
return o.Host, true
}
// HasHost returns a boolean if a field has been set.
func (o *NetworkServiceIn) HasHost() bool {
if o != nil && !IsNil(o.Host) {
return true
}
return false
}
// SetHost gets a reference to the given string and assigns it to the Host field.
func (o *NetworkServiceIn) SetHost(v string) {
o.Host = &v
}
// GetName returns the Name field value if set, zero value otherwise.
func (o *NetworkServiceIn) GetName() string {
if o == nil || IsNil(o.Name) {
var ret string
return ret
}
return *o.Name
}
// GetNameOk returns a tuple with the Name field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NetworkServiceIn) GetNameOk() (*string, bool) {
if o == nil || IsNil(o.Name) {
return nil, false
}
return o.Name, true
}
// HasName returns a boolean if a field has been set.
func (o *NetworkServiceIn) HasName() bool {
if o != nil && !IsNil(o.Name) {
return true
}
return false
}
// SetName gets a reference to the given string and assigns it to the Name field.
func (o *NetworkServiceIn) SetName(v string) {
o.Name = &v
}
// GetPort returns the Port field value if set, zero value otherwise.
func (o *NetworkServiceIn) GetPort() int64 {
if o == nil || IsNil(o.Port) {
var ret int64
return ret
}
return *o.Port
}
// GetPortOk returns a tuple with the Port field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *NetworkServiceIn) GetPortOk() (*int64, bool) {
if o == nil || IsNil(o.Port) {
return nil, false
}
return o.Port, true
}
// HasPort returns a boolean if a field has been set.
func (o *NetworkServiceIn) HasPort() bool {
if o != nil && !IsNil(o.Port) {
return true
}
return false
}
// SetPort gets a reference to the given int64 and assigns it to the Port field.
func (o *NetworkServiceIn) SetPort(v int64) {
o.Port = &v
}
func (o NetworkServiceIn) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o NetworkServiceIn) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Host) {
toSerialize["host"] = o.Host
}
if !IsNil(o.Name) {
toSerialize["name"] = o.Name
}
if !IsNil(o.Port) {
toSerialize["port"] = o.Port
}
for key, value := range o.AdditionalProperties {
toSerialize[key] = value
}
return toSerialize, nil
}
func (o *NetworkServiceIn) UnmarshalJSON(data []byte) (err error) {
varNetworkServiceIn := _NetworkServiceIn{}
err = json.Unmarshal(data, &varNetworkServiceIn)
if err != nil {
return err
}
*o = NetworkServiceIn(varNetworkServiceIn)
additionalProperties := make(map[string]interface{})
if err = json.Unmarshal(data, &additionalProperties); err == nil {
delete(additionalProperties, "host")
delete(additionalProperties, "name")
delete(additionalProperties, "port")
o.AdditionalProperties = additionalProperties
}
return err
}
type NullableNetworkServiceIn struct {
value *NetworkServiceIn
isSet bool
}
func (v NullableNetworkServiceIn) Get() *NetworkServiceIn {
return v.value
}
func (v *NullableNetworkServiceIn) Set(val *NetworkServiceIn) {
v.value = val
v.isSet = true
}
func (v NullableNetworkServiceIn) IsSet() bool {
return v.isSet
}
func (v *NullableNetworkServiceIn) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableNetworkServiceIn(val *NetworkServiceIn) *NullableNetworkServiceIn {
return &NullableNetworkServiceIn{value: val, isSet: true}
}
func (v NullableNetworkServiceIn) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableNetworkServiceIn) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}