/*
 * In-Memory DB API
 *
 * API description for the IONOS In-Memory DB
 *
 * API version: 1.0.0
 * Contact: support@cloud.ionos.com
 */

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

package ionoscloud

import (
	"encoding/json"
)

// HashedPassword The hashed password for a In-Memory DB user.
type HashedPassword struct {
	Algorithm *string `json:"algorithm"`
	Hash      *string `json:"hash"`
}

// NewHashedPassword instantiates a new HashedPassword 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 NewHashedPassword(algorithm string, hash string) *HashedPassword {
	this := HashedPassword{}

	this.Algorithm = &algorithm
	this.Hash = &hash

	return &this
}

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

// GetAlgorithm returns the Algorithm field value
// If the value is explicit nil, the zero value for string will be returned
func (o *HashedPassword) GetAlgorithm() *string {
	if o == nil {
		return nil
	}

	return o.Algorithm

}

// GetAlgorithmOk returns a tuple with the Algorithm field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *HashedPassword) GetAlgorithmOk() (*string, bool) {
	if o == nil {
		return nil, false
	}

	return o.Algorithm, true
}

// SetAlgorithm sets field value
func (o *HashedPassword) SetAlgorithm(v string) {

	o.Algorithm = &v

}

// HasAlgorithm returns a boolean if a field has been set.
func (o *HashedPassword) HasAlgorithm() bool {
	if o != nil && o.Algorithm != nil {
		return true
	}

	return false
}

// GetHash returns the Hash field value
// If the value is explicit nil, the zero value for string will be returned
func (o *HashedPassword) GetHash() *string {
	if o == nil {
		return nil
	}

	return o.Hash

}

// GetHashOk returns a tuple with the Hash field value
// and a boolean to check if the value has been set.
// NOTE: If the value is an explicit nil, `nil, true` will be returned
func (o *HashedPassword) GetHashOk() (*string, bool) {
	if o == nil {
		return nil, false
	}

	return o.Hash, true
}

// SetHash sets field value
func (o *HashedPassword) SetHash(v string) {

	o.Hash = &v

}

// HasHash returns a boolean if a field has been set.
func (o *HashedPassword) HasHash() bool {
	if o != nil && o.Hash != nil {
		return true
	}

	return false
}

func (o HashedPassword) MarshalJSON() ([]byte, error) {
	toSerialize := map[string]interface{}{}
	if o.Algorithm != nil {
		toSerialize["algorithm"] = o.Algorithm
	}

	if o.Hash != nil {
		toSerialize["hash"] = o.Hash
	}

	return json.Marshal(toSerialize)
}

type NullableHashedPassword struct {
	value *HashedPassword
	isSet bool
}

func (v NullableHashedPassword) Get() *HashedPassword {
	return v.value
}

func (v *NullableHashedPassword) Set(val *HashedPassword) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableHashedPassword(val *HashedPassword) *NullableHashedPassword {
	return &NullableHashedPassword{value: val, isSet: true}
}

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

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