代码拉取完成,页面将自动刷新
/*
M5_DynamicPolicies
5GMS AF M5 Dynamic Policy API © 2023, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
API version: 2.0.2
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package OpenAPI_M5_DynamicPolicies
import (
"encoding/json"
"fmt"
)
// checks if the DynamicPolicy type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &DynamicPolicy{}
// DynamicPolicy A representation of a Dynamic Policy resource.
type DynamicPolicy struct {
// String chosen by the 5GMS AF to serve as an identifier in a resource URI.
DynamicPolicyId string `json:"dynamicPolicyId"`
// String chosen by the 5GMS AF to serve as an identifier in a resource URI.
PolicyTemplateId string `json:"policyTemplateId"`
ServiceDataFlowDescriptions []ServiceDataFlowDescription `json:"serviceDataFlowDescriptions"`
MediaType *MediaType `json:"mediaType,omitempty"`
// String chosen by the 5GMS AF to serve as an identifier in a resource URI.
ProvisioningSessionId string `json:"provisioningSessionId"`
QosSpecification *M5QoSSpecification `json:"qosSpecification,omitempty"`
EnforcementMethod *string `json:"enforcementMethod,omitempty"`
EnforcementBitRate *int32 `json:"enforcementBitRate,omitempty"`
}
type _DynamicPolicy DynamicPolicy
// NewDynamicPolicy instantiates a new DynamicPolicy 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 NewDynamicPolicy(dynamicPolicyId string, policyTemplateId string, serviceDataFlowDescriptions []ServiceDataFlowDescription, provisioningSessionId string) *DynamicPolicy {
this := DynamicPolicy{}
this.DynamicPolicyId = dynamicPolicyId
this.PolicyTemplateId = policyTemplateId
this.ServiceDataFlowDescriptions = serviceDataFlowDescriptions
this.ProvisioningSessionId = provisioningSessionId
return &this
}
// NewDynamicPolicyWithDefaults instantiates a new DynamicPolicy 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 NewDynamicPolicyWithDefaults() *DynamicPolicy {
this := DynamicPolicy{}
return &this
}
// GetDynamicPolicyId returns the DynamicPolicyId field value
func (o *DynamicPolicy) GetDynamicPolicyId() string {
if o == nil {
var ret string
return ret
}
return o.DynamicPolicyId
}
// GetDynamicPolicyIdOk returns a tuple with the DynamicPolicyId field value
// and a boolean to check if the value has been set.
func (o *DynamicPolicy) GetDynamicPolicyIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.DynamicPolicyId, true
}
// SetDynamicPolicyId sets field value
func (o *DynamicPolicy) SetDynamicPolicyId(v string) {
o.DynamicPolicyId = v
}
// GetPolicyTemplateId returns the PolicyTemplateId field value
func (o *DynamicPolicy) GetPolicyTemplateId() string {
if o == nil {
var ret string
return ret
}
return o.PolicyTemplateId
}
// GetPolicyTemplateIdOk returns a tuple with the PolicyTemplateId field value
// and a boolean to check if the value has been set.
func (o *DynamicPolicy) GetPolicyTemplateIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.PolicyTemplateId, true
}
// SetPolicyTemplateId sets field value
func (o *DynamicPolicy) SetPolicyTemplateId(v string) {
o.PolicyTemplateId = v
}
// GetServiceDataFlowDescriptions returns the ServiceDataFlowDescriptions field value
func (o *DynamicPolicy) GetServiceDataFlowDescriptions() []ServiceDataFlowDescription {
if o == nil {
var ret []ServiceDataFlowDescription
return ret
}
return o.ServiceDataFlowDescriptions
}
// GetServiceDataFlowDescriptionsOk returns a tuple with the ServiceDataFlowDescriptions field value
// and a boolean to check if the value has been set.
func (o *DynamicPolicy) GetServiceDataFlowDescriptionsOk() ([]ServiceDataFlowDescription, bool) {
if o == nil {
return nil, false
}
return o.ServiceDataFlowDescriptions, true
}
// SetServiceDataFlowDescriptions sets field value
func (o *DynamicPolicy) SetServiceDataFlowDescriptions(v []ServiceDataFlowDescription) {
o.ServiceDataFlowDescriptions = v
}
// GetMediaType returns the MediaType field value if set, zero value otherwise.
func (o *DynamicPolicy) GetMediaType() MediaType {
if o == nil || IsNil(o.MediaType) {
var ret MediaType
return ret
}
return *o.MediaType
}
// GetMediaTypeOk returns a tuple with the MediaType field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DynamicPolicy) GetMediaTypeOk() (*MediaType, bool) {
if o == nil || IsNil(o.MediaType) {
return nil, false
}
return o.MediaType, true
}
// HasMediaType returns a boolean if a field has been set.
func (o *DynamicPolicy) HasMediaType() bool {
if o != nil && !IsNil(o.MediaType) {
return true
}
return false
}
// SetMediaType gets a reference to the given MediaType and assigns it to the MediaType field.
func (o *DynamicPolicy) SetMediaType(v MediaType) {
o.MediaType = &v
}
// GetProvisioningSessionId returns the ProvisioningSessionId field value
func (o *DynamicPolicy) GetProvisioningSessionId() string {
if o == nil {
var ret string
return ret
}
return o.ProvisioningSessionId
}
// GetProvisioningSessionIdOk returns a tuple with the ProvisioningSessionId field value
// and a boolean to check if the value has been set.
func (o *DynamicPolicy) GetProvisioningSessionIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.ProvisioningSessionId, true
}
// SetProvisioningSessionId sets field value
func (o *DynamicPolicy) SetProvisioningSessionId(v string) {
o.ProvisioningSessionId = v
}
// GetQosSpecification returns the QosSpecification field value if set, zero value otherwise.
func (o *DynamicPolicy) GetQosSpecification() M5QoSSpecification {
if o == nil || IsNil(o.QosSpecification) {
var ret M5QoSSpecification
return ret
}
return *o.QosSpecification
}
// GetQosSpecificationOk returns a tuple with the QosSpecification field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DynamicPolicy) GetQosSpecificationOk() (*M5QoSSpecification, bool) {
if o == nil || IsNil(o.QosSpecification) {
return nil, false
}
return o.QosSpecification, true
}
// HasQosSpecification returns a boolean if a field has been set.
func (o *DynamicPolicy) HasQosSpecification() bool {
if o != nil && !IsNil(o.QosSpecification) {
return true
}
return false
}
// SetQosSpecification gets a reference to the given M5QoSSpecification and assigns it to the QosSpecification field.
func (o *DynamicPolicy) SetQosSpecification(v M5QoSSpecification) {
o.QosSpecification = &v
}
// GetEnforcementMethod returns the EnforcementMethod field value if set, zero value otherwise.
func (o *DynamicPolicy) GetEnforcementMethod() string {
if o == nil || IsNil(o.EnforcementMethod) {
var ret string
return ret
}
return *o.EnforcementMethod
}
// GetEnforcementMethodOk returns a tuple with the EnforcementMethod field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DynamicPolicy) GetEnforcementMethodOk() (*string, bool) {
if o == nil || IsNil(o.EnforcementMethod) {
return nil, false
}
return o.EnforcementMethod, true
}
// HasEnforcementMethod returns a boolean if a field has been set.
func (o *DynamicPolicy) HasEnforcementMethod() bool {
if o != nil && !IsNil(o.EnforcementMethod) {
return true
}
return false
}
// SetEnforcementMethod gets a reference to the given string and assigns it to the EnforcementMethod field.
func (o *DynamicPolicy) SetEnforcementMethod(v string) {
o.EnforcementMethod = &v
}
// GetEnforcementBitRate returns the EnforcementBitRate field value if set, zero value otherwise.
func (o *DynamicPolicy) GetEnforcementBitRate() int32 {
if o == nil || IsNil(o.EnforcementBitRate) {
var ret int32
return ret
}
return *o.EnforcementBitRate
}
// GetEnforcementBitRateOk returns a tuple with the EnforcementBitRate field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *DynamicPolicy) GetEnforcementBitRateOk() (*int32, bool) {
if o == nil || IsNil(o.EnforcementBitRate) {
return nil, false
}
return o.EnforcementBitRate, true
}
// HasEnforcementBitRate returns a boolean if a field has been set.
func (o *DynamicPolicy) HasEnforcementBitRate() bool {
if o != nil && !IsNil(o.EnforcementBitRate) {
return true
}
return false
}
// SetEnforcementBitRate gets a reference to the given int32 and assigns it to the EnforcementBitRate field.
func (o *DynamicPolicy) SetEnforcementBitRate(v int32) {
o.EnforcementBitRate = &v
}
func (o DynamicPolicy) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o DynamicPolicy) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["dynamicPolicyId"] = o.DynamicPolicyId
toSerialize["policyTemplateId"] = o.PolicyTemplateId
toSerialize["serviceDataFlowDescriptions"] = o.ServiceDataFlowDescriptions
if !IsNil(o.MediaType) {
toSerialize["mediaType"] = o.MediaType
}
toSerialize["provisioningSessionId"] = o.ProvisioningSessionId
if !IsNil(o.QosSpecification) {
toSerialize["qosSpecification"] = o.QosSpecification
}
if !IsNil(o.EnforcementMethod) {
toSerialize["enforcementMethod"] = o.EnforcementMethod
}
if !IsNil(o.EnforcementBitRate) {
toSerialize["enforcementBitRate"] = o.EnforcementBitRate
}
return toSerialize, nil
}
func (o *DynamicPolicy) 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{
"dynamicPolicyId",
"policyTemplateId",
"serviceDataFlowDescriptions",
"provisioningSessionId",
}
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)
}
}
varDynamicPolicy := _DynamicPolicy{}
err = json.Unmarshal(bytes, &varDynamicPolicy)
if err != nil {
return err
}
*o = DynamicPolicy(varDynamicPolicy)
return err
}
type NullableDynamicPolicy struct {
value *DynamicPolicy
isSet bool
}
func (v NullableDynamicPolicy) Get() *DynamicPolicy {
return v.value
}
func (v *NullableDynamicPolicy) Set(val *DynamicPolicy) {
v.value = val
v.isSet = true
}
func (v NullableDynamicPolicy) IsSet() bool {
return v.isSet
}
func (v *NullableDynamicPolicy) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableDynamicPolicy(val *DynamicPolicy) *NullableDynamicPolicy {
return &NullableDynamicPolicy{value: val, isSet: true}
}
func (v NullableDynamicPolicy) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableDynamicPolicy) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。