/*
 * IONOS Object Storage API for contract-owned buckets
 *
 * ## Overview The IONOS Object Storage API for contract-owned buckets is a REST-based API that allows developers and applications to interact directly with IONOS' scalable storage solution, leveraging the S3 protocol for object storage operations. Its design ensures seamless compatibility with existing tools and libraries tailored for S3 systems.  ### API References - [S3 API Reference for contract-owned buckets](https://api.ionos.com/docs/s3-contract-owned-buckets/v2/) ### User documentation [IONOS Object Storage User Guide](https://docs.ionos.com/cloud/managed-services/s3-object-storage) * [Documentation on user-owned and contract-owned buckets](https://docs.ionos.com/cloud/managed-services/s3-object-storage/concepts/buckets) * [Documentation on S3 API Compatibility](https://docs.ionos.com/cloud/managed-services/s3-object-storage/concepts/s3-api-compatibility) * [S3 Tools](https://docs.ionos.com/cloud/managed-services/s3-object-storage/s3-tools)  ## Endpoints for contract-owned buckets | Location | Region Name | Bucket Type | Endpoint | | --- | --- | --- | --- | | **Berlin, Germany** | **eu-central-3** | Contract-owned | `https://s3.eu-central-3.ionoscloud.com` |  ## Changelog - 30.05.2024 Initial version
 *
 * API version: 2.0.2
 * Contact: support@cloud.ionos.com
 */

// Code generated by OpenAPI Generator (https://openapi-generator.tech); DO NOT EDIT.

package ionoscloud

import (
	"encoding/json"
)

import "encoding/xml"

// Error Container for all error elements.
type Error struct {
	XMLName xml.Name `xml:"Error"`
	// The error code is a string that uniquely identifies an error condition. It is meant to be read and understood by programs that detect and handle errors by type.  ## IONOS Object Storage error codes - AccessDenied   - Description: Access Denied   - HTTPStatus Code: 403 Forbidden - AccountProblem   - Description: There is a problem with your IONOS Object Storage account that prevents the operation from completing successfully. Contact IONOS for further assistance.   - HTTP Status Code: 403 Forbidden - AmbiguousGrantByEmailAddress   - Description: The email address you provided is associated with more than one account.   - HTTP Status Code: 400 Bad Request - BadDigest   - Description: The Content-MD5 you specified did not match what we received.   - HTTP Status Code: 400 Bad Request - BucketAlreadyExists   - Description: The requested bucket name is not available. The bucket namespace is shared by all users of the system. Please select a different name and try again.   - HTTP Status Code: 409 Conflict - BucketAlreadyOwnedByYou   - Description: The bucket you tried to create already exists, and you own it.   - HTTP Code: 409 Conflict - BucketNotEmpty   - Description: The bucket you tried to delete is not empty.   - HTTP Status Code: 409 Conflict - CrossLocationLoggingProhibited   - Description: Cross-location logging not allowed. Buckets in one geographic location cannot log information to a bucket in another location.   - HTTP Status Code: 403 Forbidden - EntityTooSmall   - Description: Your proposed upload is smaller than the minimum allowed object size.   - HTTP Status Code: 400 Bad Request - EntityTooLarge   - Description: Your proposed upload exceeds the maximum allowed object size.   - HTTP Status Code: 400 Bad Request - IllegalVersioningConfigurationException   - Description: Indicates that the versioning configuration specified in the request is invalid.   - HTTP Status Code: 400 Bad Request - IncorrectNumberOfFilesInPostRequest   - Description: POST requires exactly one file upload per request.   - HTTP Status Code: 400 Bad Request - InternalError   - Description: We encountered an internal error. Please try again.   - HTTP Status Code: 500 Internal Server Error  - InvalidAccessKeyId   - Description: The IONOS Object Storage access key ID you provided does not exist in our records.   - HTTP Status Code: 403 Forbidden - InvalidArgument   - Description: Invalid Argument   - HTTP Status Code: 400 Bad Request - InvalidBucketName   - Description: The specified bucket is not valid.   - HTTP Status Code: 400 Bad Request - InvalidBucketState   - Description: The request is not valid with the current state of the bucket.   - HTTP Status Code: 409 Conflict - InvalidDigest   - Description: The Content-MD5 you specified is not valid.   - HTTP Status Code: 400 Bad Request - InvalidEncryptionAlgorithmError   - Description: The encryption request you specified is not valid. The valid value is AES256.   - HTTP Status Code: 400 Bad Request - InvalidLocationConstraint   - HTTP Status Code: 400 Bad Request - InvalidObjectState   - Description: The operation is not valid for the current state of the object.   - HTTP Status Code: 403 Forbidden - InvalidPart   - Description: One or more of the specified parts could not be found. The part might not have been uploaded, or the specified entity tag might not have matched the part's entity tag.   - HTTP Status Code: 400 Bad Request - InvalidPartOrder   - Description: The list of parts was not in ascending order. Parts list must be specified in order by part number.   - HTTP Status Code: 400 Bad Request - InvalidPolicyDocument   - Description: The content of the form does not meet the conditions specified in the policy document.   - HTTP Status Code: 400 Bad Request - InvalidRange   - Description: The requested range cannot be satisfied.   - HTTP Status Code: 416 Requested Range Not Satisfiable - InvalidRequest   - Description: Please use `AWS4-HMAC-SHA256`.   - HTTP Status Code: 400 Bad Request - InvalidSecurity   - Description: The provided security credentials are not valid.   - HTTP Status Code: 403 Forbidden - InvalidTargetBucketForLogging   - Description: The target bucket for logging does not exist, is not owned by you, or does not have the appropriate grants for the log-delivery group.   - Status Code: 400 Bad Request - InvalidURI   - Description: Couldn't parse the specified URI.   - HTTP Status Code: 400 Bad Request - KeyTooLong   - Description: Your key is too long.   - HTTP Status Code: 400 Bad Request - MalformedACLError   - Description: The XML you provided was not well-formed or did not validate against our published schema.   - HTTP Status Code: 400 Bad Request - MalformedPOSTRequest   - Description: The body of your POST request is not well-formed multipart/form-data.   - HTTP Status Code: 400 Bad Request - MalformedXML   - Description: This happens when the user sends malformed XML (XML that doesn't conform to the published XSD) for the configuration. The error message is, \"The XML you provided was not well-formed or did not validate against our published schema.\"   - HTTP Status Code: 400 Bad Request - MaxMessageLengthExceeded   - Description: Your request was too big.   - HTTP Status Code: 400 Bad Request - MaxPostPreDataLengthExceededError   - Description: Your POST request fields preceding the upload file were too large.   - HTTP Status Code: 400 Bad Request - MetadataTooLarge   - Description: Your metadata headers exceed the maximum allowed metadata size.   - HTTP Status Code: 400 Bad Request - MethodNotAllowed   - Description: The specified method is not allowed against this resource.   - HTTP Status Code: 405 Method Not Allowed - MissingContentLength   - Description: You must provide the Content-Length HTTP header.   - HTTP Status Code: 411 Length Required - MissingSecurityHeader   - Description: Your request is missing a required header.   - HTTP Status Code: 400 Bad Request - NoSuchBucket   - Description: The specified bucket does not exist.   - HTTP Status Code: 404 Not Found - NoSuchBucketPolicy   - Description: The specified bucket does not have a bucket policy.   - HTTP Status Code: 404 Not Found - NoSuchKey   - Description: The specified key does not exist.   - HTTP Status Code:404 Not Found - NoSuchLifecycleConfiguration   - Description: The lifecycle configuration does not exist.   - HTTP Status Code: 404 Not Found - NoSuchReplicationConfiguration   - Description: The replication configuration does not exist.   - HTTP Status Code: 404 Not Found - NoSuchUpload   - Description: The specified multipart upload does not exist. The upload ID might be invalid, or the multipart upload might have been aborted or completed.   - HTTP Status Code: 404 Not Found - NoSuchVersion   - Description: Indicates that the version ID specified in the request does not match an existing version.   - HTTP Status Code: 404 Not Found - NotImplemented   - Description: A header you provided implies functionality that is not implemented.   - HTTP Status Code: 501 Not Implemented - PermanentRedirect   - Description: The bucket you are attempting to access must be addressed using the specified endpoint. Send all future requests to this endpoint.   - HTTP Status Code: 301 Moved Permanently - PreconditionFailed   - Description: At least one of the preconditions you specified did not hold.   - HTTP Status Code: 412 Precondition Failed - Redirect   - Description: Temporary redirect.   - HTTP Status Code: 307 Moved Temporarily - RestoreAlreadyInProgress   - Description: Object restore is already in progress.   - HTTP Status Code: 409 Conflict - RequestIsNotMultiPartContent   - Description: Bucket POST must be of the enclosure-type multipart/form-data.   - HTTP Status Code: 400 Bad Request - RequestTimeout   - Description: Your socket connection to the server was not read from or written to within the timeout period.   - HTTP Status Code: 400 Bad Request - RequestTimeTooSkewed   - Description: The difference between the request time and the server's time is too large.   - HTTP Status Code: 403 Forbidden - SignatureDoesNotMatch   - HTTP Status Code: 403 Forbidden - ServiceUnavailable   - Description: Reduce your request rate.   - HTTP Status Code: 503 Service Unavailable - SlowDown   - Description: Reduce your request rate.   - HTTP Status Code: 503 Slow Down - TemporaryRedirect   - Description: You are being redirected to the bucket while DNS updates.   - HTTP Status Code: 307 Moved Temporarily - TooManyBuckets   - Description: You have attempted to create more buckets than allowed.   - HTTP Status Code: 400 Bad Request - UnexpectedContent   - Description: This request does not support content.   - HTTP Status Code: 400 Bad Request - UnresolvableGrantByEmailAddress   - Description: The email address you provided does not match any account on record.   - HTTP Status Code: 400 Bad Request - UserKeyMustBeSpecified   - Description: The bucket POST must contain the specified field name. If it is specified, check the order of the fields.   - HTTP Status Code: 400 Bad Request
	Code *string `json:"Code,omitempty" xml:"Code"`
	// Gives a brief English description of the issue.
	Message   *string `json:"Message,omitempty" xml:"Message"`
	RequestId *string `json:"RequestId,omitempty" xml:"RequestId"`
	HostId    *string `json:"HostId,omitempty" xml:"HostId"`
}

// NewError instantiates a new Error 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 NewError() *Error {
	this := Error{}

	return &this
}

// NewErrorWithDefaults instantiates a new Error 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 NewErrorWithDefaults() *Error {
	this := Error{}
	return &this
}

// GetCode returns the Code field value
// If the value is explicit nil, the zero value for string will be returned
func (o *Error) GetCode() *string {
	if o == nil {
		return nil
	}

	return o.Code

}

// GetCodeOk returns a tuple with the Code field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *Error) GetCodeOk() (*string, bool) {
	if o == nil {
		return nil, false
	}

	return o.Code, true
}

// SetCode sets field value
func (o *Error) SetCode(v string) {

	o.Code = &v

}

// HasCode returns a boolean if a field has been set.
func (o *Error) HasCode() bool {
	if o != nil && o.Code != nil {
		return true
	}

	return false
}

// GetMessage returns the Message field value
// If the value is explicit nil, the zero value for string will be returned
func (o *Error) GetMessage() *string {
	if o == nil {
		return nil
	}

	return o.Message

}

// GetMessageOk returns a tuple with the Message field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *Error) GetMessageOk() (*string, bool) {
	if o == nil {
		return nil, false
	}

	return o.Message, true
}

// SetMessage sets field value
func (o *Error) SetMessage(v string) {

	o.Message = &v

}

// HasMessage returns a boolean if a field has been set.
func (o *Error) HasMessage() bool {
	if o != nil && o.Message != nil {
		return true
	}

	return false
}

// GetRequestId returns the RequestId field value
// If the value is explicit nil, the zero value for string will be returned
func (o *Error) GetRequestId() *string {
	if o == nil {
		return nil
	}

	return o.RequestId

}

// GetRequestIdOk returns a tuple with the RequestId field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *Error) GetRequestIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}

	return o.RequestId, true
}

// SetRequestId sets field value
func (o *Error) SetRequestId(v string) {

	o.RequestId = &v

}

// HasRequestId returns a boolean if a field has been set.
func (o *Error) HasRequestId() bool {
	if o != nil && o.RequestId != nil {
		return true
	}

	return false
}

// GetHostId returns the HostId field value
// If the value is explicit nil, the zero value for string will be returned
func (o *Error) GetHostId() *string {
	if o == nil {
		return nil
	}

	return o.HostId

}

// GetHostIdOk returns a tuple with the HostId field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *Error) GetHostIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}

	return o.HostId, true
}

// SetHostId sets field value
func (o *Error) SetHostId(v string) {

	o.HostId = &v

}

// HasHostId returns a boolean if a field has been set.
func (o *Error) HasHostId() bool {
	if o != nil && o.HostId != nil {
		return true
	}

	return false
}

func (o Error) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.Code != nil {
		toSerialize["Code"] = o.Code
	}

	if o.Message != nil {
		toSerialize["Message"] = o.Message
	}

	if o.RequestId != nil {
		toSerialize["RequestId"] = o.RequestId
	}

	if o.HostId != nil {
		toSerialize["HostId"] = o.HostId
	}

	return json.Marshal(toSerialize)
}

type NullableError struct {
	value *Error
	isSet bool
}

func (v NullableError) Get() *Error {
	return v.value
}

func (v *NullableError) Set(val *Error) {
	v.value = val
	v.isSet = true
}

func (v NullableError) IsSet() bool {
	return v.isSet
}

func (v *NullableError) Unset() {
	v.value = nil
	v.isSet = false
}

func NewNullableError(val *Error) *NullableError {
	return &NullableError{value: val, isSet: true}
}

func (v NullableError) MarshalJSON() ([]byte, error) {
	return json.Marshal(v.value)
}

func (v *NullableError) UnmarshalJSON(src []byte) error {
	v.isSet = true
	return json.Unmarshal(src, &v.value)
}
