Ai
1 Star 0 Fork 0

MrCoder/openapi

Create your Gitee Account
Explore and code with more than 13.5 million developers,Free private repositories !:)
Sign up
文件
Clone or Download
model_ipv6_prefix_range.go 4.31 KB
Copy Edit Raw Blame History
MrCoder authored 2023-12-22 15:27 +08:00 . update
/*
Neasdf_BaselineDNSPattern
EASDF Baseline DNS Pattern Service. © 2023, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
API version: 1.0.1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package OpenAPI_Neasdf_BaselineDNSPattern
import (
"encoding/json"
"fmt"
)
// checks if the Ipv6PrefixRange type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Ipv6PrefixRange{}
// Ipv6PrefixRange Range of IPv6 prefixes
type Ipv6PrefixRange struct {
Start Ipv6Prefix `json:"start"`
End Ipv6Prefix `json:"end"`
}
type _Ipv6PrefixRange Ipv6PrefixRange
// NewIpv6PrefixRange instantiates a new Ipv6PrefixRange 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 NewIpv6PrefixRange(start Ipv6Prefix, end Ipv6Prefix) *Ipv6PrefixRange {
this := Ipv6PrefixRange{}
this.Start = start
this.End = end
return &this
}
// NewIpv6PrefixRangeWithDefaults instantiates a new Ipv6PrefixRange 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 NewIpv6PrefixRangeWithDefaults() *Ipv6PrefixRange {
this := Ipv6PrefixRange{}
return &this
}
// GetStart returns the Start field value
func (o *Ipv6PrefixRange) GetStart() Ipv6Prefix {
if o == nil {
var ret Ipv6Prefix
return ret
}
return o.Start
}
// GetStartOk returns a tuple with the Start field value
// and a boolean to check if the value has been set.
func (o *Ipv6PrefixRange) GetStartOk() (*Ipv6Prefix, bool) {
if o == nil {
return nil, false
}
return &o.Start, true
}
// SetStart sets field value
func (o *Ipv6PrefixRange) SetStart(v Ipv6Prefix) {
o.Start = v
}
// GetEnd returns the End field value
func (o *Ipv6PrefixRange) GetEnd() Ipv6Prefix {
if o == nil {
var ret Ipv6Prefix
return ret
}
return o.End
}
// GetEndOk returns a tuple with the End field value
// and a boolean to check if the value has been set.
func (o *Ipv6PrefixRange) GetEndOk() (*Ipv6Prefix, bool) {
if o == nil {
return nil, false
}
return &o.End, true
}
// SetEnd sets field value
func (o *Ipv6PrefixRange) SetEnd(v Ipv6Prefix) {
o.End = v
}
func (o Ipv6PrefixRange) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Ipv6PrefixRange) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["start"] = o.Start
toSerialize["end"] = o.End
return toSerialize, nil
}
func (o *Ipv6PrefixRange) UnmarshalJSON(bytes []byte) (err error) {
// This validates that all required properties are included in the JSON object
// by unmarshalling the object into a generic map with string keys and checking
// that every required field exists as a key in the generic map.
requiredProperties := []string{
"start",
"end",
}
allProperties := make(map[string]interface{})
err = json.Unmarshal(bytes, &allProperties)
if err != nil {
return err
}
for _, requiredProperty := range requiredProperties {
if _, exists := allProperties[requiredProperty]; !exists {
return fmt.Errorf("no value given for required property %v", requiredProperty)
}
}
varIpv6PrefixRange := _Ipv6PrefixRange{}
err = json.Unmarshal(bytes, &varIpv6PrefixRange)
if err != nil {
return err
}
*o = Ipv6PrefixRange(varIpv6PrefixRange)
return err
}
type NullableIpv6PrefixRange struct {
value *Ipv6PrefixRange
isSet bool
}
func (v NullableIpv6PrefixRange) Get() *Ipv6PrefixRange {
return v.value
}
func (v *NullableIpv6PrefixRange) Set(val *Ipv6PrefixRange) {
v.value = val
v.isSet = true
}
func (v NullableIpv6PrefixRange) IsSet() bool {
return v.isSet
}
func (v *NullableIpv6PrefixRange) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableIpv6PrefixRange(val *Ipv6PrefixRange) *NullableIpv6PrefixRange {
return &NullableIpv6PrefixRange{value: val, isSet: true}
}
func (v NullableIpv6PrefixRange) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableIpv6PrefixRange) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Go
1
https://gitee.com/konglinglong/openapi.git
git@gitee.com:konglinglong/openapi.git
konglinglong
openapi
openapi
e403a3c726a4

Search