Ai
1 Star 0 Fork 0

MrCoder/openapi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
model_communication_collection.go 6.20 KB
一键复制 编辑 原始数据 按行查看 历史
MrCoder 提交于 2023-12-22 15:27 +08:00 . 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"
"time"
)
// checks if the CommunicationCollection type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &CommunicationCollection{}
// CommunicationCollection Contains communication information.
type CommunicationCollection struct {
// string with format 'date-time' as defined in OpenAPI.
StartTime time.Time `json:"startTime"`
// string with format 'date-time' as defined in OpenAPI.
EndTime time.Time `json:"endTime"`
// Unsigned integer identifying a volume in units of bytes.
UlVol int64 `json:"ulVol"`
// Unsigned integer identifying a volume in units of bytes.
DlVol int64 `json:"dlVol"`
}
type _CommunicationCollection CommunicationCollection
// NewCommunicationCollection instantiates a new CommunicationCollection 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 NewCommunicationCollection(startTime time.Time, endTime time.Time, ulVol int64, dlVol int64) *CommunicationCollection {
this := CommunicationCollection{}
this.StartTime = startTime
this.EndTime = endTime
this.UlVol = ulVol
this.DlVol = dlVol
return &this
}
// NewCommunicationCollectionWithDefaults instantiates a new CommunicationCollection 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 NewCommunicationCollectionWithDefaults() *CommunicationCollection {
this := CommunicationCollection{}
return &this
}
// GetStartTime returns the StartTime field value
func (o *CommunicationCollection) GetStartTime() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.StartTime
}
// GetStartTimeOk returns a tuple with the StartTime field value
// and a boolean to check if the value has been set.
func (o *CommunicationCollection) GetStartTimeOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.StartTime, true
}
// SetStartTime sets field value
func (o *CommunicationCollection) SetStartTime(v time.Time) {
o.StartTime = v
}
// GetEndTime returns the EndTime field value
func (o *CommunicationCollection) GetEndTime() time.Time {
if o == nil {
var ret time.Time
return ret
}
return o.EndTime
}
// GetEndTimeOk returns a tuple with the EndTime field value
// and a boolean to check if the value has been set.
func (o *CommunicationCollection) GetEndTimeOk() (*time.Time, bool) {
if o == nil {
return nil, false
}
return &o.EndTime, true
}
// SetEndTime sets field value
func (o *CommunicationCollection) SetEndTime(v time.Time) {
o.EndTime = v
}
// GetUlVol returns the UlVol field value
func (o *CommunicationCollection) GetUlVol() int64 {
if o == nil {
var ret int64
return ret
}
return o.UlVol
}
// GetUlVolOk returns a tuple with the UlVol field value
// and a boolean to check if the value has been set.
func (o *CommunicationCollection) GetUlVolOk() (*int64, bool) {
if o == nil {
return nil, false
}
return &o.UlVol, true
}
// SetUlVol sets field value
func (o *CommunicationCollection) SetUlVol(v int64) {
o.UlVol = v
}
// GetDlVol returns the DlVol field value
func (o *CommunicationCollection) GetDlVol() int64 {
if o == nil {
var ret int64
return ret
}
return o.DlVol
}
// GetDlVolOk returns a tuple with the DlVol field value
// and a boolean to check if the value has been set.
func (o *CommunicationCollection) GetDlVolOk() (*int64, bool) {
if o == nil {
return nil, false
}
return &o.DlVol, true
}
// SetDlVol sets field value
func (o *CommunicationCollection) SetDlVol(v int64) {
o.DlVol = v
}
func (o CommunicationCollection) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o CommunicationCollection) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["startTime"] = o.StartTime
toSerialize["endTime"] = o.EndTime
toSerialize["ulVol"] = o.UlVol
toSerialize["dlVol"] = o.DlVol
return toSerialize, nil
}
func (o *CommunicationCollection) 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{
"startTime",
"endTime",
"ulVol",
"dlVol",
}
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)
}
}
varCommunicationCollection := _CommunicationCollection{}
err = json.Unmarshal(bytes, &varCommunicationCollection)
if err != nil {
return err
}
*o = CommunicationCollection(varCommunicationCollection)
return err
}
type NullableCommunicationCollection struct {
value *CommunicationCollection
isSet bool
}
func (v NullableCommunicationCollection) Get() *CommunicationCollection {
return v.value
}
func (v *NullableCommunicationCollection) Set(val *CommunicationCollection) {
v.value = val
v.isSet = true
}
func (v NullableCommunicationCollection) IsSet() bool {
return v.isSet
}
func (v *NullableCommunicationCollection) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableCommunicationCollection(val *CommunicationCollection) *NullableCommunicationCollection {
return &NullableCommunicationCollection{value: val, isSet: true}
}
func (v NullableCommunicationCollection) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableCommunicationCollection) 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

搜索帮助