/* STACKIT VPN API The STACKIT VPN API provides endpoints to provision and manage VPN instances in your STACKIT project. API version: 1alpha1 */ // Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT. package vpnalpha import ( "encoding/json" ) // checks if the Phase2Status type satisfies the MappedNullable interface at compile time var _ MappedNullable = &Phase2Status{} /* types and functions for bytesIn */ // isNotNullableString type Phase2StatusGetBytesInAttributeType = *string func getPhase2StatusGetBytesInAttributeTypeOk(arg Phase2StatusGetBytesInAttributeType) (ret Phase2StatusGetBytesInRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setPhase2StatusGetBytesInAttributeType(arg *Phase2StatusGetBytesInAttributeType, val Phase2StatusGetBytesInRetType) { *arg = &val } type Phase2StatusGetBytesInArgType = string type Phase2StatusGetBytesInRetType = string /* types and functions for bytesOut */ // isNotNullableString type Phase2StatusGetBytesOutAttributeType = *string func getPhase2StatusGetBytesOutAttributeTypeOk(arg Phase2StatusGetBytesOutAttributeType) (ret Phase2StatusGetBytesOutRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setPhase2StatusGetBytesOutAttributeType(arg *Phase2StatusGetBytesOutAttributeType, val Phase2StatusGetBytesOutRetType) { *arg = &val } type Phase2StatusGetBytesOutArgType = string type Phase2StatusGetBytesOutRetType = string /* types and functions for dhGroup */ // isNotNullableString type Phase2StatusGetDhGroupAttributeType = *string func getPhase2StatusGetDhGroupAttributeTypeOk(arg Phase2StatusGetDhGroupAttributeType) (ret Phase2StatusGetDhGroupRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setPhase2StatusGetDhGroupAttributeType(arg *Phase2StatusGetDhGroupAttributeType, val Phase2StatusGetDhGroupRetType) { *arg = &val } type Phase2StatusGetDhGroupArgType = string type Phase2StatusGetDhGroupRetType = string /* types and functions for encap */ // isNotNullableString type Phase2StatusGetEncapAttributeType = *string func getPhase2StatusGetEncapAttributeTypeOk(arg Phase2StatusGetEncapAttributeType) (ret Phase2StatusGetEncapRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setPhase2StatusGetEncapAttributeType(arg *Phase2StatusGetEncapAttributeType, val Phase2StatusGetEncapRetType) { *arg = &val } type Phase2StatusGetEncapArgType = string type Phase2StatusGetEncapRetType = string /* types and functions for encryptionAlgorithm */ // isNotNullableString type Phase2StatusGetEncryptionAlgorithmAttributeType = *string func getPhase2StatusGetEncryptionAlgorithmAttributeTypeOk(arg Phase2StatusGetEncryptionAlgorithmAttributeType) (ret Phase2StatusGetEncryptionAlgorithmRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setPhase2StatusGetEncryptionAlgorithmAttributeType(arg *Phase2StatusGetEncryptionAlgorithmAttributeType, val Phase2StatusGetEncryptionAlgorithmRetType) { *arg = &val } type Phase2StatusGetEncryptionAlgorithmArgType = string type Phase2StatusGetEncryptionAlgorithmRetType = string /* types and functions for integrityAlgorithm */ // isNotNullableString type Phase2StatusGetIntegrityAlgorithmAttributeType = *string func getPhase2StatusGetIntegrityAlgorithmAttributeTypeOk(arg Phase2StatusGetIntegrityAlgorithmAttributeType) (ret Phase2StatusGetIntegrityAlgorithmRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setPhase2StatusGetIntegrityAlgorithmAttributeType(arg *Phase2StatusGetIntegrityAlgorithmAttributeType, val Phase2StatusGetIntegrityAlgorithmRetType) { *arg = &val } type Phase2StatusGetIntegrityAlgorithmArgType = string type Phase2StatusGetIntegrityAlgorithmRetType = string /* types and functions for packetsIn */ // isNotNullableString type Phase2StatusGetPacketsInAttributeType = *string func getPhase2StatusGetPacketsInAttributeTypeOk(arg Phase2StatusGetPacketsInAttributeType) (ret Phase2StatusGetPacketsInRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setPhase2StatusGetPacketsInAttributeType(arg *Phase2StatusGetPacketsInAttributeType, val Phase2StatusGetPacketsInRetType) { *arg = &val } type Phase2StatusGetPacketsInArgType = string type Phase2StatusGetPacketsInRetType = string /* types and functions for packetsOut */ // isNotNullableString type Phase2StatusGetPacketsOutAttributeType = *string func getPhase2StatusGetPacketsOutAttributeTypeOk(arg Phase2StatusGetPacketsOutAttributeType) (ret Phase2StatusGetPacketsOutRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setPhase2StatusGetPacketsOutAttributeType(arg *Phase2StatusGetPacketsOutAttributeType, val Phase2StatusGetPacketsOutRetType) { *arg = &val } type Phase2StatusGetPacketsOutArgType = string type Phase2StatusGetPacketsOutRetType = string /* types and functions for protocol */ // isNotNullableString type Phase2StatusGetProtocolAttributeType = *string func getPhase2StatusGetProtocolAttributeTypeOk(arg Phase2StatusGetProtocolAttributeType) (ret Phase2StatusGetProtocolRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setPhase2StatusGetProtocolAttributeType(arg *Phase2StatusGetProtocolAttributeType, val Phase2StatusGetProtocolRetType) { *arg = &val } type Phase2StatusGetProtocolArgType = string type Phase2StatusGetProtocolRetType = string /* types and functions for state */ // isNotNullableString type Phase2StatusGetStateAttributeType = *string func getPhase2StatusGetStateAttributeTypeOk(arg Phase2StatusGetStateAttributeType) (ret Phase2StatusGetStateRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setPhase2StatusGetStateAttributeType(arg *Phase2StatusGetStateAttributeType, val Phase2StatusGetStateRetType) { *arg = &val } type Phase2StatusGetStateArgType = string type Phase2StatusGetStateRetType = string // Phase2Status struct for Phase2Status type Phase2Status struct { // Bytes received. BytesIn Phase2StatusGetBytesInAttributeType `json:"bytesIn,omitempty"` // Bytes sent. BytesOut Phase2StatusGetBytesOutAttributeType `json:"bytesOut,omitempty"` // Negotiated Diffie-Hellman Group DhGroup Phase2StatusGetDhGroupAttributeType `json:"dhGroup,omitempty"` Encap Phase2StatusGetEncapAttributeType `json:"encap,omitempty"` // Negotiated encryption algorithm. EncryptionAlgorithm Phase2StatusGetEncryptionAlgorithmAttributeType `json:"encryptionAlgorithm,omitempty"` // Negotiated integrity algorithm or pseudo-random-function. IntegrityAlgorithm Phase2StatusGetIntegrityAlgorithmAttributeType `json:"integrityAlgorithm,omitempty"` // Packets received. PacketsIn Phase2StatusGetPacketsInAttributeType `json:"packetsIn,omitempty"` // Packets sent. PacketsOut Phase2StatusGetPacketsOutAttributeType `json:"packetsOut,omitempty"` Protocol Phase2StatusGetProtocolAttributeType `json:"protocol,omitempty"` State Phase2StatusGetStateAttributeType `json:"state,omitempty"` } // NewPhase2Status instantiates a new Phase2Status 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 NewPhase2Status() *Phase2Status { this := Phase2Status{} return &this } // NewPhase2StatusWithDefaults instantiates a new Phase2Status 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 NewPhase2StatusWithDefaults() *Phase2Status { this := Phase2Status{} return &this } // GetBytesIn returns the BytesIn field value if set, zero value otherwise. func (o *Phase2Status) GetBytesIn() (res Phase2StatusGetBytesInRetType) { res, _ = o.GetBytesInOk() return } // GetBytesInOk returns a tuple with the BytesIn field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Phase2Status) GetBytesInOk() (ret Phase2StatusGetBytesInRetType, ok bool) { return getPhase2StatusGetBytesInAttributeTypeOk(o.BytesIn) } // HasBytesIn returns a boolean if a field has been set. func (o *Phase2Status) HasBytesIn() bool { _, ok := o.GetBytesInOk() return ok } // SetBytesIn gets a reference to the given string and assigns it to the BytesIn field. func (o *Phase2Status) SetBytesIn(v Phase2StatusGetBytesInRetType) { setPhase2StatusGetBytesInAttributeType(&o.BytesIn, v) } // GetBytesOut returns the BytesOut field value if set, zero value otherwise. func (o *Phase2Status) GetBytesOut() (res Phase2StatusGetBytesOutRetType) { res, _ = o.GetBytesOutOk() return } // GetBytesOutOk returns a tuple with the BytesOut field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Phase2Status) GetBytesOutOk() (ret Phase2StatusGetBytesOutRetType, ok bool) { return getPhase2StatusGetBytesOutAttributeTypeOk(o.BytesOut) } // HasBytesOut returns a boolean if a field has been set. func (o *Phase2Status) HasBytesOut() bool { _, ok := o.GetBytesOutOk() return ok } // SetBytesOut gets a reference to the given string and assigns it to the BytesOut field. func (o *Phase2Status) SetBytesOut(v Phase2StatusGetBytesOutRetType) { setPhase2StatusGetBytesOutAttributeType(&o.BytesOut, v) } // GetDhGroup returns the DhGroup field value if set, zero value otherwise. func (o *Phase2Status) GetDhGroup() (res Phase2StatusGetDhGroupRetType) { res, _ = o.GetDhGroupOk() return } // GetDhGroupOk returns a tuple with the DhGroup field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Phase2Status) GetDhGroupOk() (ret Phase2StatusGetDhGroupRetType, ok bool) { return getPhase2StatusGetDhGroupAttributeTypeOk(o.DhGroup) } // HasDhGroup returns a boolean if a field has been set. func (o *Phase2Status) HasDhGroup() bool { _, ok := o.GetDhGroupOk() return ok } // SetDhGroup gets a reference to the given string and assigns it to the DhGroup field. func (o *Phase2Status) SetDhGroup(v Phase2StatusGetDhGroupRetType) { setPhase2StatusGetDhGroupAttributeType(&o.DhGroup, v) } // GetEncap returns the Encap field value if set, zero value otherwise. func (o *Phase2Status) GetEncap() (res Phase2StatusGetEncapRetType) { res, _ = o.GetEncapOk() return } // GetEncapOk returns a tuple with the Encap field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Phase2Status) GetEncapOk() (ret Phase2StatusGetEncapRetType, ok bool) { return getPhase2StatusGetEncapAttributeTypeOk(o.Encap) } // HasEncap returns a boolean if a field has been set. func (o *Phase2Status) HasEncap() bool { _, ok := o.GetEncapOk() return ok } // SetEncap gets a reference to the given string and assigns it to the Encap field. func (o *Phase2Status) SetEncap(v Phase2StatusGetEncapRetType) { setPhase2StatusGetEncapAttributeType(&o.Encap, v) } // GetEncryptionAlgorithm returns the EncryptionAlgorithm field value if set, zero value otherwise. func (o *Phase2Status) GetEncryptionAlgorithm() (res Phase2StatusGetEncryptionAlgorithmRetType) { res, _ = o.GetEncryptionAlgorithmOk() return } // GetEncryptionAlgorithmOk returns a tuple with the EncryptionAlgorithm field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Phase2Status) GetEncryptionAlgorithmOk() (ret Phase2StatusGetEncryptionAlgorithmRetType, ok bool) { return getPhase2StatusGetEncryptionAlgorithmAttributeTypeOk(o.EncryptionAlgorithm) } // HasEncryptionAlgorithm returns a boolean if a field has been set. func (o *Phase2Status) HasEncryptionAlgorithm() bool { _, ok := o.GetEncryptionAlgorithmOk() return ok } // SetEncryptionAlgorithm gets a reference to the given string and assigns it to the EncryptionAlgorithm field. func (o *Phase2Status) SetEncryptionAlgorithm(v Phase2StatusGetEncryptionAlgorithmRetType) { setPhase2StatusGetEncryptionAlgorithmAttributeType(&o.EncryptionAlgorithm, v) } // GetIntegrityAlgorithm returns the IntegrityAlgorithm field value if set, zero value otherwise. func (o *Phase2Status) GetIntegrityAlgorithm() (res Phase2StatusGetIntegrityAlgorithmRetType) { res, _ = o.GetIntegrityAlgorithmOk() return } // GetIntegrityAlgorithmOk returns a tuple with the IntegrityAlgorithm field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Phase2Status) GetIntegrityAlgorithmOk() (ret Phase2StatusGetIntegrityAlgorithmRetType, ok bool) { return getPhase2StatusGetIntegrityAlgorithmAttributeTypeOk(o.IntegrityAlgorithm) } // HasIntegrityAlgorithm returns a boolean if a field has been set. func (o *Phase2Status) HasIntegrityAlgorithm() bool { _, ok := o.GetIntegrityAlgorithmOk() return ok } // SetIntegrityAlgorithm gets a reference to the given string and assigns it to the IntegrityAlgorithm field. func (o *Phase2Status) SetIntegrityAlgorithm(v Phase2StatusGetIntegrityAlgorithmRetType) { setPhase2StatusGetIntegrityAlgorithmAttributeType(&o.IntegrityAlgorithm, v) } // GetPacketsIn returns the PacketsIn field value if set, zero value otherwise. func (o *Phase2Status) GetPacketsIn() (res Phase2StatusGetPacketsInRetType) { res, _ = o.GetPacketsInOk() return } // GetPacketsInOk returns a tuple with the PacketsIn field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Phase2Status) GetPacketsInOk() (ret Phase2StatusGetPacketsInRetType, ok bool) { return getPhase2StatusGetPacketsInAttributeTypeOk(o.PacketsIn) } // HasPacketsIn returns a boolean if a field has been set. func (o *Phase2Status) HasPacketsIn() bool { _, ok := o.GetPacketsInOk() return ok } // SetPacketsIn gets a reference to the given string and assigns it to the PacketsIn field. func (o *Phase2Status) SetPacketsIn(v Phase2StatusGetPacketsInRetType) { setPhase2StatusGetPacketsInAttributeType(&o.PacketsIn, v) } // GetPacketsOut returns the PacketsOut field value if set, zero value otherwise. func (o *Phase2Status) GetPacketsOut() (res Phase2StatusGetPacketsOutRetType) { res, _ = o.GetPacketsOutOk() return } // GetPacketsOutOk returns a tuple with the PacketsOut field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Phase2Status) GetPacketsOutOk() (ret Phase2StatusGetPacketsOutRetType, ok bool) { return getPhase2StatusGetPacketsOutAttributeTypeOk(o.PacketsOut) } // HasPacketsOut returns a boolean if a field has been set. func (o *Phase2Status) HasPacketsOut() bool { _, ok := o.GetPacketsOutOk() return ok } // SetPacketsOut gets a reference to the given string and assigns it to the PacketsOut field. func (o *Phase2Status) SetPacketsOut(v Phase2StatusGetPacketsOutRetType) { setPhase2StatusGetPacketsOutAttributeType(&o.PacketsOut, v) } // GetProtocol returns the Protocol field value if set, zero value otherwise. func (o *Phase2Status) GetProtocol() (res Phase2StatusGetProtocolRetType) { res, _ = o.GetProtocolOk() return } // GetProtocolOk returns a tuple with the Protocol field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Phase2Status) GetProtocolOk() (ret Phase2StatusGetProtocolRetType, ok bool) { return getPhase2StatusGetProtocolAttributeTypeOk(o.Protocol) } // HasProtocol returns a boolean if a field has been set. func (o *Phase2Status) HasProtocol() bool { _, ok := o.GetProtocolOk() return ok } // SetProtocol gets a reference to the given string and assigns it to the Protocol field. func (o *Phase2Status) SetProtocol(v Phase2StatusGetProtocolRetType) { setPhase2StatusGetProtocolAttributeType(&o.Protocol, v) } // GetState returns the State field value if set, zero value otherwise. func (o *Phase2Status) GetState() (res Phase2StatusGetStateRetType) { res, _ = o.GetStateOk() return } // GetStateOk returns a tuple with the State field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *Phase2Status) GetStateOk() (ret Phase2StatusGetStateRetType, ok bool) { return getPhase2StatusGetStateAttributeTypeOk(o.State) } // HasState returns a boolean if a field has been set. func (o *Phase2Status) HasState() bool { _, ok := o.GetStateOk() return ok } // SetState gets a reference to the given string and assigns it to the State field. func (o *Phase2Status) SetState(v Phase2StatusGetStateRetType) { setPhase2StatusGetStateAttributeType(&o.State, v) } func (o Phase2Status) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getPhase2StatusGetBytesInAttributeTypeOk(o.BytesIn); ok { toSerialize["BytesIn"] = val } if val, ok := getPhase2StatusGetBytesOutAttributeTypeOk(o.BytesOut); ok { toSerialize["BytesOut"] = val } if val, ok := getPhase2StatusGetDhGroupAttributeTypeOk(o.DhGroup); ok { toSerialize["DhGroup"] = val } if val, ok := getPhase2StatusGetEncapAttributeTypeOk(o.Encap); ok { toSerialize["Encap"] = val } if val, ok := getPhase2StatusGetEncryptionAlgorithmAttributeTypeOk(o.EncryptionAlgorithm); ok { toSerialize["EncryptionAlgorithm"] = val } if val, ok := getPhase2StatusGetIntegrityAlgorithmAttributeTypeOk(o.IntegrityAlgorithm); ok { toSerialize["IntegrityAlgorithm"] = val } if val, ok := getPhase2StatusGetPacketsInAttributeTypeOk(o.PacketsIn); ok { toSerialize["PacketsIn"] = val } if val, ok := getPhase2StatusGetPacketsOutAttributeTypeOk(o.PacketsOut); ok { toSerialize["PacketsOut"] = val } if val, ok := getPhase2StatusGetProtocolAttributeTypeOk(o.Protocol); ok { toSerialize["Protocol"] = val } if val, ok := getPhase2StatusGetStateAttributeTypeOk(o.State); ok { toSerialize["State"] = val } return toSerialize, nil } type NullablePhase2Status struct { value *Phase2Status isSet bool } func (v NullablePhase2Status) Get() *Phase2Status { return v.value } func (v *NullablePhase2Status) Set(val *Phase2Status) { v.value = val v.isSet = true } func (v NullablePhase2Status) IsSet() bool { return v.isSet } func (v *NullablePhase2Status) Unset() { v.value = nil v.isSet = false } func NewNullablePhase2Status(val *Phase2Status) *NullablePhase2Status { return &NullablePhase2Status{value: val, isSet: true} } func (v NullablePhase2Status) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullablePhase2Status) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }