1 Star 0 Fork 0

MrCoder / openapi

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
model_alarm_type.go 3.36 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"
)
// AlarmType the model 'AlarmType'
type AlarmType string
// List of AlarmType
const (
ALARMTYPE_COMMUNICATIONS_ALARM AlarmType = "COMMUNICATIONS_ALARM"
ALARMTYPE_QUALITY_OF_SERVICE_ALARM AlarmType = "QUALITY_OF_SERVICE_ALARM"
ALARMTYPE_PROCESSING_ERROR_ALARM AlarmType = "PROCESSING_ERROR_ALARM"
ALARMTYPE_EQUIPMENT_ALARM AlarmType = "EQUIPMENT_ALARM"
ALARMTYPE_ENVIRONMENTAL_ALARM AlarmType = "ENVIRONMENTAL_ALARM"
ALARMTYPE_INTEGRITY_VIOLATION AlarmType = "INTEGRITY_VIOLATION"
ALARMTYPE_OPERATIONAL_VIOLATION AlarmType = "OPERATIONAL_VIOLATION"
ALARMTYPE_PHYSICAL_VIOLATION AlarmType = "PHYSICAL_VIOLATION"
ALARMTYPE_SECURITY_SERVICE_OR_MECHANISM_VIOLATION AlarmType = "SECURITY_SERVICE_OR_MECHANISM_VIOLATION"
ALARMTYPE_TIME_DOMAIN_VIOLATION AlarmType = "TIME_DOMAIN_VIOLATION"
)
// All allowed values of AlarmType enum
var AllowedAlarmTypeEnumValues = []AlarmType{
"COMMUNICATIONS_ALARM",
"QUALITY_OF_SERVICE_ALARM",
"PROCESSING_ERROR_ALARM",
"EQUIPMENT_ALARM",
"ENVIRONMENTAL_ALARM",
"INTEGRITY_VIOLATION",
"OPERATIONAL_VIOLATION",
"PHYSICAL_VIOLATION",
"SECURITY_SERVICE_OR_MECHANISM_VIOLATION",
"TIME_DOMAIN_VIOLATION",
}
func (v *AlarmType) UnmarshalJSON(src []byte) error {
var value string
err := json.Unmarshal(src, &value)
if err != nil {
return err
}
enumTypeValue := AlarmType(value)
for _, existing := range AllowedAlarmTypeEnumValues {
if existing == enumTypeValue {
*v = enumTypeValue
return nil
}
}
return fmt.Errorf("%+v is not a valid AlarmType", value)
}
// NewAlarmTypeFromValue returns a pointer to a valid AlarmType
// for the value passed as argument, or an error if the value passed is not allowed by the enum
func NewAlarmTypeFromValue(v string) (*AlarmType, error) {
ev := AlarmType(v)
if ev.IsValid() {
return &ev, nil
} else {
return nil, fmt.Errorf("invalid value '%v' for AlarmType: valid values are %v", v, AllowedAlarmTypeEnumValues)
}
}
// IsValid return true if the value is valid for the enum, false otherwise
func (v AlarmType) IsValid() bool {
for _, existing := range AllowedAlarmTypeEnumValues {
if existing == v {
return true
}
}
return false
}
// Ptr returns reference to AlarmType value
func (v AlarmType) Ptr() *AlarmType {
return &v
}
type NullableAlarmType struct {
value *AlarmType
isSet bool
}
func (v NullableAlarmType) Get() *AlarmType {
return v.value
}
func (v *NullableAlarmType) Set(val *AlarmType) {
v.value = val
v.isSet = true
}
func (v NullableAlarmType) IsSet() bool {
return v.isSet
}
func (v *NullableAlarmType) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableAlarmType(val *AlarmType) *NullableAlarmType {
return &NullableAlarmType{value: val, isSet: true}
}
func (v NullableAlarmType) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableAlarmType) 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

搜索帮助