terraform-provider-stackitp.../pkg/sfsbeta/model_validation_error.go

267 lines
8.5 KiB
Go

/*
STACKIT File Storage (SFS)
API used to create and manage NFS Shares.
API version: 1beta.0.0
*/
// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.
package sfsbeta
import (
"encoding/json"
)
// checks if the ValidationError type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &ValidationError{}
/*
types and functions for error_description
*/
// isAny
type ValidationErrorGetErrorDescriptionAttributeType = any
type ValidationErrorGetErrorDescriptionArgType = any
type ValidationErrorGetErrorDescriptionRetType = any
func getValidationErrorGetErrorDescriptionAttributeTypeOk(arg ValidationErrorGetErrorDescriptionAttributeType) (ret ValidationErrorGetErrorDescriptionRetType, ok bool) {
if arg == nil {
return nil, false
}
return arg, true
}
func setValidationErrorGetErrorDescriptionAttributeType(arg *ValidationErrorGetErrorDescriptionAttributeType, val ValidationErrorGetErrorDescriptionRetType) {
*arg = val
}
/*
types and functions for title
*/
// isNotNullableString
type ValidationErrorGetTitleAttributeType = *string
func getValidationErrorGetTitleAttributeTypeOk(arg ValidationErrorGetTitleAttributeType) (ret ValidationErrorGetTitleRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setValidationErrorGetTitleAttributeType(arg *ValidationErrorGetTitleAttributeType, val ValidationErrorGetTitleRetType) {
*arg = &val
}
type ValidationErrorGetTitleArgType = string
type ValidationErrorGetTitleRetType = string
/*
types and functions for type
*/
// isNotNullableString
type ValidationErrorGetTypeAttributeType = *string
func getValidationErrorGetTypeAttributeTypeOk(arg ValidationErrorGetTypeAttributeType) (ret ValidationErrorGetTypeRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setValidationErrorGetTypeAttributeType(arg *ValidationErrorGetTypeAttributeType, val ValidationErrorGetTypeRetType) {
*arg = &val
}
type ValidationErrorGetTypeArgType = string
type ValidationErrorGetTypeRetType = string
/*
types and functions for fields
*/
// isArray
type ValidationErrorGetFieldsAttributeType = *[]ValidationErrorField
type ValidationErrorGetFieldsArgType = []ValidationErrorField
type ValidationErrorGetFieldsRetType = []ValidationErrorField
func getValidationErrorGetFieldsAttributeTypeOk(arg ValidationErrorGetFieldsAttributeType) (ret ValidationErrorGetFieldsRetType, ok bool) {
if arg == nil {
return ret, false
}
return *arg, true
}
func setValidationErrorGetFieldsAttributeType(arg *ValidationErrorGetFieldsAttributeType, val ValidationErrorGetFieldsRetType) {
*arg = &val
}
// ValidationError struct for ValidationError
type ValidationError struct {
// Deprecated: Human-readable string of the error that occured
ErrorDescription ValidationErrorGetErrorDescriptionAttributeType `json:"error_description,omitempty"`
// Human-readable description of the error that occurred.
// REQUIRED
Title ValidationErrorGetTitleAttributeType `json:"title" required:"true"`
// URI Uniquely identifies the error type. It will be in the format of storage.stackit.cloud/<error-type> e.g. storage.stackit.cloud/validation-error
// REQUIRED
Type ValidationErrorGetTypeAttributeType `json:"type" required:"true"`
// REQUIRED
Fields ValidationErrorGetFieldsAttributeType `json:"fields" required:"true"`
}
type _ValidationError ValidationError
// NewValidationError instantiates a new ValidationError 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 NewValidationError(title ValidationErrorGetTitleArgType, types ValidationErrorGetTypeArgType, fields ValidationErrorGetFieldsArgType) *ValidationError {
this := ValidationError{}
setValidationErrorGetTitleAttributeType(&this.Title, title)
setValidationErrorGetTypeAttributeType(&this.Type, types)
setValidationErrorGetFieldsAttributeType(&this.Fields, fields)
return &this
}
// NewValidationErrorWithDefaults instantiates a new ValidationError 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 NewValidationErrorWithDefaults() *ValidationError {
this := ValidationError{}
return &this
}
// GetErrorDescription returns the ErrorDescription field value if set, zero value otherwise (both if not set or set to explicit null).
// Deprecated
func (o *ValidationError) GetErrorDescription() (res ValidationErrorGetErrorDescriptionRetType) {
res, _ = o.GetErrorDescriptionOk()
return
}
// GetErrorDescriptionOk returns a tuple with the ErrorDescription field value if set, nil otherwise
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
// Deprecated
func (o *ValidationError) GetErrorDescriptionOk() (ret ValidationErrorGetErrorDescriptionRetType, ok bool) {
return getValidationErrorGetErrorDescriptionAttributeTypeOk(o.ErrorDescription)
}
// HasErrorDescription returns a boolean if a field has been set.
func (o *ValidationError) HasErrorDescription() bool {
_, ok := o.GetErrorDescriptionOk()
return ok
}
// SetErrorDescription gets a reference to the given interface{} and assigns it to the ErrorDescription field.
// Deprecated
func (o *ValidationError) SetErrorDescription(v ValidationErrorGetErrorDescriptionRetType) {
setValidationErrorGetErrorDescriptionAttributeType(&o.ErrorDescription, v)
}
// GetTitle returns the Title field value
func (o *ValidationError) GetTitle() (ret ValidationErrorGetTitleRetType) {
ret, _ = o.GetTitleOk()
return ret
}
// GetTitleOk returns a tuple with the Title field value
// and a boolean to check if the value has been set.
func (o *ValidationError) GetTitleOk() (ret ValidationErrorGetTitleRetType, ok bool) {
return getValidationErrorGetTitleAttributeTypeOk(o.Title)
}
// SetTitle sets field value
func (o *ValidationError) SetTitle(v ValidationErrorGetTitleRetType) {
setValidationErrorGetTitleAttributeType(&o.Title, v)
}
// GetType returns the Type field value
func (o *ValidationError) GetType() (ret ValidationErrorGetTypeRetType) {
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 *ValidationError) GetTypeOk() (ret ValidationErrorGetTypeRetType, ok bool) {
return getValidationErrorGetTypeAttributeTypeOk(o.Type)
}
// SetType sets field value
func (o *ValidationError) SetType(v ValidationErrorGetTypeRetType) {
setValidationErrorGetTypeAttributeType(&o.Type, v)
}
// GetFields returns the Fields field value
func (o *ValidationError) GetFields() (ret ValidationErrorGetFieldsRetType) {
ret, _ = o.GetFieldsOk()
return ret
}
// GetFieldsOk returns a tuple with the Fields field value
// and a boolean to check if the value has been set.
func (o *ValidationError) GetFieldsOk() (ret ValidationErrorGetFieldsRetType, ok bool) {
return getValidationErrorGetFieldsAttributeTypeOk(o.Fields)
}
// SetFields sets field value
func (o *ValidationError) SetFields(v ValidationErrorGetFieldsRetType) {
setValidationErrorGetFieldsAttributeType(&o.Fields, v)
}
func (o ValidationError) ToMap() (map[string]interface{}, error) {
toSerialize := map[string]interface{}{}
if val, ok := getValidationErrorGetErrorDescriptionAttributeTypeOk(o.ErrorDescription); ok {
toSerialize["ErrorDescription"] = val
}
if val, ok := getValidationErrorGetTitleAttributeTypeOk(o.Title); ok {
toSerialize["Title"] = val
}
if val, ok := getValidationErrorGetTypeAttributeTypeOk(o.Type); ok {
toSerialize["Type"] = val
}
if val, ok := getValidationErrorGetFieldsAttributeTypeOk(o.Fields); ok {
toSerialize["Fields"] = val
}
return toSerialize, nil
}
type NullableValidationError struct {
value *ValidationError
isSet bool
}
func (v NullableValidationError) Get() *ValidationError {
return v.value
}
func (v *NullableValidationError) Set(val *ValidationError) {
v.value = val
v.isSet = true
}
func (v NullableValidationError) IsSet() bool {
return v.isSet
}
func (v *NullableValidationError) Unset() {
v.value = nil
v.isSet = false
}
func NewNullableValidationError(val *ValidationError) *NullableValidationError {
return &NullableValidationError{value: val, isSet: true}
}
func (v NullableValidationError) MarshalJSON() ([]byte, error) {
return json.Marshal(v.value)
}
func (v *NullableValidationError) UnmarshalJSON(src []byte) error {
v.isSet = true
return json.Unmarshal(src, &v.value)
}