/*
Mender API

Combined API specification for the features of the different Mender backend services, suitable for code generation applications 

API version: 1
Contact: support@mender.io
*/

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

package client

import (
	"encoding/json"
)

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

// TenantNew Tenant configuration.
type TenantNew struct {
	// ID of given tenant.
	TenantId *string `json:"tenant_id,omitempty"`
}

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

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

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

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

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

	return false
}

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

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

func (o TenantNew) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.TenantId) {
		toSerialize["tenant_id"] = o.TenantId
	}
	return toSerialize, nil
}

type NullableTenantNew struct {
	value *TenantNew
	isSet bool
}

func (v NullableTenantNew) Get() *TenantNew {
	return v.value
}

func (v *NullableTenantNew) Set(val *TenantNew) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableTenantNew(val *TenantNew) *NullableTenantNew {
	return &NullableTenantNew{value: val, isSet: true}
}

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

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


