1 Star 0 Fork 0

MrCoder/openapi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
model_notification_header.go 6.81 KB
一键复制 编辑 原始数据 按行查看 历史
MrCoder 提交于 2年前 . update
/*
File Data Reporting MnS
OAS 3.0.1 definition of the File Data Reporting MnS © 2023, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
API version: 17.3.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package OpenAPI_FileDataReportingMnS
import (
"encoding/json"
"fmt"
"time"
)
// checks if the NotificationHeader type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &NotificationHeader{}
// NotificationHeader struct for NotificationHeader
type NotificationHeader struct {
Href string `json:"href"`
NotificationId int32 `json:"notificationId"`
NotificationType NotificationType `json:"notificationType"`
EventTime time.Time `json:"eventTime"`
SystemDN string `json:"systemDN"`
}
type _NotificationHeader NotificationHeader
// NewNotificationHeader instantiates a new NotificationHeader 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 NewNotificationHeader(href string, notificationId int32, notificationType NotificationType, eventTime time.Time, systemDN string) *NotificationHeader {
this := NotificationHeader{}
this.Href = href
this.NotificationId = notificationId
this.NotificationType = notificationType
this.EventTime = eventTime
this.SystemDN = systemDN
return &this
}
// NewNotificationHeaderWithDefaults instantiates a new NotificationHeader 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 NewNotificationHeaderWithDefaults() *NotificationHeader {
this := NotificationHeader{}
return &this
}
// GetHref returns the Href field value
func (o *NotificationHeader) GetHref() string {
if o == nil {
var ret string
return ret
}
return o.Href
}
// GetHrefOk returns a tuple with the Href field value
// and a boolean to check if the value has been set.
func (o *NotificationHeader) GetHrefOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.Href, true
}
// SetHref sets field value
func (o *NotificationHeader) SetHref(v string) {
o.Href = v
}
// GetNotificationId returns the NotificationId field value
func (o *NotificationHeader) GetNotificationId() int32 {
if o == nil {
var ret int32
return ret
}
return o.NotificationId
}
// GetNotificationIdOk returns a tuple with the NotificationId field value
// and a boolean to check if the value has been set.
func (o *NotificationHeader) GetNotificationIdOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.NotificationId, true
}
// SetNotificationId sets field value
func (o *NotificationHeader) SetNotificationId(v int32) {
o.NotificationId = v
}
// GetNotificationType returns the NotificationType field value
func (o *NotificationHeader) GetNotificationType() NotificationType {
if o == nil {
var ret NotificationType
return ret
}
return o.NotificationType
}
// GetNotificationTypeOk returns a tuple with the NotificationType field value
// and a boolean to check if the value has been set.
func (o *NotificationHeader) GetNotificationTypeOk() (*NotificationType, bool) {
if o == nil {
return nil, false
}
return &o.NotificationType, true
}
// SetNotificationType sets field value
func (o *NotificationHeader) SetNotificationType(v NotificationType) {
o.NotificationType = v
}
// GetEventTime returns the EventTime field value
func (o *NotificationHeader) GetEventTime() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.EventTime
}
// GetEventTimeOk returns a tuple with the EventTime field value
// and a boolean to check if the value has been set.
func (o *NotificationHeader) GetEventTimeOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.EventTime, true
}
// SetEventTime sets field value
func (o *NotificationHeader) SetEventTime(v time.Time) {
o.EventTime = v
}
// GetSystemDN returns the SystemDN field value
func (o *NotificationHeader) GetSystemDN() string {
if o == nil {
var ret string
return ret
}
return o.SystemDN
}
// GetSystemDNOk returns a tuple with the SystemDN field value
// and a boolean to check if the value has been set.
func (o *NotificationHeader) GetSystemDNOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.SystemDN, true
}
// SetSystemDN sets field value
func (o *NotificationHeader) SetSystemDN(v string) {
o.SystemDN = v
}
func (o NotificationHeader) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o NotificationHeader) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["href"] = o.Href
toSerialize["notificationId"] = o.NotificationId
toSerialize["notificationType"] = o.NotificationType
toSerialize["eventTime"] = o.EventTime
toSerialize["systemDN"] = o.SystemDN
return toSerialize, nil
}
func (o *NotificationHeader) 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{
"href",
"notificationId",
"notificationType",
"eventTime",
"systemDN",
}
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)
}
}
varNotificationHeader := _NotificationHeader{}
err = json.Unmarshal(bytes, &varNotificationHeader)
if err != nil {
return err
}
*o = NotificationHeader(varNotificationHeader)
return err
}
type NullableNotificationHeader struct {
value *NotificationHeader
isSet bool
}
func (v NullableNotificationHeader) Get() *NotificationHeader {
return v.value
}
func (v *NullableNotificationHeader) Set(val *NotificationHeader) {
v.value = val
v.isSet = true
}
func (v NullableNotificationHeader) IsSet() bool {
return v.isSet
}
func (v *NullableNotificationHeader) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableNotificationHeader(val *NotificationHeader) *NullableNotificationHeader {
return &NullableNotificationHeader{value: val, isSet: true}
}
func (v NullableNotificationHeader) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableNotificationHeader) 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

搜索帮助