1 Star 0 Fork 0

MrCoder / openapi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
model_source_indicator.go 2.82 KB
一键复制 编辑 原始数据 按行查看 历史
MrCoder 提交于 2023-12-22 15:27 . update
/*
Provisioning MnS
OAS 3.0.1 definition of the Provisioning MnS © 2023, 3GPP Organizational Partners (ARIB, ATIS, CCSA, ETSI, TSDSI, TTA, TTC). All rights reserved.
API version: 17.6.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package OpenAPI_ProvMnS
import (
"encoding/json"
"fmt"
)
// SourceIndicator the model 'SourceIndicator'
type SourceIndicator string
// List of SourceIndicator
const (
SOURCEINDICATOR_RESOURCE_OPERATION SourceIndicator = "RESOURCE_OPERATION"
SOURCEINDICATOR_MANAGEMENT_OPERATION SourceIndicator = "MANAGEMENT_OPERATION"
SOURCEINDICATOR_SON_OPERATION SourceIndicator = "SON_OPERATION"
SOURCEINDICATOR_UNKNOWN SourceIndicator = "UNKNOWN"
)
// All allowed values of SourceIndicator enum
var AllowedSourceIndicatorEnumValues = []SourceIndicator{
"RESOURCE_OPERATION",
"MANAGEMENT_OPERATION",
"SON_OPERATION",
"UNKNOWN",
}
func (v *SourceIndicator) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := SourceIndicator(value)
for _, existing := range AllowedSourceIndicatorEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid SourceIndicator", value)
}
// NewSourceIndicatorFromValue returns a pointer to a valid SourceIndicator
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewSourceIndicatorFromValue(v string) (*SourceIndicator, error) {
ev := SourceIndicator(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for SourceIndicator: valid values are %v", v, AllowedSourceIndicatorEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v SourceIndicator) IsValid() bool {
for _, existing := range AllowedSourceIndicatorEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to SourceIndicator value
func (v SourceIndicator) Ptr() *SourceIndicator {
return &v
}
type NullableSourceIndicator struct {
value *SourceIndicator
isSet bool
}
func (v NullableSourceIndicator) Get() *SourceIndicator {
return v.value
}
func (v *NullableSourceIndicator) Set(val *SourceIndicator) {
v.value = val
v.isSet = true
}
func (v NullableSourceIndicator) IsSet() bool {
return v.isSet
}
func (v *NullableSourceIndicator) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableSourceIndicator(val *SourceIndicator) *NullableSourceIndicator {
return &NullableSourceIndicator{value: val, isSet: true}
}
func (v NullableSourceIndicator) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableSourceIndicator) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}
Go
1
https://gitee.com/konglinglong/openapi.git
git@gitee.com:konglinglong/openapi.git
konglinglong
openapi
openapi
e403a3c726a4

搜索帮助