/*
 * 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"
	"time"
)

import "encoding/xml"

// MultipartUpload Container for the `MultipartUpload` for the IONOS Object Storage object.
type MultipartUpload struct {
	XMLName xml.Name `xml:"MultipartUpload"`
	// ID of the multipart upload.
	UploadId *string `json:"UploadId,omitempty" xml:"UploadId"`
	// The object key.
	Key *string `json:"Key,omitempty" xml:"Key"`
	// Date and time at which the multipart upload was initiated.
	Initiated    *IonosTime    `json:"Initiated,omitempty" xml:"Initiated"`
	StorageClass *StorageClass `json:"StorageClass,omitempty" xml:"StorageClass"`
	Owner        *Owner        `json:"Owner,omitempty" xml:"Owner"`
	Initiator    *Initiator    `json:"Initiator,omitempty" xml:"Initiator"`
}

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

	return &this
}

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

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

	return o.UploadId

}

// GetUploadIdOk returns a tuple with the UploadId 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 *MultipartUpload) GetUploadIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}

	return o.UploadId, true
}

// SetUploadId sets field value
func (o *MultipartUpload) SetUploadId(v string) {

	o.UploadId = &v

}

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

	return false
}

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

	return o.Key

}

// GetKeyOk returns a tuple with the Key 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 *MultipartUpload) GetKeyOk() (*string, bool) {
	if o == nil {
		return nil, false
	}

	return o.Key, true
}

// SetKey sets field value
func (o *MultipartUpload) SetKey(v string) {

	o.Key = &v

}

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

	return false
}

// GetInitiated returns the Initiated field value
// If the value is explicit nil, the zero value for time.Time will be returned
func (o *MultipartUpload) GetInitiated() *time.Time {
	if o == nil {
		return nil
	}

	if o.Initiated == nil {
		return nil
	}
	return &o.Initiated.Time

}

// GetInitiatedOk returns a tuple with the Initiated 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 *MultipartUpload) GetInitiatedOk() (*time.Time, bool) {
	if o == nil {
		return nil, false
	}

	if o.Initiated == nil {
		return nil, false
	}
	return &o.Initiated.Time, true

}

// SetInitiated sets field value
func (o *MultipartUpload) SetInitiated(v time.Time) {

	o.Initiated = &IonosTime{v}

}

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

	return false
}

// GetStorageClass returns the StorageClass field value
// If the value is explicit nil, the zero value for StorageClass will be returned
func (o *MultipartUpload) GetStorageClass() *StorageClass {
	if o == nil {
		return nil
	}

	return o.StorageClass

}

// GetStorageClassOk returns a tuple with the StorageClass 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 *MultipartUpload) GetStorageClassOk() (*StorageClass, bool) {
	if o == nil {
		return nil, false
	}

	return o.StorageClass, true
}

// SetStorageClass sets field value
func (o *MultipartUpload) SetStorageClass(v StorageClass) {

	o.StorageClass = &v

}

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

	return false
}

// GetOwner returns the Owner field value
// If the value is explicit nil, the zero value for Owner will be returned
func (o *MultipartUpload) GetOwner() *Owner {
	if o == nil {
		return nil
	}

	return o.Owner

}

// GetOwnerOk returns a tuple with the Owner 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 *MultipartUpload) GetOwnerOk() (*Owner, bool) {
	if o == nil {
		return nil, false
	}

	return o.Owner, true
}

// SetOwner sets field value
func (o *MultipartUpload) SetOwner(v Owner) {

	o.Owner = &v

}

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

	return false
}

// GetInitiator returns the Initiator field value
// If the value is explicit nil, the zero value for Initiator will be returned
func (o *MultipartUpload) GetInitiator() *Initiator {
	if o == nil {
		return nil
	}

	return o.Initiator

}

// GetInitiatorOk returns a tuple with the Initiator 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 *MultipartUpload) GetInitiatorOk() (*Initiator, bool) {
	if o == nil {
		return nil, false
	}

	return o.Initiator, true
}

// SetInitiator sets field value
func (o *MultipartUpload) SetInitiator(v Initiator) {

	o.Initiator = &v

}

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

	return false
}

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

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

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

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

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

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

	return json.Marshal(toSerialize)
}

type NullableMultipartUpload struct {
	value *MultipartUpload
	isSet bool
}

func (v NullableMultipartUpload) Get() *MultipartUpload {
	return v.value
}

func (v *NullableMultipartUpload) Set(val *MultipartUpload) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableMultipartUpload(val *MultipartUpload) *NullableMultipartUpload {
	return &NullableMultipartUpload{value: val, isSet: true}
}

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

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