* 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>
307 lines
12 KiB
Go
307 lines
12 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"
|
|
)
|
|
|
|
// checks if the BackupRunningRestore type satisfies the MappedNullable interface at compile time
|
|
var _ MappedNullable = &BackupRunningRestore{}
|
|
|
|
/*
|
|
types and functions for command
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type BackupRunningRestoreGetCommandAttributeType = *string
|
|
|
|
func getBackupRunningRestoreGetCommandAttributeTypeOk(arg BackupRunningRestoreGetCommandAttributeType) (ret BackupRunningRestoreGetCommandRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setBackupRunningRestoreGetCommandAttributeType(arg *BackupRunningRestoreGetCommandAttributeType, val BackupRunningRestoreGetCommandRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type BackupRunningRestoreGetCommandArgType = string
|
|
type BackupRunningRestoreGetCommandRetType = string
|
|
|
|
/*
|
|
types and functions for database_name
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type BackupRunningRestoreGetDatabaseNameAttributeType = *string
|
|
|
|
func getBackupRunningRestoreGetDatabaseNameAttributeTypeOk(arg BackupRunningRestoreGetDatabaseNameAttributeType) (ret BackupRunningRestoreGetDatabaseNameRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setBackupRunningRestoreGetDatabaseNameAttributeType(arg *BackupRunningRestoreGetDatabaseNameAttributeType, val BackupRunningRestoreGetDatabaseNameRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type BackupRunningRestoreGetDatabaseNameArgType = string
|
|
type BackupRunningRestoreGetDatabaseNameRetType = string
|
|
|
|
/*
|
|
types and functions for estimated_completion_time
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type BackupRunningRestoreGetEstimatedCompletionTimeAttributeType = *string
|
|
|
|
func getBackupRunningRestoreGetEstimatedCompletionTimeAttributeTypeOk(arg BackupRunningRestoreGetEstimatedCompletionTimeAttributeType) (ret BackupRunningRestoreGetEstimatedCompletionTimeRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setBackupRunningRestoreGetEstimatedCompletionTimeAttributeType(arg *BackupRunningRestoreGetEstimatedCompletionTimeAttributeType, val BackupRunningRestoreGetEstimatedCompletionTimeRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type BackupRunningRestoreGetEstimatedCompletionTimeArgType = string
|
|
type BackupRunningRestoreGetEstimatedCompletionTimeRetType = string
|
|
|
|
/*
|
|
types and functions for percent_complete
|
|
*/
|
|
|
|
// isInteger
|
|
type BackupRunningRestoreGetPercentCompleteAttributeType = *int64
|
|
type BackupRunningRestoreGetPercentCompleteArgType = int64
|
|
type BackupRunningRestoreGetPercentCompleteRetType = int64
|
|
|
|
func getBackupRunningRestoreGetPercentCompleteAttributeTypeOk(arg BackupRunningRestoreGetPercentCompleteAttributeType) (ret BackupRunningRestoreGetPercentCompleteRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setBackupRunningRestoreGetPercentCompleteAttributeType(arg *BackupRunningRestoreGetPercentCompleteAttributeType, val BackupRunningRestoreGetPercentCompleteRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
/*
|
|
types and functions for start_time
|
|
*/
|
|
|
|
// isNotNullableString
|
|
type BackupRunningRestoreGetStartTimeAttributeType = *string
|
|
|
|
func getBackupRunningRestoreGetStartTimeAttributeTypeOk(arg BackupRunningRestoreGetStartTimeAttributeType) (ret BackupRunningRestoreGetStartTimeRetType, ok bool) {
|
|
if arg == nil {
|
|
return ret, false
|
|
}
|
|
return *arg, true
|
|
}
|
|
|
|
func setBackupRunningRestoreGetStartTimeAttributeType(arg *BackupRunningRestoreGetStartTimeAttributeType, val BackupRunningRestoreGetStartTimeRetType) {
|
|
*arg = &val
|
|
}
|
|
|
|
type BackupRunningRestoreGetStartTimeArgType = string
|
|
type BackupRunningRestoreGetStartTimeRetType = string
|
|
|
|
// BackupRunningRestore struct for BackupRunningRestore
|
|
type BackupRunningRestore struct {
|
|
// the command that was executed
|
|
// REQUIRED
|
|
Command BackupRunningRestoreGetCommandAttributeType `json:"command" required:"true" validate:"required,restoreCommand"`
|
|
// the name of the database that is being restored
|
|
// REQUIRED
|
|
DatabaseName BackupRunningRestoreGetDatabaseNameAttributeType `json:"database_name" required:"true" validate:"required,databaseName"`
|
|
// the projected time when the restore should be completed
|
|
// REQUIRED
|
|
EstimatedCompletionTime BackupRunningRestoreGetEstimatedCompletionTimeAttributeType `json:"estimated_completion_time" required:"true" validate:"required,time"`
|
|
// the percentage of the current running restore job
|
|
// Can be cast to int32 without loss of precision.
|
|
// REQUIRED
|
|
PercentComplete BackupRunningRestoreGetPercentCompleteAttributeType `json:"percent_complete" required:"true" validate:"required,min=0,max=100"`
|
|
// the start time of the current running restore job
|
|
// REQUIRED
|
|
StartTime BackupRunningRestoreGetStartTimeAttributeType `json:"start_time" required:"true" validate:"required,time"`
|
|
}
|
|
|
|
type _BackupRunningRestore BackupRunningRestore
|
|
|
|
// NewBackupRunningRestore instantiates a new BackupRunningRestore object
|
|
// This constructor will assign default values to properties that have it defined,
|
|
// and makes sure properties required by API are set, but the set of arguments
|
|
// will change when the set of required properties is changed
|
|
func NewBackupRunningRestore(command BackupRunningRestoreGetCommandArgType, databaseName BackupRunningRestoreGetDatabaseNameArgType, estimatedCompletionTime BackupRunningRestoreGetEstimatedCompletionTimeArgType, percentComplete BackupRunningRestoreGetPercentCompleteArgType, startTime BackupRunningRestoreGetStartTimeArgType) *BackupRunningRestore {
|
|
this := BackupRunningRestore{}
|
|
setBackupRunningRestoreGetCommandAttributeType(&this.Command, command)
|
|
setBackupRunningRestoreGetDatabaseNameAttributeType(&this.DatabaseName, databaseName)
|
|
setBackupRunningRestoreGetEstimatedCompletionTimeAttributeType(&this.EstimatedCompletionTime, estimatedCompletionTime)
|
|
setBackupRunningRestoreGetPercentCompleteAttributeType(&this.PercentComplete, percentComplete)
|
|
setBackupRunningRestoreGetStartTimeAttributeType(&this.StartTime, startTime)
|
|
return &this
|
|
}
|
|
|
|
// NewBackupRunningRestoreWithDefaults instantiates a new BackupRunningRestore object
|
|
// This constructor will only assign default values to properties that have it defined,
|
|
// but it doesn't guarantee that properties required by API are set
|
|
func NewBackupRunningRestoreWithDefaults() *BackupRunningRestore {
|
|
this := BackupRunningRestore{}
|
|
return &this
|
|
}
|
|
|
|
// GetCommand returns the Command field value
|
|
func (o *BackupRunningRestore) GetCommand() (ret BackupRunningRestoreGetCommandRetType) {
|
|
ret, _ = o.GetCommandOk()
|
|
return ret
|
|
}
|
|
|
|
// GetCommandOk returns a tuple with the Command field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BackupRunningRestore) GetCommandOk() (ret BackupRunningRestoreGetCommandRetType, ok bool) {
|
|
return getBackupRunningRestoreGetCommandAttributeTypeOk(o.Command)
|
|
}
|
|
|
|
// SetCommand sets field value
|
|
func (o *BackupRunningRestore) SetCommand(v BackupRunningRestoreGetCommandRetType) {
|
|
setBackupRunningRestoreGetCommandAttributeType(&o.Command, v)
|
|
}
|
|
|
|
// GetDatabaseName returns the DatabaseName field value
|
|
func (o *BackupRunningRestore) GetDatabaseName() (ret BackupRunningRestoreGetDatabaseNameRetType) {
|
|
ret, _ = o.GetDatabaseNameOk()
|
|
return ret
|
|
}
|
|
|
|
// GetDatabaseNameOk returns a tuple with the DatabaseName field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BackupRunningRestore) GetDatabaseNameOk() (ret BackupRunningRestoreGetDatabaseNameRetType, ok bool) {
|
|
return getBackupRunningRestoreGetDatabaseNameAttributeTypeOk(o.DatabaseName)
|
|
}
|
|
|
|
// SetDatabaseName sets field value
|
|
func (o *BackupRunningRestore) SetDatabaseName(v BackupRunningRestoreGetDatabaseNameRetType) {
|
|
setBackupRunningRestoreGetDatabaseNameAttributeType(&o.DatabaseName, v)
|
|
}
|
|
|
|
// GetEstimatedCompletionTime returns the EstimatedCompletionTime field value
|
|
func (o *BackupRunningRestore) GetEstimatedCompletionTime() (ret BackupRunningRestoreGetEstimatedCompletionTimeRetType) {
|
|
ret, _ = o.GetEstimatedCompletionTimeOk()
|
|
return ret
|
|
}
|
|
|
|
// GetEstimatedCompletionTimeOk returns a tuple with the EstimatedCompletionTime field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BackupRunningRestore) GetEstimatedCompletionTimeOk() (ret BackupRunningRestoreGetEstimatedCompletionTimeRetType, ok bool) {
|
|
return getBackupRunningRestoreGetEstimatedCompletionTimeAttributeTypeOk(o.EstimatedCompletionTime)
|
|
}
|
|
|
|
// SetEstimatedCompletionTime sets field value
|
|
func (o *BackupRunningRestore) SetEstimatedCompletionTime(v BackupRunningRestoreGetEstimatedCompletionTimeRetType) {
|
|
setBackupRunningRestoreGetEstimatedCompletionTimeAttributeType(&o.EstimatedCompletionTime, v)
|
|
}
|
|
|
|
// GetPercentComplete returns the PercentComplete field value
|
|
func (o *BackupRunningRestore) GetPercentComplete() (ret BackupRunningRestoreGetPercentCompleteRetType) {
|
|
ret, _ = o.GetPercentCompleteOk()
|
|
return ret
|
|
}
|
|
|
|
// GetPercentCompleteOk returns a tuple with the PercentComplete field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BackupRunningRestore) GetPercentCompleteOk() (ret BackupRunningRestoreGetPercentCompleteRetType, ok bool) {
|
|
return getBackupRunningRestoreGetPercentCompleteAttributeTypeOk(o.PercentComplete)
|
|
}
|
|
|
|
// SetPercentComplete sets field value
|
|
func (o *BackupRunningRestore) SetPercentComplete(v BackupRunningRestoreGetPercentCompleteRetType) {
|
|
setBackupRunningRestoreGetPercentCompleteAttributeType(&o.PercentComplete, v)
|
|
}
|
|
|
|
// GetStartTime returns the StartTime field value
|
|
func (o *BackupRunningRestore) GetStartTime() (ret BackupRunningRestoreGetStartTimeRetType) {
|
|
ret, _ = o.GetStartTimeOk()
|
|
return ret
|
|
}
|
|
|
|
// GetStartTimeOk returns a tuple with the StartTime field value
|
|
// and a boolean to check if the value has been set.
|
|
func (o *BackupRunningRestore) GetStartTimeOk() (ret BackupRunningRestoreGetStartTimeRetType, ok bool) {
|
|
return getBackupRunningRestoreGetStartTimeAttributeTypeOk(o.StartTime)
|
|
}
|
|
|
|
// SetStartTime sets field value
|
|
func (o *BackupRunningRestore) SetStartTime(v BackupRunningRestoreGetStartTimeRetType) {
|
|
setBackupRunningRestoreGetStartTimeAttributeType(&o.StartTime, v)
|
|
}
|
|
|
|
func (o BackupRunningRestore) ToMap() (map[string]interface{}, error) {
|
|
toSerialize := map[string]interface{}{}
|
|
if val, ok := getBackupRunningRestoreGetCommandAttributeTypeOk(o.Command); ok {
|
|
toSerialize["Command"] = val
|
|
}
|
|
if val, ok := getBackupRunningRestoreGetDatabaseNameAttributeTypeOk(o.DatabaseName); ok {
|
|
toSerialize["DatabaseName"] = val
|
|
}
|
|
if val, ok := getBackupRunningRestoreGetEstimatedCompletionTimeAttributeTypeOk(o.EstimatedCompletionTime); ok {
|
|
toSerialize["EstimatedCompletionTime"] = val
|
|
}
|
|
if val, ok := getBackupRunningRestoreGetPercentCompleteAttributeTypeOk(o.PercentComplete); ok {
|
|
toSerialize["PercentComplete"] = val
|
|
}
|
|
if val, ok := getBackupRunningRestoreGetStartTimeAttributeTypeOk(o.StartTime); ok {
|
|
toSerialize["StartTime"] = val
|
|
}
|
|
return toSerialize, nil
|
|
}
|
|
|
|
type NullableBackupRunningRestore struct {
|
|
value *BackupRunningRestore
|
|
isSet bool
|
|
}
|
|
|
|
func (v NullableBackupRunningRestore) Get() *BackupRunningRestore {
|
|
return v.value
|
|
}
|
|
|
|
func (v *NullableBackupRunningRestore) Set(val *BackupRunningRestore) {
|
|
v.value = val
|
|
v.isSet = true
|
|
}
|
|
|
|
func (v NullableBackupRunningRestore) IsSet() bool {
|
|
return v.isSet
|
|
}
|
|
|
|
func (v *NullableBackupRunningRestore) Unset() {
|
|
v.value = nil
|
|
v.isSet = false
|
|
}
|
|
|
|
func NewNullableBackupRunningRestore(val *BackupRunningRestore) *NullableBackupRunningRestore {
|
|
return &NullableBackupRunningRestore{value: val, isSet: true}
|
|
}
|
|
|
|
func (v NullableBackupRunningRestore) MarshalJSON() ([]byte, error) {
|
|
return json.Marshal(v.value)
|
|
}
|
|
|
|
func (v *NullableBackupRunningRestore) UnmarshalJSON(src []byte) error {
|
|
v.isSet = true
|
|
return json.Unmarshal(src, &v.value)
|
|
}
|