/*
Digital Certificates API

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

API version: 2.0.0
*/

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

package digital_certificates

import (
	"encoding/json"
)

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

// CreateCertificateRequest struct for CreateCertificateRequest
type CreateCertificateRequest struct {
	Name string `json:"name"`
	Certificate string `json:"certificate"`
	PrivateKey string `json:"private_key"`
	CertificateType *string `json:"certificate_type,omitempty"`
	Managed *bool `json:"managed,omitempty"`
}

// NewCreateCertificateRequest instantiates a new CreateCertificateRequest 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 NewCreateCertificateRequest(name string, certificate string, privateKey string) *CreateCertificateRequest {
	this := CreateCertificateRequest{}
	this.Name = name
	this.Certificate = certificate
	this.PrivateKey = privateKey
	return &this
}

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

// GetName returns the Name field value
func (o *CreateCertificateRequest) GetName() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Name
}

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

// SetName sets field value
func (o *CreateCertificateRequest) SetName(v string) {
	o.Name = v
}

// GetCertificate returns the Certificate field value
func (o *CreateCertificateRequest) GetCertificate() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Certificate
}

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

// SetCertificate sets field value
func (o *CreateCertificateRequest) SetCertificate(v string) {
	o.Certificate = v
}

// GetPrivateKey returns the PrivateKey field value
func (o *CreateCertificateRequest) GetPrivateKey() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.PrivateKey
}

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

// SetPrivateKey sets field value
func (o *CreateCertificateRequest) SetPrivateKey(v string) {
	o.PrivateKey = v
}

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

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

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

	return false
}

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

// GetManaged returns the Managed field value if set, zero value otherwise.
func (o *CreateCertificateRequest) GetManaged() bool {
	if o == nil || IsNil(o.Managed) {
		var ret bool
		return ret
	}
	return *o.Managed
}

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

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

	return false
}

// SetManaged gets a reference to the given bool and assigns it to the Managed field.
func (o *CreateCertificateRequest) SetManaged(v bool) {
	o.Managed = &v
}

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

func (o CreateCertificateRequest) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["name"] = o.Name
	toSerialize["certificate"] = o.Certificate
	toSerialize["private_key"] = o.PrivateKey
	if !IsNil(o.CertificateType) {
		toSerialize["certificate_type"] = o.CertificateType
	}
	if !IsNil(o.Managed) {
		toSerialize["managed"] = o.Managed
	}
	return toSerialize, nil
}

type NullableCreateCertificateRequest struct {
	value *CreateCertificateRequest
	isSet bool
}

func (v NullableCreateCertificateRequest) Get() *CreateCertificateRequest {
	return v.value
}

func (v *NullableCreateCertificateRequest) Set(val *CreateCertificateRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableCreateCertificateRequest(val *CreateCertificateRequest) *NullableCreateCertificateRequest {
	return &NullableCreateCertificateRequest{value: val, isSet: true}
}

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

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


