/*
1Backend

AI-native microservices platform.

API version: 0.8.2
Contact: sales@singulatron.com
*/

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

package openapi

import (
	"encoding/json"
	"bytes"
	"fmt"
)

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

// ProxySvcCertInput struct for ProxySvcCertInput
type ProxySvcCertInput struct {
	// PEM-encoded certificate bundle   -----BEGIN EC PARAMETERS-----  BggqhkjOPQMBBw==  -----END EC PARAMETERS-----  -----BEGIN EC PRIVATE KEY-----  MHcCAQEEIDC3+7pySTQl6WRBuef...  -----END EC PRIVATE KEY-----  -----BEGIN CERTIFICATE-----  MIIBhTCCASugAwIBAgIUQYwE...  -----END CERTIFICATE-----
	Cert string `json:"cert"`
	// Id is the host which this cert is for, e.g., \"example.com\" or \"www.example.com\"
	Id string `json:"id"`
}

type _ProxySvcCertInput ProxySvcCertInput

// NewProxySvcCertInput instantiates a new ProxySvcCertInput 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 NewProxySvcCertInput(cert string, id string) *ProxySvcCertInput {
	this := ProxySvcCertInput{}
	this.Cert = cert
	this.Id = id
	return &this
}

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

// GetCert returns the Cert field value
func (o *ProxySvcCertInput) GetCert() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Cert
}

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

// SetCert sets field value
func (o *ProxySvcCertInput) SetCert(v string) {
	o.Cert = v
}

// GetId returns the Id field value
func (o *ProxySvcCertInput) GetId() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Id
}

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

// SetId sets field value
func (o *ProxySvcCertInput) SetId(v string) {
	o.Id = v
}

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

func (o ProxySvcCertInput) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["cert"] = o.Cert
	toSerialize["id"] = o.Id
	return toSerialize, nil
}

func (o *ProxySvcCertInput) UnmarshalJSON(data []byte) (err error) {
	// This validates that all required properties are included in the JSON object
	// by unmarshalling the object into a generic map with string keys and checking
	// that every required field exists as a key in the generic map.
	requiredProperties := []string{
		"cert",
		"id",
	}

	allProperties := make(map[string]interface{})

	err = json.Unmarshal(data, &allProperties)

	if err != nil {
		return err;
	}

	for _, requiredProperty := range(requiredProperties) {
		if _, exists := allProperties[requiredProperty]; !exists {
			return fmt.Errorf("no value given for required property %v", requiredProperty)
		}
	}

	varProxySvcCertInput := _ProxySvcCertInput{}

	decoder := json.NewDecoder(bytes.NewReader(data))
	decoder.DisallowUnknownFields()
	err = decoder.Decode(&varProxySvcCertInput)

	if err != nil {
		return err
	}

	*o = ProxySvcCertInput(varProxySvcCertInput)

	return err
}

type NullableProxySvcCertInput struct {
	value *ProxySvcCertInput
	isSet bool
}

func (v NullableProxySvcCertInput) Get() *ProxySvcCertInput {
	return v.value
}

func (v *NullableProxySvcCertInput) Set(val *ProxySvcCertInput) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableProxySvcCertInput(val *ProxySvcCertInput) *NullableProxySvcCertInput {
	return &NullableProxySvcCertInput{value: val, isSet: true}
}

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

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


