/* 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" ) // checks if the SourceExternalS3 type satisfies the MappedNullable interface at compile time var _ MappedNullable = &SourceExternalS3{} /* types and functions for database_owner */ // isNotNullableString type SourceExternalS3GetDatabaseOwnerAttributeType = *string func getSourceExternalS3GetDatabaseOwnerAttributeTypeOk(arg SourceExternalS3GetDatabaseOwnerAttributeType) (ret SourceExternalS3GetDatabaseOwnerRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setSourceExternalS3GetDatabaseOwnerAttributeType(arg *SourceExternalS3GetDatabaseOwnerAttributeType, val SourceExternalS3GetDatabaseOwnerRetType) { *arg = &val } type SourceExternalS3GetDatabaseOwnerArgType = string type SourceExternalS3GetDatabaseOwnerRetType = string /* types and functions for logging_guid */ // isNotNullableString type SourceExternalS3GetLoggingGuidAttributeType = *string func getSourceExternalS3GetLoggingGuidAttributeTypeOk(arg SourceExternalS3GetLoggingGuidAttributeType) (ret SourceExternalS3GetLoggingGuidRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setSourceExternalS3GetLoggingGuidAttributeType(arg *SourceExternalS3GetLoggingGuidAttributeType, val SourceExternalS3GetLoggingGuidRetType) { *arg = &val } type SourceExternalS3GetLoggingGuidArgType = string type SourceExternalS3GetLoggingGuidRetType = string /* types and functions for s3_details */ // isModel type SourceExternalS3GetS3DetailsAttributeType = *ExternalS3 type SourceExternalS3GetS3DetailsArgType = ExternalS3 type SourceExternalS3GetS3DetailsRetType = ExternalS3 func getSourceExternalS3GetS3DetailsAttributeTypeOk(arg SourceExternalS3GetS3DetailsAttributeType) (ret SourceExternalS3GetS3DetailsRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setSourceExternalS3GetS3DetailsAttributeType(arg *SourceExternalS3GetS3DetailsAttributeType, val SourceExternalS3GetS3DetailsRetType) { *arg = &val } /* types and functions for type */ // isEnum // SourceExternalS3Types the model 'SourceExternalS3' // value type for enums type SourceExternalS3Types string // List of Type const ( SOURCEEXTERNALS3TYPE_EXTERNAL_S3 SourceExternalS3Types = "EXTERNAL_S3" ) // All allowed values of SourceExternalS3 enum var AllowedSourceExternalS3TypesEnumValues = []SourceExternalS3Types{ "EXTERNAL_S3", } func (v *SourceExternalS3Types) UnmarshalJSON(src []byte) error { // use a type alias to prevent infinite recursion during unmarshal, // see https://biscuit.ninja/posts/go-avoid-an-infitine-loop-with-custom-json-unmarshallers type TmpJson SourceExternalS3Types var value TmpJson err := json.Unmarshal(src, &value) if err != nil { return err } // Allow unmarshalling zero value for testing purposes var zeroValue TmpJson if value == zeroValue { return nil } enumTypeValue := SourceExternalS3Types(value) for _, existing := range AllowedSourceExternalS3TypesEnumValues { if existing == enumTypeValue { *v = enumTypeValue return nil } } return fmt.Errorf("%+v is not a valid SourceExternalS3", value) } // NewSourceExternalS3TypesFromValue returns a pointer to a valid SourceExternalS3Types // for the value passed as argument, or an error if the value passed is not allowed by the enum func NewSourceExternalS3TypesFromValue(v SourceExternalS3Types) (*SourceExternalS3Types, error) { ev := SourceExternalS3Types(v) if ev.IsValid() { return &ev, nil } else { return nil, fmt.Errorf("invalid value '%v' for SourceExternalS3Types: valid values are %v", v, AllowedSourceExternalS3TypesEnumValues) } } // IsValid return true if the value is valid for the enum, false otherwise func (v SourceExternalS3Types) IsValid() bool { for _, existing := range AllowedSourceExternalS3TypesEnumValues { if existing == v { return true } } return false } // Ptr returns reference to TypeTypes value func (v SourceExternalS3Types) Ptr() *SourceExternalS3Types { return &v } type NullableSourceExternalS3Types struct { value *SourceExternalS3Types isSet bool } func (v NullableSourceExternalS3Types) Get() *SourceExternalS3Types { return v.value } func (v *NullableSourceExternalS3Types) Set(val *SourceExternalS3Types) { v.value = val v.isSet = true } func (v NullableSourceExternalS3Types) IsSet() bool { return v.isSet } func (v *NullableSourceExternalS3Types) Unset() { v.value = nil v.isSet = false } func NewNullableSourceExternalS3Types(val *SourceExternalS3Types) *NullableSourceExternalS3Types { return &NullableSourceExternalS3Types{value: val, isSet: true} } func (v NullableSourceExternalS3Types) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableSourceExternalS3Types) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) } type SourceExternalS3GetTypeAttributeType = *SourceExternalS3Types type SourceExternalS3GetTypeArgType = SourceExternalS3Types type SourceExternalS3GetTypeRetType = SourceExternalS3Types func getSourceExternalS3GetTypeAttributeTypeOk(arg SourceExternalS3GetTypeAttributeType) (ret SourceExternalS3GetTypeRetType, ok bool) { if arg == nil { return ret, false } return *arg, true } func setSourceExternalS3GetTypeAttributeType(arg *SourceExternalS3GetTypeAttributeType, val SourceExternalS3GetTypeRetType) { *arg = &val } // SourceExternalS3 Restore from an external S3 backup file. type SourceExternalS3 struct { // The owner of the database. // REQUIRED DatabaseOwner SourceExternalS3GetDatabaseOwnerAttributeType `json:"database_owner" required:"true"` // Logging guid to have a complete activity log over all sub stored procedures. LoggingGuid SourceExternalS3GetLoggingGuidAttributeType `json:"logging_guid,omitempty"` // REQUIRED S3Details SourceExternalS3GetS3DetailsAttributeType `json:"s3_details" required:"true"` // REQUIRED Type SourceExternalS3GetTypeAttributeType `json:"type" required:"true"` } type _SourceExternalS3 SourceExternalS3 // NewSourceExternalS3 instantiates a new SourceExternalS3 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 NewSourceExternalS3(databaseOwner SourceExternalS3GetDatabaseOwnerArgType, s3Details SourceExternalS3GetS3DetailsArgType, types SourceExternalS3GetTypeArgType) *SourceExternalS3 { this := SourceExternalS3{} setSourceExternalS3GetDatabaseOwnerAttributeType(&this.DatabaseOwner, databaseOwner) setSourceExternalS3GetS3DetailsAttributeType(&this.S3Details, s3Details) setSourceExternalS3GetTypeAttributeType(&this.Type, types) return &this } // NewSourceExternalS3WithDefaults instantiates a new SourceExternalS3 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 NewSourceExternalS3WithDefaults() *SourceExternalS3 { this := SourceExternalS3{} return &this } // GetDatabaseOwner returns the DatabaseOwner field value func (o *SourceExternalS3) GetDatabaseOwner() (ret SourceExternalS3GetDatabaseOwnerRetType) { ret, _ = o.GetDatabaseOwnerOk() return ret } // GetDatabaseOwnerOk returns a tuple with the DatabaseOwner field value // and a boolean to check if the value has been set. func (o *SourceExternalS3) GetDatabaseOwnerOk() (ret SourceExternalS3GetDatabaseOwnerRetType, ok bool) { return getSourceExternalS3GetDatabaseOwnerAttributeTypeOk(o.DatabaseOwner) } // SetDatabaseOwner sets field value func (o *SourceExternalS3) SetDatabaseOwner(v SourceExternalS3GetDatabaseOwnerRetType) { setSourceExternalS3GetDatabaseOwnerAttributeType(&o.DatabaseOwner, v) } // GetLoggingGuid returns the LoggingGuid field value if set, zero value otherwise. func (o *SourceExternalS3) GetLoggingGuid() (res SourceExternalS3GetLoggingGuidRetType) { res, _ = o.GetLoggingGuidOk() return } // GetLoggingGuidOk returns a tuple with the LoggingGuid field value if set, nil otherwise // and a boolean to check if the value has been set. func (o *SourceExternalS3) GetLoggingGuidOk() (ret SourceExternalS3GetLoggingGuidRetType, ok bool) { return getSourceExternalS3GetLoggingGuidAttributeTypeOk(o.LoggingGuid) } // HasLoggingGuid returns a boolean if a field has been set. func (o *SourceExternalS3) HasLoggingGuid() bool { _, ok := o.GetLoggingGuidOk() return ok } // SetLoggingGuid gets a reference to the given string and assigns it to the LoggingGuid field. func (o *SourceExternalS3) SetLoggingGuid(v SourceExternalS3GetLoggingGuidRetType) { setSourceExternalS3GetLoggingGuidAttributeType(&o.LoggingGuid, v) } // GetS3Details returns the S3Details field value func (o *SourceExternalS3) GetS3Details() (ret SourceExternalS3GetS3DetailsRetType) { ret, _ = o.GetS3DetailsOk() return ret } // GetS3DetailsOk returns a tuple with the S3Details field value // and a boolean to check if the value has been set. func (o *SourceExternalS3) GetS3DetailsOk() (ret SourceExternalS3GetS3DetailsRetType, ok bool) { return getSourceExternalS3GetS3DetailsAttributeTypeOk(o.S3Details) } // SetS3Details sets field value func (o *SourceExternalS3) SetS3Details(v SourceExternalS3GetS3DetailsRetType) { setSourceExternalS3GetS3DetailsAttributeType(&o.S3Details, v) } // GetType returns the Type field value func (o *SourceExternalS3) GetType() (ret SourceExternalS3GetTypeRetType) { ret, _ = o.GetTypeOk() return ret } // GetTypeOk returns a tuple with the Type field value // and a boolean to check if the value has been set. func (o *SourceExternalS3) GetTypeOk() (ret SourceExternalS3GetTypeRetType, ok bool) { return getSourceExternalS3GetTypeAttributeTypeOk(o.Type) } // SetType sets field value func (o *SourceExternalS3) SetType(v SourceExternalS3GetTypeRetType) { setSourceExternalS3GetTypeAttributeType(&o.Type, v) } func (o SourceExternalS3) ToMap() (map[string]interface{}, error) { toSerialize := map[string]interface{}{} if val, ok := getSourceExternalS3GetDatabaseOwnerAttributeTypeOk(o.DatabaseOwner); ok { toSerialize["DatabaseOwner"] = val } if val, ok := getSourceExternalS3GetLoggingGuidAttributeTypeOk(o.LoggingGuid); ok { toSerialize["LoggingGuid"] = val } if val, ok := getSourceExternalS3GetS3DetailsAttributeTypeOk(o.S3Details); ok { toSerialize["S3Details"] = val } if val, ok := getSourceExternalS3GetTypeAttributeTypeOk(o.Type); ok { toSerialize["Type"] = val } return toSerialize, nil } type NullableSourceExternalS3 struct { value *SourceExternalS3 isSet bool } func (v NullableSourceExternalS3) Get() *SourceExternalS3 { return v.value } func (v *NullableSourceExternalS3) Set(val *SourceExternalS3) { v.value = val v.isSet = true } func (v NullableSourceExternalS3) IsSet() bool { return v.isSet } func (v *NullableSourceExternalS3) Unset() { v.value = nil v.isSet = false } func NewNullableSourceExternalS3(val *SourceExternalS3) *NullableSourceExternalS3 { return &NullableSourceExternalS3{value: val, isSet: true} } func (v NullableSourceExternalS3) MarshalJSON() ([]byte, error) { return json.Marshal(v.value) } func (v *NullableSourceExternalS3) UnmarshalJSON(src []byte) error { v.isSet = true return json.Unmarshal(src, &v.value) }