Ai
1 Star 0 Fork 0

MrCoder/openapi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
model_event_subscription.go 12.95 KB
一键复制 编辑 原始数据 按行查看 历史
MrCoder 提交于 2023-12-22 15:27 +08:00 . update
/*
Nsmf_EventExposure
Session Management Event Exposure Service. © 2023, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
API version: 1.2.2
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package OpenAPI_Nsmf_EventExposure
import (
"encoding/json"
"fmt"
)
// checks if the EventSubscription type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &EventSubscription{}
// EventSubscription Represents a subscription to a single event.
type EventSubscription struct {
Event SmfEvent `json:"event"`
DnaiChgType *DnaiChangeType `json:"dnaiChgType,omitempty"`
DddTraDescriptors []DddTrafficDescriptor `json:"dddTraDescriptors,omitempty"`
DddStati []DlDataDeliveryStatus `json:"dddStati,omitempty"`
AppIds []string `json:"appIds,omitempty"`
TargetPeriod *TimeWindow `json:"targetPeriod,omitempty"`
// Indicates the subscription for UE transaction dispersion collectionon, if it is included and set to \"true\". Default value is \"false\".
TransacDispInd *bool `json:"transacDispInd,omitempty"`
// Indicates Session Management Transaction metrics.
TransacMetrics []TransactionMetric `json:"transacMetrics,omitempty"`
UeIpAddr NullableIpAddr `json:"ueIpAddr,omitempty"`
}
type _EventSubscription EventSubscription
// NewEventSubscription instantiates a new EventSubscription 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 NewEventSubscription(event SmfEvent) *EventSubscription {
this := EventSubscription{}
this.Event = event
return &this
}
// NewEventSubscriptionWithDefaults instantiates a new EventSubscription 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 NewEventSubscriptionWithDefaults() *EventSubscription {
this := EventSubscription{}
return &this
}
// GetEvent returns the Event field value
func (o *EventSubscription) GetEvent() SmfEvent {
if o == nil {
var ret SmfEvent
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 *EventSubscription) GetEventOk() (*SmfEvent, bool) {
if o == nil {
return nil, false
}
return &o.Event, true
}
// SetEvent sets field value
func (o *EventSubscription) SetEvent(v SmfEvent) {
o.Event = v
}
// GetDnaiChgType returns the DnaiChgType field value if set, zero value otherwise.
func (o *EventSubscription) GetDnaiChgType() DnaiChangeType {
if o == nil || IsNil(o.DnaiChgType) {
var ret DnaiChangeType
return ret
}
return *o.DnaiChgType
}
// GetDnaiChgTypeOk returns a tuple with the DnaiChgType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EventSubscription) GetDnaiChgTypeOk() (*DnaiChangeType, bool) {
if o == nil || IsNil(o.DnaiChgType) {
return nil, false
}
return o.DnaiChgType, true
}
// HasDnaiChgType returns a boolean if a field has been set.
func (o *EventSubscription) HasDnaiChgType() bool {
if o != nil && !IsNil(o.DnaiChgType) {
return true
}
return false
}
// SetDnaiChgType gets a reference to the given DnaiChangeType and assigns it to the DnaiChgType field.
func (o *EventSubscription) SetDnaiChgType(v DnaiChangeType) {
o.DnaiChgType = &v
}
// GetDddTraDescriptors returns the DddTraDescriptors field value if set, zero value otherwise.
func (o *EventSubscription) GetDddTraDescriptors() []DddTrafficDescriptor {
if o == nil || IsNil(o.DddTraDescriptors) {
var ret []DddTrafficDescriptor
return ret
}
return o.DddTraDescriptors
}
// GetDddTraDescriptorsOk returns a tuple with the DddTraDescriptors field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EventSubscription) GetDddTraDescriptorsOk() ([]DddTrafficDescriptor, bool) {
if o == nil || IsNil(o.DddTraDescriptors) {
return nil, false
}
return o.DddTraDescriptors, true
}
// HasDddTraDescriptors returns a boolean if a field has been set.
func (o *EventSubscription) HasDddTraDescriptors() bool {
if o != nil && !IsNil(o.DddTraDescriptors) {
return true
}
return false
}
// SetDddTraDescriptors gets a reference to the given []DddTrafficDescriptor and assigns it to the DddTraDescriptors field.
func (o *EventSubscription) SetDddTraDescriptors(v []DddTrafficDescriptor) {
o.DddTraDescriptors = v
}
// GetDddStati returns the DddStati field value if set, zero value otherwise.
func (o *EventSubscription) GetDddStati() []DlDataDeliveryStatus {
if o == nil || IsNil(o.DddStati) {
var ret []DlDataDeliveryStatus
return ret
}
return o.DddStati
}
// GetDddStatiOk returns a tuple with the DddStati field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EventSubscription) GetDddStatiOk() ([]DlDataDeliveryStatus, bool) {
if o == nil || IsNil(o.DddStati) {
return nil, false
}
return o.DddStati, true
}
// HasDddStati returns a boolean if a field has been set.
func (o *EventSubscription) HasDddStati() bool {
if o != nil && !IsNil(o.DddStati) {
return true
}
return false
}
// SetDddStati gets a reference to the given []DlDataDeliveryStatus and assigns it to the DddStati field.
func (o *EventSubscription) SetDddStati(v []DlDataDeliveryStatus) {
o.DddStati = v
}
// GetAppIds returns the AppIds field value if set, zero value otherwise.
func (o *EventSubscription) GetAppIds() []string {
if o == nil || IsNil(o.AppIds) {
var ret []string
return ret
}
return o.AppIds
}
// GetAppIdsOk returns a tuple with the AppIds field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EventSubscription) GetAppIdsOk() ([]string, bool) {
if o == nil || IsNil(o.AppIds) {
return nil, false
}
return o.AppIds, true
}
// HasAppIds returns a boolean if a field has been set.
func (o *EventSubscription) HasAppIds() bool {
if o != nil && !IsNil(o.AppIds) {
return true
}
return false
}
// SetAppIds gets a reference to the given []string and assigns it to the AppIds field.
func (o *EventSubscription) SetAppIds(v []string) {
o.AppIds = v
}
// GetTargetPeriod returns the TargetPeriod field value if set, zero value otherwise.
func (o *EventSubscription) GetTargetPeriod() TimeWindow {
if o == nil || IsNil(o.TargetPeriod) {
var ret TimeWindow
return ret
}
return *o.TargetPeriod
}
// GetTargetPeriodOk returns a tuple with the TargetPeriod field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EventSubscription) GetTargetPeriodOk() (*TimeWindow, bool) {
if o == nil || IsNil(o.TargetPeriod) {
return nil, false
}
return o.TargetPeriod, true
}
// HasTargetPeriod returns a boolean if a field has been set.
func (o *EventSubscription) HasTargetPeriod() bool {
if o != nil && !IsNil(o.TargetPeriod) {
return true
}
return false
}
// SetTargetPeriod gets a reference to the given TimeWindow and assigns it to the TargetPeriod field.
func (o *EventSubscription) SetTargetPeriod(v TimeWindow) {
o.TargetPeriod = &v
}
// GetTransacDispInd returns the TransacDispInd field value if set, zero value otherwise.
func (o *EventSubscription) GetTransacDispInd() bool {
if o == nil || IsNil(o.TransacDispInd) {
var ret bool
return ret
}
return *o.TransacDispInd
}
// GetTransacDispIndOk returns a tuple with the TransacDispInd field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EventSubscription) GetTransacDispIndOk() (*bool, bool) {
if o == nil || IsNil(o.TransacDispInd) {
return nil, false
}
return o.TransacDispInd, true
}
// HasTransacDispInd returns a boolean if a field has been set.
func (o *EventSubscription) HasTransacDispInd() bool {
if o != nil && !IsNil(o.TransacDispInd) {
return true
}
return false
}
// SetTransacDispInd gets a reference to the given bool and assigns it to the TransacDispInd field.
func (o *EventSubscription) SetTransacDispInd(v bool) {
o.TransacDispInd = &v
}
// GetTransacMetrics returns the TransacMetrics field value if set, zero value otherwise.
func (o *EventSubscription) GetTransacMetrics() []TransactionMetric {
if o == nil || IsNil(o.TransacMetrics) {
var ret []TransactionMetric
return ret
}
return o.TransacMetrics
}
// GetTransacMetricsOk returns a tuple with the TransacMetrics field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *EventSubscription) GetTransacMetricsOk() ([]TransactionMetric, bool) {
if o == nil || IsNil(o.TransacMetrics) {
return nil, false
}
return o.TransacMetrics, true
}
// HasTransacMetrics returns a boolean if a field has been set.
func (o *EventSubscription) HasTransacMetrics() bool {
if o != nil && !IsNil(o.TransacMetrics) {
return true
}
return false
}
// SetTransacMetrics gets a reference to the given []TransactionMetric and assigns it to the TransacMetrics field.
func (o *EventSubscription) SetTransacMetrics(v []TransactionMetric) {
o.TransacMetrics = v
}
// GetUeIpAddr returns the UeIpAddr field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *EventSubscription) GetUeIpAddr() IpAddr {
if o == nil || IsNil(o.UeIpAddr.Get()) {
var ret IpAddr
return ret
}
return *o.UeIpAddr.Get()
}
// GetUeIpAddrOk returns a tuple with the UeIpAddr 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 *EventSubscription) GetUeIpAddrOk() (*IpAddr, bool) {
if o == nil {
return nil, false
}
return o.UeIpAddr.Get(), o.UeIpAddr.IsSet()
}
// HasUeIpAddr returns a boolean if a field has been set.
func (o *EventSubscription) HasUeIpAddr() bool {
if o != nil && o.UeIpAddr.IsSet() {
return true
}
return false
}
// SetUeIpAddr gets a reference to the given NullableIpAddr and assigns it to the UeIpAddr field.
func (o *EventSubscription) SetUeIpAddr(v IpAddr) {
o.UeIpAddr.Set(&v)
}
// SetUeIpAddrNil sets the value for UeIpAddr to be an explicit nil
func (o *EventSubscription) SetUeIpAddrNil() {
o.UeIpAddr.Set(nil)
}
// UnsetUeIpAddr ensures that no value is present for UeIpAddr, not even an explicit nil
func (o *EventSubscription) UnsetUeIpAddr() {
o.UeIpAddr.Unset()
}
func (o EventSubscription) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o EventSubscription) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["event"] = o.Event
if !IsNil(o.DnaiChgType) {
toSerialize["dnaiChgType"] = o.DnaiChgType
}
if !IsNil(o.DddTraDescriptors) {
toSerialize["dddTraDescriptors"] = o.DddTraDescriptors
}
if !IsNil(o.DddStati) {
toSerialize["dddStati"] = o.DddStati
}
if !IsNil(o.AppIds) {
toSerialize["appIds"] = o.AppIds
}
if !IsNil(o.TargetPeriod) {
toSerialize["targetPeriod"] = o.TargetPeriod
}
if !IsNil(o.TransacDispInd) {
toSerialize["transacDispInd"] = o.TransacDispInd
}
if !IsNil(o.TransacMetrics) {
toSerialize["transacMetrics"] = o.TransacMetrics
}
if o.UeIpAddr.IsSet() {
toSerialize["ueIpAddr"] = o.UeIpAddr.Get()
}
return toSerialize, nil
}
func (o *EventSubscription) 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)
}
}
varEventSubscription := _EventSubscription{}
err = json.Unmarshal(bytes, &varEventSubscription)
if err != nil {
return err
}
*o = EventSubscription(varEventSubscription)
return err
}
type NullableEventSubscription struct {
value *EventSubscription
isSet bool
}
func (v NullableEventSubscription) Get() *EventSubscription {
return v.value
}
func (v *NullableEventSubscription) Set(val *EventSubscription) {
v.value = val
v.isSet = true
}
func (v NullableEventSubscription) IsSet() bool {
return v.isSet
}
func (v *NullableEventSubscription) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableEventSubscription(val *EventSubscription) *NullableEventSubscription {
return &NullableEventSubscription{value: val, isSet: true}
}
func (v NullableEventSubscription) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableEventSubscription) 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

搜索帮助