Ai
1 Star 0 Fork 0

MrCoder/openapi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
model_am_event_data.go 8.58 KB
一键复制 编辑 原始数据 按行查看 历史
MrCoder 提交于 2023-12-22 15:27 +08:00 . update
/*
3gpp-am-policyauthorization
API for AM policy authorization. © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
API version: 1.0.2
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package OpenAPI_AMPolicyAuthorization
import (
"encoding/json"
"fmt"
"time"
)
// checks if the AmEventData type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AmEventData{}
// AmEventData This data type contains the event identifier and the related event reporting information.
type AmEventData struct {
Event AmEvent `json:"event"`
ImmRep *bool `json:"immRep,omitempty"`
NotifMethod *NotificationMethod `json:"notifMethod,omitempty"`
// Unsigned Integer, i.e. only value 0 and integers above 0 are permissible.
MaxReportNbr *int32 `json:"maxReportNbr,omitempty"`
// string with format 'date-time' as defined in OpenAPI.
MonDur *time.Time `json:"monDur,omitempty"`
// indicating a time in seconds.
RepPeriod *int32 `json:"repPeriod,omitempty"`
}
type _AmEventData AmEventData
// NewAmEventData instantiates a new AmEventData 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 NewAmEventData(event AmEvent) *AmEventData {
this := AmEventData{}
this.Event = event
return &this
}
// NewAmEventDataWithDefaults instantiates a new AmEventData 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 NewAmEventDataWithDefaults() *AmEventData {
this := AmEventData{}
return &this
}
// GetEvent returns the Event field value
func (o *AmEventData) GetEvent() AmEvent {
if o == nil {
var ret AmEvent
return ret
}
return o.Event
}
// GetEventOk returns a tuple with the Event field value
// and a boolean to check if the value has been set.
func (o *AmEventData) GetEventOk() (*AmEvent, bool) {
if o == nil {
return nil, false
}
return &o.Event, true
}
// SetEvent sets field value
func (o *AmEventData) SetEvent(v AmEvent) {
o.Event = v
}
// GetImmRep returns the ImmRep field value if set, zero value otherwise.
func (o *AmEventData) GetImmRep() bool {
if o == nil || IsNil(o.ImmRep) {
var ret bool
return ret
}
return *o.ImmRep
}
// GetImmRepOk returns a tuple with the ImmRep field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AmEventData) GetImmRepOk() (*bool, bool) {
if o == nil || IsNil(o.ImmRep) {
return nil, false
}
return o.ImmRep, true
}
// HasImmRep returns a boolean if a field has been set.
func (o *AmEventData) HasImmRep() bool {
if o != nil && !IsNil(o.ImmRep) {
return true
}
return false
}
// SetImmRep gets a reference to the given bool and assigns it to the ImmRep field.
func (o *AmEventData) SetImmRep(v bool) {
o.ImmRep = &v
}
// GetNotifMethod returns the NotifMethod field value if set, zero value otherwise.
func (o *AmEventData) GetNotifMethod() NotificationMethod {
if o == nil || IsNil(o.NotifMethod) {
var ret NotificationMethod
return ret
}
return *o.NotifMethod
}
// GetNotifMethodOk returns a tuple with the NotifMethod field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AmEventData) GetNotifMethodOk() (*NotificationMethod, bool) {
if o == nil || IsNil(o.NotifMethod) {
return nil, false
}
return o.NotifMethod, true
}
// HasNotifMethod returns a boolean if a field has been set.
func (o *AmEventData) HasNotifMethod() bool {
if o != nil && !IsNil(o.NotifMethod) {
return true
}
return false
}
// SetNotifMethod gets a reference to the given NotificationMethod and assigns it to the NotifMethod field.
func (o *AmEventData) SetNotifMethod(v NotificationMethod) {
o.NotifMethod = &v
}
// GetMaxReportNbr returns the MaxReportNbr field value if set, zero value otherwise.
func (o *AmEventData) GetMaxReportNbr() int32 {
if o == nil || IsNil(o.MaxReportNbr) {
var ret int32
return ret
}
return *o.MaxReportNbr
}
// GetMaxReportNbrOk returns a tuple with the MaxReportNbr field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AmEventData) GetMaxReportNbrOk() (*int32, bool) {
if o == nil || IsNil(o.MaxReportNbr) {
return nil, false
}
return o.MaxReportNbr, true
}
// HasMaxReportNbr returns a boolean if a field has been set.
func (o *AmEventData) HasMaxReportNbr() bool {
if o != nil && !IsNil(o.MaxReportNbr) {
return true
}
return false
}
// SetMaxReportNbr gets a reference to the given int32 and assigns it to the MaxReportNbr field.
func (o *AmEventData) SetMaxReportNbr(v int32) {
o.MaxReportNbr = &v
}
// GetMonDur returns the MonDur field value if set, zero value otherwise.
func (o *AmEventData) GetMonDur() time.Time {
if o == nil || IsNil(o.MonDur) {
var ret time.Time
return ret
}
return *o.MonDur
}
// GetMonDurOk returns a tuple with the MonDur field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AmEventData) GetMonDurOk() (*time.Time, bool) {
if o == nil || IsNil(o.MonDur) {
return nil, false
}
return o.MonDur, true
}
// HasMonDur returns a boolean if a field has been set.
func (o *AmEventData) HasMonDur() bool {
if o != nil && !IsNil(o.MonDur) {
return true
}
return false
}
// SetMonDur gets a reference to the given time.Time and assigns it to the MonDur field.
func (o *AmEventData) SetMonDur(v time.Time) {
o.MonDur = &v
}
// GetRepPeriod returns the RepPeriod field value if set, zero value otherwise.
func (o *AmEventData) GetRepPeriod() int32 {
if o == nil || IsNil(o.RepPeriod) {
var ret int32
return ret
}
return *o.RepPeriod
}
// GetRepPeriodOk returns a tuple with the RepPeriod field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AmEventData) GetRepPeriodOk() (*int32, bool) {
if o == nil || IsNil(o.RepPeriod) {
return nil, false
}
return o.RepPeriod, true
}
// HasRepPeriod returns a boolean if a field has been set.
func (o *AmEventData) HasRepPeriod() bool {
if o != nil && !IsNil(o.RepPeriod) {
return true
}
return false
}
// SetRepPeriod gets a reference to the given int32 and assigns it to the RepPeriod field.
func (o *AmEventData) SetRepPeriod(v int32) {
o.RepPeriod = &v
}
func (o AmEventData) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AmEventData) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["event"] = o.Event
if !IsNil(o.ImmRep) {
toSerialize["immRep"] = o.ImmRep
}
if !IsNil(o.NotifMethod) {
toSerialize["notifMethod"] = o.NotifMethod
}
if !IsNil(o.MaxReportNbr) {
toSerialize["maxReportNbr"] = o.MaxReportNbr
}
if !IsNil(o.MonDur) {
toSerialize["monDur"] = o.MonDur
}
if !IsNil(o.RepPeriod) {
toSerialize["repPeriod"] = o.RepPeriod
}
return toSerialize, nil
}
func (o *AmEventData) 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{
"event",
}
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)
}
}
varAmEventData := _AmEventData{}
err = json.Unmarshal(bytes, &varAmEventData)
if err != nil {
return err
}
*o = AmEventData(varAmEventData)
return err
}
type NullableAmEventData struct {
value *AmEventData
isSet bool
}
func (v NullableAmEventData) Get() *AmEventData {
return v.value
}
func (v *NullableAmEventData) Set(val *AmEventData) {
v.value = val
v.isSet = true
}
func (v NullableAmEventData) IsSet() bool {
return v.isSet
}
func (v *NullableAmEventData) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAmEventData(val *AmEventData) *NullableAmEventData {
return &NullableAmEventData{value: val, isSet: true}
}
func (v NullableAmEventData) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAmEventData) 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

搜索帮助