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

// UserSvcLoginRequest struct for UserSvcLoginRequest
type UserSvcLoginRequest struct {
	AppHost string `json:"appHost"`
	Contact *string `json:"contact,omitempty"`
	Device *string `json:"device,omitempty"`
	Password *string `json:"password,omitempty"`
	Slug *string `json:"slug,omitempty"`
}

type _UserSvcLoginRequest UserSvcLoginRequest

// NewUserSvcLoginRequest instantiates a new UserSvcLoginRequest 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 NewUserSvcLoginRequest(appHost string) *UserSvcLoginRequest {
	this := UserSvcLoginRequest{}
	this.AppHost = appHost
	return &this
}

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

// GetAppHost returns the AppHost field value
func (o *UserSvcLoginRequest) GetAppHost() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.AppHost
}

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

// SetAppHost sets field value
func (o *UserSvcLoginRequest) SetAppHost(v string) {
	o.AppHost = v
}

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

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

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

	return false
}

// SetContact gets a reference to the given string and assigns it to the Contact field.
func (o *UserSvcLoginRequest) SetContact(v string) {
	o.Contact = &v
}

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

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

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

	return false
}

// SetDevice gets a reference to the given string and assigns it to the Device field.
func (o *UserSvcLoginRequest) SetDevice(v string) {
	o.Device = &v
}

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

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

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

	return false
}

// SetPassword gets a reference to the given string and assigns it to the Password field.
func (o *UserSvcLoginRequest) SetPassword(v string) {
	o.Password = &v
}

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

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

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

	return false
}

// SetSlug gets a reference to the given string and assigns it to the Slug field.
func (o *UserSvcLoginRequest) SetSlug(v string) {
	o.Slug = &v
}

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

func (o UserSvcLoginRequest) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["appHost"] = o.AppHost
	if !IsNil(o.Contact) {
		toSerialize["contact"] = o.Contact
	}
	if !IsNil(o.Device) {
		toSerialize["device"] = o.Device
	}
	if !IsNil(o.Password) {
		toSerialize["password"] = o.Password
	}
	if !IsNil(o.Slug) {
		toSerialize["slug"] = o.Slug
	}
	return toSerialize, nil
}

func (o *UserSvcLoginRequest) 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{
		"appHost",
	}

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

	varUserSvcLoginRequest := _UserSvcLoginRequest{}

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

	if err != nil {
		return err
	}

	*o = UserSvcLoginRequest(varUserSvcLoginRequest)

	return err
}

type NullableUserSvcLoginRequest struct {
	value *UserSvcLoginRequest
	isSet bool
}

func (v NullableUserSvcLoginRequest) Get() *UserSvcLoginRequest {
	return v.value
}

func (v *NullableUserSvcLoginRequest) Set(val *UserSvcLoginRequest) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableUserSvcLoginRequest(val *UserSvcLoginRequest) *NullableUserSvcLoginRequest {
	return &NullableUserSvcLoginRequest{value: val, isSet: true}
}

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

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


