121 lines
3 KiB
Go
121 lines
3 KiB
Go
/*
|
|
CDN API
|
|
|
|
API used to create and manage your CDN distributions.
|
|
|
|
API version: 1beta2.0.0
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package cdnbeta
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
// DomainStatus The status of the domain: CREATING indicates that the custom domain is being set up. UPDATING means that requested changes are being applied to the custom domain. ACTIVE means the custom domain is currently configured and active. DELETING means that the domain is in the process of being removed from the distribution. In case the domain has the ERROR state, more information will be available in the errors list.
|
|
type DomainStatus string
|
|
|
|
// List of DomainStatus
|
|
const (
|
|
DOMAINSTATUS_CREATING DomainStatus = "CREATING"
|
|
DOMAINSTATUS_ACTIVE DomainStatus = "ACTIVE"
|
|
DOMAINSTATUS_UPDATING DomainStatus = "UPDATING"
|
|
DOMAINSTATUS_DELETING DomainStatus = "DELETING"
|
|
DOMAINSTATUS_ERROR DomainStatus = "ERROR"
|
|
)
|
|
|
|
// All allowed values of DomainStatus enum
|
|
var AllowedDomainStatusEnumValues = []DomainStatus{
|
|
"CREATING",
|
|
"ACTIVE",
|
|
"UPDATING",
|
|
"DELETING",
|
|
"ERROR",
|
|
}
|
|
|
|
func (v *DomainStatus) UnmarshalJSON(src []byte) error {
|
|
var value string
|
|
err := json.Unmarshal(src, &value)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
// Allow unmarshalling zero value for testing purposes
|
|
var zeroValue string
|
|
if value == zeroValue {
|
|
return nil
|
|
}
|
|
enumTypeValue := DomainStatus(value)
|
|
for _, existing := range AllowedDomainStatusEnumValues {
|
|
if existing == enumTypeValue {
|
|
*v = enumTypeValue
|
|
return nil
|
|
}
|
|
}
|
|
|
|
return fmt.Errorf("%+v is not a valid DomainStatus", value)
|
|
}
|
|
|
|
// NewDomainStatusFromValue returns a pointer to a valid DomainStatus
|
|
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
|
func NewDomainStatusFromValue(v string) (*DomainStatus, error) {
|
|
ev := DomainStatus(v)
|
|
if ev.IsValid() {
|
|
return &ev, nil
|
|
} else {
|
|
return nil, fmt.Errorf("invalid value '%v' for DomainStatus: valid values are %v", v, AllowedDomainStatusEnumValues)
|
|
}
|
|
}
|
|
|
|
// IsValid return true if the value is valid for the enum, false otherwise
|
|
func (v DomainStatus) IsValid() bool {
|
|
for _, existing := range AllowedDomainStatusEnumValues {
|
|
if existing == v {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// Ptr returns reference to DomainStatus value
|
|
func (v DomainStatus) Ptr() *DomainStatus {
|
|
return &v
|
|
}
|
|
|
|
type NullableDomainStatus struct {
|
|
value *DomainStatus
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableDomainStatus) Get() *DomainStatus {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableDomainStatus) Set(val *DomainStatus) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableDomainStatus) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableDomainStatus) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableDomainStatus(val *DomainStatus) *NullableDomainStatus {
|
|
return &NullableDomainStatus{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableDomainStatus) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableDomainStatus) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|