Ai
1 Star 0 Fork 0

MrCoder/openapi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
model_metrics_reporting_configuration.go 12.61 KB
一键复制 编辑 原始数据 按行查看 历史
MrCoder 提交于 2023-12-22 15:27 +08:00 . update
/*
M1_MetricsReportingProvisioning
5GMS AF M1 Metrics Reporting Provisioning API © 2023, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
API version: 2.1.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package OpenAPI_M1_MetricsReportingProvisioning
import (
"encoding/json"
"fmt"
)
// checks if the MetricsReportingConfiguration type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &MetricsReportingConfiguration{}
// MetricsReportingConfiguration A representation of a Metrics Reporting Configuration resource.
type MetricsReportingConfiguration struct {
// String chosen by the 5GMS AF to serve as an identifier in a resource URI.
MetricsReportingConfigurationId string `json:"metricsReportingConfigurationId"`
// String providing an URI formatted according to RFC 3986.
Scheme *string `json:"scheme,omitempty"`
// String representing a Data Network as defined in clause 9A of 3GPP TS 23.003; it shall contain either a DNN Network Identifier, or a full DNN with both the Network Identifier and Operator Identifier, as specified in 3GPP TS 23.003 clause 9.1.1 and 9.1.2. It shall be coded as string in which the labels are separated by dots (e.g. \"Label1.Label2.Label3\").
DataNetworkName *string `json:"dataNetworkName,omitempty"`
// indicating a time in seconds.
ReportingInterval *int32 `json:"reportingInterval,omitempty"`
SamplePercentage *float32 `json:"samplePercentage,omitempty"`
UrlFilters []string `json:"urlFilters,omitempty"`
// indicating a time in seconds.
SamplingPeriod int32 `json:"samplingPeriod"`
Metrics []string `json:"metrics,omitempty"`
}
type _MetricsReportingConfiguration MetricsReportingConfiguration
// NewMetricsReportingConfiguration instantiates a new MetricsReportingConfiguration 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 NewMetricsReportingConfiguration(metricsReportingConfigurationId string, samplingPeriod int32) *MetricsReportingConfiguration {
this := MetricsReportingConfiguration{}
this.MetricsReportingConfigurationId = metricsReportingConfigurationId
this.SamplingPeriod = samplingPeriod
return &this
}
// NewMetricsReportingConfigurationWithDefaults instantiates a new MetricsReportingConfiguration 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 NewMetricsReportingConfigurationWithDefaults() *MetricsReportingConfiguration {
this := MetricsReportingConfiguration{}
return &this
}
// GetMetricsReportingConfigurationId returns the MetricsReportingConfigurationId field value
func (o *MetricsReportingConfiguration) GetMetricsReportingConfigurationId() string {
if o == nil {
var ret string
return ret
}
return o.MetricsReportingConfigurationId
}
// GetMetricsReportingConfigurationIdOk returns a tuple with the MetricsReportingConfigurationId field value
// and a boolean to check if the value has been set.
func (o *MetricsReportingConfiguration) GetMetricsReportingConfigurationIdOk() (*string, bool) {
if o == nil {
return nil, false
}
return &o.MetricsReportingConfigurationId, true
}
// SetMetricsReportingConfigurationId sets field value
func (o *MetricsReportingConfiguration) SetMetricsReportingConfigurationId(v string) {
o.MetricsReportingConfigurationId = v
}
// GetScheme returns the Scheme field value if set, zero value otherwise.
func (o *MetricsReportingConfiguration) GetScheme() string {
if o == nil || IsNil(o.Scheme) {
var ret string
return ret
}
return *o.Scheme
}
// GetSchemeOk returns a tuple with the Scheme field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricsReportingConfiguration) GetSchemeOk() (*string, bool) {
if o == nil || IsNil(o.Scheme) {
return nil, false
}
return o.Scheme, true
}
// HasScheme returns a boolean if a field has been set.
func (o *MetricsReportingConfiguration) HasScheme() bool {
if o != nil && !IsNil(o.Scheme) {
return true
}
return false
}
// SetScheme gets a reference to the given string and assigns it to the Scheme field.
func (o *MetricsReportingConfiguration) SetScheme(v string) {
o.Scheme = &v
}
// GetDataNetworkName returns the DataNetworkName field value if set, zero value otherwise.
func (o *MetricsReportingConfiguration) GetDataNetworkName() string {
if o == nil || IsNil(o.DataNetworkName) {
var ret string
return ret
}
return *o.DataNetworkName
}
// GetDataNetworkNameOk returns a tuple with the DataNetworkName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricsReportingConfiguration) GetDataNetworkNameOk() (*string, bool) {
if o == nil || IsNil(o.DataNetworkName) {
return nil, false
}
return o.DataNetworkName, true
}
// HasDataNetworkName returns a boolean if a field has been set.
func (o *MetricsReportingConfiguration) HasDataNetworkName() bool {
if o != nil && !IsNil(o.DataNetworkName) {
return true
}
return false
}
// SetDataNetworkName gets a reference to the given string and assigns it to the DataNetworkName field.
func (o *MetricsReportingConfiguration) SetDataNetworkName(v string) {
o.DataNetworkName = &v
}
// GetReportingInterval returns the ReportingInterval field value if set, zero value otherwise.
func (o *MetricsReportingConfiguration) GetReportingInterval() int32 {
if o == nil || IsNil(o.ReportingInterval) {
var ret int32
return ret
}
return *o.ReportingInterval
}
// GetReportingIntervalOk returns a tuple with the ReportingInterval field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricsReportingConfiguration) GetReportingIntervalOk() (*int32, bool) {
if o == nil || IsNil(o.ReportingInterval) {
return nil, false
}
return o.ReportingInterval, true
}
// HasReportingInterval returns a boolean if a field has been set.
func (o *MetricsReportingConfiguration) HasReportingInterval() bool {
if o != nil && !IsNil(o.ReportingInterval) {
return true
}
return false
}
// SetReportingInterval gets a reference to the given int32 and assigns it to the ReportingInterval field.
func (o *MetricsReportingConfiguration) SetReportingInterval(v int32) {
o.ReportingInterval = &v
}
// GetSamplePercentage returns the SamplePercentage field value if set, zero value otherwise.
func (o *MetricsReportingConfiguration) GetSamplePercentage() float32 {
if o == nil || IsNil(o.SamplePercentage) {
var ret float32
return ret
}
return *o.SamplePercentage
}
// GetSamplePercentageOk returns a tuple with the SamplePercentage field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricsReportingConfiguration) GetSamplePercentageOk() (*float32, bool) {
if o == nil || IsNil(o.SamplePercentage) {
return nil, false
}
return o.SamplePercentage, true
}
// HasSamplePercentage returns a boolean if a field has been set.
func (o *MetricsReportingConfiguration) HasSamplePercentage() bool {
if o != nil && !IsNil(o.SamplePercentage) {
return true
}
return false
}
// SetSamplePercentage gets a reference to the given float32 and assigns it to the SamplePercentage field.
func (o *MetricsReportingConfiguration) SetSamplePercentage(v float32) {
o.SamplePercentage = &v
}
// GetUrlFilters returns the UrlFilters field value if set, zero value otherwise.
func (o *MetricsReportingConfiguration) GetUrlFilters() []string {
if o == nil || IsNil(o.UrlFilters) {
var ret []string
return ret
}
return o.UrlFilters
}
// GetUrlFiltersOk returns a tuple with the UrlFilters field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricsReportingConfiguration) GetUrlFiltersOk() ([]string, bool) {
if o == nil || IsNil(o.UrlFilters) {
return nil, false
}
return o.UrlFilters, true
}
// HasUrlFilters returns a boolean if a field has been set.
func (o *MetricsReportingConfiguration) HasUrlFilters() bool {
if o != nil && !IsNil(o.UrlFilters) {
return true
}
return false
}
// SetUrlFilters gets a reference to the given []string and assigns it to the UrlFilters field.
func (o *MetricsReportingConfiguration) SetUrlFilters(v []string) {
o.UrlFilters = v
}
// GetSamplingPeriod returns the SamplingPeriod field value
func (o *MetricsReportingConfiguration) GetSamplingPeriod() int32 {
if o == nil {
var ret int32
return ret
}
return o.SamplingPeriod
}
// GetSamplingPeriodOk returns a tuple with the SamplingPeriod field value
// and a boolean to check if the value has been set.
func (o *MetricsReportingConfiguration) GetSamplingPeriodOk() (*int32, bool) {
if o == nil {
return nil, false
}
return &o.SamplingPeriod, true
}
// SetSamplingPeriod sets field value
func (o *MetricsReportingConfiguration) SetSamplingPeriod(v int32) {
o.SamplingPeriod = v
}
// GetMetrics returns the Metrics field value if set, zero value otherwise.
func (o *MetricsReportingConfiguration) GetMetrics() []string {
if o == nil || IsNil(o.Metrics) {
var ret []string
return ret
}
return o.Metrics
}
// GetMetricsOk returns a tuple with the Metrics field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *MetricsReportingConfiguration) GetMetricsOk() ([]string, bool) {
if o == nil || IsNil(o.Metrics) {
return nil, false
}
return o.Metrics, true
}
// HasMetrics returns a boolean if a field has been set.
func (o *MetricsReportingConfiguration) HasMetrics() bool {
if o != nil && !IsNil(o.Metrics) {
return true
}
return false
}
// SetMetrics gets a reference to the given []string and assigns it to the Metrics field.
func (o *MetricsReportingConfiguration) SetMetrics(v []string) {
o.Metrics = v
}
func (o MetricsReportingConfiguration) MarshalJSON() ([]byte, error) {
toSerialize, err := o.ToMap()
if err != nil {
return []byte{}, err
}
return json.Marshal(toSerialize)
}
func (o MetricsReportingConfiguration) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
toSerialize["metricsReportingConfigurationId"] = o.MetricsReportingConfigurationId
if !IsNil(o.Scheme) {
toSerialize["scheme"] = o.Scheme
}
if !IsNil(o.DataNetworkName) {
toSerialize["dataNetworkName"] = o.DataNetworkName
}
if !IsNil(o.ReportingInterval) {
toSerialize["reportingInterval"] = o.ReportingInterval
}
if !IsNil(o.SamplePercentage) {
toSerialize["samplePercentage"] = o.SamplePercentage
}
if !IsNil(o.UrlFilters) {
toSerialize["urlFilters"] = o.UrlFilters
}
toSerialize["samplingPeriod"] = o.SamplingPeriod
if !IsNil(o.Metrics) {
toSerialize["metrics"] = o.Metrics
}
return toSerialize, nil
}
func (o *MetricsReportingConfiguration) 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{
"metricsReportingConfigurationId",
"samplingPeriod",
}
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)
}
}
varMetricsReportingConfiguration := _MetricsReportingConfiguration{}
err = json.Unmarshal(bytes, &varMetricsReportingConfiguration)
if err != nil {
return err
}
*o = MetricsReportingConfiguration(varMetricsReportingConfiguration)
return err
}
type NullableMetricsReportingConfiguration struct {
value *MetricsReportingConfiguration
isSet bool
}
func (v NullableMetricsReportingConfiguration) Get() *MetricsReportingConfiguration {
return v.value
}
func (v *NullableMetricsReportingConfiguration) Set(val *MetricsReportingConfiguration) {
v.value = val
v.isSet = true
}
func (v NullableMetricsReportingConfiguration) IsSet() bool {
return v.isSet
}
func (v *NullableMetricsReportingConfiguration) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableMetricsReportingConfiguration(val *MetricsReportingConfiguration) *NullableMetricsReportingConfiguration {
return &NullableMetricsReportingConfiguration{value: val, isSet: true}
}
func (v NullableMetricsReportingConfiguration) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableMetricsReportingConfiguration) 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

搜索帮助