/*
Libre Graph API

Libre Graph is a free API for cloud collaboration inspired by the MS Graph API.

API version: v1.0.4
*/

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

package libregraph

import (
	"encoding/json"
)

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

// SharingLinkPassword The sharing link password which should be set.
type SharingLinkPassword struct {
	// Password. It may require a password policy.
	Password *string `json:"password,omitempty"`
}

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

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

// GetPassword returns the Password field value if set, zero value otherwise.
func (o *SharingLinkPassword) 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 *SharingLinkPassword) 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 *SharingLinkPassword) 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 *SharingLinkPassword) SetPassword(v string) {
	o.Password = &v
}

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

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

type NullableSharingLinkPassword struct {
	value *SharingLinkPassword
	isSet bool
}

func (v NullableSharingLinkPassword) Get() *SharingLinkPassword {
	return v.value
}

func (v *NullableSharingLinkPassword) Set(val *SharingLinkPassword) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableSharingLinkPassword(val *SharingLinkPassword) *NullableSharingLinkPassword {
	return &NullableSharingLinkPassword{value: val, isSet: true}
}

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

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