Ai
1 Star 0 Fork 0

MrCoder/openapi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
model_plmn_ec_info.go 6.63 KB
一键复制 编辑 原始数据 按行查看 历史
MrCoder 提交于 2023-12-22 15:27 +08:00 . update
/*
Nudr_DataRepository API OpenAPI file
Unified Data Repository Service. © 2023, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
API version: 2.2.4
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package OpenAPI_Nudr_DR
import (
"encoding/json"
"fmt"
)
// checks if the PlmnEcInfo type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PlmnEcInfo{}
// PlmnEcInfo struct for PlmnEcInfo
type PlmnEcInfo struct {
PlmnId PlmnId `json:"plmnId"`
EcRestrictionDataWb NullableEcRestrictionDataWb `json:"ecRestrictionDataWb,omitempty"`
EcRestrictionDataNb *bool `json:"ecRestrictionDataNb,omitempty"`
}
type _PlmnEcInfo PlmnEcInfo
// NewPlmnEcInfo instantiates a new PlmnEcInfo 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 NewPlmnEcInfo(plmnId PlmnId) *PlmnEcInfo {
this := PlmnEcInfo{}
this.PlmnId = plmnId
var ecRestrictionDataNb bool = false
this.EcRestrictionDataNb = &ecRestrictionDataNb
return &this
}
// NewPlmnEcInfoWithDefaults instantiates a new PlmnEcInfo 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 NewPlmnEcInfoWithDefaults() *PlmnEcInfo {
this := PlmnEcInfo{}
var ecRestrictionDataNb bool = false
this.EcRestrictionDataNb = &ecRestrictionDataNb
return &this
}
// GetPlmnId returns the PlmnId field value
func (o *PlmnEcInfo) GetPlmnId() PlmnId {
if o == nil {
var ret PlmnId
return ret
}
return o.PlmnId
}
// GetPlmnIdOk returns a tuple with the PlmnId field value
// and a boolean to check if the value has been set.
func (o *PlmnEcInfo) GetPlmnIdOk() (*PlmnId, bool) {
if o == nil {
return nil, false
}
return &o.PlmnId, true
}
// SetPlmnId sets field value
func (o *PlmnEcInfo) SetPlmnId(v PlmnId) {
o.PlmnId = v
}
// GetEcRestrictionDataWb returns the EcRestrictionDataWb field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PlmnEcInfo) GetEcRestrictionDataWb() EcRestrictionDataWb {
if o == nil || IsNil(o.EcRestrictionDataWb.Get()) {
var ret EcRestrictionDataWb
return ret
}
return *o.EcRestrictionDataWb.Get()
}
// GetEcRestrictionDataWbOk returns a tuple with the EcRestrictionDataWb field value if set, nil otherwise
// 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 *PlmnEcInfo) GetEcRestrictionDataWbOk() (*EcRestrictionDataWb, bool) {
if o == nil {
return nil, false
}
return o.EcRestrictionDataWb.Get(), o.EcRestrictionDataWb.IsSet()
}
// HasEcRestrictionDataWb returns a boolean if a field has been set.
func (o *PlmnEcInfo) HasEcRestrictionDataWb() bool {
if o != nil && o.EcRestrictionDataWb.IsSet() {
return true
}
return false
}
// SetEcRestrictionDataWb gets a reference to the given NullableEcRestrictionDataWb and assigns it to the EcRestrictionDataWb field.
func (o *PlmnEcInfo) SetEcRestrictionDataWb(v EcRestrictionDataWb) {
o.EcRestrictionDataWb.Set(&v)
}
// SetEcRestrictionDataWbNil sets the value for EcRestrictionDataWb to be an explicit nil
func (o *PlmnEcInfo) SetEcRestrictionDataWbNil() {
o.EcRestrictionDataWb.Set(nil)
}
// UnsetEcRestrictionDataWb ensures that no value is present for EcRestrictionDataWb, not even an explicit nil
func (o *PlmnEcInfo) UnsetEcRestrictionDataWb() {
o.EcRestrictionDataWb.Unset()
}
// GetEcRestrictionDataNb returns the EcRestrictionDataNb field value if set, zero value otherwise.
func (o *PlmnEcInfo) GetEcRestrictionDataNb() bool {
if o == nil || IsNil(o.EcRestrictionDataNb) {
var ret bool
return ret
}
return *o.EcRestrictionDataNb
}
// GetEcRestrictionDataNbOk returns a tuple with the EcRestrictionDataNb field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PlmnEcInfo) GetEcRestrictionDataNbOk() (*bool, bool) {
if o == nil || IsNil(o.EcRestrictionDataNb) {
return nil, false
}
return o.EcRestrictionDataNb, true
}
// HasEcRestrictionDataNb returns a boolean if a field has been set.
func (o *PlmnEcInfo) HasEcRestrictionDataNb() bool {
if o != nil && !IsNil(o.EcRestrictionDataNb) {
return true
}
return false
}
// SetEcRestrictionDataNb gets a reference to the given bool and assigns it to the EcRestrictionDataNb field.
func (o *PlmnEcInfo) SetEcRestrictionDataNb(v bool) {
o.EcRestrictionDataNb = &v
}
func (o PlmnEcInfo) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PlmnEcInfo) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["plmnId"] = o.PlmnId
if o.EcRestrictionDataWb.IsSet() {
toSerialize["ecRestrictionDataWb"] = o.EcRestrictionDataWb.Get()
}
if !IsNil(o.EcRestrictionDataNb) {
toSerialize["ecRestrictionDataNb"] = o.EcRestrictionDataNb
}
return toSerialize, nil
}
func (o *PlmnEcInfo) 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{
"plmnId",
}
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)
}
}
varPlmnEcInfo := _PlmnEcInfo{}
err = json.Unmarshal(bytes, &varPlmnEcInfo)
if err != nil {
return err
}
*o = PlmnEcInfo(varPlmnEcInfo)
return err
}
type NullablePlmnEcInfo struct {
value *PlmnEcInfo
isSet bool
}
func (v NullablePlmnEcInfo) Get() *PlmnEcInfo {
return v.value
}
func (v *NullablePlmnEcInfo) Set(val *PlmnEcInfo) {
v.value = val
v.isSet = true
}
func (v NullablePlmnEcInfo) IsSet() bool {
return v.isSet
}
func (v *NullablePlmnEcInfo) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePlmnEcInfo(val *PlmnEcInfo) *NullablePlmnEcInfo {
return &NullablePlmnEcInfo{value: val, isSet: true}
}
func (v NullablePlmnEcInfo) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePlmnEcInfo) 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

搜索帮助