/*
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 UserSvcOrganization type satisfies the MappedNullable interface at compile time
var _ MappedNullable = &UserSvcOrganization{}

// UserSvcOrganization struct for UserSvcOrganization
type UserSvcOrganization struct {
	AppId *string `json:"appId,omitempty"`
	CreatedAt string `json:"createdAt"`
	DeletedAt *string `json:"deletedAt,omitempty"`
	Id string `json:"id"`
	InternalId *string `json:"internalId,omitempty"`
	// Full name of the organization
	Name string `json:"name"`
	// URL-friendly unique (inside the Singularon platform) identifier for the `organization`.
	Slug string `json:"slug"`
	ThumbnailFileId *string `json:"thumbnailFileId,omitempty"`
	UpdatedAt string `json:"updatedAt"`
}

type _UserSvcOrganization UserSvcOrganization

// NewUserSvcOrganization instantiates a new UserSvcOrganization 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 NewUserSvcOrganization(createdAt string, id string, name string, slug string, updatedAt string) *UserSvcOrganization {
	this := UserSvcOrganization{}
	this.CreatedAt = createdAt
	this.Id = id
	this.Name = name
	this.Slug = slug
	this.UpdatedAt = updatedAt
	return &this
}

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

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

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

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

	return false
}

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

// GetCreatedAt returns the CreatedAt field value
func (o *UserSvcOrganization) GetCreatedAt() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.CreatedAt
}

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

// SetCreatedAt sets field value
func (o *UserSvcOrganization) SetCreatedAt(v string) {
	o.CreatedAt = v
}

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

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

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

	return false
}

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

// GetId returns the Id field value
func (o *UserSvcOrganization) 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 *UserSvcOrganization) GetIdOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Id, true
}

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

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

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

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

	return false
}

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

// GetName returns the Name field value
func (o *UserSvcOrganization) 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 *UserSvcOrganization) GetNameOk() (*string, bool) {
	if o == nil {
		return nil, false
	}
	return &o.Name, true
}

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

// GetSlug returns the Slug field value
func (o *UserSvcOrganization) GetSlug() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Slug
}

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

// SetSlug sets field value
func (o *UserSvcOrganization) SetSlug(v string) {
	o.Slug = v
}

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

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

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

	return false
}

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

// GetUpdatedAt returns the UpdatedAt field value
func (o *UserSvcOrganization) GetUpdatedAt() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.UpdatedAt
}

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

// SetUpdatedAt sets field value
func (o *UserSvcOrganization) SetUpdatedAt(v string) {
	o.UpdatedAt = v
}

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

func (o UserSvcOrganization) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.AppId) {
		toSerialize["appId"] = o.AppId
	}
	toSerialize["createdAt"] = o.CreatedAt
	if !IsNil(o.DeletedAt) {
		toSerialize["deletedAt"] = o.DeletedAt
	}
	toSerialize["id"] = o.Id
	if !IsNil(o.InternalId) {
		toSerialize["internalId"] = o.InternalId
	}
	toSerialize["name"] = o.Name
	toSerialize["slug"] = o.Slug
	if !IsNil(o.ThumbnailFileId) {
		toSerialize["thumbnailFileId"] = o.ThumbnailFileId
	}
	toSerialize["updatedAt"] = o.UpdatedAt
	return toSerialize, nil
}

func (o *UserSvcOrganization) 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{
		"createdAt",
		"id",
		"name",
		"slug",
		"updatedAt",
	}

	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)
		}
	}

	varUserSvcOrganization := _UserSvcOrganization{}

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

	if err != nil {
		return err
	}

	*o = UserSvcOrganization(varUserSvcOrganization)

	return err
}

type NullableUserSvcOrganization struct {
	value *UserSvcOrganization
	isSet bool
}

func (v NullableUserSvcOrganization) Get() *UserSvcOrganization {
	return v.value
}

func (v *NullableUserSvcOrganization) Set(val *UserSvcOrganization) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableUserSvcOrganization(val *UserSvcOrganization) *NullableUserSvcOrganization {
	return &NullableUserSvcOrganization{value: val, isSet: true}
}

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

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


