/*
 * 3DS OUTSCALE API
 *
 * Welcome to the OUTSCALE API documentation.<br /> The OUTSCALE API enables you to manage your resources in the OUTSCALE Cloud. This documentation describes the different actions available along with code examples.<br /><br /> Throttling: To protect against overloads, the number of identical requests allowed in a given time period is limited.<br /> Brute force: To protect against brute force attacks, the number of failed authentication attempts in a given time period is limited.<br /><br /> Note that the OUTSCALE Cloud is compatible with Amazon Web Services (AWS) APIs, but there are [differences in resource names](https://docs.outscale.com/en/userguide/About-the-APIs.html) between AWS and the OUTSCALE API.<br /> You can also manage your resources using the [Cockpit](https://docs.outscale.com/en/userguide/About-Cockpit.html) web interface.<br /><br /> An OpenAPI description of this API is also available for download: <button>[GitHub repository](https://github.com/outscale/osc-api)</button><br /> # Authentication Schemes ### Access Key/Secret Key The main way to authenticate your requests to the OUTSCALE API is to use an access key and a secret key.<br /> The mechanism behind this is based on AWS Signature Version 4, whose technical implementation details are described in [Signature of API Requests](https://docs.outscale.com/en/userguide/Signature-of-API-Requests.html).<br /><br /> In practice, the way to specify your access key and secret key depends on the tool or SDK you want to use to interact with the API.<br />  > For example, if you use OSC CLI: > 1. You need to create an **~/.osc/config.json** file to specify your access key, secret key, and the Region of your account. > 2. You then specify the `--profile` option when executing OSC CLI commands. > > For more information, see [Installing and Configuring OSC CLI](https://docs.outscale.com/en/userguide/Installing-and-Configuring-OSC-CLI.html).  See the code samples in each section of this documentation for specific examples in different programming languages.<br /> For more information about access keys, see [About Access Keys](https://docs.outscale.com/en/userguide/About-Access-Keys.html).  > If you try to sign requests with an invalid access key four times in a row, further authentication attempts will be prevented for 1 minute. This lockout time increases 1 minute every four failed attempts, for up to 10 minutes.  ### Login/Password For certain API actions, you can also use basic authentication with the login (email address) and password of your OUTSCALE account.<br /> This is useful only in special circumstances, for example if you do not know your access key/secret key and want to retrieve them programmatically.<br /> In most cases, however, you can use the Cockpit web interface to retrieve them.<br />  > For example, if you use OSC CLI: > 1. You need to create an **~/.osc/config.json** file to specify the Region of your account, but you leave the access key value and secret key value empty (`&quot;&quot;`). > 2. You then specify the `--profile`, `--authentication-method`, `--login`, and `--password` options when executing OSC CLI commands.  See the code samples in each section of this documentation for specific examples in different programming languages.  > If you try to sign requests with an invalid password four times in a row, further authentication attempts will be prevented for 1 minute. This lockout time increases 1 minute every four failed attempts, for up to 10 minutes.  ### No Authentication A few API actions do not require any authentication. They are indicated as such in this documentation.<br /> ### Other Security Mechanisms In parallel with the authentication schemes, you can add other security mechanisms to your OUTSCALE account, for example to restrict API requests by IP or other criteria.<br /> For more information, see [Managing Your API Accesses](https://docs.outscale.com/en/userguide/Managing-Your-API-Accesses.html). # Pagination Tutorial You can learn more about the pagination methods for read calls in the dedicated [pagination tutorial](https://docs.outscale.com/en/userguide/Tutorial-Paginating-an-API-Request.html). # Error Codes Reference You can learn more about errors returned by the API in the dedicated [errors page](api-errors.html).
 *
 * API version: 1.41.0
 * Contact: support@outscale.com
 */

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

package osc

import (
	"encoding/json"
)

// CreateImageRequest struct for CreateImageRequest
type CreateImageRequest struct {
	// **(when registering from a snapshot)** The architecture of the OMI (`i386` or `x86_64`). By default, set to `x86_64`.
	Architecture *string `json:"Architecture,omitempty"`
	// **(required when registering from a snapshot)** One or more block device mappings.
	BlockDeviceMappings *[]BlockDeviceMappingImage `json:"BlockDeviceMappings,omitempty"`
	// The boot modes compatible with the OMI.
	BootModes *[]BootMode `json:"BootModes,omitempty"`
	// A description for the new OMI.
	Description *string `json:"Description,omitempty"`
	// If true, checks whether you have the required permissions to perform the action.
	DryRun *bool `json:"DryRun,omitempty"`
	// **(required when registering from a bucket by using a manifest file)** The pre-signed URL of the manifest file for the OMI you want to register. For more information, see [Creating a Pre-signed URL](https://docs.outscale.com/en/userguide/Creating-a-Pre-Signed-URL.html).
	FileLocation *string `json:"FileLocation,omitempty"`
	// A unique name for the new OMI.<br /> Constraints: 3-128 alphanumeric characters, underscores (`_`), spaces (` `), parentheses (`()`), slashes (`/`), periods (`.`), or dashes (`-`).
	ImageName *string `json:"ImageName,omitempty"`
	// **(when creating from a VM)** If false, the VM shuts down before creating the OMI and then reboots. If true, the VM does not.
	NoReboot *bool `json:"NoReboot,omitempty"`
	// The product codes associated with the OMI.
	ProductCodes *[]string `json:"ProductCodes,omitempty"`
	// **(required when registering from a snapshot)** The name of the root device for the new OMI.
	RootDeviceName *string `json:"RootDeviceName,omitempty"`
	// **(required when copying an OMI)** The ID of the OMI you want to copy.
	SourceImageId *string `json:"SourceImageId,omitempty"`
	// **(required when copying an OMI)** The name of the source Region (always the same as the Region of your account).
	SourceRegionName *string `json:"SourceRegionName,omitempty"`
	// By default or if set to false, a virtual Trusted Platform Module (vTPM) is not mandatory on VMs created from this OMI. If true, VMs created from this OMI must have a vTPM enabled.
	TpmMandatory *bool `json:"TpmMandatory,omitempty"`
	// **(required when creating from a VM)** The ID of the VM from which you want to create the OMI.
	VmId *string `json:"VmId,omitempty"`
}

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

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

// GetArchitecture returns the Architecture field value if set, zero value otherwise.
func (o *CreateImageRequest) GetArchitecture() string {
	if o == nil || o.Architecture == nil {
		var ret string
		return ret
	}
	return *o.Architecture
}

// GetArchitectureOk returns a tuple with the Architecture field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateImageRequest) GetArchitectureOk() (*string, bool) {
	if o == nil || o.Architecture == nil {
		return nil, false
	}
	return o.Architecture, true
}

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

	return false
}

// SetArchitecture gets a reference to the given string and assigns it to the Architecture field.
func (o *CreateImageRequest) SetArchitecture(v string) {
	o.Architecture = &v
}

// GetBlockDeviceMappings returns the BlockDeviceMappings field value if set, zero value otherwise.
func (o *CreateImageRequest) GetBlockDeviceMappings() []BlockDeviceMappingImage {
	if o == nil || o.BlockDeviceMappings == nil {
		var ret []BlockDeviceMappingImage
		return ret
	}
	return *o.BlockDeviceMappings
}

// GetBlockDeviceMappingsOk returns a tuple with the BlockDeviceMappings field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateImageRequest) GetBlockDeviceMappingsOk() (*[]BlockDeviceMappingImage, bool) {
	if o == nil || o.BlockDeviceMappings == nil {
		return nil, false
	}
	return o.BlockDeviceMappings, true
}

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

	return false
}

// SetBlockDeviceMappings gets a reference to the given []BlockDeviceMappingImage and assigns it to the BlockDeviceMappings field.
func (o *CreateImageRequest) SetBlockDeviceMappings(v []BlockDeviceMappingImage) {
	o.BlockDeviceMappings = &v
}

// GetBootModes returns the BootModes field value if set, zero value otherwise.
func (o *CreateImageRequest) GetBootModes() []BootMode {
	if o == nil || o.BootModes == nil {
		var ret []BootMode
		return ret
	}
	return *o.BootModes
}

// GetBootModesOk returns a tuple with the BootModes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateImageRequest) GetBootModesOk() (*[]BootMode, bool) {
	if o == nil || o.BootModes == nil {
		return nil, false
	}
	return o.BootModes, true
}

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

	return false
}

// SetBootModes gets a reference to the given []BootMode and assigns it to the BootModes field.
func (o *CreateImageRequest) SetBootModes(v []BootMode) {
	o.BootModes = &v
}

// GetDescription returns the Description field value if set, zero value otherwise.
func (o *CreateImageRequest) GetDescription() string {
	if o == nil || o.Description == nil {
		var ret string
		return ret
	}
	return *o.Description
}

// GetDescriptionOk returns a tuple with the Description field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateImageRequest) GetDescriptionOk() (*string, bool) {
	if o == nil || o.Description == nil {
		return nil, false
	}
	return o.Description, true
}

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

	return false
}

// SetDescription gets a reference to the given string and assigns it to the Description field.
func (o *CreateImageRequest) SetDescription(v string) {
	o.Description = &v
}

// GetDryRun returns the DryRun field value if set, zero value otherwise.
func (o *CreateImageRequest) GetDryRun() bool {
	if o == nil || o.DryRun == nil {
		var ret bool
		return ret
	}
	return *o.DryRun
}

// GetDryRunOk returns a tuple with the DryRun field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateImageRequest) GetDryRunOk() (*bool, bool) {
	if o == nil || o.DryRun == nil {
		return nil, false
	}
	return o.DryRun, true
}

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

	return false
}

// SetDryRun gets a reference to the given bool and assigns it to the DryRun field.
func (o *CreateImageRequest) SetDryRun(v bool) {
	o.DryRun = &v
}

// GetFileLocation returns the FileLocation field value if set, zero value otherwise.
func (o *CreateImageRequest) GetFileLocation() string {
	if o == nil || o.FileLocation == nil {
		var ret string
		return ret
	}
	return *o.FileLocation
}

// GetFileLocationOk returns a tuple with the FileLocation field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateImageRequest) GetFileLocationOk() (*string, bool) {
	if o == nil || o.FileLocation == nil {
		return nil, false
	}
	return o.FileLocation, true
}

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

	return false
}

// SetFileLocation gets a reference to the given string and assigns it to the FileLocation field.
func (o *CreateImageRequest) SetFileLocation(v string) {
	o.FileLocation = &v
}

// GetImageName returns the ImageName field value if set, zero value otherwise.
func (o *CreateImageRequest) GetImageName() string {
	if o == nil || o.ImageName == nil {
		var ret string
		return ret
	}
	return *o.ImageName
}

// GetImageNameOk returns a tuple with the ImageName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateImageRequest) GetImageNameOk() (*string, bool) {
	if o == nil || o.ImageName == nil {
		return nil, false
	}
	return o.ImageName, true
}

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

	return false
}

// SetImageName gets a reference to the given string and assigns it to the ImageName field.
func (o *CreateImageRequest) SetImageName(v string) {
	o.ImageName = &v
}

// GetNoReboot returns the NoReboot field value if set, zero value otherwise.
func (o *CreateImageRequest) GetNoReboot() bool {
	if o == nil || o.NoReboot == nil {
		var ret bool
		return ret
	}
	return *o.NoReboot
}

// GetNoRebootOk returns a tuple with the NoReboot field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateImageRequest) GetNoRebootOk() (*bool, bool) {
	if o == nil || o.NoReboot == nil {
		return nil, false
	}
	return o.NoReboot, true
}

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

	return false
}

// SetNoReboot gets a reference to the given bool and assigns it to the NoReboot field.
func (o *CreateImageRequest) SetNoReboot(v bool) {
	o.NoReboot = &v
}

// GetProductCodes returns the ProductCodes field value if set, zero value otherwise.
func (o *CreateImageRequest) GetProductCodes() []string {
	if o == nil || o.ProductCodes == nil {
		var ret []string
		return ret
	}
	return *o.ProductCodes
}

// GetProductCodesOk returns a tuple with the ProductCodes field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateImageRequest) GetProductCodesOk() (*[]string, bool) {
	if o == nil || o.ProductCodes == nil {
		return nil, false
	}
	return o.ProductCodes, true
}

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

	return false
}

// SetProductCodes gets a reference to the given []string and assigns it to the ProductCodes field.
func (o *CreateImageRequest) SetProductCodes(v []string) {
	o.ProductCodes = &v
}

// GetRootDeviceName returns the RootDeviceName field value if set, zero value otherwise.
func (o *CreateImageRequest) GetRootDeviceName() string {
	if o == nil || o.RootDeviceName == nil {
		var ret string
		return ret
	}
	return *o.RootDeviceName
}

// GetRootDeviceNameOk returns a tuple with the RootDeviceName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateImageRequest) GetRootDeviceNameOk() (*string, bool) {
	if o == nil || o.RootDeviceName == nil {
		return nil, false
	}
	return o.RootDeviceName, true
}

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

	return false
}

// SetRootDeviceName gets a reference to the given string and assigns it to the RootDeviceName field.
func (o *CreateImageRequest) SetRootDeviceName(v string) {
	o.RootDeviceName = &v
}

// GetSourceImageId returns the SourceImageId field value if set, zero value otherwise.
func (o *CreateImageRequest) GetSourceImageId() string {
	if o == nil || o.SourceImageId == nil {
		var ret string
		return ret
	}
	return *o.SourceImageId
}

// GetSourceImageIdOk returns a tuple with the SourceImageId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateImageRequest) GetSourceImageIdOk() (*string, bool) {
	if o == nil || o.SourceImageId == nil {
		return nil, false
	}
	return o.SourceImageId, true
}

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

	return false
}

// SetSourceImageId gets a reference to the given string and assigns it to the SourceImageId field.
func (o *CreateImageRequest) SetSourceImageId(v string) {
	o.SourceImageId = &v
}

// GetSourceRegionName returns the SourceRegionName field value if set, zero value otherwise.
func (o *CreateImageRequest) GetSourceRegionName() string {
	if o == nil || o.SourceRegionName == nil {
		var ret string
		return ret
	}
	return *o.SourceRegionName
}

// GetSourceRegionNameOk returns a tuple with the SourceRegionName field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateImageRequest) GetSourceRegionNameOk() (*string, bool) {
	if o == nil || o.SourceRegionName == nil {
		return nil, false
	}
	return o.SourceRegionName, true
}

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

	return false
}

// SetSourceRegionName gets a reference to the given string and assigns it to the SourceRegionName field.
func (o *CreateImageRequest) SetSourceRegionName(v string) {
	o.SourceRegionName = &v
}

// GetTpmMandatory returns the TpmMandatory field value if set, zero value otherwise.
func (o *CreateImageRequest) GetTpmMandatory() bool {
	if o == nil || o.TpmMandatory == nil {
		var ret bool
		return ret
	}
	return *o.TpmMandatory
}

// GetTpmMandatoryOk returns a tuple with the TpmMandatory field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateImageRequest) GetTpmMandatoryOk() (*bool, bool) {
	if o == nil || o.TpmMandatory == nil {
		return nil, false
	}
	return o.TpmMandatory, true
}

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

	return false
}

// SetTpmMandatory gets a reference to the given bool and assigns it to the TpmMandatory field.
func (o *CreateImageRequest) SetTpmMandatory(v bool) {
	o.TpmMandatory = &v
}

// GetVmId returns the VmId field value if set, zero value otherwise.
func (o *CreateImageRequest) GetVmId() string {
	if o == nil || o.VmId == nil {
		var ret string
		return ret
	}
	return *o.VmId
}

// GetVmIdOk returns a tuple with the VmId field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *CreateImageRequest) GetVmIdOk() (*string, bool) {
	if o == nil || o.VmId == nil {
		return nil, false
	}
	return o.VmId, true
}

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

	return false
}

// SetVmId gets a reference to the given string and assigns it to the VmId field.
func (o *CreateImageRequest) SetVmId(v string) {
	o.VmId = &v
}

func (o CreateImageRequest) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.Architecture != nil {
		toSerialize["Architecture"] = o.Architecture
	}
	if o.BlockDeviceMappings != nil {
		toSerialize["BlockDeviceMappings"] = o.BlockDeviceMappings
	}
	if o.BootModes != nil {
		toSerialize["BootModes"] = o.BootModes
	}
	if o.Description != nil {
		toSerialize["Description"] = o.Description
	}
	if o.DryRun != nil {
		toSerialize["DryRun"] = o.DryRun
	}
	if o.FileLocation != nil {
		toSerialize["FileLocation"] = o.FileLocation
	}
	if o.ImageName != nil {
		toSerialize["ImageName"] = o.ImageName
	}
	if o.NoReboot != nil {
		toSerialize["NoReboot"] = o.NoReboot
	}
	if o.ProductCodes != nil {
		toSerialize["ProductCodes"] = o.ProductCodes
	}
	if o.RootDeviceName != nil {
		toSerialize["RootDeviceName"] = o.RootDeviceName
	}
	if o.SourceImageId != nil {
		toSerialize["SourceImageId"] = o.SourceImageId
	}
	if o.SourceRegionName != nil {
		toSerialize["SourceRegionName"] = o.SourceRegionName
	}
	if o.TpmMandatory != nil {
		toSerialize["TpmMandatory"] = o.TpmMandatory
	}
	if o.VmId != nil {
		toSerialize["VmId"] = o.VmId
	}
	return json.Marshal(toSerialize)
}

type NullableCreateImageRequest struct {
	value *CreateImageRequest
	isSet bool
}

func (v NullableCreateImageRequest) Get() *CreateImageRequest {
	return v.value
}

func (v *NullableCreateImageRequest) Set(val *CreateImageRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableCreateImageRequest(val *CreateImageRequest) *NullableCreateImageRequest {
	return &NullableCreateImageRequest{value: val, isSet: true}
}

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

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