* chore: initial push to be able to work together * chore: add missing wait folder * chore: add missing folders * chore: cleanup alpha branch * feat: mssql alpha instance (#2) * fix: remove unused attribute types and functions from backup models * fix: update API client references to use sqlserverflexalpha package * fix: update package references to use sqlserverflexalpha and modify user data source model * fix: add sqlserverflexalpha user data source to provider * fix: add sqlserverflexalpha user resource and update related functionality * chore: add stackit_sqlserverflexalpha_user resource and instance_id variable * fix: refactor sqlserverflexalpha user resource and enhance schema with status and default_database --------- Co-authored-by: Andre Harms <andre.harms@stackit.cloud> Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud> * feat: add sqlserver instance * chore: fixing tests * chore: update docs --------- Co-authored-by: Marcel S. Henselin <marcel.henselin@stackit.cloud> Co-authored-by: Andre Harms <andre.harms@stackit.cloud>
123 lines
2.5 KiB
Go
123 lines
2.5 KiB
Go
/*
|
|
STACKIT MSSQL Service API
|
|
|
|
This is the documentation for the STACKIT MSSQL service
|
|
|
|
API version: 3alpha1
|
|
*/
|
|
|
|
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
|
|
|
|
package sqlserverflexalpha
|
|
|
|
import (
|
|
"encoding/json"
|
|
"fmt"
|
|
)
|
|
|
|
// Status the model 'Status'
|
|
type Status string
|
|
|
|
// List of status
|
|
const (
|
|
STATUS_READY Status = "READY"
|
|
STATUS_PENDING Status = "PENDING"
|
|
STATUS_PROGRESSING Status = "PROGRESSING"
|
|
STATUS_FAILURE Status = "FAILURE"
|
|
STATUS_UNKNOWN Status = "UNKNOWN"
|
|
STATUS_TERMINATING Status = "TERMINATING"
|
|
)
|
|
|
|
// All allowed values of Status enum
|
|
var AllowedStatusEnumValues = []Status{
|
|
"READY",
|
|
"PENDING",
|
|
"PROGRESSING",
|
|
"FAILURE",
|
|
"UNKNOWN",
|
|
"TERMINATING",
|
|
}
|
|
|
|
func (v *Status) 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 := Status(value)
|
|
for _, existing := range AllowedStatusEnumValues {
|
|
if existing == enumTypeValue {
|
|
*v = enumTypeValue
|
|
return nil
|
|
}
|
|
}
|
|
|
|
return fmt.Errorf("%+v is not a valid Status", value)
|
|
}
|
|
|
|
// NewStatusFromValue returns a pointer to a valid Status
|
|
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
|
func NewStatusFromValue(v string) (*Status, error) {
|
|
ev := Status(v)
|
|
if ev.IsValid() {
|
|
return &ev, nil
|
|
} else {
|
|
return nil, fmt.Errorf("invalid value '%v' for Status: valid values are %v", v, AllowedStatusEnumValues)
|
|
}
|
|
}
|
|
|
|
// IsValid return true if the value is valid for the enum, false otherwise
|
|
func (v Status) IsValid() bool {
|
|
for _, existing := range AllowedStatusEnumValues {
|
|
if existing == v {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// Ptr returns reference to status value
|
|
func (v Status) Ptr() *Status {
|
|
return &v
|
|
}
|
|
|
|
type NullableStatus struct {
|
|
value *Status
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableStatus) Get() *Status {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableStatus) Set(val *Status) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableStatus) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableStatus) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableStatus(val *Status) *NullableStatus {
|
|
return &NullableStatus{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableStatus) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableStatus) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|