/*
Management API

API version: 3
*/

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

package management

import (
	"encoding/json"

	"github.com/adyen/adyen-go-api-library/v21/src/common"
)

// checks if the ApiCredentialLinks type satisfies the MappedNullable interface at compile time
var _ common.MappedNullable = &ApiCredentialLinks{}

// ApiCredentialLinks struct for ApiCredentialLinks
type ApiCredentialLinks struct {
	AllowedOrigins    *LinksElement `json:"allowedOrigins,omitempty"`
	Company           *LinksElement `json:"company,omitempty"`
	GenerateApiKey    *LinksElement `json:"generateApiKey,omitempty"`
	GenerateClientKey *LinksElement `json:"generateClientKey,omitempty"`
	Merchant          *LinksElement `json:"merchant,omitempty"`
	Self              LinksElement  `json:"self"`
}

// NewApiCredentialLinks instantiates a new ApiCredentialLinks 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 NewApiCredentialLinks(self LinksElement) *ApiCredentialLinks {
	this := ApiCredentialLinks{}
	this.Self = self
	return &this
}

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

// GetAllowedOrigins returns the AllowedOrigins field value if set, zero value otherwise.
func (o *ApiCredentialLinks) GetAllowedOrigins() LinksElement {
	if o == nil || common.IsNil(o.AllowedOrigins) {
		var ret LinksElement
		return ret
	}
	return *o.AllowedOrigins
}

// GetAllowedOriginsOk returns a tuple with the AllowedOrigins field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApiCredentialLinks) GetAllowedOriginsOk() (*LinksElement, bool) {
	if o == nil || common.IsNil(o.AllowedOrigins) {
		return nil, false
	}
	return o.AllowedOrigins, true
}

// HasAllowedOrigins returns a boolean if a field has been set.
func (o *ApiCredentialLinks) HasAllowedOrigins() bool {
	if o != nil && !common.IsNil(o.AllowedOrigins) {
		return true
	}

	return false
}

// SetAllowedOrigins gets a reference to the given LinksElement and assigns it to the AllowedOrigins field.
func (o *ApiCredentialLinks) SetAllowedOrigins(v LinksElement) {
	o.AllowedOrigins = &v
}

// GetCompany returns the Company field value if set, zero value otherwise.
func (o *ApiCredentialLinks) GetCompany() LinksElement {
	if o == nil || common.IsNil(o.Company) {
		var ret LinksElement
		return ret
	}
	return *o.Company
}

// GetCompanyOk returns a tuple with the Company field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApiCredentialLinks) GetCompanyOk() (*LinksElement, bool) {
	if o == nil || common.IsNil(o.Company) {
		return nil, false
	}
	return o.Company, true
}

// HasCompany returns a boolean if a field has been set.
func (o *ApiCredentialLinks) HasCompany() bool {
	if o != nil && !common.IsNil(o.Company) {
		return true
	}

	return false
}

// SetCompany gets a reference to the given LinksElement and assigns it to the Company field.
func (o *ApiCredentialLinks) SetCompany(v LinksElement) {
	o.Company = &v
}

// GetGenerateApiKey returns the GenerateApiKey field value if set, zero value otherwise.
func (o *ApiCredentialLinks) GetGenerateApiKey() LinksElement {
	if o == nil || common.IsNil(o.GenerateApiKey) {
		var ret LinksElement
		return ret
	}
	return *o.GenerateApiKey
}

// GetGenerateApiKeyOk returns a tuple with the GenerateApiKey field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApiCredentialLinks) GetGenerateApiKeyOk() (*LinksElement, bool) {
	if o == nil || common.IsNil(o.GenerateApiKey) {
		return nil, false
	}
	return o.GenerateApiKey, true
}

// HasGenerateApiKey returns a boolean if a field has been set.
func (o *ApiCredentialLinks) HasGenerateApiKey() bool {
	if o != nil && !common.IsNil(o.GenerateApiKey) {
		return true
	}

	return false
}

// SetGenerateApiKey gets a reference to the given LinksElement and assigns it to the GenerateApiKey field.
func (o *ApiCredentialLinks) SetGenerateApiKey(v LinksElement) {
	o.GenerateApiKey = &v
}

// GetGenerateClientKey returns the GenerateClientKey field value if set, zero value otherwise.
func (o *ApiCredentialLinks) GetGenerateClientKey() LinksElement {
	if o == nil || common.IsNil(o.GenerateClientKey) {
		var ret LinksElement
		return ret
	}
	return *o.GenerateClientKey
}

// GetGenerateClientKeyOk returns a tuple with the GenerateClientKey field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApiCredentialLinks) GetGenerateClientKeyOk() (*LinksElement, bool) {
	if o == nil || common.IsNil(o.GenerateClientKey) {
		return nil, false
	}
	return o.GenerateClientKey, true
}

// HasGenerateClientKey returns a boolean if a field has been set.
func (o *ApiCredentialLinks) HasGenerateClientKey() bool {
	if o != nil && !common.IsNil(o.GenerateClientKey) {
		return true
	}

	return false
}

// SetGenerateClientKey gets a reference to the given LinksElement and assigns it to the GenerateClientKey field.
func (o *ApiCredentialLinks) SetGenerateClientKey(v LinksElement) {
	o.GenerateClientKey = &v
}

// GetMerchant returns the Merchant field value if set, zero value otherwise.
func (o *ApiCredentialLinks) GetMerchant() LinksElement {
	if o == nil || common.IsNil(o.Merchant) {
		var ret LinksElement
		return ret
	}
	return *o.Merchant
}

// GetMerchantOk returns a tuple with the Merchant field value if set, nil otherwise
// and a boolean to check if the value has been set.
func (o *ApiCredentialLinks) GetMerchantOk() (*LinksElement, bool) {
	if o == nil || common.IsNil(o.Merchant) {
		return nil, false
	}
	return o.Merchant, true
}

// HasMerchant returns a boolean if a field has been set.
func (o *ApiCredentialLinks) HasMerchant() bool {
	if o != nil && !common.IsNil(o.Merchant) {
		return true
	}

	return false
}

// SetMerchant gets a reference to the given LinksElement and assigns it to the Merchant field.
func (o *ApiCredentialLinks) SetMerchant(v LinksElement) {
	o.Merchant = &v
}

// GetSelf returns the Self field value
func (o *ApiCredentialLinks) GetSelf() LinksElement {
	if o == nil {
		var ret LinksElement
		return ret
	}

	return o.Self
}

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

// SetSelf sets field value
func (o *ApiCredentialLinks) SetSelf(v LinksElement) {
	o.Self = v
}

func (o ApiCredentialLinks) MarshalJSON() ([]byte, error) {
	toSerialize, err := o.ToMap()
	if err != nil {
		return []byte{}, err
	}
	return json.Marshal(toSerialize)
}

func (o ApiCredentialLinks) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !common.IsNil(o.AllowedOrigins) {
		toSerialize["allowedOrigins"] = o.AllowedOrigins
	}
	if !common.IsNil(o.Company) {
		toSerialize["company"] = o.Company
	}
	if !common.IsNil(o.GenerateApiKey) {
		toSerialize["generateApiKey"] = o.GenerateApiKey
	}
	if !common.IsNil(o.GenerateClientKey) {
		toSerialize["generateClientKey"] = o.GenerateClientKey
	}
	if !common.IsNil(o.Merchant) {
		toSerialize["merchant"] = o.Merchant
	}
	toSerialize["self"] = o.Self
	return toSerialize, nil
}

type NullableApiCredentialLinks struct {
	value *ApiCredentialLinks
	isSet bool
}

func (v NullableApiCredentialLinks) Get() *ApiCredentialLinks {
	return v.value
}

func (v *NullableApiCredentialLinks) Set(val *ApiCredentialLinks) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableApiCredentialLinks(val *ApiCredentialLinks) *NullableApiCredentialLinks {
	return &NullableApiCredentialLinks{value: val, isSet: true}
}

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

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