1 Star 0 Fork 0

MrCoder/openapi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
model_policy_update.go 9.20 KB
一键复制 编辑 原始数据 按行查看 历史
MrCoder 提交于 2023-12-22 15:27 +08:00 . update
/*
Npcf_UEPolicyControl
UE Policy Control Service. © 2022, 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_Npcf_UEPolicyControl
import (
"encoding/json"
"fmt"
)
// checks if the PolicyUpdate type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &PolicyUpdate{}
// PolicyUpdate Represents updated policies that the PCF provides in a notification or in the reply to an Update Request.
type PolicyUpdate struct {
// String providing an URI formatted according to RFC 3986.
ResourceUri string `json:"resourceUri"`
// string with format 'bytes' as defined in OpenAPI
UePolicy *string `json:"uePolicy,omitempty"`
N2Pc5Pol *N2InfoContent `json:"n2Pc5Pol,omitempty"`
N2Pc5ProSePol *N2InfoContent `json:"n2Pc5ProSePol,omitempty"`
// Request Triggers that the PCF subscribes. Only values \"LOC_CH\" and \"PRA_CH\" are permitted.
Triggers []RequestTrigger `json:"triggers,omitempty"`
// Contains the presence reporting area(s) for which reporting was requested. The praId attribute within the PresenceInfo data type is the key of the map.
Pras map[string]PresenceInfo `json:"pras,omitempty"`
}
type _PolicyUpdate PolicyUpdate
// NewPolicyUpdate instantiates a new PolicyUpdate 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 NewPolicyUpdate(resourceUri string) *PolicyUpdate {
this := PolicyUpdate{}
this.ResourceUri = resourceUri
return &this
}
// NewPolicyUpdateWithDefaults instantiates a new PolicyUpdate 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 NewPolicyUpdateWithDefaults() *PolicyUpdate {
this := PolicyUpdate{}
return &this
}
// GetResourceUri returns the ResourceUri field value
func (o *PolicyUpdate) GetResourceUri() string {
if o == nil {
var ret string
return ret
}
return o.ResourceUri
}
// GetResourceUriOk returns a tuple with the ResourceUri field value
// and a boolean to check if the value has been set.
func (o *PolicyUpdate) GetResourceUriOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ResourceUri, true
}
// SetResourceUri sets field value
func (o *PolicyUpdate) SetResourceUri(v string) {
o.ResourceUri = v
}
// GetUePolicy returns the UePolicy field value if set, zero value otherwise.
func (o *PolicyUpdate) GetUePolicy() string {
if o == nil || IsNil(o.UePolicy) {
var ret string
return ret
}
return *o.UePolicy
}
// GetUePolicyOk returns a tuple with the UePolicy field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PolicyUpdate) GetUePolicyOk() (*string, bool) {
if o == nil || IsNil(o.UePolicy) {
return nil, false
}
return o.UePolicy, true
}
// HasUePolicy returns a boolean if a field has been set.
func (o *PolicyUpdate) HasUePolicy() bool {
if o != nil && !IsNil(o.UePolicy) {
return true
}
return false
}
// SetUePolicy gets a reference to the given string and assigns it to the UePolicy field.
func (o *PolicyUpdate) SetUePolicy(v string) {
o.UePolicy = &v
}
// GetN2Pc5Pol returns the N2Pc5Pol field value if set, zero value otherwise.
func (o *PolicyUpdate) GetN2Pc5Pol() N2InfoContent {
if o == nil || IsNil(o.N2Pc5Pol) {
var ret N2InfoContent
return ret
}
return *o.N2Pc5Pol
}
// GetN2Pc5PolOk returns a tuple with the N2Pc5Pol field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PolicyUpdate) GetN2Pc5PolOk() (*N2InfoContent, bool) {
if o == nil || IsNil(o.N2Pc5Pol) {
return nil, false
}
return o.N2Pc5Pol, true
}
// HasN2Pc5Pol returns a boolean if a field has been set.
func (o *PolicyUpdate) HasN2Pc5Pol() bool {
if o != nil && !IsNil(o.N2Pc5Pol) {
return true
}
return false
}
// SetN2Pc5Pol gets a reference to the given N2InfoContent and assigns it to the N2Pc5Pol field.
func (o *PolicyUpdate) SetN2Pc5Pol(v N2InfoContent) {
o.N2Pc5Pol = &v
}
// GetN2Pc5ProSePol returns the N2Pc5ProSePol field value if set, zero value otherwise.
func (o *PolicyUpdate) GetN2Pc5ProSePol() N2InfoContent {
if o == nil || IsNil(o.N2Pc5ProSePol) {
var ret N2InfoContent
return ret
}
return *o.N2Pc5ProSePol
}
// GetN2Pc5ProSePolOk returns a tuple with the N2Pc5ProSePol field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *PolicyUpdate) GetN2Pc5ProSePolOk() (*N2InfoContent, bool) {
if o == nil || IsNil(o.N2Pc5ProSePol) {
return nil, false
}
return o.N2Pc5ProSePol, true
}
// HasN2Pc5ProSePol returns a boolean if a field has been set.
func (o *PolicyUpdate) HasN2Pc5ProSePol() bool {
if o != nil && !IsNil(o.N2Pc5ProSePol) {
return true
}
return false
}
// SetN2Pc5ProSePol gets a reference to the given N2InfoContent and assigns it to the N2Pc5ProSePol field.
func (o *PolicyUpdate) SetN2Pc5ProSePol(v N2InfoContent) {
o.N2Pc5ProSePol = &v
}
// GetTriggers returns the Triggers field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PolicyUpdate) GetTriggers() []RequestTrigger {
if o == nil {
var ret []RequestTrigger
return ret
}
return o.Triggers
}
// GetTriggersOk returns a tuple with the Triggers 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 *PolicyUpdate) GetTriggersOk() ([]RequestTrigger, bool) {
if o == nil || IsNil(o.Triggers) {
return nil, false
}
return o.Triggers, true
}
// HasTriggers returns a boolean if a field has been set.
func (o *PolicyUpdate) HasTriggers() bool {
if o != nil && IsNil(o.Triggers) {
return true
}
return false
}
// SetTriggers gets a reference to the given []RequestTrigger and assigns it to the Triggers field.
func (o *PolicyUpdate) SetTriggers(v []RequestTrigger) {
o.Triggers = v
}
// GetPras returns the Pras field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PolicyUpdate) GetPras() map[string]PresenceInfo {
if o == nil {
var ret map[string]PresenceInfo
return ret
}
return o.Pras
}
// GetPrasOk returns a tuple with the Pras 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 *PolicyUpdate) GetPrasOk() (*map[string]PresenceInfo, bool) {
if o == nil || IsNil(o.Pras) {
return nil, false
}
return &o.Pras, true
}
// HasPras returns a boolean if a field has been set.
func (o *PolicyUpdate) HasPras() bool {
if o != nil && IsNil(o.Pras) {
return true
}
return false
}
// SetPras gets a reference to the given map[string]PresenceInfo and assigns it to the Pras field.
func (o *PolicyUpdate) SetPras(v map[string]PresenceInfo) {
o.Pras = v
}
func (o PolicyUpdate) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o PolicyUpdate) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["resourceUri"] = o.ResourceUri
if !IsNil(o.UePolicy) {
toSerialize["uePolicy"] = o.UePolicy
}
if !IsNil(o.N2Pc5Pol) {
toSerialize["n2Pc5Pol"] = o.N2Pc5Pol
}
if !IsNil(o.N2Pc5ProSePol) {
toSerialize["n2Pc5ProSePol"] = o.N2Pc5ProSePol
}
if o.Triggers != nil {
toSerialize["triggers"] = o.Triggers
}
if o.Pras != nil {
toSerialize["pras"] = o.Pras
}
return toSerialize, nil
}
func (o *PolicyUpdate) 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{
"resourceUri",
}
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)
}
}
varPolicyUpdate := _PolicyUpdate{}
err = json.Unmarshal(bytes, &varPolicyUpdate)
if err != nil {
return err
}
*o = PolicyUpdate(varPolicyUpdate)
return err
}
type NullablePolicyUpdate struct {
value *PolicyUpdate
isSet bool
}
func (v NullablePolicyUpdate) Get() *PolicyUpdate {
return v.value
}
func (v *NullablePolicyUpdate) Set(val *PolicyUpdate) {
v.value = val
v.isSet = true
}
func (v NullablePolicyUpdate) IsSet() bool {
return v.isSet
}
func (v *NullablePolicyUpdate) Unset() {
v.value = nil
v.isSet = false
}
func NewNullablePolicyUpdate(val *PolicyUpdate) *NullablePolicyUpdate {
return &NullablePolicyUpdate{value: val, isSet: true}
}
func (v NullablePolicyUpdate) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullablePolicyUpdate) 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

搜索帮助