代码拉取完成,页面将自动刷新
/*
N32 Handshake API
N32-c Handshake 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_N32_Handshake
import (
"encoding/json"
"fmt"
)
// ApiSignature - API URI of the service operation
type ApiSignature struct {
CallbackName *CallbackName
String *string
}
// CallbackNameAsApiSignature is a convenience function that returns CallbackName wrapped in ApiSignature
func CallbackNameAsApiSignature(v *CallbackName) ApiSignature {
return ApiSignature{
CallbackName: v,
}
}
// stringAsApiSignature is a convenience function that returns string wrapped in ApiSignature
func StringAsApiSignature(v *string) ApiSignature {
return ApiSignature{
String: v,
}
}
// Unmarshal JSON data into one of the pointers in the struct
func (dst *ApiSignature) UnmarshalJSON(data []byte) error {
var err error
match := 0
// try to unmarshal data into CallbackName
err = newStrictDecoder(data).Decode(&dst.CallbackName)
if err == nil {
jsonCallbackName, _ := json.Marshal(dst.CallbackName)
if string(jsonCallbackName) == "{}" { // empty struct
dst.CallbackName = nil
} else {
match++
}
} else {
dst.CallbackName = nil
}
// try to unmarshal data into String
err = newStrictDecoder(data).Decode(&dst.String)
if err == nil {
jsonString, _ := json.Marshal(dst.String)
if string(jsonString) == "{}" { // empty struct
dst.String = nil
} else {
match++
}
} else {
dst.String = nil
}
if match > 1 { // more than 1 match
// reset to nil
dst.CallbackName = nil
dst.String = nil
return fmt.Errorf("data matches more than one schema in oneOf(ApiSignature)")
} else if match == 1 {
return nil // exactly one match
} else { // no match
return fmt.Errorf("data failed to match schemas in oneOf(ApiSignature)")
}
}
// Marshal data from the first non-nil pointers in the struct to JSON
func (src ApiSignature) MarshalJSON() ([]byte, error) {
if src.CallbackName != nil {
return json.Marshal(&src.CallbackName)
}
if src.String != nil {
return json.Marshal(&src.String)
}
return nil, nil // no data in oneOf schemas
}
// Get the actual instance
func (obj *ApiSignature) GetActualInstance() interface{} {
if obj == nil {
return nil
}
if obj.CallbackName != nil {
return obj.CallbackName
}
if obj.String != nil {
return obj.String
}
// all schemas are nil
return nil
}
type NullableApiSignature struct {
value *ApiSignature
isSet bool
}
func (v NullableApiSignature) Get() *ApiSignature {
return v.value
}
func (v *NullableApiSignature) Set(val *ApiSignature) {
v.value = val
v.isSet = true
}
func (v NullableApiSignature) IsSet() bool {
return v.isSet
}
func (v *NullableApiSignature) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableApiSignature(val *ApiSignature) *NullableApiSignature {
return &NullableApiSignature{value: val, isSet: true}
}
func (v NullableApiSignature) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableApiSignature) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。