/*
Pulp 3 API

Fetch, Upload, Organize, and Distribute Software Packages

API version: v3
Contact: pulp-list@redhat.com
*/

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

package pulpclient

import (
	"encoding/json"
)

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

// RpmModulemdDefaults ModulemdDefaults serializer.
type RpmModulemdDefaults struct {
	// A URI of a repository the new content unit should be associated with.
	Repository *string `json:"repository,omitempty"`
	// Modulemd name.
	Module string `json:"module"`
	// Modulemd default stream.
	Stream string `json:"stream"`
	// Default profiles for modulemd streams.
	Profiles map[string]interface{} `json:"profiles"`
	// Modulemd default snippet
	Snippet string `json:"snippet"`
	AdditionalProperties map[string]interface{}
}

type _RpmModulemdDefaults RpmModulemdDefaults

// NewRpmModulemdDefaults instantiates a new RpmModulemdDefaults 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 NewRpmModulemdDefaults(module string, stream string, profiles map[string]interface{}, snippet string) *RpmModulemdDefaults {
	this := RpmModulemdDefaults{}
	this.Module = module
	this.Stream = stream
	this.Profiles = profiles
	this.Snippet = snippet
	return &this
}

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

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

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

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

	return false
}

// SetRepository gets a reference to the given string and assigns it to the Repository field.
func (o *RpmModulemdDefaults) SetRepository(v string) {
	o.Repository = &v
}

// GetModule returns the Module field value
func (o *RpmModulemdDefaults) GetModule() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Module
}

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

// SetModule sets field value
func (o *RpmModulemdDefaults) SetModule(v string) {
	o.Module = v
}

// GetStream returns the Stream field value
func (o *RpmModulemdDefaults) GetStream() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Stream
}

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

// SetStream sets field value
func (o *RpmModulemdDefaults) SetStream(v string) {
	o.Stream = v
}

// GetProfiles returns the Profiles field value
func (o *RpmModulemdDefaults) GetProfiles() map[string]interface{} {
	if o == nil {
		var ret map[string]interface{}
		return ret
	}

	return o.Profiles
}

// GetProfilesOk returns a tuple with the Profiles field value
// and a boolean to check if the value has been set.
func (o *RpmModulemdDefaults) GetProfilesOk() (map[string]interface{}, bool) {
	if o == nil {
		return map[string]interface{}{}, false
	}
	return o.Profiles, true
}

// SetProfiles sets field value
func (o *RpmModulemdDefaults) SetProfiles(v map[string]interface{}) {
	o.Profiles = v
}

// GetSnippet returns the Snippet field value
func (o *RpmModulemdDefaults) GetSnippet() string {
	if o == nil {
		var ret string
		return ret
	}

	return o.Snippet
}

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

// SetSnippet sets field value
func (o *RpmModulemdDefaults) SetSnippet(v string) {
	o.Snippet = v
}

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

func (o RpmModulemdDefaults) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	if !IsNil(o.Repository) {
		toSerialize["repository"] = o.Repository
	}
	toSerialize["module"] = o.Module
	toSerialize["stream"] = o.Stream
	toSerialize["profiles"] = o.Profiles
	toSerialize["snippet"] = o.Snippet

	for key, value := range o.AdditionalProperties {
		toSerialize[key] = value
	}

	return toSerialize, nil
}

func (o *RpmModulemdDefaults) UnmarshalJSON(bytes []byte) (err error) {
	varRpmModulemdDefaults := _RpmModulemdDefaults{}

	if err = json.Unmarshal(bytes, &varRpmModulemdDefaults); err == nil {
		*o = RpmModulemdDefaults(varRpmModulemdDefaults)
	}

	additionalProperties := make(map[string]interface{})

	if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
		delete(additionalProperties, "repository")
		delete(additionalProperties, "module")
		delete(additionalProperties, "stream")
		delete(additionalProperties, "profiles")
		delete(additionalProperties, "snippet")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableRpmModulemdDefaults struct {
	value *RpmModulemdDefaults
	isSet bool
}

func (v NullableRpmModulemdDefaults) Get() *RpmModulemdDefaults {
	return v.value
}

func (v *NullableRpmModulemdDefaults) Set(val *RpmModulemdDefaults) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableRpmModulemdDefaults(val *RpmModulemdDefaults) *NullableRpmModulemdDefaults {
	return &NullableRpmModulemdDefaults{value: val, isSet: true}
}

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

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


