Ai
1 Star 0 Fork 0

MrCoder/openapi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
model_authorization_data.go 9.05 KB
一键复制 编辑 原始数据 按行查看 历史
MrCoder 提交于 2023-12-22 15:27 +08:00 . update
/*
Nudr_DataRepository API OpenAPI file
Unified Data Repository Service. © 2023, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
API version: 2.2.4
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package OpenAPI_Nudr_DR
import (
"encoding/json"
"fmt"
"time"
)
// checks if the AuthorizationData type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &AuthorizationData{}
// AuthorizationData NIDD Authorization Information
type AuthorizationData struct {
AuthorizationData []UserIdentifier `json:"authorizationData"`
AllowedDnnList []AccessAndMobilitySubscriptionDataSubscribedDnnListInner `json:"allowedDnnList,omitempty"`
AllowedSnssaiList []Snssai `json:"allowedSnssaiList,omitempty"`
AllowedMtcProviders []MtcProvider `json:"allowedMtcProviders,omitempty"`
// string with format 'date-time' as defined in OpenAPI.
ValidityTime *time.Time `json:"validityTime,omitempty"`
}
type _AuthorizationData AuthorizationData
// NewAuthorizationData instantiates a new AuthorizationData 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 NewAuthorizationData(authorizationData []UserIdentifier) *AuthorizationData {
this := AuthorizationData{}
this.AuthorizationData = authorizationData
return &this
}
// NewAuthorizationDataWithDefaults instantiates a new AuthorizationData 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 NewAuthorizationDataWithDefaults() *AuthorizationData {
this := AuthorizationData{}
return &this
}
// GetAuthorizationData returns the AuthorizationData field value
func (o *AuthorizationData) GetAuthorizationData() []UserIdentifier {
if o == nil {
var ret []UserIdentifier
return ret
}
return o.AuthorizationData
}
// GetAuthorizationDataOk returns a tuple with the AuthorizationData field value
// and a boolean to check if the value has been set.
func (o *AuthorizationData) GetAuthorizationDataOk() ([]UserIdentifier, bool) {
if o == nil {
return nil, false
}
return o.AuthorizationData, true
}
// SetAuthorizationData sets field value
func (o *AuthorizationData) SetAuthorizationData(v []UserIdentifier) {
o.AuthorizationData = v
}
// GetAllowedDnnList returns the AllowedDnnList field value if set, zero value otherwise.
func (o *AuthorizationData) GetAllowedDnnList() []AccessAndMobilitySubscriptionDataSubscribedDnnListInner {
if o == nil || IsNil(o.AllowedDnnList) {
var ret []AccessAndMobilitySubscriptionDataSubscribedDnnListInner
return ret
}
return o.AllowedDnnList
}
// GetAllowedDnnListOk returns a tuple with the AllowedDnnList field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthorizationData) GetAllowedDnnListOk() ([]AccessAndMobilitySubscriptionDataSubscribedDnnListInner, bool) {
if o == nil || IsNil(o.AllowedDnnList) {
return nil, false
}
return o.AllowedDnnList, true
}
// HasAllowedDnnList returns a boolean if a field has been set.
func (o *AuthorizationData) HasAllowedDnnList() bool {
if o != nil && !IsNil(o.AllowedDnnList) {
return true
}
return false
}
// SetAllowedDnnList gets a reference to the given []AccessAndMobilitySubscriptionDataSubscribedDnnListInner and assigns it to the AllowedDnnList field.
func (o *AuthorizationData) SetAllowedDnnList(v []AccessAndMobilitySubscriptionDataSubscribedDnnListInner) {
o.AllowedDnnList = v
}
// GetAllowedSnssaiList returns the AllowedSnssaiList field value if set, zero value otherwise.
func (o *AuthorizationData) GetAllowedSnssaiList() []Snssai {
if o == nil || IsNil(o.AllowedSnssaiList) {
var ret []Snssai
return ret
}
return o.AllowedSnssaiList
}
// GetAllowedSnssaiListOk returns a tuple with the AllowedSnssaiList field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthorizationData) GetAllowedSnssaiListOk() ([]Snssai, bool) {
if o == nil || IsNil(o.AllowedSnssaiList) {
return nil, false
}
return o.AllowedSnssaiList, true
}
// HasAllowedSnssaiList returns a boolean if a field has been set.
func (o *AuthorizationData) HasAllowedSnssaiList() bool {
if o != nil && !IsNil(o.AllowedSnssaiList) {
return true
}
return false
}
// SetAllowedSnssaiList gets a reference to the given []Snssai and assigns it to the AllowedSnssaiList field.
func (o *AuthorizationData) SetAllowedSnssaiList(v []Snssai) {
o.AllowedSnssaiList = v
}
// GetAllowedMtcProviders returns the AllowedMtcProviders field value if set, zero value otherwise.
func (o *AuthorizationData) GetAllowedMtcProviders() []MtcProvider {
if o == nil || IsNil(o.AllowedMtcProviders) {
var ret []MtcProvider
return ret
}
return o.AllowedMtcProviders
}
// GetAllowedMtcProvidersOk returns a tuple with the AllowedMtcProviders field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthorizationData) GetAllowedMtcProvidersOk() ([]MtcProvider, bool) {
if o == nil || IsNil(o.AllowedMtcProviders) {
return nil, false
}
return o.AllowedMtcProviders, true
}
// HasAllowedMtcProviders returns a boolean if a field has been set.
func (o *AuthorizationData) HasAllowedMtcProviders() bool {
if o != nil && !IsNil(o.AllowedMtcProviders) {
return true
}
return false
}
// SetAllowedMtcProviders gets a reference to the given []MtcProvider and assigns it to the AllowedMtcProviders field.
func (o *AuthorizationData) SetAllowedMtcProviders(v []MtcProvider) {
o.AllowedMtcProviders = v
}
// GetValidityTime returns the ValidityTime field value if set, zero value otherwise.
func (o *AuthorizationData) GetValidityTime() time.Time {
if o == nil || IsNil(o.ValidityTime) {
var ret time.Time
return ret
}
return *o.ValidityTime
}
// GetValidityTimeOk returns a tuple with the ValidityTime field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *AuthorizationData) GetValidityTimeOk() (*time.Time, bool) {
if o == nil || IsNil(o.ValidityTime) {
return nil, false
}
return o.ValidityTime, true
}
// HasValidityTime returns a boolean if a field has been set.
func (o *AuthorizationData) HasValidityTime() bool {
if o != nil && !IsNil(o.ValidityTime) {
return true
}
return false
}
// SetValidityTime gets a reference to the given time.Time and assigns it to the ValidityTime field.
func (o *AuthorizationData) SetValidityTime(v time.Time) {
o.ValidityTime = &v
}
func (o AuthorizationData) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o AuthorizationData) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["authorizationData"] = o.AuthorizationData
if !IsNil(o.AllowedDnnList) {
toSerialize["allowedDnnList"] = o.AllowedDnnList
}
if !IsNil(o.AllowedSnssaiList) {
toSerialize["allowedSnssaiList"] = o.AllowedSnssaiList
}
if !IsNil(o.AllowedMtcProviders) {
toSerialize["allowedMtcProviders"] = o.AllowedMtcProviders
}
if !IsNil(o.ValidityTime) {
toSerialize["validityTime"] = o.ValidityTime
}
return toSerialize, nil
}
func (o *AuthorizationData) 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{
"authorizationData",
}
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)
}
}
varAuthorizationData := _AuthorizationData{}
err = json.Unmarshal(bytes, &varAuthorizationData)
if err != nil {
return err
}
*o = AuthorizationData(varAuthorizationData)
return err
}
type NullableAuthorizationData struct {
value *AuthorizationData
isSet bool
}
func (v NullableAuthorizationData) Get() *AuthorizationData {
return v.value
}
func (v *NullableAuthorizationData) Set(val *AuthorizationData) {
v.value = val
v.isSet = true
}
func (v NullableAuthorizationData) IsSet() bool {
return v.isSet
}
func (v *NullableAuthorizationData) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAuthorizationData(val *AuthorizationData) *NullableAuthorizationData {
return &NullableAuthorizationData{value: val, isSet: true}
}
func (v NullableAuthorizationData) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAuthorizationData) 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

搜索帮助