Ai
1 Star 0 Fork 0

MrCoder/openapi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
model_pfd_data.go 7.85 KB
一键复制 编辑 原始数据 按行查看 历史
MrCoder 提交于 2023-12-22 15:27 +08:00 . update
/*
3gpp-pfd-management
API for PFD management. © 2023, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
API version: 1.2.1
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package OpenAPI_PfdManagement
import (
"encoding/json"
"fmt"
)
// checks if the PfdData type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PfdData{}
// PfdData Represents a PFD request to add, update or remove PFD(s) for one external application identifier.
type PfdData struct {
// Each element uniquely external application identifier
ExternalAppId string `json:"externalAppId"`
// string formatted according to IETF RFC 3986 identifying a referenced resource.
Self *string `json:"self,omitempty"`
// Contains the PFDs of the external application identifier. Each PFD is identified in the map via a key containing the PFD identifier.
Pfds map[string]Pfd `json:"pfds"`
// Unsigned integer identifying a period of time in units of seconds with \"nullable=true\" property.
AllowedDelay NullableInt32 `json:"allowedDelay,omitempty"`
// Unsigned integer identifying a period of time in units of seconds with \"readOnly=true\" property.
CachingTime *int32 `json:"cachingTime,omitempty"`
}
type _PfdData PfdData
// NewPfdData instantiates a new PfdData 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 NewPfdData(externalAppId string, pfds map[string]Pfd) *PfdData {
this := PfdData{}
this.ExternalAppId = externalAppId
this.Pfds = pfds
return &this
}
// NewPfdDataWithDefaults instantiates a new PfdData 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 NewPfdDataWithDefaults() *PfdData {
this := PfdData{}
return &this
}
// GetExternalAppId returns the ExternalAppId field value
func (o *PfdData) GetExternalAppId() string {
if o == nil {
var ret string
return ret
}
return o.ExternalAppId
}
// GetExternalAppIdOk returns a tuple with the ExternalAppId field value
// and a boolean to check if the value has been set.
func (o *PfdData) GetExternalAppIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ExternalAppId, true
}
// SetExternalAppId sets field value
func (o *PfdData) SetExternalAppId(v string) {
o.ExternalAppId = v
}
// GetSelf returns the Self field value if set, zero value otherwise.
func (o *PfdData) GetSelf() string {
if o == nil || IsNil(o.Self) {
var ret string
return ret
}
return *o.Self
}
// GetSelfOk returns a tuple with the Self field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PfdData) GetSelfOk() (*string, bool) {
if o == nil || IsNil(o.Self) {
return nil, false
}
return o.Self, true
}
// HasSelf returns a boolean if a field has been set.
func (o *PfdData) HasSelf() bool {
if o != nil && !IsNil(o.Self) {
return true
}
return false
}
// SetSelf gets a reference to the given string and assigns it to the Self field.
func (o *PfdData) SetSelf(v string) {
o.Self = &v
}
// GetPfds returns the Pfds field value
func (o *PfdData) GetPfds() map[string]Pfd {
if o == nil {
var ret map[string]Pfd
return ret
}
return o.Pfds
}
// GetPfdsOk returns a tuple with the Pfds field value
// and a boolean to check if the value has been set.
func (o *PfdData) GetPfdsOk() (*map[string]Pfd, bool) {
if o == nil {
return nil, false
}
return &o.Pfds, true
}
// SetPfds sets field value
func (o *PfdData) SetPfds(v map[string]Pfd) {
o.Pfds = v
}
// GetAllowedDelay returns the AllowedDelay field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PfdData) GetAllowedDelay() int32 {
if o == nil || IsNil(o.AllowedDelay.Get()) {
var ret int32
return ret
}
return *o.AllowedDelay.Get()
}
// GetAllowedDelayOk returns a tuple with the AllowedDelay 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 *PfdData) GetAllowedDelayOk() (*int32, bool) {
if o == nil {
return nil, false
}
return o.AllowedDelay.Get(), o.AllowedDelay.IsSet()
}
// HasAllowedDelay returns a boolean if a field has been set.
func (o *PfdData) HasAllowedDelay() bool {
if o != nil && o.AllowedDelay.IsSet() {
return true
}
return false
}
// SetAllowedDelay gets a reference to the given NullableInt32 and assigns it to the AllowedDelay field.
func (o *PfdData) SetAllowedDelay(v int32) {
o.AllowedDelay.Set(&v)
}
// SetAllowedDelayNil sets the value for AllowedDelay to be an explicit nil
func (o *PfdData) SetAllowedDelayNil() {
o.AllowedDelay.Set(nil)
}
// UnsetAllowedDelay ensures that no value is present for AllowedDelay, not even an explicit nil
func (o *PfdData) UnsetAllowedDelay() {
o.AllowedDelay.Unset()
}
// GetCachingTime returns the CachingTime field value if set, zero value otherwise.
func (o *PfdData) GetCachingTime() int32 {
if o == nil || IsNil(o.CachingTime) {
var ret int32
return ret
}
return *o.CachingTime
}
// GetCachingTimeOk returns a tuple with the CachingTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PfdData) GetCachingTimeOk() (*int32, bool) {
if o == nil || IsNil(o.CachingTime) {
return nil, false
}
return o.CachingTime, true
}
// HasCachingTime returns a boolean if a field has been set.
func (o *PfdData) HasCachingTime() bool {
if o != nil && !IsNil(o.CachingTime) {
return true
}
return false
}
// SetCachingTime gets a reference to the given int32 and assigns it to the CachingTime field.
func (o *PfdData) SetCachingTime(v int32) {
o.CachingTime = &v
}
func (o PfdData) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PfdData) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["externalAppId"] = o.ExternalAppId
if !IsNil(o.Self) {
toSerialize["self"] = o.Self
}
toSerialize["pfds"] = o.Pfds
if o.AllowedDelay.IsSet() {
toSerialize["allowedDelay"] = o.AllowedDelay.Get()
}
if !IsNil(o.CachingTime) {
toSerialize["cachingTime"] = o.CachingTime
}
return toSerialize, nil
}
func (o *PfdData) 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{
"externalAppId",
"pfds",
}
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)
}
}
varPfdData := _PfdData{}
err = json.Unmarshal(bytes, &varPfdData)
if err != nil {
return err
}
*o = PfdData(varPfdData)
return err
}
type NullablePfdData struct {
value *PfdData
isSet bool
}
func (v NullablePfdData) Get() *PfdData {
return v.value
}
func (v *NullablePfdData) Set(val *PfdData) {
v.value = val
v.isSet = true
}
func (v NullablePfdData) IsSet() bool {
return v.isSet
}
func (v *NullablePfdData) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePfdData(val *PfdData) *NullablePfdData {
return &NullablePfdData{value: val, isSet: true}
}
func (v NullablePfdData) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePfdData) 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

搜索帮助