* 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>
135 lines
3.2 KiB
Go
135 lines
3.2 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"
|
|
)
|
|
|
|
// BackupSort the model 'BackupSort'
|
|
type BackupSort string
|
|
|
|
// List of backup.sort
|
|
const (
|
|
BACKUPSORT_END_TIME_DESC BackupSort = "end_time.desc"
|
|
BACKUPSORT_END_TIME_ASC BackupSort = "end_time.asc"
|
|
BACKUPSORT_INDEX_DESC BackupSort = "index.desc"
|
|
BACKUPSORT_INDEX_ASC BackupSort = "index.asc"
|
|
BACKUPSORT_NAME_DESC BackupSort = "name.desc"
|
|
BACKUPSORT_NAME_ASC BackupSort = "name.asc"
|
|
BACKUPSORT_RETAINED_UNTIL_DESC BackupSort = "retained_until.desc"
|
|
BACKUPSORT_RETAINED_UNTIL_ASC BackupSort = "retained_until.asc"
|
|
BACKUPSORT_SIZE_DESC BackupSort = "size.desc"
|
|
BACKUPSORT_SIZE_ASC BackupSort = "size.asc"
|
|
BACKUPSORT_TYPE_DESC BackupSort = "type.desc"
|
|
BACKUPSORT_TYPE_ASC BackupSort = "type.asc"
|
|
)
|
|
|
|
// All allowed values of BackupSort enum
|
|
var AllowedBackupSortEnumValues = []BackupSort{
|
|
"end_time.desc",
|
|
"end_time.asc",
|
|
"index.desc",
|
|
"index.asc",
|
|
"name.desc",
|
|
"name.asc",
|
|
"retained_until.desc",
|
|
"retained_until.asc",
|
|
"size.desc",
|
|
"size.asc",
|
|
"type.desc",
|
|
"type.asc",
|
|
}
|
|
|
|
func (v *BackupSort) 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 := BackupSort(value)
|
|
for _, existing := range AllowedBackupSortEnumValues {
|
|
if existing == enumTypeValue {
|
|
*v = enumTypeValue
|
|
return nil
|
|
}
|
|
}
|
|
|
|
return fmt.Errorf("%+v is not a valid BackupSort", value)
|
|
}
|
|
|
|
// NewBackupSortFromValue returns a pointer to a valid BackupSort
|
|
// for the value passed as argument, or an error if the value passed is not allowed by the enum
|
|
func NewBackupSortFromValue(v string) (*BackupSort, error) {
|
|
ev := BackupSort(v)
|
|
if ev.IsValid() {
|
|
return &ev, nil
|
|
} else {
|
|
return nil, fmt.Errorf("invalid value '%v' for BackupSort: valid values are %v", v, AllowedBackupSortEnumValues)
|
|
}
|
|
}
|
|
|
|
// IsValid return true if the value is valid for the enum, false otherwise
|
|
func (v BackupSort) IsValid() bool {
|
|
for _, existing := range AllowedBackupSortEnumValues {
|
|
if existing == v {
|
|
return true
|
|
}
|
|
}
|
|
return false
|
|
}
|
|
|
|
// Ptr returns reference to backup.sort value
|
|
func (v BackupSort) Ptr() *BackupSort {
|
|
return &v
|
|
}
|
|
|
|
type NullableBackupSort struct {
|
|
value *BackupSort
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableBackupSort) Get() *BackupSort {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableBackupSort) Set(val *BackupSort) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableBackupSort) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableBackupSort) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableBackupSort(val *BackupSort) *NullableBackupSort {
|
|
return &NullableBackupSort{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableBackupSort) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableBackupSort) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|