1 Star 0 Fork 0

MrCoder / openapi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
model_exception.go 5.51 KB
一键复制 编辑 原始数据 按行查看 历史
MrCoder 提交于 2023-12-22 15:27 . update
/*
Naf_EventExposure
AF Event Exposure Service. © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
API version: 1.2.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package OpenAPI_Naf_EventExposure
import (
"encoding/json"
"fmt"
)
// checks if the Exception type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &Exception{}
// Exception Represents the Exception information.
type Exception struct {
ExcepId ExceptionId `json:"excepId"`
ExcepLevel *int32 `json:"excepLevel,omitempty"`
ExcepTrend *ExceptionTrend `json:"excepTrend,omitempty"`
}
type _Exception Exception
// NewException instantiates a new Exception 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 NewException(excepId ExceptionId) *Exception {
this := Exception{}
this.ExcepId = excepId
return &this
}
// NewExceptionWithDefaults instantiates a new Exception 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 NewExceptionWithDefaults() *Exception {
this := Exception{}
return &this
}
// GetExcepId returns the ExcepId field value
func (o *Exception) GetExcepId() ExceptionId {
if o == nil {
var ret ExceptionId
return ret
}
return o.ExcepId
}
// GetExcepIdOk returns a tuple with the ExcepId field value
// and a boolean to check if the value has been set.
func (o *Exception) GetExcepIdOk() (*ExceptionId, bool) {
if o == nil {
return nil, false
}
return &o.ExcepId, true
}
// SetExcepId sets field value
func (o *Exception) SetExcepId(v ExceptionId) {
o.ExcepId = v
}
// GetExcepLevel returns the ExcepLevel field value if set, zero value otherwise.
func (o *Exception) GetExcepLevel() int32 {
if o == nil || IsNil(o.ExcepLevel) {
var ret int32
return ret
}
return *o.ExcepLevel
}
// GetExcepLevelOk returns a tuple with the ExcepLevel field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Exception) GetExcepLevelOk() (*int32, bool) {
if o == nil || IsNil(o.ExcepLevel) {
return nil, false
}
return o.ExcepLevel, true
}
// HasExcepLevel returns a boolean if a field has been set.
func (o *Exception) HasExcepLevel() bool {
if o != nil && !IsNil(o.ExcepLevel) {
return true
}
return false
}
// SetExcepLevel gets a reference to the given int32 and assigns it to the ExcepLevel field.
func (o *Exception) SetExcepLevel(v int32) {
o.ExcepLevel = &v
}
// GetExcepTrend returns the ExcepTrend field value if set, zero value otherwise.
func (o *Exception) GetExcepTrend() ExceptionTrend {
if o == nil || IsNil(o.ExcepTrend) {
var ret ExceptionTrend
return ret
}
return *o.ExcepTrend
}
// GetExcepTrendOk returns a tuple with the ExcepTrend field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *Exception) GetExcepTrendOk() (*ExceptionTrend, bool) {
if o == nil || IsNil(o.ExcepTrend) {
return nil, false
}
return o.ExcepTrend, true
}
// HasExcepTrend returns a boolean if a field has been set.
func (o *Exception) HasExcepTrend() bool {
if o != nil && !IsNil(o.ExcepTrend) {
return true
}
return false
}
// SetExcepTrend gets a reference to the given ExceptionTrend and assigns it to the ExcepTrend field.
func (o *Exception) SetExcepTrend(v ExceptionTrend) {
o.ExcepTrend = &v
}
func (o Exception) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o Exception) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["excepId"] = o.ExcepId
if !IsNil(o.ExcepLevel) {
toSerialize["excepLevel"] = o.ExcepLevel
}
if !IsNil(o.ExcepTrend) {
toSerialize["excepTrend"] = o.ExcepTrend
}
return toSerialize, nil
}
func (o *Exception) 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{
"excepId",
}
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)
}
}
varException := _Exception{}
err = json.Unmarshal(bytes, &varException)
if err != nil {
return err
}
*o = Exception(varException)
return err
}
type NullableException struct {
value *Exception
isSet bool
}
func (v NullableException) Get() *Exception {
return v.value
}
func (v *NullableException) Set(val *Exception) {
v.value = val
v.isSet = true
}
func (v NullableException) IsSet() bool {
return v.isSet
}
func (v *NullableException) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableException(val *Exception) *NullableException {
return &NullableException{value: val, isSet: true}
}
func (v NullableException) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableException) 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

搜索帮助