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

// PublicIp Information about the public IP.
type PublicIp struct {
	// (Required in a Net) The ID representing the association of the public IP with the VM or the NIC.
	LinkPublicIpId *string `json:"LinkPublicIpId,omitempty"`
	// The ID of the NAT service associated with the public IP (if any).
	NatServiceId NullableString `json:"NatServiceId,omitempty"`
	// The IDs of the Net access points associated with the public IP (if any).
	NetAccessPointIds []string `json:"NetAccessPointIds,omitempty"`
	// The OUTSCALE account ID of the owner of the NIC.
	NicAccountId NullableString `json:"NicAccountId,omitempty"`
	// The ID of the NIC the public IP is associated with (if any).
	NicId NullableString `json:"NicId,omitempty"`
	// The private IP associated with the NIC or load balancer.
	PrivateIp NullableString `json:"PrivateIp,omitempty"`
	// The public IP.
	PublicIp *string `json:"PublicIp,omitempty"`
	// The allocation ID of the public IP.
	PublicIpId *string `json:"PublicIpId,omitempty"`
	// One or more tags associated with the public IP.
	Tags *[]ResourceTag `json:"Tags,omitempty"`
	// The ID of the VM the public IP is associated with (if any).
	VmId NullableString `json:"VmId,omitempty"`
}

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

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

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

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

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

	return false
}

// SetLinkPublicIpId gets a reference to the given string and assigns it to the LinkPublicIpId field.
func (o *PublicIp) SetLinkPublicIpId(v string) {
	o.LinkPublicIpId = &v
}

// GetNatServiceId returns the NatServiceId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PublicIp) GetNatServiceId() string {
	if o == nil || o.NatServiceId.Get() == nil {
		var ret string
		return ret
	}
	return *o.NatServiceId.Get()
}

// GetNatServiceIdOk returns a tuple with the NatServiceId 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
func (o *PublicIp) GetNatServiceIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.NatServiceId.Get(), o.NatServiceId.IsSet()
}

// HasNatServiceId returns a boolean if a field has been set.
func (o *PublicIp) HasNatServiceId() bool {
	if o != nil && o.NatServiceId.IsSet() {
		return true
	}

	return false
}

// SetNatServiceId gets a reference to the given NullableString and assigns it to the NatServiceId field.
func (o *PublicIp) SetNatServiceId(v string) {
	o.NatServiceId.Set(&v)
}

// SetNatServiceIdNil sets the value for NatServiceId to be an explicit nil
func (o *PublicIp) SetNatServiceIdNil() {
	o.NatServiceId.Set(nil)
}

// UnsetNatServiceId ensures that no value is present for NatServiceId, not even an explicit nil
func (o *PublicIp) UnsetNatServiceId() {
	o.NatServiceId.Unset()
}

// GetNetAccessPointIds returns the NetAccessPointIds field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PublicIp) GetNetAccessPointIds() []string {
	if o == nil {
		var ret []string
		return ret
	}
	return o.NetAccessPointIds
}

// GetNetAccessPointIdsOk returns a tuple with the NetAccessPointIds 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
func (o *PublicIp) GetNetAccessPointIdsOk() (*[]string, bool) {
	if o == nil || o.NetAccessPointIds == nil {
		return nil, false
	}
	return &o.NetAccessPointIds, true
}

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

	return false
}

// SetNetAccessPointIds gets a reference to the given []string and assigns it to the NetAccessPointIds field.
func (o *PublicIp) SetNetAccessPointIds(v []string) {
	o.NetAccessPointIds = v
}

// GetNicAccountId returns the NicAccountId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PublicIp) GetNicAccountId() string {
	if o == nil || o.NicAccountId.Get() == nil {
		var ret string
		return ret
	}
	return *o.NicAccountId.Get()
}

// GetNicAccountIdOk returns a tuple with the NicAccountId 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
func (o *PublicIp) GetNicAccountIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.NicAccountId.Get(), o.NicAccountId.IsSet()
}

// HasNicAccountId returns a boolean if a field has been set.
func (o *PublicIp) HasNicAccountId() bool {
	if o != nil && o.NicAccountId.IsSet() {
		return true
	}

	return false
}

// SetNicAccountId gets a reference to the given NullableString and assigns it to the NicAccountId field.
func (o *PublicIp) SetNicAccountId(v string) {
	o.NicAccountId.Set(&v)
}

// SetNicAccountIdNil sets the value for NicAccountId to be an explicit nil
func (o *PublicIp) SetNicAccountIdNil() {
	o.NicAccountId.Set(nil)
}

// UnsetNicAccountId ensures that no value is present for NicAccountId, not even an explicit nil
func (o *PublicIp) UnsetNicAccountId() {
	o.NicAccountId.Unset()
}

// GetNicId returns the NicId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PublicIp) GetNicId() string {
	if o == nil || o.NicId.Get() == nil {
		var ret string
		return ret
	}
	return *o.NicId.Get()
}

// GetNicIdOk returns a tuple with the NicId 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
func (o *PublicIp) GetNicIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.NicId.Get(), o.NicId.IsSet()
}

// HasNicId returns a boolean if a field has been set.
func (o *PublicIp) HasNicId() bool {
	if o != nil && o.NicId.IsSet() {
		return true
	}

	return false
}

// SetNicId gets a reference to the given NullableString and assigns it to the NicId field.
func (o *PublicIp) SetNicId(v string) {
	o.NicId.Set(&v)
}

// SetNicIdNil sets the value for NicId to be an explicit nil
func (o *PublicIp) SetNicIdNil() {
	o.NicId.Set(nil)
}

// UnsetNicId ensures that no value is present for NicId, not even an explicit nil
func (o *PublicIp) UnsetNicId() {
	o.NicId.Unset()
}

// GetPrivateIp returns the PrivateIp field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PublicIp) GetPrivateIp() string {
	if o == nil || o.PrivateIp.Get() == nil {
		var ret string
		return ret
	}
	return *o.PrivateIp.Get()
}

// GetPrivateIpOk returns a tuple with the PrivateIp 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
func (o *PublicIp) GetPrivateIpOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.PrivateIp.Get(), o.PrivateIp.IsSet()
}

// HasPrivateIp returns a boolean if a field has been set.
func (o *PublicIp) HasPrivateIp() bool {
	if o != nil && o.PrivateIp.IsSet() {
		return true
	}

	return false
}

// SetPrivateIp gets a reference to the given NullableString and assigns it to the PrivateIp field.
func (o *PublicIp) SetPrivateIp(v string) {
	o.PrivateIp.Set(&v)
}

// SetPrivateIpNil sets the value for PrivateIp to be an explicit nil
func (o *PublicIp) SetPrivateIpNil() {
	o.PrivateIp.Set(nil)
}

// UnsetPrivateIp ensures that no value is present for PrivateIp, not even an explicit nil
func (o *PublicIp) UnsetPrivateIp() {
	o.PrivateIp.Unset()
}

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

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

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

	return false
}

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

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

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

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

	return false
}

// SetPublicIpId gets a reference to the given string and assigns it to the PublicIpId field.
func (o *PublicIp) SetPublicIpId(v string) {
	o.PublicIpId = &v
}

// GetTags returns the Tags field value if set, zero value otherwise.
func (o *PublicIp) GetTags() []ResourceTag {
	if o == nil || o.Tags == nil {
		var ret []ResourceTag
		return ret
	}
	return *o.Tags
}

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

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

	return false
}

// SetTags gets a reference to the given []ResourceTag and assigns it to the Tags field.
func (o *PublicIp) SetTags(v []ResourceTag) {
	o.Tags = &v
}

// GetVmId returns the VmId field value if set, zero value otherwise (both if not set or set to explicit null).
func (o *PublicIp) GetVmId() string {
	if o == nil || o.VmId.Get() == nil {
		var ret string
		return ret
	}
	return *o.VmId.Get()
}

// GetVmIdOk returns a tuple with the VmId 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
func (o *PublicIp) GetVmIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return o.VmId.Get(), o.VmId.IsSet()
}

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

	return false
}

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

// SetVmIdNil sets the value for VmId to be an explicit nil
func (o *PublicIp) SetVmIdNil() {
	o.VmId.Set(nil)
}

// UnsetVmId ensures that no value is present for VmId, not even an explicit nil
func (o *PublicIp) UnsetVmId() {
	o.VmId.Unset()
}

func (o PublicIp) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.LinkPublicIpId != nil {
		toSerialize["LinkPublicIpId"] = o.LinkPublicIpId
	}
	if o.NatServiceId.IsSet() {
		toSerialize["NatServiceId"] = o.NatServiceId.Get()
	}
	if o.NetAccessPointIds != nil {
		toSerialize["NetAccessPointIds"] = o.NetAccessPointIds
	}
	if o.NicAccountId.IsSet() {
		toSerialize["NicAccountId"] = o.NicAccountId.Get()
	}
	if o.NicId.IsSet() {
		toSerialize["NicId"] = o.NicId.Get()
	}
	if o.PrivateIp.IsSet() {
		toSerialize["PrivateIp"] = o.PrivateIp.Get()
	}
	if o.PublicIp != nil {
		toSerialize["PublicIp"] = o.PublicIp
	}
	if o.PublicIpId != nil {
		toSerialize["PublicIpId"] = o.PublicIpId
	}
	if o.Tags != nil {
		toSerialize["Tags"] = o.Tags
	}
	if o.VmId.IsSet() {
		toSerialize["VmId"] = o.VmId.Get()
	}
	return json.Marshal(toSerialize)
}

type NullablePublicIp struct {
	value *PublicIp
	isSet bool
}

func (v NullablePublicIp) Get() *PublicIp {
	return v.value
}

func (v *NullablePublicIp) Set(val *PublicIp) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullablePublicIp(val *PublicIp) *NullablePublicIp {
	return &NullablePublicIp{value: val, isSet: true}
}

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

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