1 Star 0 Fork 0

MrCoder / openapi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
model_routing_rule.go 6.14 KB
一键复制 编辑 原始数据 按行查看 历史
MrCoder 提交于 2023-12-22 15:27 . update
/*
CAPIF_Routing_Info_API
API for Routing information. © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
API version: 1.1.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package OpenAPI_CAPIF_Routing_Info_API
import (
"encoding/json"
"fmt"
)
// checks if the RoutingRule type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &RoutingRule{}
// RoutingRule Represents an API routing rule.
type RoutingRule struct {
Ipv4AddrRanges []Ipv4AddressRange `json:"ipv4AddrRanges,omitempty"`
Ipv6AddrRanges []Ipv6AddressRange `json:"ipv6AddrRanges,omitempty"`
AefProfile NullableAefProfile `json:"aefProfile"`
}
type _RoutingRule RoutingRule
// NewRoutingRule instantiates a new RoutingRule 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 NewRoutingRule(aefProfile NullableAefProfile) *RoutingRule {
this := RoutingRule{}
this.AefProfile = aefProfile
return &this
}
// NewRoutingRuleWithDefaults instantiates a new RoutingRule 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 NewRoutingRuleWithDefaults() *RoutingRule {
this := RoutingRule{}
return &this
}
// GetIpv4AddrRanges returns the Ipv4AddrRanges field value if set, zero value otherwise.
func (o *RoutingRule) GetIpv4AddrRanges() []Ipv4AddressRange {
if o == nil || IsNil(o.Ipv4AddrRanges) {
var ret []Ipv4AddressRange
return ret
}
return o.Ipv4AddrRanges
}
// GetIpv4AddrRangesOk returns a tuple with the Ipv4AddrRanges field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RoutingRule) GetIpv4AddrRangesOk() ([]Ipv4AddressRange, bool) {
if o == nil || IsNil(o.Ipv4AddrRanges) {
return nil, false
}
return o.Ipv4AddrRanges, true
}
// HasIpv4AddrRanges returns a boolean if a field has been set.
func (o *RoutingRule) HasIpv4AddrRanges() bool {
if o != nil && !IsNil(o.Ipv4AddrRanges) {
return true
}
return false
}
// SetIpv4AddrRanges gets a reference to the given []Ipv4AddressRange and assigns it to the Ipv4AddrRanges field.
func (o *RoutingRule) SetIpv4AddrRanges(v []Ipv4AddressRange) {
o.Ipv4AddrRanges = v
}
// GetIpv6AddrRanges returns the Ipv6AddrRanges field value if set, zero value otherwise.
func (o *RoutingRule) GetIpv6AddrRanges() []Ipv6AddressRange {
if o == nil || IsNil(o.Ipv6AddrRanges) {
var ret []Ipv6AddressRange
return ret
}
return o.Ipv6AddrRanges
}
// GetIpv6AddrRangesOk returns a tuple with the Ipv6AddrRanges field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *RoutingRule) GetIpv6AddrRangesOk() ([]Ipv6AddressRange, bool) {
if o == nil || IsNil(o.Ipv6AddrRanges) {
return nil, false
}
return o.Ipv6AddrRanges, true
}
// HasIpv6AddrRanges returns a boolean if a field has been set.
func (o *RoutingRule) HasIpv6AddrRanges() bool {
if o != nil && !IsNil(o.Ipv6AddrRanges) {
return true
}
return false
}
// SetIpv6AddrRanges gets a reference to the given []Ipv6AddressRange and assigns it to the Ipv6AddrRanges field.
func (o *RoutingRule) SetIpv6AddrRanges(v []Ipv6AddressRange) {
o.Ipv6AddrRanges = v
}
// GetAefProfile returns the AefProfile field value
// If the value is explicit nil, the zero value for AefProfile will be returned
func (o *RoutingRule) GetAefProfile() AefProfile {
if o == nil || o.AefProfile.Get() == nil {
var ret AefProfile
return ret
}
return *o.AefProfile.Get()
}
// GetAefProfileOk returns a tuple with the AefProfile field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *RoutingRule) GetAefProfileOk() (*AefProfile, bool) {
if o == nil {
return nil, false
}
return o.AefProfile.Get(), o.AefProfile.IsSet()
}
// SetAefProfile sets field value
func (o *RoutingRule) SetAefProfile(v AefProfile) {
o.AefProfile.Set(&v)
}
func (o RoutingRule) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o RoutingRule) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if !IsNil(o.Ipv4AddrRanges) {
toSerialize["ipv4AddrRanges"] = o.Ipv4AddrRanges
}
if !IsNil(o.Ipv6AddrRanges) {
toSerialize["ipv6AddrRanges"] = o.Ipv6AddrRanges
}
toSerialize["aefProfile"] = o.AefProfile.Get()
return toSerialize, nil
}
func (o *RoutingRule) 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{
"aefProfile",
}
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)
}
}
varRoutingRule := _RoutingRule{}
err = json.Unmarshal(bytes, &varRoutingRule)
if err != nil {
return err
}
*o = RoutingRule(varRoutingRule)
return err
}
type NullableRoutingRule struct {
value *RoutingRule
isSet bool
}
func (v NullableRoutingRule) Get() *RoutingRule {
return v.value
}
func (v *NullableRoutingRule) Set(val *RoutingRule) {
v.value = val
v.isSet = true
}
func (v NullableRoutingRule) IsSet() bool {
return v.isSet
}
func (v *NullableRoutingRule) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableRoutingRule(val *RoutingRule) *NullableRoutingRule {
return &NullableRoutingRule{value: val, isSet: true}
}
func (v NullableRoutingRule) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableRoutingRule) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
Go
1
https://gitee.com/konglinglong/openapi.git
git@gitee.com:konglinglong/openapi.git
konglinglong
openapi
openapi
e403a3c726a4

搜索帮助