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

// UpdateVmRequest struct for UpdateVmRequest
type UpdateVmRequest struct {
	ActionsOnNextBoot *ActionsOnNextBoot `json:"ActionsOnNextBoot,omitempty"`
	// One or more block device mappings of the VM.
	BlockDeviceMappings *[]BlockDeviceMappingVmUpdate `json:"BlockDeviceMappings,omitempty"`
	// This parameter is not available. It is present in our API for the sake of historical compatibility with AWS.
	BsuOptimized *bool `json:"BsuOptimized,omitempty"`
	// If true, you cannot delete the VM unless you change this parameter back to false.
	DeletionProtection *bool `json:"DeletionProtection,omitempty"`
	// If true, checks whether you have the required permissions to perform the action.
	DryRun *bool `json:"DryRun,omitempty"`
	// (Net only) If true, the source/destination check is enabled. If false, it is disabled.
	IsSourceDestChecked *bool `json:"IsSourceDestChecked,omitempty"`
	// The name of a keypair you want to associate with the VM.<br /> When you replace the keypair of a VM with another one, the metadata of the VM is modified to reflect the new public key, but the replacement is still not effective in the operating system of the VM. To complete the replacement and effectively apply the new keypair, you need to perform other actions inside the VM. For more information, see [Modifying the Keypair of a VM](https://docs.outscale.com/en/userguide/Modifying-the-Keypair-of-a-VM.html).
	KeypairName *string `json:"KeypairName,omitempty"`
	// (dedicated tenancy only) If true, nested virtualization is enabled. If false, it is disabled.
	NestedVirtualization *bool `json:"NestedVirtualization,omitempty"`
	// The performance of the VM.
	Performance *string `json:"Performance,omitempty"`
	// One or more IDs of security groups for the VM.
	SecurityGroupIds *[]string `json:"SecurityGroupIds,omitempty"`
	// The Base64-encoded MIME user data, limited to 500 kibibytes (KiB).
	UserData *string `json:"UserData,omitempty"`
	// The ID of the VM.
	VmId string `json:"VmId"`
	// The VM behavior when you stop it. If set to `stop`, the VM stops. If set to `restart`, the VM stops then automatically restarts. If set to `terminate`, the VM stops and is terminated.
	VmInitiatedShutdownBehavior *string `json:"VmInitiatedShutdownBehavior,omitempty"`
	// The type of VM. For more information, see [VM Types](https://docs.outscale.com/en/userguide/VM-Types.html).
	VmType *string `json:"VmType,omitempty"`
}

// NewUpdateVmRequest instantiates a new UpdateVmRequest 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 NewUpdateVmRequest(vmId string) *UpdateVmRequest {
	this := UpdateVmRequest{}
	this.VmId = vmId
	return &this
}

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

// GetActionsOnNextBoot returns the ActionsOnNextBoot field value if set, zero value otherwise.
func (o *UpdateVmRequest) GetActionsOnNextBoot() ActionsOnNextBoot {
	if o == nil || o.ActionsOnNextBoot == nil {
		var ret ActionsOnNextBoot
		return ret
	}
	return *o.ActionsOnNextBoot
}

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

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

	return false
}

// SetActionsOnNextBoot gets a reference to the given ActionsOnNextBoot and assigns it to the ActionsOnNextBoot field.
func (o *UpdateVmRequest) SetActionsOnNextBoot(v ActionsOnNextBoot) {
	o.ActionsOnNextBoot = &v
}

// GetBlockDeviceMappings returns the BlockDeviceMappings field value if set, zero value otherwise.
func (o *UpdateVmRequest) GetBlockDeviceMappings() []BlockDeviceMappingVmUpdate {
	if o == nil || o.BlockDeviceMappings == nil {
		var ret []BlockDeviceMappingVmUpdate
		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 *UpdateVmRequest) GetBlockDeviceMappingsOk() (*[]BlockDeviceMappingVmUpdate, 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 *UpdateVmRequest) HasBlockDeviceMappings() bool {
	if o != nil && o.BlockDeviceMappings != nil {
		return true
	}

	return false
}

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

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

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

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

	return false
}

// SetBsuOptimized gets a reference to the given bool and assigns it to the BsuOptimized field.
func (o *UpdateVmRequest) SetBsuOptimized(v bool) {
	o.BsuOptimized = &v
}

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

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

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

	return false
}

// SetDeletionProtection gets a reference to the given bool and assigns it to the DeletionProtection field.
func (o *UpdateVmRequest) SetDeletionProtection(v bool) {
	o.DeletionProtection = &v
}

// GetDryRun returns the DryRun field value if set, zero value otherwise.
func (o *UpdateVmRequest) 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 *UpdateVmRequest) 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 *UpdateVmRequest) 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 *UpdateVmRequest) SetDryRun(v bool) {
	o.DryRun = &v
}

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

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

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

	return false
}

// SetIsSourceDestChecked gets a reference to the given bool and assigns it to the IsSourceDestChecked field.
func (o *UpdateVmRequest) SetIsSourceDestChecked(v bool) {
	o.IsSourceDestChecked = &v
}

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

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

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

	return false
}

// SetKeypairName gets a reference to the given string and assigns it to the KeypairName field.
func (o *UpdateVmRequest) SetKeypairName(v string) {
	o.KeypairName = &v
}

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

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

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

	return false
}

// SetNestedVirtualization gets a reference to the given bool and assigns it to the NestedVirtualization field.
func (o *UpdateVmRequest) SetNestedVirtualization(v bool) {
	o.NestedVirtualization = &v
}

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

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

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

	return false
}

// SetPerformance gets a reference to the given string and assigns it to the Performance field.
func (o *UpdateVmRequest) SetPerformance(v string) {
	o.Performance = &v
}

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

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

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

	return false
}

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

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

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

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

	return false
}

// SetUserData gets a reference to the given string and assigns it to the UserData field.
func (o *UpdateVmRequest) SetUserData(v string) {
	o.UserData = &v
}

// GetVmId returns the VmId field value
func (o *UpdateVmRequest) GetVmId() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.VmId
}

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

// SetVmId sets field value
func (o *UpdateVmRequest) SetVmId(v string) {
	o.VmId = v
}

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

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

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

	return false
}

// SetVmInitiatedShutdownBehavior gets a reference to the given string and assigns it to the VmInitiatedShutdownBehavior field.
func (o *UpdateVmRequest) SetVmInitiatedShutdownBehavior(v string) {
	o.VmInitiatedShutdownBehavior = &v
}

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

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

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

	return false
}

// SetVmType gets a reference to the given string and assigns it to the VmType field.
func (o *UpdateVmRequest) SetVmType(v string) {
	o.VmType = &v
}

func (o UpdateVmRequest) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.ActionsOnNextBoot != nil {
		toSerialize["ActionsOnNextBoot"] = o.ActionsOnNextBoot
	}
	if o.BlockDeviceMappings != nil {
		toSerialize["BlockDeviceMappings"] = o.BlockDeviceMappings
	}
	if o.BsuOptimized != nil {
		toSerialize["BsuOptimized"] = o.BsuOptimized
	}
	if o.DeletionProtection != nil {
		toSerialize["DeletionProtection"] = o.DeletionProtection
	}
	if o.DryRun != nil {
		toSerialize["DryRun"] = o.DryRun
	}
	if o.IsSourceDestChecked != nil {
		toSerialize["IsSourceDestChecked"] = o.IsSourceDestChecked
	}
	if o.KeypairName != nil {
		toSerialize["KeypairName"] = o.KeypairName
	}
	if o.NestedVirtualization != nil {
		toSerialize["NestedVirtualization"] = o.NestedVirtualization
	}
	if o.Performance != nil {
		toSerialize["Performance"] = o.Performance
	}
	if o.SecurityGroupIds != nil {
		toSerialize["SecurityGroupIds"] = o.SecurityGroupIds
	}
	if o.UserData != nil {
		toSerialize["UserData"] = o.UserData
	}
	if true {
		toSerialize["VmId"] = o.VmId
	}
	if o.VmInitiatedShutdownBehavior != nil {
		toSerialize["VmInitiatedShutdownBehavior"] = o.VmInitiatedShutdownBehavior
	}
	if o.VmType != nil {
		toSerialize["VmType"] = o.VmType
	}
	return json.Marshal(toSerialize)
}

type NullableUpdateVmRequest struct {
	value *UpdateVmRequest
	isSet bool
}

func (v NullableUpdateVmRequest) Get() *UpdateVmRequest {
	return v.value
}

func (v *NullableUpdateVmRequest) Set(val *UpdateVmRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableUpdateVmRequest(val *UpdateVmRequest) *NullableUpdateVmRequest {
	return &NullableUpdateVmRequest{value: val, isSet: true}
}

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

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