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

// SecretSvcSecretInput struct for SecretSvcSecretInput
type SecretSvcSecretInput struct {
	AppHost *string `json:"appHost,omitempty"`
	// Slugs of services/users who can change the deleters list
	CanChangeDeleters []string `json:"canChangeDeleters,omitempty"`
	// Slugs of services/users who can change the readers list
	CanChangeReaders []string `json:"canChangeReaders,omitempty"`
	// Slugs of services/users who can change the writers list
	CanChangeWriters []string `json:"canChangeWriters,omitempty"`
	// Checksum of the secret value
	Checksum *string `json:"checksum,omitempty"`
	// Algorithm used for the checksum (e.g., \"CRC32\")
	ChecksumAlgorithm *SecretSvcChecksumAlgorithm `json:"checksumAlgorithm,omitempty"`
	// Slugs of services/users who can delete the secret
	Deleters []string `json:"deleters,omitempty"`
	// Whether the secret is encrypted All secrets are encrypted before written to the DB. This really only exists for write requests to know if the secret is already encrypted. Ie: while most `secret save [id] [value]` commands are probably not encrypted, File based saves, eg. `secret save secretA.yaml` are probably encrypted.
	Encrypted *bool `json:"encrypted,omitempty"`
	// Envar- or slug-like id of the secret
	Id string `json:"id"`
	// Slugs of services/users who can read the secret
	Readers []string `json:"readers,omitempty"`
	// Secret Value
	Value *string `json:"value,omitempty"`
	// Slugs of services/users who can modify the secret
	Writers []string `json:"writers,omitempty"`
}

type _SecretSvcSecretInput SecretSvcSecretInput

// NewSecretSvcSecretInput instantiates a new SecretSvcSecretInput 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 NewSecretSvcSecretInput(id string) *SecretSvcSecretInput {
	this := SecretSvcSecretInput{}
	this.Id = id
	return &this
}

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

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

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

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

	return false
}

// SetAppHost gets a reference to the given string and assigns it to the AppHost field.
func (o *SecretSvcSecretInput) SetAppHost(v string) {
	o.AppHost = &v
}

// GetCanChangeDeleters returns the CanChangeDeleters field value if set, zero value otherwise.
func (o *SecretSvcSecretInput) GetCanChangeDeleters() []string {
	if o == nil || IsNil(o.CanChangeDeleters) {
		var ret []string
		return ret
	}
	return o.CanChangeDeleters
}

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

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

	return false
}

// SetCanChangeDeleters gets a reference to the given []string and assigns it to the CanChangeDeleters field.
func (o *SecretSvcSecretInput) SetCanChangeDeleters(v []string) {
	o.CanChangeDeleters = v
}

// GetCanChangeReaders returns the CanChangeReaders field value if set, zero value otherwise.
func (o *SecretSvcSecretInput) GetCanChangeReaders() []string {
	if o == nil || IsNil(o.CanChangeReaders) {
		var ret []string
		return ret
	}
	return o.CanChangeReaders
}

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

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

	return false
}

// SetCanChangeReaders gets a reference to the given []string and assigns it to the CanChangeReaders field.
func (o *SecretSvcSecretInput) SetCanChangeReaders(v []string) {
	o.CanChangeReaders = v
}

// GetCanChangeWriters returns the CanChangeWriters field value if set, zero value otherwise.
func (o *SecretSvcSecretInput) GetCanChangeWriters() []string {
	if o == nil || IsNil(o.CanChangeWriters) {
		var ret []string
		return ret
	}
	return o.CanChangeWriters
}

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

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

	return false
}

// SetCanChangeWriters gets a reference to the given []string and assigns it to the CanChangeWriters field.
func (o *SecretSvcSecretInput) SetCanChangeWriters(v []string) {
	o.CanChangeWriters = v
}

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

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

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

	return false
}

// SetChecksum gets a reference to the given string and assigns it to the Checksum field.
func (o *SecretSvcSecretInput) SetChecksum(v string) {
	o.Checksum = &v
}

// GetChecksumAlgorithm returns the ChecksumAlgorithm field value if set, zero value otherwise.
func (o *SecretSvcSecretInput) GetChecksumAlgorithm() SecretSvcChecksumAlgorithm {
	if o == nil || IsNil(o.ChecksumAlgorithm) {
		var ret SecretSvcChecksumAlgorithm
		return ret
	}
	return *o.ChecksumAlgorithm
}

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

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

	return false
}

// SetChecksumAlgorithm gets a reference to the given SecretSvcChecksumAlgorithm and assigns it to the ChecksumAlgorithm field.
func (o *SecretSvcSecretInput) SetChecksumAlgorithm(v SecretSvcChecksumAlgorithm) {
	o.ChecksumAlgorithm = &v
}

// GetDeleters returns the Deleters field value if set, zero value otherwise.
func (o *SecretSvcSecretInput) GetDeleters() []string {
	if o == nil || IsNil(o.Deleters) {
		var ret []string
		return ret
	}
	return o.Deleters
}

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

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

	return false
}

// SetDeleters gets a reference to the given []string and assigns it to the Deleters field.
func (o *SecretSvcSecretInput) SetDeleters(v []string) {
	o.Deleters = v
}

// GetEncrypted returns the Encrypted field value if set, zero value otherwise.
func (o *SecretSvcSecretInput) GetEncrypted() bool {
	if o == nil || IsNil(o.Encrypted) {
		var ret bool
		return ret
	}
	return *o.Encrypted
}

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

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

	return false
}

// SetEncrypted gets a reference to the given bool and assigns it to the Encrypted field.
func (o *SecretSvcSecretInput) SetEncrypted(v bool) {
	o.Encrypted = &v
}

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

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

// GetReaders returns the Readers field value if set, zero value otherwise.
func (o *SecretSvcSecretInput) GetReaders() []string {
	if o == nil || IsNil(o.Readers) {
		var ret []string
		return ret
	}
	return o.Readers
}

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

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

	return false
}

// SetReaders gets a reference to the given []string and assigns it to the Readers field.
func (o *SecretSvcSecretInput) SetReaders(v []string) {
	o.Readers = v
}

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

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

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

	return false
}

// SetValue gets a reference to the given string and assigns it to the Value field.
func (o *SecretSvcSecretInput) SetValue(v string) {
	o.Value = &v
}

// GetWriters returns the Writers field value if set, zero value otherwise.
func (o *SecretSvcSecretInput) GetWriters() []string {
	if o == nil || IsNil(o.Writers) {
		var ret []string
		return ret
	}
	return o.Writers
}

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

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

	return false
}

// SetWriters gets a reference to the given []string and assigns it to the Writers field.
func (o *SecretSvcSecretInput) SetWriters(v []string) {
	o.Writers = v
}

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

func (o SecretSvcSecretInput) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.AppHost) {
		toSerialize["appHost"] = o.AppHost
	}
	if !IsNil(o.CanChangeDeleters) {
		toSerialize["canChangeDeleters"] = o.CanChangeDeleters
	}
	if !IsNil(o.CanChangeReaders) {
		toSerialize["canChangeReaders"] = o.CanChangeReaders
	}
	if !IsNil(o.CanChangeWriters) {
		toSerialize["canChangeWriters"] = o.CanChangeWriters
	}
	if !IsNil(o.Checksum) {
		toSerialize["checksum"] = o.Checksum
	}
	if !IsNil(o.ChecksumAlgorithm) {
		toSerialize["checksumAlgorithm"] = o.ChecksumAlgorithm
	}
	if !IsNil(o.Deleters) {
		toSerialize["deleters"] = o.Deleters
	}
	if !IsNil(o.Encrypted) {
		toSerialize["encrypted"] = o.Encrypted
	}
	toSerialize["id"] = o.Id
	if !IsNil(o.Readers) {
		toSerialize["readers"] = o.Readers
	}
	if !IsNil(o.Value) {
		toSerialize["value"] = o.Value
	}
	if !IsNil(o.Writers) {
		toSerialize["writers"] = o.Writers
	}
	return toSerialize, nil
}

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

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

	varSecretSvcSecretInput := _SecretSvcSecretInput{}

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

	if err != nil {
		return err
	}

	*o = SecretSvcSecretInput(varSecretSvcSecretInput)

	return err
}

type NullableSecretSvcSecretInput struct {
	value *SecretSvcSecretInput
	isSet bool
}

func (v NullableSecretSvcSecretInput) Get() *SecretSvcSecretInput {
	return v.value
}

func (v *NullableSecretSvcSecretInput) Set(val *SecretSvcSecretInput) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableSecretSvcSecretInput(val *SecretSvcSecretInput) *NullableSecretSvcSecretInput {
	return &NullableSecretSvcSecretInput{value: val, isSet: true}
}

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

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


