代码拉取完成,页面将自动刷新
/*
3gpp-data-reporting
API for 3GPP Data Reporting. © 2022, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
API version: 1.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package OpenAPI_DataReporting
import (
"encoding/json"
"fmt"
)
// ReportingConditionThreshold struct for ReportingConditionThreshold
type ReportingConditionThreshold struct {
float32 *float32
float64 *float64
int32 *int32
int64 *int64
}
// Unmarshal JSON data into any of the pointers in the struct
func (dst *ReportingConditionThreshold) UnmarshalJSON(data []byte) error {
var err error
// try to unmarshal JSON data into float32
err = json.Unmarshal(data, &dst.float32)
if err == nil {
jsonfloat32, _ := json.Marshal(dst.float32)
if string(jsonfloat32) == "{}" { // empty struct
dst.float32 = nil
} else {
return nil // data stored in dst.float32, return on the first match
}
} else {
dst.float32 = nil
}
// try to unmarshal JSON data into float64
err = json.Unmarshal(data, &dst.float64)
if err == nil {
jsonfloat64, _ := json.Marshal(dst.float64)
if string(jsonfloat64) == "{}" { // empty struct
dst.float64 = nil
} else {
return nil // data stored in dst.float64, return on the first match
}
} else {
dst.float64 = nil
}
// try to unmarshal JSON data into int32
err = json.Unmarshal(data, &dst.int32)
if err == nil {
jsonint32, _ := json.Marshal(dst.int32)
if string(jsonint32) == "{}" { // empty struct
dst.int32 = nil
} else {
return nil // data stored in dst.int32, return on the first match
}
} else {
dst.int32 = nil
}
// try to unmarshal JSON data into int64
err = json.Unmarshal(data, &dst.int64)
if err == nil {
jsonint64, _ := json.Marshal(dst.int64)
if string(jsonint64) == "{}" { // empty struct
dst.int64 = nil
} else {
return nil // data stored in dst.int64, return on the first match
}
} else {
dst.int64 = nil
}
return fmt.Errorf("data failed to match schemas in anyOf(ReportingConditionThreshold)")
}
// Marshal data from the first non-nil pointers in the struct to JSON
func (src *ReportingConditionThreshold) MarshalJSON() ([]byte, error) {
if src.float32 != nil {
return json.Marshal(&src.float32)
}
if src.float64 != nil {
return json.Marshal(&src.float64)
}
if src.int32 != nil {
return json.Marshal(&src.int32)
}
if src.int64 != nil {
return json.Marshal(&src.int64)
}
return nil, nil // no data in anyOf schemas
}
type NullableReportingConditionThreshold struct {
value *ReportingConditionThreshold
isSet bool
}
func (v NullableReportingConditionThreshold) Get() *ReportingConditionThreshold {
return v.value
}
func (v *NullableReportingConditionThreshold) Set(val *ReportingConditionThreshold) {
v.value = val
v.isSet = true
}
func (v NullableReportingConditionThreshold) IsSet() bool {
return v.isSet
}
func (v *NullableReportingConditionThreshold) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableReportingConditionThreshold(val *ReportingConditionThreshold) *NullableReportingConditionThreshold {
return &NullableReportingConditionThreshold{value: val, isSet: true}
}
func (v NullableReportingConditionThreshold) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableReportingConditionThreshold) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。