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

// MyPermissionsResponse struct for MyPermissionsResponse
type MyPermissionsResponse struct {
	Permissions []string `json:"permissions"`
	AdditionalProperties map[string]interface{}
}

type _MyPermissionsResponse MyPermissionsResponse

// NewMyPermissionsResponse instantiates a new MyPermissionsResponse 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 NewMyPermissionsResponse(permissions []string) *MyPermissionsResponse {
	this := MyPermissionsResponse{}
	this.Permissions = permissions
	return &this
}

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

// GetPermissions returns the Permissions field value
func (o *MyPermissionsResponse) GetPermissions() []string {
	if o == nil {
		var ret []string
		return ret
	}

	return o.Permissions
}

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

// SetPermissions sets field value
func (o *MyPermissionsResponse) SetPermissions(v []string) {
	o.Permissions = v
}

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

func (o MyPermissionsResponse) ToMap() (map[string]interface{}, error) {
	toSerialize := map[string]interface{}{}
	toSerialize["permissions"] = o.Permissions

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

	return toSerialize, nil
}

func (o *MyPermissionsResponse) UnmarshalJSON(bytes []byte) (err error) {
	varMyPermissionsResponse := _MyPermissionsResponse{}

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

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

	if err = json.Unmarshal(bytes, &additionalProperties); err == nil {
		delete(additionalProperties, "permissions")
		o.AdditionalProperties = additionalProperties
	}

	return err
}

type NullableMyPermissionsResponse struct {
	value *MyPermissionsResponse
	isSet bool
}

func (v NullableMyPermissionsResponse) Get() *MyPermissionsResponse {
	return v.value
}

func (v *NullableMyPermissionsResponse) Set(val *MyPermissionsResponse) {
	v.value = val
	v.isSet = true
}

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

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

func NewNullableMyPermissionsResponse(val *MyPermissionsResponse) *NullableMyPermissionsResponse {
	return &NullableMyPermissionsResponse{value: val, isSet: true}
}

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

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


